summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@iohq.net>2016-05-22 22:42:56 -0600
committerAaron Ball <nullspoon@iohq.net>2016-05-22 22:42:56 -0600
commit5f5d8849581d9e6c6478274a701f1b7dc5cb2899 (patch)
tree42c4de185e62b9a7629fe6fa2d81175909ab4411
parent74e2b3acffa0f068f56a6623c8d0d96c9629f328 (diff)
parent5777f8ccbcc7d3130069ee3751d45d515bbd2381 (diff)
downloadmkinitramfs-5f5d8849581d9e6c6478274a701f1b7dc5cb2899.tar.gz
mkinitramfs-5f5d8849581d9e6c6478274a701f1b7dc5cb2899.tar.xz
Merge branch 'learn-label-uuid'
-rwxr-xr-xinit12
1 files 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)

Generated by cgit