[Bug 1964771] Re: [u-boot-sifive] insufficient installation checks

Heinrich Schuchardt 1964771 at bugs.launchpad.net
Fri Mar 10 14:29:33 UTC 2023


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"

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to u-boot in Ubuntu.
https://bugs.launchpad.net/bugs/1964771

Title:
  [u-boot-sifive] insufficient installation checks

Status in u-boot package in Ubuntu:
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/1964771/+subscriptions




More information about the foundations-bugs mailing list