Get /boot part number

This commit is contained in:
gardouille 2023-07-01 17:11:06 +02:00
parent 23328640e8
commit bd3c2de8a4
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 9 additions and 2 deletions

11
debian/chroot.mount vendored
View File

@ -98,8 +98,14 @@ else
mountpoint -q /target || mount -- ${hdd}3 /target
fi
### boot - grub
mountpoint -q /target/boot || mount -- ${hdd}1 /target/boot
### boot - grub {{{
### If a boot partition is available for $hdd device
if blkid | grep --quiet --extended-regexp -- "^${hdd}.*LABEL=\"boot\""; then
### Get partition number
boot_part_number=$(blkid | grep --extended-regexp -- "^${hdd}.*LABEL=\"boot\"" | sed --silent "s;${hdd}\(.\).*;\1;p")
mountpoint -q /target/boot || mount -- "${hdd}${boot_part_number}" /target/boot
fi
### }}}
##
if [ "${manage_btrfs}" -eq 0 ]; then
printf '%b\n' "The root system is in ${GREEN}BTRFS${RESET}, no extra mount is required."
@ -175,6 +181,7 @@ DNS=80.67.169.12
## }}}
printf '%b\n' "A systemd-networkd sample is available in ${GREEN}/tmp/50-default-networkd${RESET}."
printf '%b\n' "${GREEN}The system is available on /target you can now try to chroot.${RESET}"
exit 0