From 83475b4fdafa31ecc142bf443e7fe1f1af155e3c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 17 Aug 2018 22:55:29 -0300 Subject: Provision: UUID fixes and other enhancements --- share/hydractl/provision | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/share/hydractl/provision b/share/hydractl/provision index 2bf2307..c791d06 100755 --- a/share/hydractl/provision +++ b/share/hydractl/provision @@ -204,21 +204,12 @@ else boot_device="$device"2 syst_device="$device"3 - - # Use UUID - # Give time to devices table be updated - sleep 2 - reboot_device="`blkid | grep ^$boot_device: | cut -d ' ' -f 2 | sed -e 's/"//g'`" - - # Use device name: might lead to wrong results: - # During install boot_device might be /dev/sdb2, but on but be /dev/sda2 - #reboot_device="$boot_device" fi fi hydra_sudo_run parted -s -- $device set 2 boot on -# Take a small break to device table be updated +# Take a small break to devices table be updated sleep 2 # Create volumes. @@ -457,9 +448,9 @@ fi # Boot device must be available before installing kernel and initramfs. if [ "$grub" == "y" ] && [ "$encrypt" != "y" ]; then echo "Boot device setup..." + hydra_sudo_run mkfs.ext4 $boot_device - hydra_sudo_run mount $boot_device $WORK/boot - echo "$reboot_device /boot ext4 defaults,errors=remount-ro 0 2" | $SUDO tee -a $WORK/etc/fstab > /dev/null + hydra_sudo_run mount $boot_device $WORK/boot fi # Kernel. @@ -499,6 +490,9 @@ EOF hydra_sudo_run chroot $WORK update-initramfs -u else $APT_INSTALL dracut -y + + # Ensure initramfs-tools is absent + hydra_sudo_run chroot $WORK apt-get autoremove -y fi # Grub. @@ -526,6 +520,20 @@ if [ "$grub" == "y" ]; then fi fi +# Set boot partition config +if [ "$grub" == "y" ] && [ "$encrypt" != "y" ]; then + # Use UUID + # Reboot device must be calculated after filesystem creation and grub installation + #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'`" + + # Use device name: might lead to wrong results + # During install boot_device might be /dev/sdb2, but on but 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 +fi + # Utils. echo "Installing basic utilities..." $APT_INSTALL screen cron lsb-release openssl -y @@ -581,4 +589,9 @@ Now proceeed with final steps: - Review fstab, crypttab and optional GRUB configuration. See https://padrao.fluxo.info/install for more information. + +If you know what you're doing, you might test the installation using: + + sudo kvm -m 512 -hda $device + EOF -- cgit v1.2.3