Checking for ${overlay}, not ${device} when trying to close ${overlay}.
[debian-live-boot.git] / scripts / boot / 9990-cmdline-old
blobb8fc4a616d4377c69bd6c27ca736a9ab17e42fb3
1 #!/bin/sh
3 #set -e
5 Cmdline_old ()
7 for _PARAMETER in ${_CMDLINE}
8 do
9 case "${_PARAMETER}" in
10 skipconfig)
11 NOFSTAB="true"
12 NONETWORKING="true"
14 export NOFSTAB NONETWORKING
17 BOOTIF=*)
18 BOOTIF="${x#BOOTIF=}"
21 dhcp)
22 # Force dhcp even while netbooting
23 # Use for debugging in case somebody works on fixing dhclient
24 DHCP="true";
25 export DHCP
28 nodhcp)
29 DHCP=""
30 export DHCP
33 ethdevice=*)
34 DEVICE="${_PARAMETER#ethdevice=}"
35 ETHDEVICE="${DEVICE}"
36 export DEVICE ETHDEVICE
39 ethdevice-timeout=*)
40 ETHDEV_TIMEOUT="${_PARAMETER#ethdevice-timeout=}"
41 export ETHDEV_TIMEOUT
44 fetch=*)
45 FETCH="${_PARAMETER#fetch=}"
46 export FETCH
49 findiso=*)
50 FINDISO="${_PARAMETER#findiso=}"
51 export FINDISO
54 ftpfs=*)
55 FTPFS="${_PARAMETER#ftpfs=}"
56 export FTPFS
59 httpfs=*)
60 HTTPFS="${_PARAMETER#httpfs=}"
61 export HTTPFS
64 iscsi=*)
65 ISCSI="${_PARAMETER#iscsi=}"
66 #ip:port - separated by ;
67 ISCSI_PORTAL="${ISCSI%;*}"
68 if echo "${ISCSI_PORTAL}" | grep -q , ; then
69 ISCSI_SERVER="${ISCSI_PORTAL%,*}"
70 ISCSI_PORT="${ISCSI_PORTAL#*,}"
72 #target name
73 ISCSI_TARGET="${ISCSI#*;}"
74 export ISCSI ISCSI_PORTAL ISCSI_TARGET ISCSI_SERVER ISCSI_PORT
77 isofrom=*|fromiso=*)
78 FROMISO="${_PARAMETER#*=}"
79 export FROMISO
82 ignore_uuid)
83 IGNORE_UUID="true"
84 export IGNORE_UUID
87 ip=*)
88 STATICIP="${_PARAMETER#ip=}"
90 if [ -z "${STATICIP}" ]
91 then
92 STATICIP="frommedia"
95 export STATICIP
98 live-media=*|bootfrom=*)
99 LIVE_MEDIA="${_PARAMETER#*=}"
100 export LIVE_MEDIA
103 live-media-encryption=*|encryption=*)
104 LIVE_MEDIA_ENCRYPTION="${_PARAMETER#*=}"
105 export LIVE_MEDIA_ENCRYPTION
108 live-media-offset=*)
109 LIVE_MEDIA_OFFSET="${_PARAMETER#live-media-offset=}"
110 export LIVE_MEDIA_OFFSET
113 live-media-path=*)
114 LIVE_MEDIA_PATH="${_PARAMETER#live-media-path=}"
115 export LIVE_MEDIA_PATH
118 live-media-timeout=*)
119 LIVE_MEDIA_TIMEOUT="${_PARAMETER#live-media-timeout=}"
120 export LIVE_MEDIA_TIMEOUT
123 module=*)
124 MODULE="${_PARAMETER#module=}"
125 export MODULE
128 netboot=*)
129 NETBOOT="${_PARAMETER#netboot=}"
130 export NETBOOT
133 nfsopts=*)
134 NFSOPTS="${_PARAMETER#nfsopts=}"
135 export NFSOPTS
138 nfsoverlay=*)
139 NFS_COW="${_PARAMETER#nfsoverlay=}"
140 export NFS_COW
143 nofstab)
144 NOFSTAB="true"
145 export NOFSTAB
148 nonetworking)
149 NONETWORKING="true"
150 export NONETWORKING
153 ramdisk-size=*)
154 ramdisk_size="${_PARAMETER#ramdisk-size=}"
157 persistence)
158 PERSISTENCE="true"
159 export PERSISTENCE
162 persistence-encryption=*)
163 PERSISTENCE_ENCRYPTION="${_PARAMETER#*=}"
164 export PERSISTENCE_ENCRYPTION
167 persistence-media=*)
168 PERSISTENCE_MEDIA="${_PARAMETER#*=}"
169 export PERSISTENCE_MEDIA
171 persistence-method=*)
172 PERSISTENCE_METHOD="${_PARAMETER#*=}"
173 export PERSISTENCE_METHOD
176 persistence-path=*)
177 PERSISTENCE_PATH="${_PARAMETER#persistence-path=}"
178 export PERSISTENCE_PATH
180 persistence-read-only)
181 PERSISTENCE_READONLY="true"
182 export PERSISTENCE_READONLY
185 persistence-storage=*)
186 PERSISTENCE_STORAGE="${_PARAMETER#persistence-storage=}"
187 export PERSISTENCE_STORAGE
190 persistence-label=*)
191 custom_overlay_label="${_PARAMETER#persistence-label=*}"
194 nopersistence)
195 NOPERSISTENCE="true"
196 export NOPERSISTENCE
199 quickusbmodules)
200 QUICKUSBMODULES="true"
201 export QUICKUSBMODULES
204 todisk=*)
205 TODISK="${_PARAMETER#todisk=}"
206 export TODISK
209 toram)
210 TORAM="true"
211 export TORAM
214 toram=*)
215 TORAM="true"
216 MODULETORAM="${_PARAMETER#toram=}"
217 export TORAM MODULETORAM
220 exposedroot)
221 EXPOSED_ROOT="true"
222 export EXPOSED_ROOT
225 plainroot)
226 PLAIN_ROOT="true"
227 export PLAIN_ROOT
230 skipunion)
231 SKIP_UNION_MOUNTS="true"
232 export SKIP_UNION_MOUNTS
235 root=*)
236 ROOT="${_PARAMETER#root=}"
237 export ROOT
240 union=*)
241 UNIONTYPE="${_PARAMETER#union=}"
242 export UNIONTYPE
244 esac
245 done
247 # sort of compatibility with netboot.h from linux docs
248 if [ -z "${NETBOOT}" ]
249 then
250 if [ "${ROOT}" = "/dev/nfs" ]
251 then
252 NETBOOT="nfs"
253 export NETBOOT
254 elif [ "${ROOT}" = "/dev/cifs" ]
255 then
256 NETBOOT="cifs"
257 export NETBOOT
261 if [ -z "${MODULE}" ]
262 then
263 MODULE="filesystem"
264 export MODULE
267 if [ -z "${UNIONTYPE}" ]
268 then
269 UNIONTYPE="aufs"
270 export UNIONTYPE
273 if [ -z "${PERSISTENCE_ENCRYPTION}" ]
274 then
275 PERSISTENCE_ENCRYPTION="none"
276 export PERSISTENCE_ENCRYPTION
277 elif is_in_comma_sep_list luks ${PERSISTENCE_ENCRYPTION}
278 then
279 if ! modprobe dm-crypt
280 then
281 log_warning_msg "Unable to load module dm-crypt"
282 PERSISTENCE_ENCRYPTION=$(echo ${PERSISTENCE_ENCRYPTION} | sed -e 's/\<luks,\|,\?luks$//g')
283 export PERSISTENCE_ENCRYPTION
286 if [ ! -x /lib/cryptsetup/askpass ] || [ ! -x /sbin/cryptsetup ]
287 then
288 log_warning_msg "cryptsetup in unavailable"
289 PERSISTENCE_ENCRYPTION=$(echo ${PERSISTENCE_ENCRYPTION} | sed -e 's/\<luks,\|,\?luks$//g')
290 export PERSISTENCE_ENCRYPTION
294 if [ -z "${PERSISTENCE_METHOD}" ]
295 then
296 PERSISTENCE_METHOD="overlay"
297 export PERSISTENCE_METHOD
300 if [ -z "${PERSISTENCE_STORAGE}" ]
301 then
302 PERSISTENCE_STORAGE="filesystem,file"
303 export PERSISTENCE_STORAGE