]> TLD Linux GIT Repositories - packages/dracut.git/blob - git.patch
- require all compressors (except lzo, which isn't much popular)
[packages/dracut.git] / git.patch
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
4 @@ -33,7 +33,11 @@
5  fi
6  
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 ]]; }
14  
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
20 @@ -6,6 +6,10 @@
21  
22  KERNEL_VERSION="$(uname -r)"
23  
24 +[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
25 +SKIP="$dracutbasedir/skipcpio"
26 +[[ -x $SKIP ]] || SKIP=cat
27 +
28  [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
29  
30  if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
31 @@ -16,11 +20,11 @@
32  cd /run/initramfs
33  
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
44  else
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
49 @@ -834,6 +834,13 @@
50  export DRACUT_KERNEL_LAZY="1"
51  export DRACUT_RESOLVE_LAZY="1"
52  
53 +if [[ $print_cmdline ]]; then
54 +    stdloglvl=0
55 +    sysloglvl=0
56 +    fileloglvl=0
57 +    kmsgloglvl=0
58 +fi
59 +
60  if [[ -f $dracutbasedir/dracut-functions.sh ]]; then
61      . $dracutbasedir/dracut-functions.sh
62  else
63 @@ -907,6 +914,7 @@
64          dracut_args[$i]="\"${dracut_args[$i]}\""
65          #" keep vim happy
66  done
67 +
68  dinfo "Executing: $0 ${dracut_args[@]}"
69  
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
74 @@ -1 +0,0 @@
75 -DRACUT_VERSION=037
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
79 @@ -160,27 +160,35 @@
80          ;;
81  esac
82  
83 -if [[ $SKIP ]]; then
84 -    read -N 6 bin < <($SKIP "$image")
85 -fi
86 -
87 -case $bin in
88 -    $'\x1f\x8b'*)
89 -        CAT="zcat --";;
90 -    BZh*)
91 -        CAT="bzcat --";;
92 -    $'\x71\xc7'*|070701)
93 -        CAT="cat --"
94 -        ;;
95 -    $'\x02\x21'*)
96 -        CAT="lz4 -d -c";;
97 -    *)
98 -        CAT="xzcat --";
99 -        if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
100 -            CAT="xzcat --single-stream --"
101 -        fi
102 -        ;;
103 -esac
104 +CAT=$({
105 +        if [[ $SKIP ]]; then
106 +            $SKIP "$image"
107 +        else
108 +            cat "$image"
109 +        fi } | {
110 +        read -N 6 bin
111 +        case $bin in
112 +            $'\x1f\x8b'*)
113 +                echo "zcat --"
114 +                ;;
115 +            BZh*)
116 +                echo "bzcat --"
117 +                ;;
118 +            $'\x71\xc7'*|070701)
119 +                echo "cat --"
120 +                ;;
121 +            $'\x02\x21'*)
122 +                echo "lz4 -d -c"
123 +                ;;
124 +            *)
125 +                if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
126 +                    echo "xzcat --single-stream --"
127 +                else
128 +                    echo "xzcat --"
129 +                fi
130 +                ;;
131 +        esac
132 +    })
133  
134  skipcpio()
135  {
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
139 @@ -12,7 +12,7 @@
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
145      fi
146      unset _file
147      unset _value
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
151 @@ -64,13 +64,17 @@
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
160  
161      [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
162  
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}}
169  
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 @@
176  
177  # Handle static ip configuration
178  do_static() {
179 -    strstr $ip '*:*:*' && load_ipv6
180 +    strglobin $ip '*:*:*' && load_ipv6
181  
182      linkup $netif
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
190 @@ -364,7 +364,12 @@
191  
192  # no ip option directed at our interface?
193  if [ ! -e /tmp/net.${netif}.up ]; then
194 -    do_dhcp -4
195 +    if getargs 'ip=dhcp6'; then
196 +        load_ipv6
197 +        do_dhcp -6
198 +    else
199 +        do_dhcp -4
200 +    fi
201  fi
202  
203  exit 0
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
207 @@ -377,7 +377,7 @@
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
213          ip="$autoconf"
214          gw=$(getarg gateway=)
215          mask=$(getarg netmask=)
216 @@ -516,3 +516,27 @@
217      done
218      return 1
219  }
220 +
221 +is_persistent_ethernet_name() {
222 +    case "$1" in
223 +        # udev persistent interface names
224 +        eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*)
225 +            ;;
226 +        eno[0-9]|eno[0-9][0-9]|eno[0-9][0-9][0-9]*)
227 +            ;;
228 +        ens[0-9]|ens[0-9][0-9]|ens[0-9][0-9][0-9]*)
229 +            ;;
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]*)
231 +            ;;
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]*)
233 +            ;;
234 +        # biosdevname
235 +        em[0-9]|em[0-9][0-9]|em[0-9][0-9][0-9]*)
236 +            ;;
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]*)
238 +            ;;
239 +        *)
240 +            return 1
241 +    esac
242 +    return 0
243 +}
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
247 @@ -3,6 +3,8 @@
248  # ex: ts=8 sw=4 sts=4 et filetype=sh
249  
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
252 +
253  udevadm settle --timeout=30
254  
255  if [ -e /tmp/bridge.info ]; then
256 @@ -85,7 +87,7 @@
257  
258      netif=${netup%%.did-setup}
259      netif=${netif##*/net.}
260 -    strstr "$netif" ":*:*:*:*:" && continue
261 +    strglobin "$netif" ":*:*:*:*:" && continue
262      [ -e /tmp/ifcfg/ifcfg-$netif ] && continue
263      unset bridge
264      unset bond
265 @@ -120,9 +122,9 @@
266          echo "ONBOOT=yes"
267          echo "NETBOOT=yes"
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"
275              else
276 @@ -132,7 +134,7 @@
277          else
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
282                  echo "IPV6INIT=yes"
283                  echo "IPV6_AUTOCONF=no"
284                  echo "IPV6ADDR=\"$ip/$mask\""
285 @@ -149,7 +151,7 @@
286                      fi
287                  fi
288              fi
289 -            if strstr "$gw" '*:*:*'; then
290 +            if strglobin "$gw" '*:*:*'; then
291                  echo "IPV6_DEFAULTGW=\"$gw\""
292              elif [ -n "$gw" ]; then
293                  echo "GATEWAY=\"$gw\""
294 @@ -164,7 +166,13 @@
295          {
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)\""
305 +                fi
306              fi
307              echo "TYPE=Ethernet"
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
312 @@ -8,7 +8,7 @@
313  
314  . /tmp/cms.conf
315  
316 -strstr "$IPADDR" '*:*:*' && ipv6=1
317 +strglobin "$IPADDR" '*:*:*' && ipv6=1
318  
319  if [ "$ipv6" ] && ! str_starts "$IPADDR" "["; then
320      IPADDR="[$IPADDR]"
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
324 @@ -144,6 +144,7 @@
325      processcmsfile()
326      {
327          source /tmp/cms.conf
328 +        SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
329  
330          if [[ $NETTYPE ]]; then
331             (
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
335 @@ -26,7 +26,7 @@
336  
337      IFCFGFILE=/run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-$DEVICE
338  
339 -    strstr "$IPADDR" '*:*:*' && ipv6=1
340 +    strglobin "$IPADDR" '*:*:*' && ipv6=1
341  
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
347 @@ -16,7 +16,7 @@
348  # called by dracut
349  installkernel() {
350      instmods =drivers/md
351 -    instmods dm_mod
352 +    instmods dm_mod dm-cache dm-cache-mq dm-cache-cleaner
353  }
354  
355  # called by dracut
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
359 @@ -80,7 +80,8 @@
360      inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules
361  
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
372 @@ -54,6 +54,8 @@
373              done
374          )
375  
376 +        [[ -z "$UUID" ]] && continue
377 +
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
384 @@ -13,4 +13,4 @@
385      else
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"
387      fi
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
393 @@ -28,12 +28,35 @@
394      # are to kill it and start a new lldpad to take over. Data is transfered
395      # between the 2 using a shm segment
396      lldpad -d
397 -    # stupid tools, need sleep
398 -    sleep 1
399 -    dcbtool sc "$netif" dcb on
400 -    sleep 1
401 -    dcbtool sc "$netif" app:fcoe e:1 a:1 w:1
402 +    # wait for lldpad to be ready
403 +    i=0
404 +    while [ $i -lt 60 ]; do
405 +        lldptool -p && break
406 +        info "Waiting for lldpad to be ready"
407 +        sleep 1
408 +        i=$(($i+1))
409 +    done
410 +
411 +    # on some systems lldpad needs some time
412 +    # sleep until we find a better solution
413 +    sleep 30
414 +
415 +    while [ $i -lt 60 ]; do
416 +        dcbtool sc "$netif" dcb on && break
417 +        info "Retrying to turn dcb on"
418 +        sleep 1
419 +        i=$(($i+1))
420 +    done
421 +
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"
425 +        sleep 1
426 +        i=$(($i+1))
427 +    done
428 +
429      sleep 1
430 +
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
437 @@ -21,7 +21,7 @@
438  
439  # called by dracut
440  install() {
441 -    inst_multiple ip dcbtool fipvlan lldpad readlink
442 +    inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
443  
444      mkdir -m 0755 -p "$initdir/var/lib/lldpad"
445  
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
449 @@ -27,7 +27,11 @@
450      return 0
451  }
452  
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
458 +fi
459  
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
465 @@ -111,6 +111,10 @@
466      fi
467  fi
468  
469 +if strstr "$(nbd-client --help 2>&1)" "systemd-mark"; then
470 +    preopts="--systemd-mark $preopts"
471 +fi
472 +
473  nbd-client $preopts "$nbdserver" $nbdport /dev/nbd0 $opts || exit 1
474  
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
479 @@ -40,7 +40,7 @@
480      arg="${arg##$nfs:}"
481  
482      # check if we have a server
483 -    if strstr "$arg" ':/*' ; then
484 +    if strstr "$arg" ':/' ; then
485          server="${arg%%:/*}"
486          arg="/${arg##*:/}"
487      fi
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
491 @@ -70,9 +70,10 @@
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
494  
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
498 +        {
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
502  
503          mv /lib/dracut/resume.sh /lib/dracut/hooks/pre-mount/10-resume.sh
504      else
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
508 @@ -11,6 +11,8 @@
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
520 @@ -44,6 +44,7 @@
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 \
525          \
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
531 @@ -20,19 +20,33 @@
532      [ "$RD_DEBUG" = "yes" ] && set -x
533  }
534  
535 -# returns OK if $1 contains $2
536 +# returns OK if $1 contains literal string $2 (and isn't empty)
537  strstr() {
538 -    [ "${1#*$2*}" != "$1" ]
539 +    [ "${1##*"$2"*}" != "$1" ]
540  }
541  
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.
546 +strglob() {
547 +    [ -n "$1" -a -z "${1##$2}" ]
548 +}
549 +
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.
553 +strglobin() {
554 +    [ -n "$1" -a -z "${1##*$2*}" ]
555 +}
556 +
557 +# returns OK if $1 contains literal string $2 at the beginning, and isn't empty
558  str_starts() {
559 -    [ "${1#$2*}" != "$1" ]
560 +    [ "${1#"$2"*}" != "$1" ]
561  }
562  
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
565  str_ends() {
566 -    [ "${1%*$2}" != "$1" ]
567 +    [ "${1%*"$2"}" != "$1" ]
568  }
569  
570  if [ -z "$DRACUT_SYSTEMD" ]; then
571 @@ -85,9 +99,9 @@
572      local out=''
573  
574      while strstr "${in}" "$s"; do
575 -        chop="${in%%$s*}"
576 +        chop="${in%%"$s"*}"
577          out="${out}${chop}$r"
578 -        in="${in#*$s}"
579 +        in="${in#*"$s"}"
580      done
581      echo "${out}${in}"
582  }
583 @@ -555,7 +569,7 @@
584      arg="${arg##$nfs:}"
585  
586      # check if we have a server
587 -    if strstr "$arg" ':/*' ; then
588 +    if strstr "$arg" ':/' ; then
589          server="${arg%%:/*}"
590          arg="/${arg##*:/}"
591      fi
592 @@ -969,6 +983,7 @@
593          local _cmd
594          local _exe
595          local _rl
596 +        local _ret=1
597          local i
598          _cmd="$1"
599          [ -z "$_cmd" ] && return 1
600 @@ -983,8 +998,9 @@
601              fi
602              i=${i%/exe}
603              echo ${i##/proc/}
604 +            _ret=0
605          done
606 -        return 0
607 +        return $_ret
608      }
609  fi
610  
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
614 @@ -353,7 +353,9 @@
615  # remove helper symlink
616  [ -h /dev/root ] && rm -f -- /dev/root
617  
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"
621 +unset bv
622  info "Switching root"
623  
624  
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
628 @@ -17,10 +17,10 @@
629      local dev=$1 fs=$2
630      case "$fs" in
631          xfs)
632 -            echo -n " xfs_db xfs_repair xfs_check xfs_metadump "
633 +            echo -n " xfs_db xfs_repair xfs_check xfs_metadump"
634              ;;
635          ext?)
636 -            echo -n " fsck.$fs e2fsck "
637 +            echo -n " e2fsck "
638              ;;
639          jfs)
640              echo -n " jfs_fsck "
641 @@ -31,10 +31,10 @@
642          btrfs)
643              echo -n " btrfsck "
644              ;;
645 -        *)
646 -            [[ -x fsck.$fs ]] && echo -n " fsck.$fs "
647 -            ;;
648      esac
649 +
650 +    echo -n " fsck.$fs "
651 +    return 0
652  }
653  
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
658 @@ -1,7 +1,7 @@
659  #!/bin/sh
660  >/dev/watchdog
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)
665  plymouth --quit
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
670 @@ -1,6 +1,6 @@
671  #!/bin/sh
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)
676  plymouth --quit
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
681 @@ -1,7 +1,7 @@
682  #!/bin/sh
683  >/dev/watchdog
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)
688  plymouth --quit
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
693 @@ -1,7 +1,7 @@
694  #!/bin/sh
695  >/dev/watchdog
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)
700  plymouth --quit
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
705 @@ -1,6 +1,6 @@
706  #!/bin/sh
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
716 @@ -1,6 +1,6 @@
717  #!/bin/sh
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)
722  plymouth --quit
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
727 @@ -1,6 +1,6 @@
728  #!/bin/sh
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
738 @@ -1,6 +1,6 @@
739  #!/bin/sh
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)
744  plymouth --quit
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
749 @@ -1,6 +1,6 @@
750  #!/bin/sh
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)
755  plymouth --quit
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
760 @@ -1,6 +1,6 @@
761  #!/bin/sh
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)
766  plymouth --quit
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
771 @@ -4,7 +4,7 @@
772  export TERM=linux
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" ]; }
777  
778  stty sane
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
783 @@ -2,14 +2,15 @@
784  exec >/dev/console 2>&1
785  set -x
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)
791  export TERM=linux
792  export PS1='initramfs-test:\w\$ '
793  stty sane
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
798         i=${i%.did-setup}
799         IFACES+="${i##*/net.} "
800  done