-rw-r--r-- install/welcome
1 #!/bin/bash 2 3 build() { 4 ( 5 test -s /etc/vconsole.conf && . /etc/vconsole.conf 6 7 is_valid() { test "$1" -ge 0 -a "$1" -le 15; } 8 is_valid ${WELCOME_FG:-5} || WELCOME_FG=5 9 is_valid ${WELCOME_IN:-4} || WELCOME_IN=4 10 11 echo "WELCOME_FG=$WELCOME_FG" >> "$BUILDROOT/welcome" 12 echo "WELCOME_IN=$WELCOME_IN" >> "$BUILDROOT/welcome" 13 ) 14 15 add_file "/usr/lib/initcpio/hooks/encrypt" "/welcome-decrypt" 755 16 17 # This is pretty ugly but we want the 'build' function in the encrypt hook 18 # and we want it called from a file called 'welcome' as it calls 19 # 'add_runscript' which reads the filename. 20 TMP=`mktemp -d` 21 cp /usr/lib/initcpio/install/encrypt $TMP/welcome 22 sed -i 's/build()/_&/' $TMP/welcome 23 echo _build >> $TMP/welcome 24 . $TMP/welcome 25 rm -r $TMP 26 } 27 28 help() { 29 cat <<HELPEOF 30 This hook displays "Welcome" while waiting for input for disk decryption. It 31 depends on (and uses) the build function from the standard encrypt hook to 32 ensure that everything is set up correctly for decryption, but instead of using 33 the encrypt hook's own boot script, a custom one is specified by the user in 34 /etc/initcpio/welcome-decrypt 35 HELPEOF 36 } 37