]> gitweb.fluxo.info Git - hydra.git/commitdiff
Provision: dracut support
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Aug 2018 23:19:30 +0000 (20:19 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Aug 2018 23:19:30 +0000 (20:19 -0300)
share/hydractl/provision

index cabb40e2f10810fc1c14dbbd767b5bde32f1b0ca..32a2b7a59e2f07d0629d40ce0364a5df8fe400ed 100755 (executable)
@@ -126,6 +126,7 @@ function hydra_provision_config {
   hydra_user_config   version           stretch                          "Distro version"
   hydra_user_config   vg                $hostname                        "Install vg"
   hydra_user_config   grub              y                                "Setup GRUB? (y/n)"
+  hydra_user_config   initramfs         initramfs-tools                  "Initramfs manager? (initramfs-tools/dracut)"
   hydra_user_config   mirror            https://deb.debian.org/debian/   "Debian mirror"
   hydra_user_config   ssh               y                                "Install openssh-server? (y/n)"
 
@@ -369,7 +370,7 @@ fi
 echo "Applying initial upgrades..."
 hydra_sudo_run chroot $WORK/ apt-get update
 hydra_sudo_run chroot $WORK/ apt-get upgrade -y
-$APT_INSTALL locales cryptsetup lvm2 initramfs-tools -y
+$APT_INSTALL locales cryptsetup lvm2 -y
 
 # Crypttab.
 echo "Configuring crypttab..."
@@ -482,11 +483,18 @@ $APT_INSTALL linux-image-$kernel_arch -y
 
 # Initramfs.
 echo "Creating initramfs..."
-if [ -e "$WORK/etc/cryptsetup-initramfs/conf-hook" ]; then
-  hydra_sudo_run sed -i -e 's/#CRYPTSETUP=/CRYPTSETUP=y/' $WORK/etc/cryptsetup-initramfs/conf-hook
-fi
 
-hydra_sudo_run chroot $WORK update-initramfs -u
+if [ "$initramfs" == "initramfs-tools" ]; then
+  $APT_INSTALL initramfs-tools -y
+
+  if [ -e "$WORK/etc/cryptsetup-initramfs/conf-hook" ]; then
+    hydra_sudo_run sed -i -e 's/#CRYPTSETUP=/CRYPTSETUP=y/' $WORK/etc/cryptsetup-initramfs/conf-hook
+  fi
+
+  hydra_sudo_run chroot $WORK update-initramfs -u
+else
+  $APT_INSTALL dracut -y
+fi
 
 # Grub.
 if [ "$grub" == "y" ]; then