diff options
-rwxr-xr-x | init | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -41,20 +41,24 @@ function log { function parse_cmdline { local cmdline=${1} - dev='' for i in ${cmdline[@]}; do case "${i}" in root=*) if [[ ${i:5:4} == 'UUID' ]]; then - #mount by uuid - ROOTDEV="/dev/disk/by-uuid/$(echo ${i} | cut -d '=' -f 3)" + # mount by uuid + local uuid=$(echo ${i} | cut -d '=' -f 3) + ROOTDEV="$(blkid -U ${uuid})" + elif [[ ${i:5:5} == 'LABEL' ]]; then + # mount by label + local label=$(echo ${i} | cut -d '=' -f 3) + ROOTDEV="$(blkid -L ${label})" else # mount by dev ROOTDEV="$(echo ${i} | cut -d '=' -f 2)" fi ;; initdebug) - # Enable debug mode (this is gonna be slow + # Enable debug mode (this is gonna be slow) DEBUG=1 ;; interractive) |