aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-02-14 22:01:15 -0200
committerSilvio Rhatto <rhatto@riseup.net>2019-02-14 22:01:15 -0200
commitbbe90843813c948dc12d82427017b7242312e295 (patch)
tree90b25b6eccbc9b29fd351469c26d312199054949 /share
parent009b6c00f3efbd9089b8704ea534b67c7a0910e8 (diff)
downloadhydra-bbe90843813c948dc12d82427017b7242312e295.tar.gz
hydra-bbe90843813c948dc12d82427017b7242312e295.tar.bz2
Provision: use lsblk instead of blkid
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/provision18
1 files changed, 16 insertions, 2 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index 1721a17..24fd614 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -524,14 +524,28 @@ fi
if [ "$grub" == "y" ] && [ "$encrypt" != "y" ]; then
# Use UUID
# Reboot device must be calculated after filesystem creation and grub installation
+ #
+ # We use lsblk instead of blkid. From blkid(8):
+ #
+ # When device is specified, tokens from only this device are displayed. It is
+ # possible to specify multiple device arguments on the command line. If none
+ # is given, all devices which appear in /proc/partitions are shown, if they are
+ # recognized.
+ #
+ # Note that blkid reads information directly from devices and for non-root
+ # users it returns cached unverified information. It is better to use lsblk
+ # --fs to get a user-friendly overview of filesystems and devices. lsblk(8)
+ # is also easy to use in scripts. blkid is mostly designed for system services
+ # and to test libblkid functionality.
#reboot_device="`blkid | grep ^$boot_device: | cut -d ' ' -f 2 | sed -e 's/"//g'`"
- reboot_device="`blkid $boot_device | cut -d ' ' -f 2 | sed -e 's/"//g'`"
+ #reboot_device="`blkid $boot_device | cut -d ' ' -f 2 | sed -e 's/"//g'`"
+ reboot_device="`lsblk $boot_device -n -o UUID`"
# Use device name: might lead to wrong results
# During install boot_device might be /dev/sdb2, but on boot be /dev/sda2
#reboot_device="$boot_device"
- echo "$reboot_device /boot ext4 defaults,errors=remount-ro 0 2" | $SUDO tee -a $WORK/etc/fstab > /dev/null
+ echo "UUID=$reboot_device /boot ext4 defaults,errors=remount-ro 0 2" | $SUDO tee -a $WORK/etc/fstab > /dev/null
hydra_sudo_run chroot $WORK update-initramfs -u
fi