From d3ef216c34d9b8e0c720cbb3b9b3b88da63b08a2 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 15 Apr 2018 22:03:06 +0100 Subject: Support persistance and multiboot USB sticks in examples. --- examples/dracut/mgalive-parse.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 examples/dracut/mgalive-parse.sh (limited to 'examples/dracut/mgalive-parse.sh') diff --git a/examples/dracut/mgalive-parse.sh b/examples/dracut/mgalive-parse.sh new file mode 100755 index 0000000..c5225ba --- /dev/null +++ b/examples/dracut/mgalive-parse.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# live images are specified with +# root=mgalive:backingdev + +[ -z "$root" ] && root=$(getarg root=) + +if [ "${root%%:*}" = "mgalive" ] ; then + liveroot=$root +fi + +[ "${liveroot%%:*}" = "mgalive" ] || return + +modprobe -q loop + +case "$liveroot" in + mgalive:LABEL=*|LABEL=*) \ + root="${root#mgalive:}" + root="$(echo $root | sed 's,/,\\x2f,g')" + root="mgalive:/dev/disk/by-label/${root#LABEL=}" + rootok=1 ;; + mgalive:UUID=*|UUID=*) \ + root="${root#mgalive:}" + root="mgalive:/dev/disk/by-uuid/${root#UUID=}" + rootok=1 ;; +esac +info "root was $liveroot, is now $root" + +# make sure that init doesn't complain +[ -z "$root" ] && root="mgalive" + +wait_for_dev /live/union -- cgit v1.2.1