summaryrefslogtreecommitdiffstats
path: root/modules.d/90mgalive/mgalive-parse.sh
blob: 8cc9ef7dd2c7146d69bdbe786cb1e65640380354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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