[u-boot-sifive] insufficient installation checks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
u-boot (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The postinst script of package u-boot-sifive makes only rudimentary checks:
No warning is written if partitions named loader1 or loader2 do not exist.
The script happily writes to /dev/nmve0n1 or /dev/sda1 if a partition there has the name loader1 or loader2.
Consider checking if /dev/disk/
We should write a warning if /dev/disk/
The boot ROM does not rely on the partition name but loads U-Boot SPL from the SD card partition with GUID 5B193300-
We could use 'lsblk -ro NAME,PARTTYPE' to identify the partition type GUIDs.
Best regards
Heinrich
Currently the partition type GUID is not easily available. We could make it available by adding a udev rule for mapping partitions by partition type GUID, e.g.
$ cat /etc/udev/ rules.d/ 99-u-boot. rules t_storage_ end" DISABLE_ PERSISTENT_ STORAGE_ RULES_FLAG} =="1", GOTO="persisten t_storage_ end"
ACTION=="remove", GOTO="persisten
ENV{UDEV_
SUBSYSTEM! ="block| ubi", GOTO="persisten t_storage_ end" ="loop* |mmcblk* [0-9]|msblk* [0-9]|mspblk* [0-9]|nvme* |sd*|sr* |vd*|xvd* |bcache* |cciss* |dasd*| ubd*|ubi* |scm*|pmem* |nbd*|zd* ", GOTO="persisten t_storage_ end"
KERNEL!
# ignore partitions that span the entire disk t_storage_ end"
TEST=="whole_disk", GOTO="persisten
# allow admin to disable probing the filesystem for slow devices like floppy disk drives DISABLE_ PERSISTENT_ STORAGE_ BLKID_FLAG} =="1", GOTO="persisten t_storage_ end"
ENV{UDEV_
# by-parttype links (partition metadata) PART_ENTRY_ SCHEME} =="gpt" , ENV{ID_ PART_ENTRY_ TYPE}== "?*", SYMLINK+ ="disk/ by-parttype/ $env{ID_ PART_ENTRY_ TYPE}"
ENV{ID_
LABEL=" persistent_ storage_ end"