From 5777f8ccbcc7d3130069ee3751d45d515bbd2381 Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Sun, 22 May 2016 22:42:09 -0600 Subject: Learned support for uuid and labels Now we support uuid specifications and labels through the use of blkid. --- init | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/init b/init index c0ffa88..8630934 100755 --- a/init +++ b/init @@ -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) -- cgit v1.2.3