summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rwxr-xr-xinit20
1 files changed, 20 insertions, 0 deletions
diff --git a/init b/init
index 8ea174a..e075862 100755
--- a/init
+++ b/init
@@ -3,6 +3,7 @@
export DEBUG=0
export INTERACTIVE=0
export ROOTDEV=''
+export CRYPTROOT=''
screen_init() {
# Clear screen
@@ -57,6 +58,20 @@ parse_cmdline() {
ROOTDEV="$(echo ${i} | cut -d '=' -f 2)"
fi
;;
+ cryptroot=*)
+ if [ "${i:10:4}" == 'UUID' ]; then
+ # mount by uuid
+ local uuid=$(echo ${i} | cut -d '=' -f 3)
+ CRYPTROOT="$(blkid -U ${uuid})"
+ elif [ "${i:10:5}" == 'LABEL' ]; then
+ # mount by label
+ local label=$(echo ${i} | cut -d '=' -f 3)
+ CRYPTROOT="$(blkid -L ${label})"
+ else
+ # mount by dev
+ CRYPTROOT="$(echo ${i} | cut -d '=' -f 2)"
+ fi
+ ;;
initdebug)
# Enable debug mode (this is gonna be slow)
DEBUG=1
@@ -194,6 +209,11 @@ main() {
log "New rootdev: ${ROOTDEV}"
fi
+ if [ ! -z "${CRYPTROOT}" ]; then
+ log "Cryptroot defined. Changing rootdev to '${CRYPTROOT}'"
+ ROOTDEV="${CRYPTROOT}"
+ fi
+
# Drop to interactive shell if requested
if [ "${INTERACTIVE}" == 1 ]; then
log "Interractive shell requested. Type 'exit' to continue boot sequence."

Generated by cgit