From bd3c2de8a4a8a614de537622f18c1fa13cf004e8 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Sat, 1 Jul 2023 17:11:06 +0200 Subject: [PATCH] Get /boot part number --- debian/chroot.mount | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/chroot.mount b/debian/chroot.mount index fe3e633..be560d4 100755 --- a/debian/chroot.mount +++ b/debian/chroot.mount @@ -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