aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-08-17 22:55:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-08-17 22:55:29 -0300
commit83475b4fdafa31ecc142bf443e7fe1f1af155e3c (patch)
treeac23607ca4ddc72f943828c34811079cc155f915
parent38b92ef29b1e3a457bde4b55e1e1744979083a0f (diff)
downloadhydra-83475b4fdafa31ecc142bf443e7fe1f1af155e3c.tar.gz
hydra-83475b4fdafa31ecc142bf443e7fe1f1af155e3c.tar.bz2
Provision: UUID fixes and other enhancements
-rwxr-xr-xshare/hydractl/provision37
1 files 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