diff options
author | Aaron Ball <nullspoon@iohq.net> | 2016-05-22 22:42:09 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@iohq.net> | 2016-05-22 22:42:09 -0600 |
commit | 5777f8ccbcc7d3130069ee3751d45d515bbd2381 (patch) | |
tree | 42c4de185e62b9a7629fe6fa2d81175909ab4411 /init | |
parent | 74e2b3acffa0f068f56a6623c8d0d96c9629f328 (diff) | |
download | mkinitramfs-5777f8ccbcc7d3130069ee3751d45d515bbd2381.tar.gz mkinitramfs-5777f8ccbcc7d3130069ee3751d45d515bbd2381.tar.xz |
Learned support for uuid and labels
Now we support uuid specifications and labels through the use of blkid.
Diffstat (limited to 'init')
-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) |