aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-08-17 19:05:15 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-08-17 19:05:15 -0300
commit1477211c74d8be63342fb97c0fdb4d7bbe414348 (patch)
treebb373dbd329f8e7b7478b48b49bcbf9818de5685 /share
parent90a127db7e09d0518e18f7891b7921518e6141e5 (diff)
downloadhydra-1477211c74d8be63342fb97c0fdb4d7bbe414348.tar.gz
hydra-1477211c74d8be63342fb97c0fdb4d7bbe414348.tar.bz2
Provision: fix GRUB install issues
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/provision26
1 files changed, 14 insertions, 12 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index ffbcce8..192ae69 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -336,9 +336,11 @@ hydra_sudo_run LC_ALL=C DEBIAN_FRONTEND=noninteractive debootstrap --force-check
# Initial configuration.
echo "Applying initial configuration..."
-hydra_sudo_run mount none -t proc $WORK/proc
-hydra_sudo_run mount none -t sysfs $WORK/sys
-hydra_sudo_run mount -o bind /dev/ $WORK/dev
+hydra_sudo_run mount none -t proc $WORK/proc
+hydra_sudo_run mount none -t sysfs $WORK/sys
+hydra_sudo_run mount -o bind /run/ $WORK/run
+hydra_sudo_run mount -o bind /dev/ $WORK/dev
+hydra_sudo_run mount -o bind /dev/pts $WORK/dev/pts
echo LANG=C | $SUDO tee $WORK/etc/default/locale > /dev/null
# Resolver configuration.
@@ -467,6 +469,14 @@ else
kernel_arch="$arch"
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
+fi
+
# Kernel.
$APT_INSTALL linux-image-$kernel_arch -y
@@ -480,14 +490,6 @@ hydra_sudo_run chroot $WORK update-initramfs -u
# Grub.
if [ "$grub" == "y" ]; then
- echo "Boot device setup..."
-
- if [ "$encrypt" != "y" ]; then
- 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
- fi
-
echo "Setting up GRUB..."
$APT_INSTALL grub-pc -y
@@ -545,7 +547,7 @@ if [ "$grub" == "y" ] && [ "$encrypt" != "y" ]; then
hydra_sudo_run umount $WORK/boot
fi
-hydra_sudo_run umount $WORK/sys $WORK/proc $WORK/dev $WORK
+hydra_sudo_run umount $WORK/sys $WORK/proc $WORK/dev/pts $WORK/dev $WORK/run $WORK
if [ "$swap_size" != "0" ]; then
hydra_sudo_run cryptsetup luksClose provision-swap