mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-21 01:31:26 +00:00
When testing a possible boot device, detect its partition type and skip grub, LUKS, and LVM partitions. These aren't mountable as /boot, this silences spurious exFAT errors. In detect_boot_device, skip testing CONFIG_BOOT_DEV a second time if it is found as a block device. This avoids doubling any errors shown from checking this device, no sense trying it twice. Refactor some logic to avoid duplication - extract device_has_partitions and use it in detect_boot_device, extract mount_possible_boot_device and use it instead of duplicating the logic. Move find_lvm_vg_name() to /etc/functions. Avoid mixing up similarly-named devices like 'nvme0n1'/'nvme0n10' or 'sda'/'sdaa' - it's probably unlikely that many devices will appear, but looking for partitions in '/sys/class/block/<device>/' instead of '/dev/' would avoid any collisions. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>