From 897faaf920889e28e46b5340272e67442f83ff73 Mon Sep 17 00:00:00 2001 From: simono41 Date: Sun, 4 Mar 2018 20:16:30 +0100 Subject: [PATCH] usbsecret-fix --- .gitignore | 1 + arch-install | 4 ++-- hooks/usbsecret | 24 ++++++++++++++++-------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index fc6eb14..8adbf3e 100755 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ ArchLinuxARM-rpi-2-latest.tar.gz ArchLinuxARM-rpi-3-latest.tar.gz airootfs.sha512 test +arch.img diff --git a/arch-install b/arch-install index 8fb6807..7f972d4 100755 --- a/arch-install +++ b/arch-install @@ -126,8 +126,8 @@ function usbkeyinstallation() { function usbsecret() { - cp /opt/${repo}/install/usbsecret ${mountpoint}/usr/lib/initcpio/install/usbsecret - cp /opt/${repo}/hooks/usbsecret ${mountpoint}/root/usbsecret + cp /opt/${repo}/install/usbsecret ${mountpoint}/usr/lib/initcpio/install/usbsecret + cp /opt/${repo}/hooks/usbsecret ${mountpoint}/root/usbsecret # hooks #cp install/usbsecret ${mountpoint}/usr/lib/initcpio/install/usbsecret diff --git a/hooks/usbsecret b/hooks/usbsecret index e86bc88..b781210 100755 --- a/hooks/usbsecret +++ b/hooks/usbsecret @@ -1,14 +1,22 @@ run_hook () { - msg ":: Suche USB-Stick nach entsperrung des Systems!" - if blkid -s PARTUUID -o value | grep %USB_UUID% > /dev/null; then - msg ":: USB-Stick gefunden fahre mit starten des Systems weiter!" - else - msg ":: USB-Stick konnte nicht zur entsperrung gefunden werden!" - launch_interactive_shell - fi + # Do not need this thanks to tr: file=$(dos2unix inputs.txt) - msg ":: done." + # Use -r so a line with backslashes will be showed like you want + while true + do + # Not empty? Check with test -n + if blkid -s PARTUUID -o value | grep %USB_UUID% > /dev/null; then + echo ":: USB-Stick gefunden fahre mit starten des Systems weiter!" + break + else + echo ":: USB-Stick konnte nicht zur entsperrung gefunden werden!" + echo "..." + sleep 5 + fi + done + + echo ":: done." } # vim: set ft=sh ts=4 sw=4 et: