1 diff -urN dracut-037/dracut-functions.sh dracut.dev/dracut-functions.sh
2 --- dracut-037/dracut-functions.sh 2014-03-19 16:16:08.000000000 +0000
3 +++ dracut.dev/dracut-functions.sh 2014-05-17 10:31:22.000000000 +0000
7 # Generic substring function. If $2 is in $1, return 0.
8 -strstr() { [[ $1 = *$2* ]]; }
9 +strstr() { [[ $1 = *"$2"* ]]; }
10 +# Generic glob matching function. If glob pattern $2 matches anywhere in $1, OK
11 +strglobin() { [[ $1 = *$2* ]]; }
12 +# Generic glob matching function. If glob pattern $2 matches all of $1, OK
13 +strglob() { [[ $1 = $2 ]]; }
15 # helper function for check() in module-setup.sh
16 # to check for required installed binaries
17 diff -urN dracut-037/dracut-initramfs-restore.sh dracut.dev/dracut-initramfs-restore.sh
18 --- dracut-037/dracut-initramfs-restore.sh 2014-03-19 16:16:08.000000000 +0000
19 +++ dracut.dev/dracut-initramfs-restore.sh 2014-05-17 10:31:22.000000000 +0000
22 KERNEL_VERSION="$(uname -r)"
24 +[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
25 +SKIP="$dracutbasedir/skipcpio"
26 +[[ -x $SKIP ]] || SKIP=cat
28 [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
30 if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
34 [ -f .need_shutdown -a -f "$IMG" ] || exit 1
35 -if zcat "$IMG" | cpio -id --quiet >/dev/null; then
36 +if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
37 rm -f -- .need_shutdown
38 -elif xzcat "$IMG" | cpio -id --quiet >/dev/null; then
39 +elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
40 rm -f -- .need_shutdown
41 -elif lz4 -d -c "$IMG" | cpio -id --quiet >/dev/null; then
42 +elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
43 rm -f -- .need_shutdown
45 # something failed, so we clean up
46 diff -urN dracut-037/dracut.sh dracut.dev/dracut.sh
47 --- dracut-037/dracut.sh 2014-03-19 16:16:08.000000000 +0000
48 +++ dracut.dev/dracut.sh 2014-05-17 10:31:22.000000000 +0000
50 export DRACUT_KERNEL_LAZY="1"
51 export DRACUT_RESOLVE_LAZY="1"
53 +if [[ $print_cmdline ]]; then
60 if [[ -f $dracutbasedir/dracut-functions.sh ]]; then
61 . $dracutbasedir/dracut-functions.sh
64 dracut_args[$i]="\"${dracut_args[$i]}\""
68 dinfo "Executing: $0 ${dracut_args[@]}"
70 [[ $do_list = yes ]] && {
71 diff -urN dracut-037/dracut-version.sh dracut.dev/dracut-version.sh
72 --- dracut-037/dracut-version.sh 2014-03-19 16:17:06.000000000 +0000
73 +++ dracut.dev/dracut-version.sh 1970-01-01 00:00:00.000000000 +0000
76 diff -urN dracut-037/lsinitrd.sh dracut.dev/lsinitrd.sh
77 --- dracut-037/lsinitrd.sh 2014-03-19 16:16:08.000000000 +0000
78 +++ dracut.dev/lsinitrd.sh 2014-05-17 10:31:22.000000000 +0000
84 - read -N 6 bin < <($SKIP "$image")
92 - $'\x71\xc7'*|070701)
99 - if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
100 - CAT="xzcat --single-stream --"
105 + if [[ $SKIP ]]; then
118 + $'\x71\xc7'*|070701)
125 + if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
126 + echo "xzcat --single-stream --"
136 diff -urN dracut-037/modules.d/10i18n/parse-i18n.sh dracut.dev/modules.d/10i18n/parse-i18n.sh
137 --- dracut-037/modules.d/10i18n/parse-i18n.sh 2014-03-19 16:16:08.000000000 +0000
138 +++ dracut.dev/modules.d/10i18n/parse-i18n.sh 2014-05-17 10:31:22.000000000 +0000
140 _value="$(getarg $@)"
141 [ -z "${_value}" ] && _value=$_default
142 if [ -n "${_value}" ]; then
143 - printf '%s="%s"\n' $key ${_value} >> $_file
144 + printf '%s="%s"\n' ${_key} ${_value} >> $_file
148 diff -urN dracut-037/modules.d/40network/dhclient-script.sh dracut.dev/modules.d/40network/dhclient-script.sh
149 --- dracut-037/modules.d/40network/dhclient-script.sh 2014-03-19 16:16:08.000000000 +0000
150 +++ dracut.dev/modules.d/40network/dhclient-script.sh 2014-05-17 10:31:22.000000000 +0000
152 search=$(printf -- "$new_domain_search")
153 namesrv=$new_domain_name_servers
154 hostname=$new_host_name
155 - lease_time=$new_dhcp_lease_time
156 + [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
157 + [ -n "$new_max_life" ] && lease_time=$new_max_life
158 + preferred_lft=$lease_time
159 + [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
161 [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
163 ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
164 - dev ${netif} scope global valid_lft ${lease_time} \
165 - preferred_lft ${lease_time}
166 + dev ${netif} scope global \
167 + ${lease_time:+valid_lft $lease_time} \
168 + ${preferred_lft:+preferred_lft ${preferred_lft}}
170 [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
171 if [ -n "$namesrv" ] ; then
172 diff -urN dracut-037/modules.d/40network/ifup.sh dracut.dev/modules.d/40network/ifup.sh
173 --- dracut-037/modules.d/40network/ifup.sh 2014-03-19 16:16:08.000000000 +0000
174 +++ dracut.dev/modules.d/40network/ifup.sh 2014-05-17 10:31:22.000000000 +0000
175 @@ -130,12 +130,12 @@
177 # Handle static ip configuration
179 - strstr $ip '*:*:*' && load_ipv6
180 + strglobin $ip '*:*:*' && load_ipv6
183 [ -n "$macaddr" ] && ip link set address $macaddr dev $netif
184 [ -n "$mtu" ] && ip link set mtu $mtu dev $netif
185 - if strstr $ip '*:*:*'; then
186 + if strglobin $ip '*:*:*'; then
187 # note no ip addr flush for ipv6
188 ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
189 wait_for_ipv6_dad $netif
192 # no ip option directed at our interface?
193 if [ ! -e /tmp/net.${netif}.up ]; then
195 + if getargs 'ip=dhcp6'; then
204 diff -urN dracut-037/modules.d/40network/net-lib.sh dracut.dev/modules.d/40network/net-lib.sh
205 --- dracut-037/modules.d/40network/net-lib.sh 2014-03-19 16:16:08.000000000 +0000
206 +++ dracut.dev/modules.d/40network/net-lib.sh 2014-05-17 10:31:22.000000000 +0000
208 # ip=<ipv4-address> means anaconda-style static config argument cluster:
209 # ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
210 # ksdevice={link|bootif|ibft|<MAC>|<ifname>}
211 - if strstr "$autoconf" "*.*.*.*"; then
212 + if strglob "$autoconf" "*.*.*.*"; then
214 gw=$(getarg gateway=)
215 mask=$(getarg netmask=)
221 +is_persistent_ethernet_name() {
223 + # udev persistent interface names
224 + eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*)
226 + eno[0-9]|eno[0-9][0-9]|eno[0-9][0-9][0-9]*)
228 + ens[0-9]|ens[0-9][0-9]|ens[0-9][0-9][0-9]*)
230 + enp[0-9]s[0-9]*|enp[0-9][0-9]s[0-9]*|enp[0-9][0-9][0-9]*s[0-9]*)
232 + enP*p[0-9]s[0-9]*|enP*p[0-9][0-9]s[0-9]*|enP*p[0-9][0-9][0-9]*s[0-9]*)
235 + em[0-9]|em[0-9][0-9]|em[0-9][0-9][0-9]*)
237 + p[0-9]p[0-9]*|p[0-9][0-9]p[0-9]*|p[0-9][0-9][0-9]*p[0-9]*)
244 diff -urN dracut-037/modules.d/45ifcfg/write-ifcfg.sh dracut.dev/modules.d/45ifcfg/write-ifcfg.sh
245 --- dracut-037/modules.d/45ifcfg/write-ifcfg.sh 2014-03-19 16:16:08.000000000 +0000
246 +++ dracut.dev/modules.d/45ifcfg/write-ifcfg.sh 2014-05-17 10:31:22.000000000 +0000
248 # ex: ts=8 sw=4 sts=4 et filetype=sh
250 # NFS root might have reached here before /tmp/net.ifaces was written
251 +type is_persistent_ethernet_name >/dev/null 2>&1 || . /lib/net-lib.sh
253 udevadm settle --timeout=30
255 if [ -e /tmp/bridge.info ]; then
258 netif=${netup%%.did-setup}
259 netif=${netif##*/net.}
260 - strstr "$netif" ":*:*:*:*:" && continue
261 + strglobin "$netif" ":*:*:*:*:" && continue
262 [ -e /tmp/ifcfg/ifcfg-$netif ] && continue
268 echo "UUID=\"$uuid\""
269 + strstr "$(ip -6 addr show dev $netif)" 'inet6' && echo "IPV6INIT=yes"
270 if [ -f /tmp/dhclient.$netif.lease ]; then
271 [ -f /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
272 - strstr "$ip" '*:*:*' && echo "IPV6INIT=yes"
273 if [ -f /tmp/net.$netif.has_ibft_config ]; then
274 echo "BOOTPROTO=ibft"
278 # If we've booted with static ip= lines, the override file is there
279 [ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
280 - if strstr "$ip" '*:*:*'; then
281 + if strglobin "$ip" '*:*:*'; then
283 echo "IPV6_AUTOCONF=no"
284 echo "IPV6ADDR=\"$ip/$mask\""
289 - if strstr "$gw" '*:*:*'; then
290 + if strglobin "$gw" '*:*:*'; then
291 echo "IPV6_DEFAULTGW=\"$gw\""
292 elif [ -n "$gw" ]; then
293 echo "GATEWAY=\"$gw\""
296 [ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
297 if ! print_s390 $netif; then
298 - [ -n "$macaddr" ] || echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
299 + if [ -z "$macaddr" ] && \
300 + ! is_persistent_ethernet_name "$netif" && \
301 + [ -f /sys/class/net/$netif/addr_assign_type ] && \
302 + [ "$(cat /sys/class/net/$netif/addr_assign_type)" = "0" ] && \
303 + [ -f /sys/class/net/$netif/address ]; then
304 + echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
308 echo "NAME=\"$netif\""
309 diff -urN dracut-037/modules.d/80cms/cmsifup.sh dracut.dev/modules.d/80cms/cmsifup.sh
310 --- dracut-037/modules.d/80cms/cmsifup.sh 2014-03-19 16:16:08.000000000 +0000
311 +++ dracut.dev/modules.d/80cms/cmsifup.sh 2014-05-17 10:31:22.000000000 +0000
316 -strstr "$IPADDR" '*:*:*' && ipv6=1
317 +strglobin "$IPADDR" '*:*:*' && ipv6=1
319 if [ "$ipv6" ] && ! str_starts "$IPADDR" "["; then
321 diff -urN dracut-037/modules.d/80cms/cmssetup.sh dracut.dev/modules.d/80cms/cmssetup.sh
322 --- dracut-037/modules.d/80cms/cmssetup.sh 2014-03-19 16:16:08.000000000 +0000
323 +++ dracut.dev/modules.d/80cms/cmssetup.sh 2014-05-17 10:31:22.000000000 +0000
328 + SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
330 if [[ $NETTYPE ]]; then
332 diff -urN dracut-037/modules.d/80cms/cms-write-ifcfg.sh dracut.dev/modules.d/80cms/cms-write-ifcfg.sh
333 --- dracut-037/modules.d/80cms/cms-write-ifcfg.sh 2014-03-19 16:16:08.000000000 +0000
334 +++ dracut.dev/modules.d/80cms/cms-write-ifcfg.sh 2014-05-17 10:31:22.000000000 +0000
337 IFCFGFILE=/run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-$DEVICE
339 - strstr "$IPADDR" '*:*:*' && ipv6=1
340 + strglobin "$IPADDR" '*:*:*' && ipv6=1
342 # to please NetworkManager on startup in loader before loader reconfigures net
343 cat > /etc/sysconfig/network << EOF
344 diff -urN dracut-037/modules.d/90dm/module-setup.sh dracut.dev/modules.d/90dm/module-setup.sh
345 --- dracut-037/modules.d/90dm/module-setup.sh 2014-03-19 16:16:08.000000000 +0000
346 +++ dracut.dev/modules.d/90dm/module-setup.sh 2014-05-17 10:31:22.000000000 +0000
352 + instmods dm_mod dm-cache dm-cache-mq dm-cache-cleaner
356 diff -urN dracut-037/modules.d/90lvm/module-setup.sh dracut.dev/modules.d/90lvm/module-setup.sh
357 --- dracut-037/modules.d/90lvm/module-setup.sh 2014-03-19 16:16:08.000000000 +0000
358 +++ dracut.dev/modules.d/90lvm/module-setup.sh 2014-05-17 10:31:22.000000000 +0000
360 inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules
362 # Do not run lvmetad update via pvscan in udev rule - lvmetad is not running yet in dracut!
363 - if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
364 + if [[ -f ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules ]] && \
365 + grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
366 sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
367 sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
368 sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
369 diff -urN dracut-037/modules.d/90mdraid/module-setup.sh dracut.dev/modules.d/90mdraid/module-setup.sh
370 --- dracut-037/modules.d/90mdraid/module-setup.sh 2014-03-19 16:16:08.000000000 +0000
371 +++ dracut.dev/modules.d/90mdraid/module-setup.sh 2014-05-17 10:31:22.000000000 +0000
376 + [[ -z "$UUID" ]] && continue
378 if ! [[ ${_activated[${UUID}]} ]]; then
379 printf "%s" " rd.md.uuid=${UUID}"
380 _activated["${UUID}"]=1
381 diff -urN dracut-037/modules.d/95fcoe/fcoe-genrules.sh dracut.dev/modules.d/95fcoe/fcoe-genrules.sh
382 --- dracut-037/modules.d/95fcoe/fcoe-genrules.sh 2014-03-19 16:16:08.000000000 +0000
383 +++ dracut.dev/modules.d/95fcoe/fcoe-genrules.sh 2014-05-17 10:31:22.000000000 +0000
386 printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb"
388 -} > /etc/udev/rules.d/92-fcoe.rules
389 +} >> /etc/udev/rules.d/92-fcoe.rules
390 diff -urN dracut-037/modules.d/95fcoe/fcoe-up.sh dracut.dev/modules.d/95fcoe/fcoe-up.sh
391 --- dracut-037/modules.d/95fcoe/fcoe-up.sh 2014-03-19 16:16:08.000000000 +0000
392 +++ dracut.dev/modules.d/95fcoe/fcoe-up.sh 2014-05-17 10:31:22.000000000 +0000
394 # are to kill it and start a new lldpad to take over. Data is transfered
395 # between the 2 using a shm segment
397 - # stupid tools, need sleep
399 - dcbtool sc "$netif" dcb on
401 - dcbtool sc "$netif" app:fcoe e:1 a:1 w:1
402 + # wait for lldpad to be ready
404 + while [ $i -lt 60 ]; do
405 + lldptool -p && break
406 + info "Waiting for lldpad to be ready"
411 + # on some systems lldpad needs some time
412 + # sleep until we find a better solution
415 + while [ $i -lt 60 ]; do
416 + dcbtool sc "$netif" dcb on && break
417 + info "Retrying to turn dcb on"
422 + while [ $i -lt 60 ]; do
423 + dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 && break
424 + info "Retrying to turn fcoe on"
431 fipvlan "$netif" -c -s
432 elif [ "$netdriver" = "bnx2x" ]; then
433 # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan
434 diff -urN dracut-037/modules.d/95fcoe/module-setup.sh dracut.dev/modules.d/95fcoe/module-setup.sh
435 --- dracut-037/modules.d/95fcoe/module-setup.sh 2014-03-19 16:16:08.000000000 +0000
436 +++ dracut.dev/modules.d/95fcoe/module-setup.sh 2014-05-17 10:31:22.000000000 +0000
441 - inst_multiple ip dcbtool fipvlan lldpad readlink
442 + inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
444 mkdir -m 0755 -p "$initdir/var/lib/lldpad"
446 diff -urN dracut-037/modules.d/95fstab-sys/mount-sys.sh dracut.dev/modules.d/95fstab-sys/mount-sys.sh
447 --- dracut-037/modules.d/95fstab-sys/mount-sys.sh 2014-03-19 16:16:08.000000000 +0000
448 +++ dracut.dev/modules.d/95fstab-sys/mount-sys.sh 2014-05-17 10:31:22.000000000 +0000
453 -[ -f /etc/fstab ] && fstab_mount /etc/fstab
454 +# systemd will mount and run fsck from /etc/fstab and we don't want to
455 +# run into a race condition.
456 +if [ -z "$DRACUT_SYSTEMD" ]; then
457 + [ -f /etc/fstab ] && fstab_mount /etc/fstab
460 # prefer $NEWROOT/etc/fstab.sys over local /etc/fstab.sys
461 if [ -f $NEWROOT/etc/fstab.sys ]; then
462 diff -urN dracut-037/modules.d/95nbd/nbdroot.sh dracut.dev/modules.d/95nbd/nbdroot.sh
463 --- dracut-037/modules.d/95nbd/nbdroot.sh 2014-03-19 16:16:08.000000000 +0000
464 +++ dracut.dev/modules.d/95nbd/nbdroot.sh 2014-05-17 10:31:22.000000000 +0000
469 +if strstr "$(nbd-client --help 2>&1)" "systemd-mark"; then
470 + preopts="--systemd-mark $preopts"
473 nbd-client $preopts "$nbdserver" $nbdport /dev/nbd0 $opts || exit 1
475 # NBD doesn't emit uevents when it gets connected, so kick it
476 diff -urN dracut-037/modules.d/95nfs/nfs-lib.sh dracut.dev/modules.d/95nfs/nfs-lib.sh
477 --- dracut-037/modules.d/95nfs/nfs-lib.sh 2014-03-19 16:16:08.000000000 +0000
478 +++ dracut.dev/modules.d/95nfs/nfs-lib.sh 2014-05-17 10:31:22.000000000 +0000
482 # check if we have a server
483 - if strstr "$arg" ':/*' ; then
484 + if strstr "$arg" ':/' ; then
488 diff -urN dracut-037/modules.d/95resume/parse-resume.sh dracut.dev/modules.d/95resume/parse-resume.sh
489 --- dracut-037/modules.d/95resume/parse-resume.sh 2014-03-19 16:16:08.000000000 +0000
490 +++ dracut.dev/modules.d/95resume/parse-resume.sh 2014-05-17 10:31:22.000000000 +0000
492 printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
493 "$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh
495 - printf -- "%s" 'warn "Cancelling resume operation. Device not found.";'
496 - printf -- ' cancel_wait_for_dev /dev/resume; rm -f -- "$job" "%s/initqueue/settled/resume.sh";\n' \
497 - "$hookdir" >> $hookdir/initqueue/timeout/resume.sh
499 + printf -- "%s" 'warn "Cancelling resume operation. Device not found.";'
500 + printf -- ' cancel_wait_for_dev /dev/resume; rm -f -- "$job" "%s/initqueue/settled/resume.sh";\n' "$hookdir"
501 + } >> $hookdir/initqueue/timeout/resume.sh
503 mv /lib/dracut/resume.sh /lib/dracut/hooks/pre-mount/10-resume.sh
505 diff -urN dracut-037/modules.d/98systemd/dracut-initqueue.service dracut.dev/modules.d/98systemd/dracut-initqueue.service
506 --- dracut-037/modules.d/98systemd/dracut-initqueue.service 2014-03-19 16:16:08.000000000 +0000
507 +++ dracut.dev/modules.d/98systemd/dracut-initqueue.service 2014-05-17 10:31:22.000000000 +0000
509 Description=dracut initqueue hook
510 Documentation=man:dracut-initqueue.service(8)
511 DefaultDependencies=no
512 +Before=remote-fs-pre.target
513 +Wants=remote-fs-pre.target
514 After=systemd-udev-trigger.service
515 Wants=systemd-udev-trigger.service
516 ConditionPathExists=/etc/initrd-release
517 diff -urN dracut-037/modules.d/98systemd/module-setup.sh dracut.dev/modules.d/98systemd/module-setup.sh
518 --- dracut-037/modules.d/98systemd/module-setup.sh 2014-03-19 16:16:08.000000000 +0000
519 +++ dracut.dev/modules.d/98systemd/module-setup.sh 2014-05-17 10:31:22.000000000 +0000
521 $systemdutildir/systemd-modules-load \
522 $systemdutildir/systemd-vconsole-setup \
523 $systemdutildir/system-generators/systemd-fstab-generator \
524 + $systemdutildir/system-generators/systemd-gpt-auto-generator \
526 $systemdsystemunitdir/cryptsetup.target \
527 $systemdsystemunitdir/emergency.target \
528 diff -urN dracut-037/modules.d/99base/dracut-lib.sh dracut.dev/modules.d/99base/dracut-lib.sh
529 --- dracut-037/modules.d/99base/dracut-lib.sh 2014-03-19 16:16:08.000000000 +0000
530 +++ dracut.dev/modules.d/99base/dracut-lib.sh 2014-05-17 10:31:22.000000000 +0000
532 [ "$RD_DEBUG" = "yes" ] && set -x
535 -# returns OK if $1 contains $2
536 +# returns OK if $1 contains literal string $2 (and isn't empty)
538 - [ "${1#*$2*}" != "$1" ]
539 + [ "${1##*"$2"*}" != "$1" ]
542 -# returns OK if $1 contains $2 at the beginning
543 +# returns OK if $1 matches (completely) glob pattern $2
544 +# An empty $1 will not be considered matched, even if $2 is * which technically
545 +# matches; as it would match anything, it's not an interesting case.
547 + [ -n "$1" -a -z "${1##$2}" ]
550 +# returns OK if $1 contains (anywhere) a match of glob pattern $2
551 +# An empty $1 will not be considered matched, even if $2 is * which technically
552 +# matches; as it would match anything, it's not an interesting case.
554 + [ -n "$1" -a -z "${1##*$2*}" ]
557 +# returns OK if $1 contains literal string $2 at the beginning, and isn't empty
559 - [ "${1#$2*}" != "$1" ]
560 + [ "${1#"$2"*}" != "$1" ]
563 -# returns OK if $1 contains $2 at the end
564 +# returns OK if $1 contains literal string $2 at the end, and isn't empty
566 - [ "${1%*$2}" != "$1" ]
567 + [ "${1%*"$2"}" != "$1" ]
570 if [ -z "$DRACUT_SYSTEMD" ]; then
574 while strstr "${in}" "$s"; do
576 + chop="${in%%"$s"*}"
577 out="${out}${chop}$r"
586 # check if we have a server
587 - if strstr "$arg" ':/*' ; then
588 + if strstr "$arg" ':/' ; then
599 [ -z "$_cmd" ] && return 1
611 diff -urN dracut-037/modules.d/99base/init.sh dracut.dev/modules.d/99base/init.sh
612 --- dracut-037/modules.d/99base/init.sh 2014-03-19 16:16:08.000000000 +0000
613 +++ dracut.dev/modules.d/99base/init.sh 2014-05-17 10:31:22.000000000 +0000
615 # remove helper symlink
616 [ -h /dev/root ] && rm -f -- /dev/root
618 -getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root"
619 +bv=$(getarg rd.break -d rdbreak) && [ -z "$bv" ] &&
620 + emergency_shell -n switch_root "Break before switch_root"
622 info "Switching root"
625 diff -urN dracut-037/modules.d/99fs-lib/module-setup.sh dracut.dev/modules.d/99fs-lib/module-setup.sh
626 --- dracut-037/modules.d/99fs-lib/module-setup.sh 2014-03-19 16:16:08.000000000 +0000
627 +++ dracut.dev/modules.d/99fs-lib/module-setup.sh 2014-05-17 10:31:23.000000000 +0000
632 - echo -n " xfs_db xfs_repair xfs_check xfs_metadump "
633 + echo -n " xfs_db xfs_repair xfs_check xfs_metadump"
636 - echo -n " fsck.$fs e2fsck "
646 - [[ -x fsck.$fs ]] && echo -n " fsck.$fs "
650 + echo -n " fsck.$fs "
654 include_fs_helper_modules() {
655 diff -urN dracut-037/test/TEST-01-BASIC/test-init.sh dracut.dev/test/TEST-01-BASIC/test-init.sh
656 --- dracut-037/test/TEST-01-BASIC/test-init.sh 2014-03-19 16:16:08.000000000 +0000
657 +++ dracut.dev/test/TEST-01-BASIC/test-init.sh 2014-05-17 10:31:23.000000000 +0000
661 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
662 -strstr() { [ "${1#*$2*}" != "$1" ]; }
663 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
664 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
666 exec >/dev/console 2>&1
667 diff -urN dracut-037/test/TEST-02-SYSTEMD/test-init.sh dracut.dev/test/TEST-02-SYSTEMD/test-init.sh
668 --- dracut-037/test/TEST-02-SYSTEMD/test-init.sh 2014-03-19 16:16:08.000000000 +0000
669 +++ dracut.dev/test/TEST-02-SYSTEMD/test-init.sh 2014-05-17 10:31:23.000000000 +0000
672 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
673 -strstr() { [ "${1#*$2*}" != "$1" ]; }
674 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
675 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
677 exec </dev/console >/dev/console 2>&1
678 diff -urN dracut-037/test/TEST-03-USR-MOUNT/test-init.sh dracut.dev/test/TEST-03-USR-MOUNT/test-init.sh
679 --- dracut-037/test/TEST-03-USR-MOUNT/test-init.sh 2014-03-19 16:16:08.000000000 +0000
680 +++ dracut.dev/test/TEST-03-USR-MOUNT/test-init.sh 2014-05-17 10:31:23.000000000 +0000
684 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
685 -strstr() { [ "${1#*$2*}" != "$1" ]; }
686 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
687 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
689 exec </dev/console >/dev/console 2>&1
690 diff -urN dracut-037/test/TEST-04-FULL-SYSTEMD/test-init.sh dracut.dev/test/TEST-04-FULL-SYSTEMD/test-init.sh
691 --- dracut-037/test/TEST-04-FULL-SYSTEMD/test-init.sh 2014-03-19 16:16:08.000000000 +0000
692 +++ dracut.dev/test/TEST-04-FULL-SYSTEMD/test-init.sh 2014-05-17 10:31:23.000000000 +0000
696 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
697 -strstr() { [ "${1#*$2*}" != "$1" ]; }
698 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
699 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
701 exec </dev/console >/dev/console 2>&1
702 diff -urN dracut-037/test/TEST-10-RAID/test-init.sh dracut.dev/test/TEST-10-RAID/test-init.sh
703 --- dracut-037/test/TEST-10-RAID/test-init.sh 2014-03-19 16:16:08.000000000 +0000
704 +++ dracut.dev/test/TEST-10-RAID/test-init.sh 2014-05-17 10:31:23.000000000 +0000
707 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
708 -strstr() { [ "${1#*$2*}" != "$1" ]; }
709 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
710 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
711 command -v plymouth >/dev/null && plymouth --quit
712 exec >/dev/console 2>&1
713 diff -urN dracut-037/test/TEST-11-LVM/test-init.sh dracut.dev/test/TEST-11-LVM/test-init.sh
714 --- dracut-037/test/TEST-11-LVM/test-init.sh 2014-03-19 16:16:08.000000000 +0000
715 +++ dracut.dev/test/TEST-11-LVM/test-init.sh 2014-05-17 10:31:23.000000000 +0000
718 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
719 -strstr() { [ "${1#*$2*}" != "$1" ]; }
720 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
721 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
723 exec >/dev/console 2>&1
724 diff -urN dracut-037/test/TEST-12-RAID-DEG/test-init.sh dracut.dev/test/TEST-12-RAID-DEG/test-init.sh
725 --- dracut-037/test/TEST-12-RAID-DEG/test-init.sh 2014-03-19 16:16:08.000000000 +0000
726 +++ dracut.dev/test/TEST-12-RAID-DEG/test-init.sh 2014-05-17 10:31:23.000000000 +0000
729 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
730 -strstr() { [ "${1#*$2*}" != "$1" ]; }
731 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
732 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
733 command -v plymouth >/dev/null && plymouth --quit
734 exec >/dev/console 2>&1
735 diff -urN dracut-037/test/TEST-14-IMSM/test-init.sh dracut.dev/test/TEST-14-IMSM/test-init.sh
736 --- dracut-037/test/TEST-14-IMSM/test-init.sh 2014-03-19 16:16:08.000000000 +0000
737 +++ dracut.dev/test/TEST-14-IMSM/test-init.sh 2014-05-17 10:31:23.000000000 +0000
740 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
741 -strstr() { [ "${1#*$2*}" != "$1" ]; }
742 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
743 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
745 exec >/dev/console 2>&1
746 diff -urN dracut-037/test/TEST-16-DMSQUASH/test-init.sh dracut.dev/test/TEST-16-DMSQUASH/test-init.sh
747 --- dracut-037/test/TEST-16-DMSQUASH/test-init.sh 2014-03-19 16:16:08.000000000 +0000
748 +++ dracut.dev/test/TEST-16-DMSQUASH/test-init.sh 2014-05-17 10:31:23.000000000 +0000
751 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
752 -strstr() { [ "${1#*$2*}" != "$1" ]; }
753 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
754 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
756 exec >/dev/console 2>&1
757 diff -urN dracut-037/test/TEST-17-LVM-THIN/test-init.sh dracut.dev/test/TEST-17-LVM-THIN/test-init.sh
758 --- dracut-037/test/TEST-17-LVM-THIN/test-init.sh 2014-03-19 16:16:08.000000000 +0000
759 +++ dracut.dev/test/TEST-17-LVM-THIN/test-init.sh 2014-05-17 10:31:23.000000000 +0000
762 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
763 -strstr() { [ "${1#*$2*}" != "$1" ]; }
764 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
765 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
767 exec >/dev/console 2>&1
768 diff -urN dracut-037/test/TEST-20-NFS/client-init.sh dracut.dev/test/TEST-20-NFS/client-init.sh
769 --- dracut-037/test/TEST-20-NFS/client-init.sh 2014-03-19 16:16:08.000000000 +0000
770 +++ dracut.dev/test/TEST-20-NFS/client-init.sh 2014-05-17 10:31:23.000000000 +0000
773 export PS1='initramfs-test:\w\$ '
774 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
775 -strstr() { [ "${1#*$2*}" != "$1" ]; }
776 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
779 strstr "$CMDLINE" "rd.shell" && sh -i
780 diff -urN dracut-037/test/TEST-50-MULTINIC/client-init.sh dracut.dev/test/TEST-50-MULTINIC/client-init.sh
781 --- dracut-037/test/TEST-50-MULTINIC/client-init.sh 2014-03-19 16:16:08.000000000 +0000
782 +++ dracut.dev/test/TEST-50-MULTINIC/client-init.sh 2014-05-17 10:31:23.000000000 +0000
784 exec >/dev/console 2>&1
786 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
787 -strstr() { [ "${1#*$2*}" != "$1" ]; }
788 +strstr() { [ "${1##*"$2"*}" != "$1" ]; }
789 +strglobin() { [ -n "$1" -a -z "${1##*$2*}" ]; }
790 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
792 export PS1='initramfs-test:\w\$ '
794 echo "made it to the rootfs! Powering down."
795 for i in /run/initramfs/net.*.did-setup; do
796 - strstr "$i" ":*:*:*:*:" && continue
797 + strglobin "$i" ":*:*:*:*:" && continue
799 IFACES+="${i##*/net.} "