From 8a5c10950b8c2afd0b1a01175047cd8bbf66b513 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 17 Aug 2018 20:19:30 -0300 Subject: Provision: dracut support --- share/hydractl/provision | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/share/hydractl/provision b/share/hydractl/provision index cabb40e..32a2b7a 100755 --- a/share/hydractl/provision +++ b/share/hydractl/provision @@ -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 -- cgit v1.2.3