[u-boot-sifive] insufficient installation checks

Bug #1964771 reported by Heinrich Schuchardt
6
This bug affects 1 person
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/by-partlabel/loader1 and loader2 point to a device called /dev/mmcblk*.

We should write a warning if /dev/disk/by-partlabel/loader1 or /dev/disk/by-partlabel/loader2 are missing.

The boot ROM does not rely on the partition name but loads U-Boot SPL from the SD card partition with GUID 5B193300-FC78-40CD-8002-E86C45580B47. So it may be preferable to use the GUID instead of the label.

We could use 'lsblk -ro NAME,PARTTYPE' to identify the partition type GUIDs.

Best regards

Heinrich

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

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
ACTION=="remove", GOTO="persistent_storage_end"
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end"

SUBSYSTEM!="block|ubi", GOTO="persistent_storage_end"
KERNEL!="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="persistent_storage_end"

# ignore partitions that span the entire disk
TEST=="whole_disk", GOTO="persistent_storage_end"

# allow admin to disable probing the filesystem for slow devices like floppy disk drives
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_BLKID_FLAG}=="1", GOTO="persistent_storage_end"

# by-parttype links (partition metadata)
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_TYPE}=="?*", SYMLINK+="disk/by-parttype/$env{ID_PART_ENTRY_TYPE}"

LABEL="persistent_storage_end"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.