Debian Codegraph @

dracut/modules.d/55kiwi-live/parse-kiwi-live.sh

raw
1 #!/bin/bash
2 # live images are specified with
3 # root=live:CDLABEL=label
4 # root=live:AOEINTERFACE=name
5 type getOverlayBaseDirectory >/dev/null 2>&1 || . /lib/kiwi-live-lib.sh
6
7 [ -z "${root}" ] && root=$(getarg root=)
8
9 if [ "${root%%:*}" = "live" ] ; then
10 liveroot=${root}
11 fi
12
13 [ "${liveroot%%:*}" = "live" ] || return 1
14
15 modprobe -q loop
16
17 case "${liveroot}" in
18 live:CDLABEL=*|CDLABEL=*) \
19 root="${root#live:}"
20 root="${root//\//\\x2f}"
21 root="live:/dev/disk/by-label/${root#CDLABEL=}"
22 rootok=1 ;;
23 live:AOEINTERFACE=*|AOEINTERFACE=*) \
24 modprobe -q aoe
25 root="${root#live:}"
26 root="${root//\//\\x2f}"
27 root="live:aoe:/dev/etherd/${root#AOEINTERFACE=}"
28 rootok=1 ;;
29 live:ftp:*|live:http:*|live:https:*|live:dolly:*) \
30 modprobe -q brd
31 root="${root#live:}"
32 root="live:net:${root}"
33 rootok=1 ;;
34 esac
35
36 [ "$rootok" = "1" ] || return 1
37
38 info "root was ${liveroot}, is now ${root}"
39
40 # make sure that init doesn't complain
41 [ -z "${root}" ] && root="live"
42
43 OVERLAY_BASE="$(getOverlayBaseDirectory)"
44
45 wait_for_dev -n "${OVERLAY_BASE}/rootfsbase"
46 wait_for_dev -n "${OVERLAY_BASE}/overlayfs/rw"
47 wait_for_dev -n "${OVERLAY_BASE}/overlayfs/work"
48
49 return 0