From b7990dc0356b1afdc0a79545902a310f783d7b6f Mon Sep 17 00:00:00 2001 From: Mats van Reenen Date: Sun, 11 Sep 2022 12:51:13 +0200 Subject: [PATCH] fix bash execution in run --- in-root.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/in-root.sh b/in-root.sh index efc3558..b9466fe 100644 --- a/in-root.sh +++ b/in-root.sh @@ -6,11 +6,11 @@ function run(){ echo "[ ] $1" echo "# $1" >>install.log echo "> $2" >>install.log - $2 &>>install.log \ + bash -c "$2" &>>install.log \ && echo -e "\e[1A\e[K[ \e[32mOK\e[0m ] $1" \ || { echo -e "\e[1A\e[K[\e[31mFAIL\e[0m] $1" - $3 + bash -c "$3" exit } echo >>install.log @@ -34,10 +34,10 @@ echo "127.0.1.1 $HOSTNAME" >>/etc/hosts run "config initramfs" "sed --in-place -e 's/HOOKS=(.*)/HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)/' /etc/mkinitcpio.conf" run "generate initramfs" "mkinitcpio -P" -DISKUUID=$(blkid --output export &{DISK}10 | grep PARTUUID | sed 's/PARTUUID=//') +DISKUUID=$(blkid --output export ${DISK}10 | grep PARTUUID | sed 's/PARTUUID=//') run "run grub-install" "grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot" run "grub: enable crypt disk" "sed --in-place -E -e 's/#?GRUB_ENABLE_CRYPTODISK=(.*)/GRUB_ENABLE_CRYPTODISK=y/' /etc/default/grub" -run "grub: crypt disk map" "sed --in-place -E -e 's/#?GRUB_CMDLINE_LINUX=\"?(.*)\"?/GRUB_CMDLINE_LINUX=\"${DISKUUID}:cryptroot \1\"/' /etc/default/grub" +run "grub: crypt disk map" "sed --in-place -E -e 's/#?GRUB_CMDLINE_LINUX=\\\"?(.*)\\\"?/GRUB_CMDLINE_LINUX=\\\"/dev/disk/by-uuid/${DISKUUID}:cryptroot \\\1\\\"/' /etc/default/grub" run "make grub config" "grub-mkconfig -o /boot/grub/grub.cfg" run "add .ssh dir to skel" "mkdir /etc/skel/.ssh"