diff options
Diffstat (limited to 'init')
-rwxr-xr-x | init | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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." |