diff options
Diffstat (limited to 'hooks')
-rw-r--r-- | hooks/encrypt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hooks/encrypt b/hooks/encrypt index 30dfc12..9ae2d45 100644 --- a/hooks/encrypt +++ b/hooks/encrypt @@ -3,6 +3,17 @@ # encryption schemes run_hook () { + replace_root () + { + newcmdline="" + for cmd in $CMDLINE; do + case "$cmd" in + root=*) newcmdline="${newcmdline} root=${1}" ;; + *) newcmdline="${newcmdline} ${cmd}" ;; + esac + done + export CMDLINE="${newcmdline}" + } mkdevice () { /bin/mknod "/dev/mapper/control" c ${1} ${2}; } /bin/modprobe -a -q dm-crypt >/dev/null 2>&1 @@ -22,6 +33,7 @@ run_hook () done if [ -e "/dev/mapper/root" ]; then export root="/dev/mapper/root" + replace_root ${root} else err "Password succeeded, but root creation failed, aborting..." exit 1 @@ -57,6 +69,7 @@ run_hook () else if [ -e "/dev/mapper/root" ]; then export root="/dev/mapper/root" + replace_root ${root} else err "Password succeeded, but root creation failed, aborting..." exit 1 |