Created
December 17, 2010 19:43
-
-
Save fapestniegd/745576 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PREREQ="mdadm" | |
| prereqs(){ | |
| echo "$PREREQ" | |
| } | |
| . /scripts/functions | |
| case $1 in | |
| prereqs) | |
| prereqs | |
| exit 0 | |
| ;; | |
| esac | |
| log_begin_msg "Starting root-on-crypt" | |
| /sbin/modprobe usb-storage | |
| sleep 10; | |
| /bin/mount -t ext2 /dev/sda1 /cryptkeys/boot | |
| if [ ! -f /cryptkeys/boot/crypttab ]; then | |
| echo "could not read /cryptkeys/boot/crypttab" | |
| reboot; | |
| else | |
| /bin/cat /cryptkeys/boot/crypttab | \ | |
| awk '{print "cryptsetup --key-file /cryptkeys"$3" luksOpen "$2" "$1}'| \ | |
| while read READY_DEVICE ; do | |
| echo "${READY_DEVICE}" | |
| ${READY_DEVICE} | |
| done | |
| fi | |
| /bin/umount /cryptkeys/boot | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment