From 62639dc664253f6cd643894fff6941dc29006a31 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sat, 6 Feb 2016 21:54:40 +0100 Subject: Boot parameter "livemedia=": also support UUID and LABEL. Examples: + livemedia=08d500da-9538-435c-94fc-c97b1c96d1b1 + livemedia=LIVESLAK + livemedia=/dev/sde1 --- liveinit | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'liveinit') diff --git a/liveinit b/liveinit index 809c9ed..443da4c 100755 --- a/liveinit +++ b/liveinit @@ -339,8 +339,18 @@ if [ "$RESCUE" = "" ]; then fi sleep 1 else - # LIVEMEDIA was spcified on the boot commandline using "livemedia=" - LIVEALL="$LIVEMEDIA" + # LIVEMEDIA was specified on the boot commandline using "livemedia=" + if [ ! -b "$LIVEMEDIA" ]; then + # Passed a UUID or LABEL? + LIVEALL=$(findfs UUID=$LIVEMEDIA 2>/dev/null) || LIVEALL=$(findfs LABEL=$LIVEMEDIA 2>/dev/null) + if [ -z "$LIVEALL" ]; then + echo "${MARKER}: Live media '$LIVEMEDIA' not found... trouble ahead." + else + LIVEMEDIA="$LIVEALL" + fi + else + LIVEALL="$LIVEMEDIA" + fi LIVEFS=$(blkid $LIVEMEDIA |rev |cut -d'"' -f2 |rev) mount -t $LIVEFS -o ro $LIVEMEDIA /mnt/media fi -- cgit v1.2.3