diff options
author | Harald Hoyer <harald@redhat.com> | 2010-09-10 15:23:06 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2010-09-10 15:34:36 +0200 |
commit | cc02093d690effca253d19a11f3b07f0c14b2d1f (patch) | |
tree | 196580402561086bb6e99273a31462b489675e2e /modules.d | |
parent | d95d2f3b44c6f4bc178020ea4c071c09760f6f61 (diff) | |
download | dracut-cc02093d690effca253d19a11f3b07f0c14b2d1f.tar.gz dracut-cc02093d690effca253d19a11f3b07f0c14b2d1f.tar.bz2 dracut-cc02093d690effca253d19a11f3b07f0c14b2d1f.zip |
reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
Diffstat (limited to 'modules.d')
166 files changed, 1117 insertions, 757 deletions
diff --git a/modules.d/00bootchart/check b/modules.d/00bootchart/check index dfb39474..1e2f863e 100644 --- a/modules.d/00bootchart/check +++ b/modules.d/00bootchart/check @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [ -x /sbin/bootchartd ] || exit 1 # do not enable bootchartd by default diff --git a/modules.d/00bootchart/install b/modules.d/00bootchart/install index 87388157..efef9e7a 100644 --- a/modules.d/00bootchart/install +++ b/modules.d/00bootchart/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst /sbin/bootchartd inst /bin/bash diff --git a/modules.d/00dash/check b/modules.d/00dash/check index 8e12d07e..d18c69c3 100755 --- a/modules.d/00dash/check +++ b/modules.d/00dash/check @@ -1,2 +1,4 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [ -x /bin/dash ]
\ No newline at end of file diff --git a/modules.d/00dash/install b/modules.d/00dash/install index a197573c..6203546d 100755 --- a/modules.d/00dash/install +++ b/modules.d/00dash/install @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # If another shell is already installed, do not use dash [[ -x $initdir/bin/sh ]] && return diff --git a/modules.d/01fips/check b/modules.d/01fips/check index 9d8d2e66..7856e39e 100755 --- a/modules.d/01fips/check +++ b/modules.d/01fips/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [[ $1 = -d ]] && exit 0 exit 255 diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh index fbd809e8..05968398 100755 --- a/modules.d/01fips/fips.sh +++ b/modules.d/01fips/fips.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh do_fips() { FIPSMODULES=$(cat /etc/fipsmodules) @@ -6,21 +8,21 @@ do_fips() KERNEL=$(uname -r) udevadm trigger --action=add >/dev/null 2>&1 case "$boot" in - block:LABEL=*|LABEL=*) - boot="${boot#block:}" - boot="$(echo $boot | sed 's,/,\\x2f,g')" - boot="/dev/disk/by-label/${boot#LABEL=}" - bootok=1 ;; - block:UUID=*|UUID=*) - boot="${boot#block:}" - boot="/dev/disk/by-uuid/${root#UUID=}" - bootok=1 ;; - /dev/*) - bootok=1 ;; + block:LABEL=*|LABEL=*) + boot="${boot#block:}" + boot="$(echo $boot | sed 's,/,\\x2f,g')" + boot="/dev/disk/by-label/${boot#LABEL=}" + bootok=1 ;; + block:UUID=*|UUID=*) + boot="${boot#block:}" + boot="/dev/disk/by-uuid/${root#UUID=}" + bootok=1 ;; + /dev/*) + bootok=1 ;; esac [ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version) - + if [ $UDEVVERSION -ge 143 ]; then udevadm settle --exit-if-exists=$boot else @@ -66,5 +68,3 @@ else do_fips || die "FIPS integrity test failed" set +e fi - -# vim:ts=8:sw=4:sts=4:et diff --git a/modules.d/01fips/install b/modules.d/01fips/install index f74ea6a7..622ce217 100755 --- a/modules.d/01fips/install +++ b/modules.d/01fips/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst_hook pre-trigger 01 "$moddir/fips.sh" dracut_install sha512hmac rmmod insmod mount uname umount @@ -6,10 +8,8 @@ dracut_install sha512hmac rmmod insmod mount uname umount for dir in "$usrlibdir" "$libdir"; do [[ -e $dir/libsoftokn3.so ]] && \ dracut_install $dir/libsoftokn3.so $dir/libsoftokn3.chk \ - $dir/libfreebl3.so $dir/libfreebl3.chk && \ - break + $dir/libfreebl3.so $dir/libfreebl3.chk && \ + break done dracut_install $usrlibdir/hmaccalc/sha512hmac.hmac - -# vim:ts=8:sw=4:sts=4:et diff --git a/modules.d/01fips/installkernel b/modules.d/01fips/installkernel index bce58e46..daa248dc 100755 --- a/modules.d/01fips/installkernel +++ b/modules.d/01fips/installkernel @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh FIPSMODULES="aead aes_generic aes-x86_64 ansi_cprng cbc ccm chainiv ctr" FIPSMODULES="$FIPSMODULES des deflate ecb eseqiv hmac seqiv sha256 sha512" @@ -12,5 +14,3 @@ for mod in $FIPSMODULES; do echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf" fi done - -# vim:ts=8:sw=4:sts=4:et diff --git a/modules.d/10i18n/check b/modules.d/10i18n/check index 8c3cbfc3..e0292c8b 100755 --- a/modules.d/10i18n/check +++ b/modules.d/10i18n/check @@ -1,3 +1,5 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh exit 0 diff --git a/modules.d/10i18n/console_init b/modules.d/10i18n/console_init index a5cdfb70..f8f9bf36 100755 --- a/modules.d/10i18n/console_init +++ b/modules.d/10i18n/console_init @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [ -e /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n [ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard @@ -58,7 +60,7 @@ dev_open() { local dev=$1 exec 6<${dev} && \ - exec 7>>${dev} + exec 7>>${dev} } diff --git a/modules.d/10i18n/install b/modules.d/10i18n/install index 83999e53..433c7e70 100755 --- a/modules.d/10i18n/install +++ b/modules.d/10i18n/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps DEFAULT_SYSFONT=LatArCyrHeb-16 @@ -10,7 +12,7 @@ KEYBOARD_CONF="${initdir}/etc/sysconfig/keyboard" findkeymap () { local MAP=$1 [[ ! -f $MAP ]] && \ - MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1) + MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1) [[ " $KEYMAPS " = *" $MAP "* ]] && return KEYMAPS="$KEYMAPS $MAP" case $MAP in @@ -161,12 +163,12 @@ checks() { for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share do [[ -d "${kbddir}" ]] && \ - for dir in ${KBDSUBDIRS//,/ } - do - [[ -d "${kbddir}/${dir}" ]] && continue - false - done && break - kbddir='' + for dir in ${KBDSUBDIRS//,/ } + do + [[ -d "${kbddir}/${dir}" ]] && continue + false + done && break + kbddir='' done [[ ${kbddir} ]] || { diff --git a/modules.d/10i18n/parse-i18n.sh b/modules.d/10i18n/parse-i18n.sh index 785b51be..0d41eb70 100755 --- a/modules.d/10i18n/parse-i18n.sh +++ b/modules.d/10i18n/parse-i18n.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst_key_val() { local value diff --git a/modules.d/10rpmversion/check b/modules.d/10rpmversion/check index f479d219..4002ae4a 100755 --- a/modules.d/10rpmversion/check +++ b/modules.d/10rpmversion/check @@ -1,3 +1,5 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [ -f /etc/redhat-release ] diff --git a/modules.d/10rpmversion/install b/modules.d/10rpmversion/install index 1fd0005f..8fa9be0a 100755 --- a/modules.d/10rpmversion/install +++ b/modules.d/10rpmversion/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [ -e "$moddir/dracut-version" ]; then dracut_rpm_version=$(cat "$moddir/dracut-version") diff --git a/modules.d/10rpmversion/version.sh b/modules.d/10rpmversion/version.sh index 8af23b57..8f010fb7 100755 --- a/modules.d/10rpmversion/version.sh +++ b/modules.d/10rpmversion/version.sh @@ -1,3 +1,5 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh for i in dracut-*; do if [ -f $i ]; then vinfo < $i diff --git a/modules.d/40network/check b/modules.d/40network/check index 4e2a5fdc..26b56b3b 100755 --- a/modules.d/40network/check +++ b/modules.d/40network/check @@ -1,22 +1,24 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [[ $1 = -d ]]; then - [ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg - exit 0 + [ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg + exit 0 fi . $dracutfunctions for program in ip arping; do - if ! type -P $program >/dev/null; then - dwarning "Could not find program \"$program\" required by network." - exit 1 - fi + if ! type -P $program >/dev/null; then + dwarning "Could not find program \"$program\" required by network." + exit 1 + fi done for program in dhclient brctl; do - if ! type -P $program >/dev/null; then - dwarning "Could not find program \"$program\" it might be required by network." - fi + if ! type -P $program >/dev/null; then + dwarning "Could not find program \"$program\" it might be required by network." + fi done exit 255 diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script index 1f5c4c0a..4b566d0c 100755 --- a/modules.d/40network/dhclient-script +++ b/modules.d/40network/dhclient-script @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh setup_interface() { ip=$new_ip_address @@ -20,12 +22,12 @@ setup_interface() { # disallow MTUs from 576 and below by default, so that broken # MTUs are ignored, but higher stuff is allowed (1492, 1500, etc). if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then - echo "if ! ip link set $netif mtu $mtu ; then" - echo "ip link set $netif down" - echo "ip link set $netif mtu $mtu" - echo "ip link set $netif up" - echo wait_for_if_up $netif - echo "fi" + echo "if ! ip link set $netif mtu $mtu ; then" + echo "ip link set $netif down" + echo "ip link set $netif mtu $mtu" + echo "ip link set $netif up" + echo wait_for_if_up $netif + echo "fi" fi > /tmp/net.$netif.up echo ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif >> /tmp/net.$netif.up @@ -34,9 +36,9 @@ setup_interface() { [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf if [ -n "$namesrv" ] ; then - for s in $namesrv; do - echo nameserver $s - done + for s in $namesrv; do + echo nameserver $s + done fi >> /tmp/net.$netif.resolv.conf [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname @@ -56,24 +58,24 @@ netif=$interface case $reason in PREINIT) - echo "dhcp: PREINIT $netif up" - ip link set $netif up - wait_for_if_up $netif - ;; + echo "dhcp: PREINIT $netif up" + ip link set $netif up + wait_for_if_up $netif + ;; BOUND) - echo "dhcp: BOND setting $netif" - if ! arping -q -D -c 2 -I $netif $new_ip_address ; then - warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying" - exit 1 - fi - setup_interface - set | while read line; do - [ "${line#new_}" = "$line" ] && continue - echo "$line" - done >/tmp/dhclient.$netif.dhcpopts - echo online > /sys/class/net/$netif/uevent - /sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif - ;; + echo "dhcp: BOND setting $netif" + if ! arping -q -D -c 2 -I $netif $new_ip_address ; then + warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying" + exit 1 + fi + setup_interface + set | while read line; do + [ "${line#new_}" = "$line" ] && continue + echo "$line" + done >/tmp/dhclient.$netif.dhcpopts + echo online > /sys/class/net/$netif/uevent + /sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif + ;; *) echo "dhcp: $reason";; esac diff --git a/modules.d/40network/dhcp-root.sh b/modules.d/40network/dhcp-root.sh index 644b5ef0..f716bc6f 100755 --- a/modules.d/40network/dhcp-root.sh +++ b/modules.d/40network/dhcp-root.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # Don't continue if root is ok [ -n "$rootok" ] && return @@ -14,7 +16,7 @@ if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] ; th # Done, all good! rootok=1 if [ "$netroot" != "dhcp" ] ; then - netroot=$root + netroot=$root fi # Shut up init error check diff --git a/modules.d/40network/ifname-genrules.sh b/modules.d/40network/ifname-genrules.sh index 5186e919..e188c88b 100755 --- a/modules.d/40network/ifname-genrules.sh +++ b/modules.d/40network/ifname-genrules.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # if there are no ifname parameters, just use NAME=KERNEL if ! getarg ifname= >/dev/null ; then @@ -8,12 +10,12 @@ fi { for p in $(getargs ifname=); do parse_ifname_opts $p - printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if" + printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if" done # Rename non named interfaces out of the way for named ones. for p in $(getargs ifname=); do parse_ifname_opts $p - printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME!="?*", KERNEL=="%s", NAME="%%k-renamed"\n' "$ifname_if" + printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME!="?*", KERNEL=="%s", NAME="%%k-renamed"\n' "$ifname_if" done } > /etc/udev/rules.d/50-ifname.rules diff --git a/modules.d/40network/ifup b/modules.d/40network/ifup index 6ef10104..5cd6fc5e 100755 --- a/modules.d/40network/ifup +++ b/modules.d/40network/ifup @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # We don't need to check for ip= errors here, that is handled by the # cmdline parser script @@ -14,16 +16,16 @@ do_dhcp() { # XXX add -V vendor class and option parsing per kernel echo "Starting dhcp for interface $netif" dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \ - || echo "dhcp failed" + || echo "dhcp failed" } load_ipv6() { modprobe ipv6 i=0 while [ ! -d /proc/sys/net/ipv6 ]; do - i=$(($i+1)) - [ $i -gt 10 ] && break - sleep 0.1 + i=$(($i+1)) + [ $i -gt 10 ] && break + sleep 0.1 done } @@ -33,17 +35,17 @@ do_ipv6auto() { echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects - echo ip link set $netif up - echo wait_for_if_up $netif + echo ip link set $netif up + echo wait_for_if_up $netif } > /tmp/net.$netif.up [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname namesrv=$(getargs nameserver) if [ -n "$namesrv" ] ; then - for s in $namesrv; do - echo nameserver $s - done + for s in $namesrv; do + echo nameserver $s + done fi >> /tmp/net.$netif.resolv.conf @@ -56,12 +58,12 @@ do_static() { strstr $ip '*:*:*' && load_ipv6 { - echo ip link set $netif up - echo wait_for_if_up $netif - # do not flush addr for ipv6 - strstr $ip '*:*:*' || \ - echo ip addr flush dev $netif - echo ip addr add $ip/$mask dev $netif + echo ip link set $netif up + echo wait_for_if_up $netif + # do not flush addr for ipv6 + strstr $ip '*:*:*' || \ + echo ip addr flush dev $netif + echo ip addr add $ip/$mask dev $netif } > /tmp/net.$netif.up [ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw @@ -69,9 +71,9 @@ do_static() { namesrv=$(getargs nameserver) if [ -n "$namesrv" ] ; then - for s in $namesrv; do - echo nameserver $s - done + for s in $namesrv; do + echo nameserver $s + done fi >> /tmp/net.$netif.resolv.conf echo online > /sys/class/net/$netif/uevent @@ -130,9 +132,9 @@ ip=$(getarg ip) if [ -z "$ip" ]; then if [ "$netroot" = "dhcp6" ]; then - do_dhcp -6 + do_dhcp -6 else - do_dhcp -4 + do_dhcp -4 fi fi @@ -140,24 +142,24 @@ fi # looking for ip= lines for p in $(getargs ip=); do ip_to_var $p - + # If this option isn't directed at our interface, skip it [ -n "$dev" ] && [ "$dev" != "$netif" ] && continue # Store config for later use for i in ip srv gw mask hostname; do - eval '[ "$'$i'" ] && echo '$i'="$'$i'"' + eval '[ "$'$i'" ] && echo '$i'="$'$i'"' done > /tmp/net.$netif.override case $autoconf in - dhcp|on|any) - do_dhcp -4 ;; - dhcp6) - do_dhcp -6 ;; - auto6) - do_ipv6auto ;; + dhcp|on|any) + do_dhcp -4 ;; + dhcp6) + do_dhcp -6 ;; + auto6) + do_ipv6auto ;; *) - do_static ;; + do_static ;; esac break done diff --git a/modules.d/40network/install b/modules.d/40network/install index d406f2ec..a95ba2ab 100755 --- a/modules.d/40network/install +++ b/modules.d/40network/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh dracut_install ip dhclient brctl arping inst "$moddir/ifup" "/sbin/ifup" inst "$moddir/netroot" "/sbin/netroot" @@ -15,7 +17,7 @@ inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh" arch=$(uname -m) for dir in "$usrlibdir/tls/$arch" "$usrlibdir/tls" "$usrlibdir/$arch" \ - "$usrlibdir" "$libdir"; do + "$usrlibdir" "$libdir"; do for i in "$dir"/libnss_dns.so.* "$dir"/libnss_mdns4_minimal.so.*; do [ -e "$i" ] && dracut_install "$i" done diff --git a/modules.d/40network/installkernel b/modules.d/40network/installkernel index 4c7adcd4..1c9ce7df 100755 --- a/modules.d/40network/installkernel +++ b/modules.d/40network/installkernel @@ -1,16 +1,19 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # Include wired net drivers, excluding wireless net_module_test() { local net_drivers='eth_type_trans|register_virtio_device' local unwanted_drivers='/(wireless|isdn|uwb)/' egrep -q $net_drivers "$1" && \ - egrep -qv 'iw_handler_get_spy' "$1" && \ - [[ ! $1 =~ $unwanted_drivers ]] + egrep -qv 'iw_handler_get_spy' "$1" && \ + [[ ! $1 =~ $unwanted_drivers ]] } instmods $(filter_kernel_modules net_module_test) - + instmods ecb arc4 # bridge modules instmods bridge stp llc diff --git a/modules.d/40network/kill-dhclient.sh b/modules.d/40network/kill-dhclient.sh index 54b33443..5d020991 100755 --- a/modules.d/40network/kill-dhclient.sh +++ b/modules.d/40network/kill-dhclient.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh for f in /tmp/dhclient.*.pid; do [ -e $f ] || continue diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh index 7a269096..f8e60565 100755 --- a/modules.d/40network/net-genrules.sh +++ b/modules.d/40network/net-genrules.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # pxelinux provides macaddr '-' separated, but we need ':' fix_bootif() { @@ -25,18 +27,18 @@ fix_bootif() { # BOOTIF says everything, use only that one BOOTIF=$(getarg 'BOOTIF=') if [ -n "$BOOTIF" ] ; then - BOOTIF=$(fix_bootif "$BOOTIF") - printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$BOOTIF" + BOOTIF=$(fix_bootif "$BOOTIF") + printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$BOOTIF" # If we have to handle multiple interfaces, handle only them. elif [ -n "$IFACES" ] ; then - for iface in $IFACES ; do - printf 'ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface" - done + for iface in $IFACES ; do + printf 'ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface" + done # Default: We don't know the interface to use, handle all else - printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n' + printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n' fi } > /etc/udev/rules.d/60-net.rules diff --git a/modules.d/40network/netroot b/modules.d/40network/netroot index 6a24d418..81a9ad3f 100755 --- a/modules.d/40network/netroot +++ b/modules.d/40network/netroot @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh PATH=$PATH:/sbin:/usr/sbin @@ -41,16 +43,16 @@ if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then # If we have a specific bootdev with no dhcpoptions or empty root-path, # we die. Otherwise we just warn if [ -z "$new_root_path" ] ; then - [ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'" - warn "No dhcp root-path received for '$BOOTDEV' trying other interfaces if available" - exit 1 + [ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'" + warn "No dhcp root-path received for '$BOOTDEV' trying other interfaces if available" + exit 1 fi # Set netroot to new_root_path, so cmdline parsers don't call netroot=$new_root_path for f in ./cmdline/90*.sh; do - [ -f "$f" ] && . "$f"; + [ -f "$f" ] && . "$f"; done else rootok="1" @@ -93,7 +95,7 @@ if [ -z "$dest" ] ; then dummy=${netroot#*:} dummy=${dummy%%:*} case "$dummy" in - [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) dest=$dummy;; + [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) dest=$dummy;; esac fi if [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then @@ -108,8 +110,8 @@ source_all netroot if $handler $netif $netroot $NEWROOT; then # Network rootfs mount successful for iface in $IFACES ; do - [ -f /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease - [ -f /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts + [ -f /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease + [ -f /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts done # Save used netif for later use @@ -119,9 +121,9 @@ else # If we're trying with multiple interfaces, put that one down. # ip down/flush ensures that routeing info goes away as well if [ -z "$BOOTDEV" ] ; then - ip link set $netif down - ip addr flush dev $netif - echo "#empty" > /etc/resolv.conf + ip link set $netif down + ip addr flush dev $netif + echo "#empty" > /etc/resolv.conf fi fi exit 0 diff --git a/modules.d/40network/parse-bridge.sh b/modules.d/40network/parse-bridge.sh index 218485ab..984192f4 100755 --- a/modules.d/40network/parse-bridge.sh +++ b/modules.d/40network/parse-bridge.sh @@ -1,9 +1,11 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # Format: -# bridge=<bridgename>:<ethname> +# bridge=<bridgename>:<ethname> # -# bridge without parameters assumes bridge=br0:eth0 +# bridge without parameters assumes bridge=br0:eth0 # # return if bridge already parsed @@ -12,7 +14,7 @@ # Check if bridge parameter is valid if getarg bridge= >/dev/null ; then if [ -z "$netroot" ] ; then - die "No netboot configured, bridge is invalid" + die "No netboot configured, bridge is invalid" fi fi @@ -26,10 +28,10 @@ parsebridge() { unset bridgename ethname case $# in - 0) bridgename=br0; ethname=eth0 ;; - 1) die "bridge= requires two parameters" ;; - 2) bridgename=$1; ethname=$2 ;; - *) die "bridge= requires two parameters" ;; + 0) bridgename=br0; ethname=eth0 ;; + 1) die "bridge= requires two parameters" ;; + 2) bridgename=$1; ethname=$2 ;; + *) die "bridge= requires two parameters" ;; esac } diff --git a/modules.d/40network/parse-ifname.sh b/modules.d/40network/parse-ifname.sh index aba84750..4c3c70e4 100755 --- a/modules.d/40network/parse-ifname.sh +++ b/modules.d/40network/parse-ifname.sh @@ -1,7 +1,9 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # Format: -# ifname=<interface>:<mac> +# ifname=<interface>:<mac> # # Note letters in the macaddress must be lowercase! # diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh index a3c9597f..b4954a26 100755 --- a/modules.d/40network/parse-ip-opts.sh +++ b/modules.d/40network/parse-ip-opts.sh @@ -1,11 +1,13 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # Format: -# ip=[dhcp|on|any] +# ip=[dhcp|on|any] # -# ip=<interface>:[dhcp|on|any] +# ip=<interface>:[dhcp|on|any] # -# ip=<client-IP-number>:<server-id>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|none|off] +# ip=<client-IP-number>:<server-id>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|none|off] # # When supplying more than only ip= line, <interface> is mandatory and # bootdev= must contain the name of the primary interface to use for @@ -17,8 +19,8 @@ # Check if ip= lines should be used if getarg ip= >/dev/null ; then if [ -z "$netroot" ] ; then - echo "Warning: No netboot configured, ignoring ip= lines" - return; + echo "Warning: No netboot configured, ignoring ip= lines" + return; fi fi @@ -38,7 +40,7 @@ fi if [ -z "$NEEDBOOTDEV" ] ; then local count=0 for p in $(getargs ip=); do - count=$(( $count + 1 )) + count=$(( $count + 1 )) done [ $count -gt 1 ] && NEEDBOOTDEV=1 fi @@ -59,39 +61,39 @@ for p in $(getargs ip=); do # Empty autoconf defaults to 'dhcp' if [ -z "$autoconf" ] ; then - warn "Empty autoconf values default to dhcp" - autoconf="dhcp" + warn "Empty autoconf values default to dhcp" + autoconf="dhcp" fi # Error checking for autoconf in combination with other values case $autoconf in - error) die "Error parsing option 'ip=$p'";; - bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";; - none|off) \ - [ -z "$ip" ] && \ - die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense" - [ -z "$mask" ] && \ - die "Sorry, automatic calculation of netmask is not yet supported" - ;; - auto6);; - dhcp|dhcp6|on|any) \ - [ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ - die "Sorry, 'ip=$p' does not make sense for multiple interface configurations" - [ -n "$ip" ] && \ - die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'" - ;; - *) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";; + error) die "Error parsing option 'ip=$p'";; + bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";; + none|off) \ + [ -z "$ip" ] && \ + die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense" + [ -z "$mask" ] && \ + die "Sorry, automatic calculation of netmask is not yet supported" + ;; + auto6);; + dhcp|dhcp6|on|any) \ + [ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ + die "Sorry, 'ip=$p' does not make sense for multiple interface configurations" + [ -n "$ip" ] && \ + die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'" + ;; + *) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";; esac if [ -n "$dev" ] ; then # We don't like duplicate device configs - if [ -n "$IFACES" ] ; then - for i in $IFACES ; do - [ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'" - done - fi - # IFACES list for later use - IFACES="$IFACES $dev" + if [ -n "$IFACES" ] ; then + for i in $IFACES ; do + [ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'" + done + fi + # IFACES list for later use + IFACES="$IFACES $dev" fi # Small optimization for udev rules @@ -99,15 +101,15 @@ for p in $(getargs ip=); do # Do we need to check for specific options? if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then - # Correct device? (Empty is ok as well) - [ "$dev" = "$BOOTDEV" ] || continue - # Server-ip is there? - [ -n "$DHCPORSERVER" ] && [ -n "$srv" ] && continue - # dhcp? (It's simpler to check for a set ip. Checks above ensure that if - # ip is there, we're static - [ -z "$ip" ] && continue - # Not good! - die "Server-ip or dhcp for netboot needed, but current arguments say otherwise" + # Correct device? (Empty is ok as well) + [ "$dev" = "$BOOTDEV" ] || continue + # Server-ip is there? + [ -n "$DHCPORSERVER" ] && [ -n "$srv" ] && continue + # dhcp? (It's simpler to check for a set ip. Checks above ensure that if + # ip is there, we're static + [ -z "$ip" ] && continue + # Not good! + die "Server-ip or dhcp for netboot needed, but current arguments say otherwise" fi done diff --git a/modules.d/45ifcfg/check b/modules.d/45ifcfg/check index b8e40d91..636df1d8 100755 --- a/modules.d/45ifcfg/check +++ b/modules.d/45ifcfg/check @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # ifcfg is required by network #[[ $1 = -d ]] && echo network diff --git a/modules.d/45ifcfg/install b/modules.d/45ifcfg/install index 2d0edd0c..ba456c26 100755 --- a/modules.d/45ifcfg/install +++ b/modules.d/45ifcfg/install @@ -1,2 +1,4 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh" diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh index f5989ef0..ac3bd909 100755 --- a/modules.d/45ifcfg/write-ifcfg.sh +++ b/modules.d/45ifcfg/write-ifcfg.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # NFS root might have reached here before /tmp/net.ifaces was written udevadm settle --timeout=30 @@ -16,40 +18,40 @@ for netif in $IFACES ; do fi cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr { - echo "# Generated by dracut initrd" - echo "DEVICE=$netif" - echo "ONBOOT=yes" - echo "NETBOOT=yes" - if [ -f /tmp/net.$netif.lease ]; then - strstr "$ip" '*:*:*' && - echo "DHCPV6C=yes" - echo "BOOTPROTO=dhcp" - else - echo "BOOTPROTO=none" + echo "# Generated by dracut initrd" + echo "DEVICE=$netif" + echo "ONBOOT=yes" + echo "NETBOOT=yes" + if [ -f /tmp/net.$netif.lease ]; then + strstr "$ip" '*:*:*' && + echo "DHCPV6C=yes" + echo "BOOTPROTO=dhcp" + else + echo "BOOTPROTO=none" # If we've booted with static ip= lines, the override file is there - . /tmp/net.$netif.override - echo "IPADDR=$ip" - echo "NETMASK=$mask" - [ -n "$gw" ] && echo "GATEWAY=$gw" - fi + . /tmp/net.$netif.override + echo "IPADDR=$ip" + echo "NETMASK=$mask" + [ -n "$gw" ] && echo "GATEWAY=$gw" + fi } > /tmp/ifcfg/ifcfg-$netif # bridge needs different things written to ifcfg if [ -z "$bridge" ]; then # standard interface - { + { echo "HWADDR=$(cat /sys/class/net/$netif/address)" echo "TYPE=Ethernet" echo "NAME=\"Boot Disk\"" - } >> /tmp/ifcfg/ifcfg-$netif + } >> /tmp/ifcfg/ifcfg-$netif else # bridge - { - echo "TYPE=Bridge" + { + echo "TYPE=Bridge" echo "NAME=\"Boot Disk\"" - } >> /tmp/ifcfg/ifcfg-$netif + } >> /tmp/ifcfg/ifcfg-$netif # write separate ifcfg file for the raw eth interface - { + { echo "DEVICE=$ethname" echo "TYPE=Ethernet" echo "ONBOOT=yes" @@ -57,7 +59,7 @@ for netif in $IFACES ; do echo "HWADDR=$(cat /sys/class/net/$ethname/address)" echo "BRIDGE=$netif" echo "NAME=$ethname" - } >> /tmp/ifcfg/ifcfg-$ethname + } >> /tmp/ifcfg/ifcfg-$ethname fi done diff --git a/modules.d/50gensplash/check b/modules.d/50gensplash/check index 90b88741..eebce204 100755 --- a/modules.d/50gensplash/check +++ b/modules.d/50gensplash/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # TODO: splash_geninitramfs # TODO: /usr/share/splashutils/initrd.splash diff --git a/modules.d/50gensplash/gensplash-emergency.sh b/modules.d/50gensplash/gensplash-emergency.sh index 01e639b3..813a2b20 100755 --- a/modules.d/50gensplash/gensplash-emergency.sh +++ b/modules.d/50gensplash/gensplash-emergency.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh CDROOT=0 . /lib/gensplash-lib.sh diff --git a/modules.d/50gensplash/gensplash-newroot.sh b/modules.d/50gensplash/gensplash-newroot.sh index ed2d421f..7c41b5d3 100755 --- a/modules.d/50gensplash/gensplash-newroot.sh +++ b/modules.d/50gensplash/gensplash-newroot.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh CDROOT=0 . /lib/gensplash-lib.sh diff --git a/modules.d/50gensplash/gensplash-pretrigger.sh b/modules.d/50gensplash/gensplash-pretrigger.sh index f1b0d312..47bd9a08 100755 --- a/modules.d/50gensplash/gensplash-pretrigger.sh +++ b/modules.d/50gensplash/gensplash-pretrigger.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if ! getarg rd_NO_SPLASH; then [ -c /dev/null ] || mknod /dev/null c 1 3 diff --git a/modules.d/50gensplash/install b/modules.d/50gensplash/install index 1ad2c95a..2f6dcc56 100755 --- a/modules.d/50gensplash/install +++ b/modules.d/50gensplash/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh call_splash_geninitramfs() { local out ret diff --git a/modules.d/50plymouth/check b/modules.d/50plymouth/check index 40f20164..f11c9fd4 100755 --- a/modules.d/50plymouth/check +++ b/modules.d/50plymouth/check @@ -1,3 +1,5 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [[ $1 = -d ]] && type -P cryptsetup >/dev/null && echo crypt [[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]] diff --git a/modules.d/50plymouth/install b/modules.d/50plymouth/install index ba5ef895..7a0c237b 100755 --- a/modules.d/50plymouth/install +++ b/modules.d/50plymouth/install @@ -1,8 +1,10 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \ - || ! grep -q PLYMOUTH_POPULATE_SOURCE_FUNCTIONS /usr/libexec/plymouth/plymouth-populate-initrd \ - || [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then + || ! grep -q PLYMOUTH_POPULATE_SOURCE_FUNCTIONS /usr/libexec/plymouth/plymouth-populate-initrd \ + || [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then . "$moddir"/plymouth-populate-initrd else PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \ diff --git a/modules.d/50plymouth/installkernel b/modules.d/50plymouth/installkernel index 9f3291da..d84eee9d 100755 --- a/modules.d/50plymouth/installkernel +++ b/modules.d/50plymouth/installkernel @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # Include KMS capable drm drivers for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko' 2>/dev/null); do grep -q drm_crtc_init $modname && instmods $modname diff --git a/modules.d/50plymouth/plymouth-emergency.sh b/modules.d/50plymouth/plymouth-emergency.sh index 31193309..d54b55ac 100755 --- a/modules.d/50plymouth/plymouth-emergency.sh +++ b/modules.d/50plymouth/plymouth-emergency.sh @@ -1 +1,3 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [ -x /bin/plymouth ] && /bin/plymouth --hide-splash diff --git a/modules.d/50plymouth/plymouth-newroot.sh b/modules.d/50plymouth/plymouth-newroot.sh index be563cdd..e03e98d0 100755 --- a/modules.d/50plymouth/plymouth-newroot.sh +++ b/modules.d/50plymouth/plymouth-newroot.sh @@ -1,5 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [ -x /bin/plymouth ]; then - /bin/plymouth --newroot=$NEWROOT + /bin/plymouth --newroot=$NEWROOT fi diff --git a/modules.d/50plymouth/plymouth-populate-initrd b/modules.d/50plymouth/plymouth-populate-initrd index aa3d8fa2..199cab02 100755 --- a/modules.d/50plymouth/plymouth-populate-initrd +++ b/modules.d/50plymouth/plymouth-populate-initrd @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png" PLYMOUTH_THEME=$(plymouth-set-default-theme) @@ -11,28 +13,28 @@ mkdir -p "${initdir}/usr/share/plymouth" if [[ $hostonly ]]; then dracut_install "${usrlibdir}/plymouth/text.so" \ - "${usrlibdir}/plymouth/details.so" \ - "/usr/share/plymouth/themes/details/details.plymouth" \ - "/usr/share/plymouth/themes/text/text.plymouth" \ + "${usrlibdir}/plymouth/details.so" \ + "/usr/share/plymouth/themes/details/details.plymouth" \ + "/usr/share/plymouth/themes/text/text.plymouth" \ if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then - for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do + for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do [[ -f "$x" ]] || break inst $x - done + done fi if [ -L /usr/share/plymouth/themes/default.plymouth ]; then - inst /usr/share/plymouth/themes/default.plymouth + inst /usr/share/plymouth/themes/default.plymouth # Install plugin for this theme - PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;) - inst "${usrlibdir}/plymouth/${PLYMOUTH_PLUGIN}.so" + PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;) + inst "${usrlibdir}/plymouth/${PLYMOUTH_PLUGIN}.so" fi else for x in /usr/share/plymouth/themes/{text,details}/* ; do [[ -f "$x" ]] || continue - THEME_DIR=$(dirname "$x") - mkdir -p "${initdir}/$THEME_DIR" + THEME_DIR=$(dirname "$x") + mkdir -p "${initdir}/$THEME_DIR" dracut_install "$x" done for x in "${usrlibdir}"/plymouth/{text,details}.so ; do @@ -41,9 +43,7 @@ else dracut_install "$x" done ( - cd ${initdir}/usr/share/plymouth/themes; - ln -s text/text.plymouth default.plymouth 2>&1; + cd ${initdir}/usr/share/plymouth/themes; + ln -s text/text.plymouth default.plymouth 2>&1; ) fi - -# vim:ts=8:sw=4:sts=4:et diff --git a/modules.d/50plymouth/plymouth-pretrigger.sh b/modules.d/50plymouth/plymouth-pretrigger.sh index 36f9966f..6662ec7a 100755 --- a/modules.d/50plymouth/plymouth-pretrigger.sh +++ b/modules.d/50plymouth/plymouth-pretrigger.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if ! getarg rd_NO_PLYMOUTH; then [ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3 @@ -19,6 +21,3 @@ if ! getarg rd_NO_PLYMOUTH; then /lib/udev/console_init tty0 /bin/plymouth --show-splash 2>&1 | vinfo fi - - -# vim:ts=8:sw=4:sts=4:et diff --git a/modules.d/60xen/check b/modules.d/60xen/check index 6b9cabe5..55129ac5 100755 --- a/modules.d/60xen/check +++ b/modules.d/60xen/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # No Xen-detect? Boo!! if ! hash xen-detect 2>/dev/null; then diff --git a/modules.d/60xen/install b/modules.d/60xen/install index 6ae0060f..08f3f0a5 100755 --- a/modules.d/60xen/install +++ b/modules.d/60xen/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh hash xen-detect 2>/dev/null || \ hash -p /usr/lib/xen-default/bin/xen-detect xen-detect inst "$(hash -t xen-detect)" /sbin/xen-detect diff --git a/modules.d/60xen/installkernel b/modules.d/60xen/installkernel index cb140642..7c1ffd52 100755 --- a/modules.d/60xen/installkernel +++ b/modules.d/60xen/installkernel @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh for i in \ xenbus_probe_frontend xen-pcifront \ diff --git a/modules.d/60xen/xen-pre-udev.sh b/modules.d/60xen/xen-pre-udev.sh index 96faf44d..6d5616e3 100755 --- a/modules.d/60xen/xen-pre-udev.sh +++ b/modules.d/60xen/xen-pre-udev.sh @@ -1,10 +1,12 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh xen-detect RC=$? if [ "$RC" = "1" ] ; then - modprobe xenbus_probe_frontend - modprobe xen-kbdfront - modprobe xen-fbfront - modprobe xen-blkfront - modprobe xen-netfront - modprobe xen-pcifront + modprobe xenbus_probe_frontend + modprobe xen-kbdfront + modprobe xen-fbfront + modprobe xen-blkfront + modprobe xen-netfront + modprobe xen-pcifront fi diff --git a/modules.d/90btrfs/check b/modules.d/90btrfs/check index c562cb8c..03c52935 100755 --- a/modules.d/90btrfs/check +++ b/modules.d/90btrfs/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # We depend on udev-rules being loaded [[ "$1" = "-d" ]] && exit 0 @@ -15,7 +17,7 @@ is_btrfs() { get_fs_type /dev/block/$1 |grep -q btrfs; } if [[ "$1" = "-h" ]]; then rootdev=$(find_root_block_device) if [[ $rootdev ]]; then - is_btrfs "$rootdev" || exit 1 + is_btrfs "$rootdev" || exit 1 fi fi diff --git a/modules.d/90btrfs/install b/modules.d/90btrfs/install index c6a8f48f..af934fc8 100755 --- a/modules.d/90btrfs/install +++ b/modules.d/90btrfs/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst_rules "$moddir/40-btrfs.rules" dracut_install btrfsctl diff --git a/modules.d/90crypt/check b/modules.d/90crypt/check index b89d9a09..3ac80764 100755 --- a/modules.d/90crypt/check +++ b/modules.d/90crypt/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # if cryptsetup is not installed, then we cannot support encrypted devices. type -P cryptsetup >/dev/null || exit 1 @@ -12,12 +14,12 @@ is_crypt() { [[ $(get_fs_type /dev/block/$1) = crypto_LUKS ]]; } [[ $1 = '-h' ]] && { rootdev=$(find_root_block_device) if [[ $rootdev ]]; then - # root lives on a block device, so we can be more precise about - # hostonly checking - check_block_and_slaves is_crypt "$rootdev" || exit 1 + # root lives on a block device, so we can be more precise about + # hostonly checking + check_block_and_slaves is_crypt "$rootdev" || exit 1 else - # root is not on a block device, use the shotgun approach - blkid | grep -q crypto\?_LUKS || exit 1 + # root is not on a block device, use the shotgun approach + blkid | grep -q crypto\?_LUKS || exit 1 fi } diff --git a/modules.d/90crypt/crypt-cleanup.sh b/modules.d/90crypt/crypt-cleanup.sh index 1242b1ca..e9fc6bac 100755 --- a/modules.d/90crypt/crypt-cleanup.sh +++ b/modules.d/90crypt/crypt-cleanup.sh @@ -1,11 +1,13 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # close everything which is not busy rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1 while true; do - local do_break="y" - for i in /dev/mapper/luks-*; do - cryptsetup luksClose $i >/dev/null 2>&1 && do_break=n - done - [ "$do_break" = "y" ] && break + local do_break="y" + for i in /dev/mapper/luks-*; do + cryptsetup luksClose $i >/dev/null 2>&1 && do_break=n + done + [ "$do_break" = "y" ] && break done diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh index efec56c1..45b5fe74 100755 --- a/modules.d/90crypt/cryptroot-ask.sh +++ b/modules.d/90crypt/cryptroot-ask.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # do not ask, if we already have root [ -f /sysroot/proc ] && exit 0 @@ -37,7 +39,7 @@ if [ -f /etc/crypttab ] && ! getarg rd_NO_CRYPTTAB; then luksname="$name" break fi - + # path used in crypttab else cdev=$(readlink -f $dev) @@ -88,12 +90,12 @@ unset keydev_uuid keypath if [ -n "$keypaths" ]; then keydev_uuids="$(getargs rd_LUKS_KEYDEV_UUID)" [ -n "$keydev_uuids" ] || { - warn 'No UUID of device storing LUKS key specified.' - warn 'It is recommended to set rd_LUKS_KEYDEV_UUID.' - warn 'Performing scan of *all* devices accessible by UUID...' + warn 'No UUID of device storing LUKS key specified.' + warn 'It is recommended to set rd_LUKS_KEYDEV_UUID.' + warn 'Performing scan of *all* devices accessible by UUID...' } tmp=$(foreach_uuid_until "probe_keydev \$full_uuid $keypaths" \ - $keydev_uuids) && { + $keydev_uuids) && { keydev_uuid="${tmp%% *}" keypath="${tmp#* }" } || { @@ -129,20 +131,20 @@ else prompt="Password for $device ($sluksname...)" fi - # flock against other interactive activities + # flock against other interactive activities { flock -s 9; /bin/plymouth ask-for-password \ - --prompt "$prompt" \ - --command="/sbin/cryptsetup luksOpen -T1 $device $luksname" + --prompt "$prompt" \ + --command="/sbin/cryptsetup luksOpen -T1 $device $luksname" } 9>/.console.lock - - unset sluksname prompt - + + unset sluksname prompt + else # flock against other interactive activities { flock -s 9; - echo "$device ($luksname) is password protected" - cryptsetup luksOpen -T5 $device $luksname + echo "$device ($luksname) is password protected" + cryptsetup luksOpen -T5 $device $luksname } 9>/.console.lock fi fi @@ -155,4 +157,3 @@ unset device luksname udevsettle exit 0 -# vim:ts=8:sw=4:sts=4:et diff --git a/modules.d/90crypt/install b/modules.d/90crypt/install index 0a1a8e06..a518bc3d 100755 --- a/modules.d/90crypt/install +++ b/modules.d/90crypt/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst cryptsetup inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask inst_hook cmdline 30 "$moddir/parse-crypt.sh" diff --git a/modules.d/90crypt/installkernel b/modules.d/90crypt/installkernel index de154a5c..f41e5ac8 100755 --- a/modules.d/90crypt/installkernel +++ b/modules.d/90crypt/installkernel @@ -1,3 +1,5 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods dm_crypt cbc sha256 xts aes aes_generic aesni-intel aes-x86_64 fpu diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh index c42ff80d..888b1b02 100755 --- a/modules.d/90crypt/parse-crypt.sh +++ b/modules.d/90crypt/parse-crypt.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if getarg rd_NO_LUKS; then info "rd_NO_LUKS: removing cryptoluks activation" rm -f /etc/udev/rules.d/70-luks.rules @@ -11,8 +13,8 @@ else LUKS=$(getargs rd_LUKS_UUID) unset settled [ -n "$(getargs rd_LUKS_KEYPATH)" ] && \ - [ -z "$(getargs rd_LUKS_KEYDEV_UUID)" ] && \ - settled='--settled' + [ -z "$(getargs rd_LUKS_KEYDEV_UUID)" ] && \ + settled='--settled' if [ -n "$LUKS" ]; then for luksid in $LUKS; do @@ -26,7 +28,7 @@ else } >> /etc/udev/rules.d/70-luks.rules printf '[ -e /dev/disk/by-uuid/*%s* ] || exit 1\n' $luksid \ - >> /initqueue-finished/crypt.sh + >> /initqueue-finished/crypt.sh { printf '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid printf 'warn "crypto LUKS UUID "%s" not found"\n' $luksid @@ -34,9 +36,9 @@ else done else echo 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue' $settled \ - '--unique --onetime --name cryptroot-ask-%k' \ - '/sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"' \ - >> /etc/udev/rules.d/70-luks.rules + '--unique --onetime --name cryptroot-ask-%k' \ + '/sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"' \ + >> /etc/udev/rules.d/70-luks.rules fi echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules diff --git a/modules.d/90dm/check b/modules.d/90dm/check index 008f04fc..3a95d013 100755 --- a/modules.d/90dm/check +++ b/modules.d/90dm/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh exit 255 diff --git a/modules.d/90dm/dm-pre-udev.sh b/modules.d/90dm/dm-pre-udev.sh index dfa45419..a016ea28 100755 --- a/modules.d/90dm/dm-pre-udev.sh +++ b/modules.d/90dm/dm-pre-udev.sh @@ -1 +1,3 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh strstr "$(cat /proc/misc)" device-mapper || modprobe dm_mod diff --git a/modules.d/90dm/install b/modules.d/90dm/install index f77d9457..28e53b3a 100755 --- a/modules.d/90dm/install +++ b/modules.d/90dm/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh modinfo -k $kernel dm_mod >/dev/null 2>&1 && \ inst_hook pre-udev 30 "$moddir/dm-pre-udev.sh" diff --git a/modules.d/90dm/installkernel b/modules.d/90dm/installkernel index f5a8ad9c..f9fdfcb7 100755 --- a/modules.d/90dm/installkernel +++ b/modules.d/90dm/installkernel @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods =drivers/md diff --git a/modules.d/90dmraid/check b/modules.d/90dmraid/check index b93de099..fd7dde73 100755 --- a/modules.d/90dmraid/check +++ b/modules.d/90dmraid/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # We depend on dm_mod being loaded [ "$1" = "-d" ] && echo dm @@ -16,12 +18,12 @@ is_dmraid() { get_fs_type /dev/block/$1 |grep -v linux_raid_member | \ [[ $1 = '-h' ]] && { rootdev=$(find_root_block_device) if [[ $rootdev ]]; then - # root lives on a block device, so we can be more precise about - # hostonly checking - check_block_and_slaves is_dmraid "$rootdev" || exit 1 + # root lives on a block device, so we can be more precise about + # hostonly checking + check_block_and_slaves is_dmraid "$rootdev" || exit 1 else - # root is not on a block device, use the shotgun approach - dmraid -r | grep -q ok || exit 1 + # root is not on a block device, use the shotgun approach + dmraid -r | grep -q ok || exit 1 fi } diff --git a/modules.d/90dmraid/dmraid.sh b/modules.d/90dmraid/dmraid.sh index dba655b9..f7f96594 100755 --- a/modules.d/90dmraid/dmraid.sh +++ b/modules.d/90dmraid/dmraid.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh . /lib/dracut-lib.sh @@ -20,19 +22,19 @@ echo $SETS|vinfo if [ -n "$DM_RAIDS" ]; then # only activate specified DM RAIDS for r in $DM_RAIDS; do - for s in $SETS; do - if [ "${s##$r}" != "$s" ]; then - info "Activating $s" + for s in $SETS; do + if [ "${s##$r}" != "$s" ]; then + info "Activating $s" dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo [ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s" 2>&1 | vinfo udevsettle - fi - done + fi + done done else # scan and activate all DM RAIDS for s in $SETS; do - info "Activating $s" + info "Activating $s" dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo [ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s" 2>&1 | vinfo done diff --git a/modules.d/90dmraid/install b/modules.d/90dmraid/install index 52fd0a27..7626bdcb 100755 --- a/modules.d/90dmraid/install +++ b/modules.d/90dmraid/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh dracut_install dmraid partx kpartx inst dmeventd diff --git a/modules.d/90dmraid/parse-dm.sh b/modules.d/90dmraid/parse-dm.sh index 63780bd1..b722c409 100755 --- a/modules.d/90dmraid/parse-dm.sh +++ b/modules.d/90dmraid/parse-dm.sh @@ -1,3 +1,5 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # nodmraid for anaconda / rc.sysinit compatibility if getarg rd_NO_DM || getarg nodmraid; then info "rd_NO_DM: removing DM RAID activation" diff --git a/modules.d/90dmsquash-live/check b/modules.d/90dmsquash-live/check index ae7306e0..c25b2b82 100755 --- a/modules.d/90dmsquash-live/check +++ b/modules.d/90dmsquash-live/check @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # if dmsetup is not installed, then we cannot support fedora/red hat # style live images diff --git a/modules.d/90dmsquash-live/dmsquash-live-genrules.sh b/modules.d/90dmsquash-live/dmsquash-live-genrules.sh index c2aee3a2..dd49397b 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-genrules.sh +++ b/modules.d/90dmsquash-live/dmsquash-live-genrules.sh @@ -1,15 +1,17 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [ "${root%%:*}" = "live" ]; then { - printf 'KERNEL=="%s", SYMLINK+="live"\n' \ - ${root#live:/dev/} - printf 'SYMLINK=="%s", SYMLINK+="live"\n' \ - ${root#live:/dev/} + printf 'KERNEL=="%s", SYMLINK+="live"\n' \ + ${root#live:/dev/} + printf 'SYMLINK=="%s", SYMLINK+="live"\n' \ + ${root#live:/dev/} } >> /dev/.udev/rules.d/99-live-mount.rules { - printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \ - ${root#live:/dev/} - printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \ - ${root#live:/dev/} + printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \ + ${root#live:/dev/} + printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \ + ${root#live:/dev/} } >> /etc/udev/rules.d/99-live-squash.rules echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh fi diff --git a/modules.d/90dmsquash-live/dmsquash-live-root b/modules.d/90dmsquash-live/dmsquash-live-root index 1b7fe192..1716a687 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root +++ b/modules.d/90dmsquash-live/dmsquash-live-root @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh . /lib/dracut-lib.sh [ -f /tmp/root.info ] && . /tmp/root.info @@ -32,8 +34,8 @@ getarg check || check="" if [ -n "$check" ]; then checkisomd5 --verbose $livedev || : if [ $? -ne 0 ]; then - die "CD check failed!" - exit 1 + die "CD check failed!" + exit 1 fi fi @@ -79,7 +81,7 @@ do_live_overlay() { if [ -f /overlayfs$pathspec -a -w /overlayfs$pathspec ]; then losetup $OVERLAY_LOOPDEV /overlayfs$pathspec if [ -n "$reset_overlay" ]; then - dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k count=1 2>/dev/null + dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k count=1 2>/dev/null fi setup="yes" fi @@ -88,8 +90,8 @@ do_live_overlay() { if [ -z "$setup" ]; then if [ -n "$devspec" -a -n "$pathspec" ]; then - warn "Unable to find persistent overlay; using temporary" - sleep 5 + warn "Unable to find persistent overlay; using temporary" + sleep 5 fi dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((512*1024)) 2> /dev/null @@ -124,7 +126,7 @@ fi # we might have just an embedded ext3 to use as rootfs (uncompressed live) if [ -e /dev/.initramfs/live/${live_dir}/ext3fs.img ]; then - EXT3FS="/dev/.initramfs/live/${live_dir}/ext3fs.img" + EXT3FS="/dev/.initramfs/live/${live_dir}/ext3fs.img" fi if [ -n "$EXT3FS" ] ; then @@ -136,7 +138,7 @@ fi # we might have an embedded ext3 on squashfs to use as rootfs (compressed live) if [ -e /dev/.initramfs/live/${live_dir}/squashfs.img ]; then - SQUASHED="/dev/.initramfs/live/${live_dir}/squashfs.img" + SQUASHED="/dev/.initramfs/live/${live_dir}/squashfs.img" fi if [ -e "$SQUASHED" ] ; then diff --git a/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh b/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh index fa771f84..f4c25f7f 100755 --- a/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh +++ b/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh @@ -1,7 +1,9 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [ "${root%%:*}" = "liveiso" ]; then { - printf 'KERNEL=="loop0", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \ - ${root#liveiso:} + printf 'KERNEL=="loop0", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \ + ${root#liveiso:} } >> /etc/udev/rules.d/99-liveiso-mount.rules echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh fi diff --git a/modules.d/90dmsquash-live/install b/modules.d/90dmsquash-live/install index daa4c45f..ddbc90cd 100755 --- a/modules.d/90dmsquash-live/install +++ b/modules.d/90dmsquash-live/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh dracut_install umount inst dmsetup inst blkid diff --git a/modules.d/90dmsquash-live/parse-dmsquash-live.sh b/modules.d/90dmsquash-live/parse-dmsquash-live.sh index 24b854e7..dfab959f 100755 --- a/modules.d/90dmsquash-live/parse-dmsquash-live.sh +++ b/modules.d/90dmsquash-live/parse-dmsquash-live.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # live images are specified with # root=live:backingdev @@ -16,24 +18,24 @@ fi [ "${liveroot%%:*}" = "live" ] || return case "$liveroot" in - live:LABEL=*|LABEL=*) - root="${root#live:}" - root="$(echo $root | sed 's,/,\\x2f,g')" - root="live:/dev/disk/by-label/${root#LABEL=}" + live:LABEL=*|LABEL=*) \ + root="${root#live:}" + root="$(echo $root | sed 's,/,\\x2f,g')" + root="live:/dev/disk/by-label/${root#LABEL=}" rootok=1 ;; - live:CDLABEL=*|CDLABEL=*) - root="${root#live:}" - root="$(echo $root | sed 's,/,\\x2f,g')" - root="live:/dev/disk/by-label/${root#CDLABEL=}" + live:CDLABEL=*|CDLABEL=*) \ + root="${root#live:}" + root="$(echo $root | sed 's,/,\\x2f,g')" + root="live:/dev/disk/by-label/${root#CDLABEL=}" rootok=1 ;; - live:UUID=*|UUID=*) - root="${root#live:}" - root="live:/dev/disk/by-uuid/${root#UUID=}" + live:UUID=*|UUID=*) \ + root="${root#live:}" + root="live:/dev/disk/by-uuid/${root#UUID=}" rootok=1 ;; live:/*.[Ii][Ss][Oo]|/*.[Ii][Ss][Oo]) - root="${root#live:}" - root="liveiso:${root}" - rootok=1 ;; + root="${root#live:}" + root="liveiso:${root}" + rootok=1 ;; live:/dev/*) rootok=1 ;; esac diff --git a/modules.d/90kernel-modules/install b/modules.d/90kernel-modules/install index 2f19d0c2..9810d121 100755 --- a/modules.d/90kernel-modules/install +++ b/modules.d/90kernel-modules/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf dracut_install $(find /etc/modprobe.d/ -type f -name '*.conf') inst_hook cmdline 01 "$moddir/parse-kernel.sh" diff --git a/modules.d/90kernel-modules/installkernel b/modules.d/90kernel-modules/installkernel index e679b101..5b3b4f2d 100755 --- a/modules.d/90kernel-modules/installkernel +++ b/modules.d/90kernel-modules/installkernel @@ -1,9 +1,11 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [[ -z $drivers ]]; then block_module_test() { - local blockfuncs='ahci_init_controller|ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device' + local blockfuncs='ahci_init_controller|ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device' - egrep -q "$blockfuncs" "$1" + egrep -q "$blockfuncs" "$1" } hostonly='' instmods sr_mod sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc hostonly='' instmods pcmcia firewire-ohci @@ -16,19 +18,19 @@ if [[ -z $drivers ]]; then instmods $(filter_kernel_modules block_module_test) # if not on hostonly mode, install all known filesystems if the required list is not set via the filesystems variable if ! [[ $hostonly ]]; then - if [[ -z $filesystems ]]; then - instmods '=fs' - # hardcoded list of exceptions - # to save a lot of space - rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2 - else - instmods $filesystems - fi + if [[ -z $filesystems ]]; then + instmods '=fs' + # hardcoded list of exceptions + # to save a lot of space + rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2 + else + instmods $filesystems + fi else - hostonly='' instmods $(get_fs_type "/dev/block/$(find_root_block_device)") + hostonly='' instmods $(get_fs_type "/dev/block/$(find_root_block_device)") fi else - hostonly='' instmods $drivers $filesystems + hostonly='' instmods $drivers $filesystems fi [[ $add_drivers ]] && hostonly='' instmods $add_drivers diff --git a/modules.d/90kernel-modules/parse-kernel.sh b/modules.d/90kernel-modules/parse-kernel.sh index 6278daca..7b2503dc 100755 --- a/modules.d/90kernel-modules/parse-kernel.sh +++ b/modules.d/90kernel-modules/parse-kernel.sh @@ -1,5 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh for p in $(getargs rdloaddriver=); do - modprobe $p + modprobe $p done diff --git a/modules.d/90lvm/check b/modules.d/90lvm/check index 26f39cb5..c2110642 100755 --- a/modules.d/90lvm/check +++ b/modules.d/90lvm/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # We depend on dm_mod being loaded [ "$1" = "-d" ] && echo dm @@ -14,12 +16,12 @@ is_lvm() { [[ $(get_fs_type /dev/block/$1) = LVM2_member ]]; } [[ $1 = '-h' ]] && { rootdev=$(find_root_block_device) if [[ $rootdev ]]; then - # root lives on a block device, so we can be more precise about - # hostonly checking - check_block_and_slaves is_lvm "$rootdev" || exit 1 + # root lives on a block device, so we can be more precise about + # hostonly checking + check_block_and_slaves is_lvm "$rootdev" || exit 1 else - # root is not on a block device, use the shotgun approach - blkid | grep -q LVM2_member || exit 1 + # root is not on a block device, use the shotgun approach + blkid | grep -q LVM2_member || exit 1 fi } diff --git a/modules.d/90lvm/install b/modules.d/90lvm/install index 71fd3860..8c409906 100755 --- a/modules.d/90lvm/install +++ b/modules.d/90lvm/install @@ -1,14 +1,16 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst lvm inst_rules "$moddir/64-lvm.rules" if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then if [ -f /etc/lvm/lvm.conf ]; then - inst /etc/lvm/lvm.conf - # FIXME: near-term hack to establish read-only locking; - # use command-line lvm.conf editor once it is available - sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf + inst /etc/lvm/lvm.conf + # FIXME: near-term hack to establish read-only locking; + # use command-line lvm.conf editor once it is available + sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf fi fi diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh index 784329ea..0a8a6e3a 100755 --- a/modules.d/90lvm/lvm_scan.sh +++ b/modules.d/90lvm/lvm_scan.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # run lvm scan if udev has settled @@ -11,24 +13,24 @@ LVS=$(getargs rd_LVM_LV=) # build a list of devices to scan lvmdevs=$( for f in /tmp/.lvm_scan-*; do - [ -e "$f" ] || continue - echo -n "${f##/tmp/.lvm_scan-} " + [ -e "$f" ] || continue + echo -n "${f##/tmp/.lvm_scan-} " done ) if [ ! -e /etc/lvm/lvm.conf ]; then { - echo 'devices {'; - echo -n ' filter = [ ' - for dev in $lvmdevs; do - printf '"a|^/dev/%s$|", ' $dev; - done; - echo '"r/.*/" ]'; - echo '}'; - # establish read-only locking - echo 'global {'; - echo ' locking_type = 4'; - echo '}'; + echo 'devices {'; + echo -n ' filter = [ ' + for dev in $lvmdevs; do + printf '"a|^/dev/%s$|", ' $dev; + done; + echo '"r/.*/" ]'; + echo '}'; + # establish read-only locking + echo 'global {'; + echo ' locking_type = 4'; + echo '}'; } > /etc/lvm/lvm.conf lvmwritten=1 fi @@ -50,28 +52,28 @@ nopoll=$( # hopefully this output format will never change, e.g.: # LVM version: 2.02.53(1) (2009-09-25) lvm version 2>/dev/null | \ - ( - IFS=. read maj min sub; - maj=${maj##*:}; - sub=${sub%% *}; sub=${sub%%\(*}; - check_lvm_ver $maj $min $sub && \ - echo " --poll n ") 2>/dev/null ) + ( + IFS=. read maj min sub; + maj=${maj##*:}; + sub=${sub%% *}; sub=${sub%%\(*}; + check_lvm_ver $maj $min $sub && \ + echo " --poll n ") 2>/dev/null ) -if [ -n "$LVS" ] ; then - info "Scanning devices $lvmdevs for LVM logical volumes $LVS" - lvm lvscan --ignorelockingfailure 2>&1 | vinfo - lvm lvchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo -fi + if [ -n "$LVS" ] ; then + info "Scanning devices $lvmdevs for LVM logical volumes $LVS" + lvm lvscan --ignorelockingfailure 2>&1 | vinfo + lvm lvchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo + fi -if [ -z "$LVS" -o -n "$VGS" ]; then - info "Scanning devices $lvmdevs for LVM volume groups $VGS" - lvm vgscan --ignorelockingfailure 2>&1 | vinfo - lvm vgchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $VGS 2>&1 | vinfo -fi + if [ -z "$LVS" -o -n "$VGS" ]; then + info "Scanning devices $lvmdevs for LVM volume groups $VGS" + lvm vgscan --ignorelockingfailure 2>&1 | vinfo + lvm vgchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $VGS 2>&1 | vinfo + fi -if [ "$lvmwritten" ]; then - rm -f /etc/lvm/lvm.conf - ln -s /sbin/lvm-cleanup /pre-pivot/30-lvm-cleanup.sh 2>/dev/null - ln -s /sbin/lvm-cleanup /pre-pivot/31-lvm-cleanup.sh 2>/dev/null -fi -unset lvmwritten + if [ "$lvmwritten" ]; then + rm -f /etc/lvm/lvm.conf + ln -s /sbin/lvm-cleanup /pre-pivot/30-lvm-cleanup.sh 2>/dev/null + ln -s /sbin/lvm-cleanup /pre-pivot/31-lvm-cleanup.sh 2>/dev/null + fi + unset lvmwritten diff --git a/modules.d/90lvm/parse-lvm.sh b/modules.d/90lvm/parse-lvm.sh index 5e93d3ef..e85d43e4 100755 --- a/modules.d/90lvm/parse-lvm.sh +++ b/modules.d/90lvm/parse-lvm.sh @@ -1,3 +1,5 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [ -e /etc/lvm/lvm.conf ] && getarg rd_NO_LVMCONF; then rm -f /etc/lvm/lvm.conf fi diff --git a/modules.d/90mdraid/check b/modules.d/90mdraid/check index 77aa1f59..6996d844 100755 --- a/modules.d/90mdraid/check +++ b/modules.d/90mdraid/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # No mdadm? No mdraid support. type -P mdadm >/dev/null || exit 1 @@ -11,12 +13,12 @@ is_mdraid() { [[ -d "/sys/dev/block/$1/md" ]]; } [[ $1 = '-h' ]] && { rootdev=$(find_root_block_device) if [[ $rootdev ]]; then - # root lives on a block device, so we can be more precise about - # hostonly checking - check_block_and_slaves is_mdraid "$rootdev" || exit 1 + # root lives on a block device, so we can be more precise about + # hostonly checking + check_block_and_slaves is_mdraid "$rootdev" || exit 1 else - # root is not on a block device, use the shotgun approach - blkid | egrep -q '(linux|isw)_raid' || exit 1 + # root is not on a block device, use the shotgun approach + blkid | egrep -q '(linux|isw)_raid' || exit 1 fi } diff --git a/modules.d/90mdraid/install b/modules.d/90mdraid/install index 6045aaf9..80abda38 100755 --- a/modules.d/90mdraid/install +++ b/modules.d/90mdraid/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh dracut_install mdadm partx diff --git a/modules.d/90mdraid/installkernel b/modules.d/90mdraid/installkernel index d26bafac..679ac8e0 100755 --- a/modules.d/90mdraid/installkernel +++ b/modules.d/90mdraid/installkernel @@ -1,3 +1,5 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods =drivers/md diff --git a/modules.d/90mdraid/md-noimsm.sh b/modules.d/90mdraid/md-noimsm.sh index a08f676b..299c9010 100755 --- a/modules.d/90mdraid/md-noimsm.sh +++ b/modules.d/90mdraid/md-noimsm.sh @@ -1,2 +1,4 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh info "rd_NO_MDIMSM: no MD RAID for imsm/isw raids" udevproperty rd_NO_MDIMSM=1
\ No newline at end of file diff --git a/modules.d/90mdraid/md_finished.sh b/modules.d/90mdraid/md_finished.sh index 0958251a..784a2272 100755 --- a/modules.d/90mdraid/md_finished.sh +++ b/modules.d/90mdraid/md_finished.sh @@ -1,3 +1,5 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh for f in /initqueue-settled/mdcontainer_start* /initqueue-settled/mdraid_start* /initqueue-settled/mdadm_auto*; do [ -e $f ] && return 1 done diff --git a/modules.d/90mdraid/mdadm_auto.sh b/modules.d/90mdraid/mdadm_auto.sh index a971a5a1..ee189b72 100755 --- a/modules.d/90mdraid/mdadm_auto.sh +++ b/modules.d/90mdraid/mdadm_auto.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh . /lib/dracut-lib.sh info "Autoassembling MD Raid" diff --git a/modules.d/90mdraid/mdcontainer_start.sh b/modules.d/90mdraid/mdcontainer_start.sh index 46340a2f..4d8229e8 100755 --- a/modules.d/90mdraid/mdcontainer_start.sh +++ b/modules.d/90mdraid/mdcontainer_start.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh . /lib/dracut-lib.sh md=$1 diff --git a/modules.d/90mdraid/mdmon-pre-udev.sh b/modules.d/90mdraid/mdmon-pre-udev.sh index 3fc7eb77..a683022d 100755 --- a/modules.d/90mdraid/mdmon-pre-udev.sh +++ b/modules.d/90mdraid/mdmon-pre-udev.sh @@ -1,3 +1,5 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # save state dir for mdmon/mdadm for the real root mkdir /dev/.mdadm [ -e /var/run/mdadm ] && rm -fr /var/run/mdadm diff --git a/modules.d/90mdraid/mdraid-cleanup.sh b/modules.d/90mdraid/mdraid-cleanup.sh index f4b7810e..ea9e1792 100755 --- a/modules.d/90mdraid/mdraid-cleanup.sh +++ b/modules.d/90mdraid/mdraid-cleanup.sh @@ -1,16 +1,19 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # stop everything which is not busy for i in /dev/md* /dev/md/*; do [ -b $i ] || continue mddetail=$(udevadm info --query=property --name=$i) case "$mddetail" in - *MD_LEVEL=container*) - ;; - *DEVTYPE=partition*) - ;; - *) - mdadm --stop $i >/dev/null 2>&1 - ;; + *MD_LEVEL=container*) + ;; + *DEVTYPE=partition*) + ;; + *) + mdadm --stop $i >/dev/null 2>&1 + ;; esac done diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh index b7cca55d..2f335127 100755 --- a/modules.d/90mdraid/mdraid_start.sh +++ b/modules.d/90mdraid/mdraid_start.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh . /lib/dracut-lib.sh # run mdadm if udev has settled @@ -10,12 +12,12 @@ mdadm -Is --run 2>&1 | vinfo # there could still be some leftover devices # which have had a container added for md in /dev/md[0-9]* /dev/md/*; do - [ -b "$md" ] || continue - udevinfo="$(udevadm info --query=env --name=$md)" - strstr "$udevinfo" "MD_UUID=" && continue - strstr "$udevinfo" "MD_LEVEL=container" && continue - strstr "$udevinfo" "DEVTYPE=partition" && continue - mdadm --run "$md" 2>&1 | vinfo + [ -b "$md" ] || continue + udevinfo="$(udevadm info --query=env --name=$md)" + strstr "$udevinfo" "MD_UUID=" && continue + strstr "$udevinfo" "MD_LEVEL=container" && continue + strstr "$udevinfo" "DEVTYPE=partition" && continue + mdadm --run "$md" 2>&1 | vinfo done unset udevinfo diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh index 5d03d5c2..7f98d034 100755 --- a/modules.d/90mdraid/parse-md.sh +++ b/modules.d/90mdraid/parse-md.sh @@ -1,3 +1,5 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if getarg rd_NO_MD; then info "rd_NO_MD: removing MD RAID activation" udevproperty rd_NO_MD=1 @@ -6,21 +8,21 @@ else # rewrite the md rules to only process the specified raid array if [ -n "$MD_UUID" ]; then - for f in /etc/udev/rules.d/65-md-incremental*.rules; do - [ -e "$f" ] || continue - mv $f ${f}.bak - while read line; do - if [ "${line%%UUID CHECK}" != "$line" ]; then - for uuid in $MD_UUID; do - printf 'ENV{MD_UUID}=="%s", GOTO="do_md_inc"\n' $uuid - done; - printf 'GOTO="md_inc_end"\n'; - else - echo $line; - fi - done < ${f}.bak > $f - rm ${f}.bak - done + for f in /etc/udev/rules.d/65-md-incremental*.rules; do + [ -e "$f" ] || continue + mv $f ${f}.bak + while read line; do + if [ "${line%%UUID CHECK}" != "$line" ]; then + for uuid in $MD_UUID; do + printf 'ENV{MD_UUID}=="%s", GOTO="do_md_inc"\n' $uuid + done; + printf 'GOTO="md_inc_end"\n'; + else + echo $line; + fi + done < ${f}.bak > $f + rm ${f}.bak + done fi fi @@ -31,7 +33,7 @@ if [ -e /etc/mdadm.conf ] && ! getarg rd_NO_MDADMCONF; then fi if getarg rd_NO_MDADMCONF; then - rm -f /etc/mdadm/mdadm.conf /etc/mdadm.conf + rm -f /etc/mdadm/mdadm.conf /etc/mdadm.conf fi # noiswmd nodmraid for anaconda / rc.sysinit compatibility diff --git a/modules.d/90multipath/check b/modules.d/90multipath/check index 511c5d59..39d1fd29 100755 --- a/modules.d/90multipath/check +++ b/modules.d/90multipath/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # if there's no multipath binary, no go. type -P multipath >/dev/null || exit 1 diff --git a/modules.d/90multipath/install b/modules.d/90multipath/install index d42e4115..a48d6c6e 100755 --- a/modules.d/90multipath/install +++ b/modules.d/90multipath/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh for f in \ /sbin/dmsetup \ diff --git a/modules.d/90multipath/installkernel b/modules.d/90multipath/installkernel index c2f4ec0d..dbbbd272 100755 --- a/modules.d/90multipath/installkernel +++ b/modules.d/90multipath/installkernel @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh mp_mod_test() { local mpfuncs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target' diff --git a/modules.d/90multipath/multipathd-stop.sh b/modules.d/90multipath/multipathd-stop.sh index 9244aa31..e6a0c086 100755 --- a/modules.d/90multipath/multipathd-stop.sh +++ b/modules.d/90multipath/multipathd-stop.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [ -e /etc/multipath.conf ]; then HARD="" diff --git a/modules.d/90multipath/multipathd.sh b/modules.d/90multipath/multipathd.sh index c9a2b3f2..72ca2ef3 100755 --- a/modules.d/90multipath/multipathd.sh +++ b/modules.d/90multipath/multipathd.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [ -e /etc/multipath.conf -a -e /etc/multipath/wwids ]; then modprobe dm-multipath diff --git a/modules.d/95dasd/check b/modules.d/95dasd/check index 72ad8466..d9b6117f 100755 --- a/modules.d/95dasd/check +++ b/modules.d/95dasd/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh arch=$(uname -m) [ "$arch" = "s390" -o "$arch" = "s390x" ] || exit 1 diff --git a/modules.d/95dasd/install b/modules.d/95dasd/install index f73cc556..54503dbc 100755 --- a/modules.d/95dasd/install +++ b/modules.d/95dasd/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst_hook cmdline 30 "$moddir/parse-dasd.sh" dracut_install tr dasdinfo dasdconf.sh if [[ $hostonly ]]; then diff --git a/modules.d/95dasd/installkernel b/modules.d/95dasd/installkernel index 1f8b3721..450f06e0 100755 --- a/modules.d/95dasd/installkernel +++ b/modules.d/95dasd/installkernel @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods dasd_mod dasd_eckd_mod dasd_fba_mod dasd_diag_mod diff --git a/modules.d/95dasd/parse-dasd.sh b/modules.d/95dasd/parse-dasd.sh index 47bcfe4c..edf0eb47 100755 --- a/modules.d/95dasd/parse-dasd.sh +++ b/modules.d/95dasd/parse-dasd.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh for dasd_arg in $(getargs 'rd_DASD='); do ( IFS="," diff --git a/modules.d/95dasd_mod/check b/modules.d/95dasd_mod/check index a26196cf..dcd24216 100755 --- a/modules.d/95dasd_mod/check +++ b/modules.d/95dasd_mod/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh arch=$(uname -m) [ "$arch" = "s390" -o "$arch" = "s390x" ] || exit 1 diff --git a/modules.d/95dasd_mod/install b/modules.d/95dasd_mod/install index 7e66db7d..3a74a7a7 100755 --- a/modules.d/95dasd_mod/install +++ b/modules.d/95dasd_mod/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst_hook cmdline 31 "$moddir/parse-dasd-mod.sh" dracut_install dasd_cio_free grep sed seq diff --git a/modules.d/95dasd_mod/installkernel b/modules.d/95dasd_mod/installkernel index c83c1943..f8ba37a2 100755 --- a/modules.d/95dasd_mod/installkernel +++ b/modules.d/95dasd_mod/installkernel @@ -1,5 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods dasd_mod dasd_eckd_mod dasd_fba_mod dasd_diag_mod - + diff --git a/modules.d/95dasd_mod/parse-dasd-mod.sh b/modules.d/95dasd_mod/parse-dasd-mod.sh index 80ceb2f8..38a9275c 100755 --- a/modules.d/95dasd_mod/parse-dasd-mod.sh +++ b/modules.d/95dasd_mod/parse-dasd-mod.sh @@ -1,9 +1,11 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh [ -d /etc/modprobe.d ] || mkdir /etc/modprobe.d dasd_arg=$(getarg rd_DASD_MOD=) if [ -n "$dasd_arg" ]; then - echo "options dasd_mod dasd=$dasd_arg" >> /etc/modprobe.d/dasd_mod.conf + echo "options dasd_mod dasd=$dasd_arg" >> /etc/modprobe.d/dasd_mod.conf fi unset dasd_arg diff --git a/modules.d/95debug/check b/modules.d/95debug/check index da9bfd79..d61ec696 100755 --- a/modules.d/95debug/check +++ b/modules.d/95debug/check @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # do not add this module by default exit 1 diff --git a/modules.d/95debug/install b/modules.d/95debug/install index 46a47908..9ca32ea1 100755 --- a/modules.d/95debug/install +++ b/modules.d/95debug/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh dracut_install -o ps grep more cat rm strace free showmount dracut_install -o ping netstat rpcinfo vi scp ping6 ssh dracut_install -o fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat diff --git a/modules.d/95fcoe/check b/modules.d/95fcoe/check index 50405a8b..e3bd344a 100755 --- a/modules.d/95fcoe/check +++ b/modules.d/95fcoe/check @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # We depend on network modules being loaded [ "$1" = "-d" ] && echo network diff --git a/modules.d/95fcoe/fcoe-genrules.sh b/modules.d/95fcoe/fcoe-genrules.sh index 5750bd1c..d87f72c5 100755 --- a/modules.d/95fcoe/fcoe-genrules.sh +++ b/modules.d/95fcoe/fcoe-genrules.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # We use (fcoe_interface or fcoe_mac) and fcoe_dcb as set by parse-fcoe.sh # If neither mac nor interface are set we don't continue @@ -7,8 +9,8 @@ # Write udev rules { if [ -n "$fcoe_mac" ] ; then - printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_mac" "$fcoe_dcb" + printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_mac" "$fcoe_dcb" else - 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" + 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" fi } > /etc/udev/rules.d/60-fcoe.rules diff --git a/modules.d/95fcoe/fcoe-up b/modules.d/95fcoe/fcoe-up index 7a89e3ee..46075073 100755 --- a/modules.d/95fcoe/fcoe-up +++ b/modules.d/95fcoe/fcoe-up @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # We get called like this: # /sbin/fcoe-up <network-device> <dcb|nodcb> diff --git a/modules.d/95fcoe/install b/modules.d/95fcoe/install index db08a342..9621fc98 100755 --- a/modules.d/95fcoe/install +++ b/modules.d/95fcoe/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh dracut_install ip inst dcbtool diff --git a/modules.d/95fcoe/installkernel b/modules.d/95fcoe/installkernel index 5ce7ca88..4f1aec6f 100755 --- a/modules.d/95fcoe/installkernel +++ b/modules.d/95fcoe/installkernel @@ -1,2 +1,4 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods fcoe 8021q diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh index 26a5a1a2..492cca00 100755 --- a/modules.d/95fcoe/parse-fcoe.sh +++ b/modules.d/95fcoe/parse-fcoe.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # Supported formats: # fcoe=<networkdevice>:<dcb|nodcb> diff --git a/modules.d/95iscsi/check b/modules.d/95iscsi/check index 55cb53ba..f9433592 100755 --- a/modules.d/95iscsi/check +++ b/modules.d/95iscsi/check @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # We depend on network modules being loaded [ "$1" = "-d" ] && echo network @@ -16,20 +19,20 @@ is_iscsi() ( [[ -L /sys/dev/block/$1 ]] || return cd "$(readlink -f /sys/dev/block/$1)" until [[ -d sys || -d iscsi_session ]]; do - cd .. + cd .. done [[ -d iscsi_session ]] ) case $1 in -h) rootdev=$(find_root_block_device) - if [[ $rootdev ]]; then - # root lives on a block device, so we can be more precise about - # hostonly checking - check_block_and_slaves is_iscsi "$rootdev" || exit 1 - else - exit 1 - fi ;; + if [[ $rootdev ]]; then + # root lives on a block device, so we can be more precise about + # hostonly checking + check_block_and_slaves is_iscsi "$rootdev" || exit 1 + else + exit 1 + fi ;; esac exit 0 diff --git a/modules.d/95iscsi/install b/modules.d/95iscsi/install index 6386410b..a0db7c55 100755 --- a/modules.d/95iscsi/install +++ b/modules.d/95iscsi/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh dracut_install umount inst iscsistart inst hostname diff --git a/modules.d/95iscsi/installkernel b/modules.d/95iscsi/installkernel index ae0b6e04..80dd6390 100755 --- a/modules.d/95iscsi/installkernel +++ b/modules.d/95iscsi/installkernel @@ -1,2 +1,4 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods iscsi_tcp crc32c iscsi_ibft diff --git a/modules.d/95iscsi/iscsiroot b/modules.d/95iscsi/iscsiroot index 23e26a61..ebad9c8d 100755 --- a/modules.d/95iscsi/iscsiroot +++ b/modules.d/95iscsi/iscsiroot @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # This implementation is incomplete: Discovery mode is not implemented and # the argument handling doesn't follow currently agreed formats. This is mainly @@ -41,7 +43,7 @@ modprobe crc32c 2>/dev/null if getarg iscsi_firmware ; then if [ -n "${root%%block:*}" ]; then # if root is not specified try to mount the whole iSCSI LUN - printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules + printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules fi iscsistart -b exit 0 @@ -76,20 +78,20 @@ handle_netroot() IFS=@ set $iroot if [ $# -gt 1 ]; then - authinfo=$1; shift - iroot=$* + authinfo=$1; shift + iroot=$* # allow empty authinfo to allow having an @ in iscsi_target_name like this: # netroot=iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk - if [ -n "$authinfo" ]; then + if [ -n "$authinfo" ]; then IFS=: set $authinfo iscsi_username=$1 iscsi_password=$2 if [ $# -gt 2 ]; then - iscsi_in_username=$3 - iscsi_in_password=$4 + iscsi_in_username=$3 + iscsi_in_password=$4 fi - fi + fi fi IFS="$OLDIFS" @@ -98,16 +100,16 @@ handle_netroot() local i set -- while [ -n "$v" ]; do - if [ "${v#\[*:*:*\]:}" != "$v" ]; then - # handle IPv6 address - i="${v%%\]:*}" - i="${i##\[}" - set -- "$@" "$i" - v=${v#\[$i\]:} - else - set -- "$@" "${v%%:*}" - v=${v#*:} - fi + if [ "${v#\[*:*:*\]:}" != "$v" ]; then + # handle IPv6 address + i="${v%%\]:*}" + i="${i##\[}" + set -- "$@" "$i" + v=${v#\[$i\]:} + else + set -- "$@" "${v%%:*}" + v=${v#*:} + fi done iscsi_target_ip=$1; shift iscsi_protocol=$1; shift # ignored @@ -123,9 +125,9 @@ handle_netroot() if [ -z $iscsi_initiator ]; then # XXX Where are these from? - [ -f /etc/initiatorname.iscsi ] && . /etc/initiatorname.iscsi - [ -f /etc/iscsi/initiatorname.iscsi ] && . /etc/iscsi/initiatorname.iscsi - iscsi_initiator=$InitiatorName + [ -f /etc/initiatorname.iscsi ] && . /etc/initiatorname.iscsi + [ -f /etc/iscsi/initiatorname.iscsi ] && . /etc/iscsi/initiatorname.iscsi + iscsi_initiator=$InitiatorName # XXX rfc3720 says 'SCSI Initiator Name: The iSCSI Initiator Name specifies # the worldwide unique name of the initiator.' Could we use hostname/ip @@ -133,20 +135,20 @@ handle_netroot() fi if [ -z $iscsi_target_port ]; then - iscsi_target_port=3260 + iscsi_target_port=3260 fi if [ -z $iscsi_target_group ]; then - iscsi_target_group=1 + iscsi_target_group=1 fi if [ -z $iscsi_initiator ]; then # XXX is this correct? - iscsi_initiator=$(iscsi-iname) + iscsi_initiator=$(iscsi-iname) fi if [ -z $iscsi_lun ]; then - iscsi_lun=0 + iscsi_lun=0 fi echo "InitiatorName='$iscsi_initiator'" > /dev/.initiatorname.iscsi @@ -155,7 +157,7 @@ handle_netroot() if [ -n "${root%%block:*}" ]; then # if root is not specified try to mount the whole iSCSI LUN - printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules + printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules fi # inject new exit_if_exists @@ -164,18 +166,18 @@ handle_netroot() # force udevsettle to break > /initqueue/work - iscsistart -i $iscsi_initiator -t $iscsi_target_name \ - -g $iscsi_target_group -a $iscsi_target_ip \ - -p $iscsi_target_port \ - ${iscsi_username+-u $iscsi_username} \ - ${iscsi_password+-w $iscsi_password} \ - ${iscsi_in_username+-U $iscsi_in_username} \ - ${iscsi_in_password+-W $iscsi_in_password} || : + iscsistart -i $iscsi_initiator -t $iscsi_target_name \ + -g $iscsi_target_group -a $iscsi_target_ip \ + -p $iscsi_target_port \ + ${iscsi_username+-u $iscsi_username} \ + ${iscsi_password+-w $iscsi_password} \ + ${iscsi_in_username+-U $iscsi_in_username} \ + ${iscsi_in_password+-W $iscsi_in_password} || : # install mount script if [ -n "${root%%block:*}" ]; then # if root is not specified try to mount the whole iSCSI LUN - echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > /mount/01-$$-iscsi.sh + echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > /mount/01-$$-iscsi.sh fi } @@ -183,7 +185,7 @@ handle_netroot() if getarg netroot; then for nroot in $(getargs netroot); do [ "${netroot%%:*}" = "iscsi" ] || continue - handle_netroot ${nroot##iscsi:} + handle_netroot ${nroot##iscsi:} done else handle_netroot $iroot diff --git a/modules.d/95iscsi/mount-lun.sh b/modules.d/95iscsi/mount-lun.sh index d0b64587..0eadfd26 100755 --- a/modules.d/95iscsi/mount-lun.sh +++ b/modules.d/95iscsi/mount-lun.sh @@ -1,15 +1,17 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh if [ -z $iscsi_lun ]; then iscsi_lun=0 fi NEWROOT=${NEWROOT:-"/sysroot"} for disk in /dev/disk/by-path/*-iscsi-*-$iscsi_lun; do - if mount -t ${fstype:-auto} -o "$rflags" $disk $NEWROOT; then - if [ ! -d /sysroot/proc ]; then - umount $disk - continue - fi - break - fi + if mount -t ${fstype:-auto} -o "$rflags" $disk $NEWROOT; then + if [ ! -d /sysroot/proc ]; then + umount $disk + continue + fi + break + fi done diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh index 7b82b10f..644fee2c 100755 --- a/modules.d/95iscsi/parse-iscsiroot.sh +++ b/modules.d/95iscsi/parse-iscsiroot.sh @@ -1,12 +1,14 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # Preferred format: -# root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> -# [root=*] netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> +# root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> +# [root=*] netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> # # Legacy formats: -# [net]root=[iscsi] iscsiroot=[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> -# [net]root=[iscsi] iscsi_firmware +# [net]root=[iscsi] iscsiroot=[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> +# [net]root=[iscsi] iscsi_firmware # # root= takes precedence over netroot= if root=iscsi[...] # @@ -25,7 +27,7 @@ # Root takes precedence over netroot if [ "${root%%:*}" = "iscsi" ] ; then if [ -n "$netroot" ] ; then - echo "Warning: root takes precedence over netroot. Ignoring netroot" + echo "Warning: root takes precedence over netroot. Ignoring netroot" fi netroot=$root @@ -44,7 +46,7 @@ if [ -n "$iscsiroot" ] ; then # Accept iscsiroot argument? [ -z "$netroot" ] || [ "$netroot" = "iscsi" ] || \ - die "Argument iscsiroot only accepted for empty root= or [net]root=iscsi" + die "Argument iscsiroot only accepted for empty root= or [net]root=iscsi" # Override root with iscsiroot content? [ -z "$netroot" ] || [ "$netroot" = "iscsi" ] && netroot=iscsi:$iscsiroot @@ -62,7 +64,7 @@ fi # Check required arguments. there's only one, but it's at the end if [ -z "$iscsi_firmware" ] ; then case "${netroot##iscsi:*:*:*:*:}" in - $netroot|'') die "Argument targetname for iscsiroot is missing";; + $netroot|'') die "Argument targetname for iscsiroot is missing";; esac fi diff --git a/modules.d/95nbd/check b/modules.d/95nbd/check index aa69a411..adbeb7a2 100755 --- a/modules.d/95nbd/check +++ b/modules.d/95nbd/check @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # We depend on network modules being loaded [ "$1" = "-d" ] && echo network diff --git a/modules.d/95nbd/install b/modules.d/95nbd/install index b4673fcb..1fcd952f 100755 --- a/modules.d/95nbd/install +++ b/modules.d/95nbd/install @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh inst nbd-client inst_hook cmdline 90 "$moddir/parse-nbdroot.sh" diff --git a/modules.d/95nbd/installkernel b/modules.d/95nbd/installkernel index c8eea5ec..38d413d3 100755 --- a/modules.d/95nbd/installkernel +++ b/modules.d/95nbd/installkernel @@ -1,2 +1,4 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods nbd diff --git a/modules.d/95nbd/nbdroot b/modules.d/95nbd/nbdroot index 51a1a946..995ca393 100755 --- a/modules.d/95nbd/nbdroot +++ b/modules.d/95nbd/nbdroot @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh . /lib/dracut-lib.sh @@ -94,11 +96,11 @@ nbd-client $preopts "$nbdserver" "$nbdport" /dev/nbd0 $opts || exit 1 # add the udev rules for mounting the nbd0 device if [ ! -e /etc/udev/rules.d/99-mount.rules ]; then echo '[ -e /dev/root ] || { info=$(udevadm info --query=env --name=/dev/nbd0); [ -z "${info%%*ID_FS_TYPE*}" ] && { ln -s /dev/nbd0 /dev/root 2>/dev/null; :; };} && rm $job;' \ - > /initqueue-settled/nbd.sh + > /initqueue-settled/nbd.sh printf '/bin/mount -t %s -o %s %s %s\n' \ - "$nbdfstype" "$fsopts" /dev/nbd0 "$NEWROOT" \ - > /mount/01-$$-nbd.sh + "$nbdfstype" "$fsopts" /dev/nbd0 "$NEWROOT" \ + > /mount/01-$$-nbd.sh fi # NBD doesn't emit uevents when it gets connected, so kick it diff --git a/modules.d/95nbd/parse-nbdroot.sh b/modules.d/95nbd/parse-nbdroot.sh index 000ac6ed..4edcf17a 100755 --- a/modules.d/95nbd/parse-nbdroot.sh +++ b/modules.d/95nbd/parse-nbdroot.sh @@ -1,8 +1,10 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # Preferred format: -# root=nbd:srv:port[:fstype[:rootflags[:nbdopts]]] -# [root=*] netroot=nbd:srv:port[:fstype[:rootflags[:nbdopts]]] +# root=nbd:srv:port[:fstype[:rootflags[:nbdopts]]] +# [root=*] netroot=nbd:srv:port[:fstype[:rootflags[:nbdopts]]] # # nbdopts is a comma seperated list of options to give to nbd-client # @@ -32,7 +34,7 @@ netroot_to_var() { # Root takes precedence over netroot if [ "${root%%:*}" = "nbd" ] ; then if [ -n "$netroot" ] ; then - warn "root takes precedence over netroot. Ignoring netroot" + warn "root takes precedence over netroot. Ignoring netroot" fi netroot=$root diff --git a/modules.d/95nfs/check b/modules.d/95nfs/check index adb53dd8..5eb2d6a0 100755 --- a/modules.d/95nfs/check +++ b/modules.d/95nfs/check @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # We depend on network modules being loaded [ "$1" = "-d" ] && echo network diff --git a/modules.d/95nfs/install b/modules.d/95nfs/install index f0f53cc9..57f55dbf 100755 --- a/modules.d/95nfs/install +++ b/modules.d/95nfs/install @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + type -P portmap >/dev/null && dracut_install portmap type -P rpcbind >/dev/null && dracut_install rpcbind @@ -10,13 +13,13 @@ dracut_install rpc.idmapd /etc/idmapd.conf dracut_install sed for i in {"$libdir","$usrlibdir"}/libnfsidmap_nsswitch.so* \ - {"$libdir","$usrlibdir"}/libnfsidmap/*.so \ - {"$libdir","$usrlibdir"}/libnfsidmap*.so*; do + {"$libdir","$usrlibdir"}/libnfsidmap/*.so \ + {"$libdir","$usrlibdir"}/libnfsidmap*.so*; do [ -e "$i" ] && dracut_install "$i" done nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ - | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') + | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') nsslibs=${nsslibs#|} nsslibs=${nsslibs%|} diff --git a/modules.d/95nfs/installkernel b/modules.d/95nfs/installkernel index fa31aa23..b4f6d99c 100755 --- a/modules.d/95nfs/installkernel +++ b/modules.d/95nfs/installkernel @@ -1,2 +1,5 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + instmods nfs sunrpc ipv6 diff --git a/modules.d/95nfs/nfsroot b/modules.d/95nfs/nfsroot index 6ae4e0be..0a537db8 100755 --- a/modules.d/95nfs/nfsroot +++ b/modules.d/95nfs/nfsroot @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh . /lib/dracut-lib.sh @@ -41,7 +43,7 @@ nfsroot_to_var $root if [ -z "$server" ] ; then # XXX new_dhcp_next_server is unconfirmed this is an assumption for var in $srv $new_dhcp_server_identifier $new_dhcp_next_server $new_root_path '' ; do - [ -n "$var" ] && server=$var && break; + [ -n "$var" ] && server=$var && break; done # XXX This blindly assumes that if new_root_path has to used that @@ -97,8 +99,8 @@ if [ "$nfs" = "nfs4" ]; then # XXX Should we loop here? mount -t nfs4 -o$options${nfslock+,$nfslock} \ - $server:$path $NEWROOT \ - && { [ -e /dev/root ] || >/dev/root ; } + $server:$path $NEWROOT \ + && { [ -e /dev/root ] || >/dev/root ; } else # NFSv{2,3} doesn't support using locks as it requires a helper to transfer # the rpcbind state to the new root @@ -107,8 +109,8 @@ else # XXX Should we loop here? { mount -t nfs -o$options${options:+,}nolock,nfsvers=3 $server:$path $NEWROOT || \ - mount -t nfs -o$options${options:+,}nolock,nfsvers=2 $server:$path $NEWROOT ; } \ - && { [ -e /dev/root ] || >/dev/root ; } + mount -t nfs -o$options${options:+,}nolock,nfsvers=2 $server:$path $NEWROOT ; } \ + && { [ -e /dev/root ] || >/dev/root ; } fi # inject new exit_if_exists diff --git a/modules.d/95nfs/nfsroot-cleanup.sh b/modules.d/95nfs/nfsroot-cleanup.sh index 02a99a67..fbc2876f 100755 --- a/modules.d/95nfs/nfsroot-cleanup.sh +++ b/modules.d/95nfs/nfsroot-cleanup.sh @@ -1,3 +1,6 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + [ -f /tmp/nfs.rpc_pipefs_path ] && rpcpipefspath=`cat /tmp/nfs.rpc_pipefs_path` [ -z "$rpcpipefspath" ] && rpcpipefspath=var/lib/nfs/rpc_pipefs @@ -15,9 +18,9 @@ if incol2 /proc/mounts /var/lib/nfs/rpc_pipefs; then [ -d $NEWROOT/$rpcpipefspath ] || mkdir -p $NEWROOT/$rpcpipefspath 2>/dev/null if [ -d $NEWROOT/$rpcpipefspath ]; then - mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/$rpcpipefspath + mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/$rpcpipefspath else - umount /var/lib/nfs/rpc_pipefs + umount /var/lib/nfs/rpc_pipefs fi fi diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh index 910dd268..06de9fa1 100755 --- a/modules.d/95nfs/parse-nfsroot.sh +++ b/modules.d/95nfs/parse-nfsroot.sh @@ -1,12 +1,14 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # Preferred format: -# root=nfs[4]:[server:]path[:options] +# root=nfs[4]:[server:]path[:options] # # This syntax can come from DHCP root-path as well. # # Legacy format: -# root=/dev/nfs nfsroot=[server:]path[,options] +# root=/dev/nfs nfsroot=[server:]path[,options] # # In Legacy root=/dev/nfs mode, if the 'nfsroot' parameter is not given # on the command line or is empty, the dhcp root-path is used as @@ -14,9 +16,9 @@ # # If server is unspecified it will be pulled from one of the following # sources, in order: -# static ip= option on kernel command line -# DHCP next-server option -# DHCP server-id option +# static ip= option on kernel command line +# DHCP next-server option +# DHCP server-id option # DHCP root-path option # # NFSv4 is only used if explicitly requested with nfs4: prefix, otherwise @@ -49,7 +51,7 @@ if [ -n "$nfsroot" ] ; then # @deprecated warn "Argument nfsroot is deprecated and might be removed in a future release. See http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information." if [ "$(getarg root=)" != "/dev/nfs" ]; then - die "Argument nfsroot only accepted for legacy root=/dev/nfs" + die "Argument nfsroot only accepted for legacy root=/dev/nfs" fi netroot=nfs:$nfsroot; fi @@ -57,9 +59,9 @@ fi case "$netroot" in /dev/nfs) netroot=nfs;; /dev/*) unset netroot; return;; -# LEGACY: root=<server-ip>:/<path + # LEGACY: root=<server-ip>:/<path [0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*) - netroot=nfs:$netroot;; + netroot=nfs:$netroot;; esac # Continue if nfs @@ -72,9 +74,9 @@ esac if nfsdomain=$(getarg rd_NFS_DOMAIN); then if [ -f /etc/idmapd.conf ]; then - sed -i -e \ - "s/^[[:space:]#]*Domain[[:space:]]*=.*/Domain = $nfsdomain/g" \ - /etc/idmapd.conf + sed -i -e \ + "s/^[[:space:]#]*Domain[[:space:]]*=.*/Domain = $nfsdomain/g" \ + /etc/idmapd.conf fi # and even again after the sed, in case it was not yet specified echo "Domain = $nfsdomain" >> /etc/idmapd.conf diff --git a/modules.d/95resume/install b/modules.d/95resume/install index 9200f957..779d0765 100755 --- a/modules.d/95resume/install +++ b/modules.d/95resume/install @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + inst_hook cmdline 10 "$moddir/parse-resume.sh" inst_hook pre-udev 30 "$moddir/resume-genrules.sh" inst_hook mount 10 "$moddir/resume.sh" diff --git a/modules.d/95resume/parse-resume.sh b/modules.d/95resume/parse-resume.sh index 94d71126..2c7661f6 100755 --- a/modules.d/95resume/parse-resume.sh +++ b/modules.d/95resume/parse-resume.sh @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + if resume=$(getarg resume=) && ! getarg noresume; then export resume echo "$resume" >/.resume @@ -7,9 +10,9 @@ else fi case "$resume" in - LABEL=*) - resume="$(echo $resume | sed 's,/,\\x2f,g')" - resume="/dev/disk/by-label/${resume#LABEL=}" ;; - UUID=*) - resume="/dev/disk/by-uuid/${resume#UUID=}" ;; + LABEL=*) \ + resume="$(echo $resume | sed 's,/,\\x2f,g')" + resume="/dev/disk/by-label/${resume#LABEL=}" ;; + UUID=*) \ + resume="/dev/disk/by-uuid/${resume#UUID=}" ;; esac diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh index a2718b3e..fc14f83d 100755 --- a/modules.d/95resume/resume-genrules.sh +++ b/modules.d/95resume/resume-genrules.sh @@ -1,16 +1,19 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + if [ -n "$resume" ]; then { - printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \ - ${resume#/dev/}; - printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \ - ${resume#/dev/}; + printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \ + ${resume#/dev/}; + printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \ + ${resume#/dev/}; } >> /dev/.udev/rules.d/99-resume-link.rules { - printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \ - ${resume#/dev/}; - printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \ - ${resume#/dev/}; + printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \ + ${resume#/dev/}; + printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \ + ${resume#/dev/}; } >> /etc/udev/rules.d/99-resume.rules printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; }\n' \ @@ -20,7 +23,7 @@ if [ -n "$resume" ]; then elif ! getarg noresume; then { - echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \ - " RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\""; + echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \ + " RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\""; } >> /etc/udev/rules.d/99-resume.rules fi diff --git a/modules.d/95resume/resume.sh b/modules.d/95resume/resume.sh index 8bb4114f..ee554148 100755 --- a/modules.d/95resume/resume.sh +++ b/modules.d/95resume/resume.sh @@ -1,8 +1,11 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + [ -s /.resume -a -b "$resume" ] && { # parsing the output of ls is Bad, but until there is a better way... ls -lH "$resume" | ( - read x x x x maj min x; - echo "${maj%,}:$min"> /sys/power/resume) + read x x x x maj min x; + echo "${maj%,}:$min"> /sys/power/resume) >/.resume } diff --git a/modules.d/95rootfs-block/block-genrules.sh b/modules.d/95rootfs-block/block-genrules.sh index caafb650..873385c4 100755 --- a/modules.d/95rootfs-block/block-genrules.sh +++ b/modules.d/95rootfs-block/block-genrules.sh @@ -1,13 +1,16 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + if [ "${root%%:*}" = "block" ]; then { - printf 'KERNEL=="%s", SYMLINK+="root"\n' \ - ${root#block:/dev/} - printf 'SYMLINK=="%s", SYMLINK+="root"\n' \ - ${root#block:/dev/} + printf 'KERNEL=="%s", SYMLINK+="root"\n' \ + ${root#block:/dev/} + printf 'SYMLINK=="%s", SYMLINK+="root"\n' \ + ${root#block:/dev/} } >> /dev/.udev/rules.d/99-root.rules printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \ - "${root#block:}" "${root#block:}" >> /initqueue-settled/blocksymlink.sh + "${root#block:}" "${root#block:}" >> /initqueue-settled/blocksymlink.sh echo '[ -e /dev/root ]' > /initqueue-finished/block.sh fi diff --git a/modules.d/95rootfs-block/install b/modules.d/95rootfs-block/install index 9fdc121a..60b47c59 100755 --- a/modules.d/95rootfs-block/install +++ b/modules.d/95rootfs-block/install @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + dracut_install umount inst_hook cmdline 95 "$moddir/parse-block.sh" inst_hook pre-udev 30 "$moddir/block-genrules.sh" diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh index c6b24dad..c26ad0dd 100755 --- a/modules.d/95rootfs-block/mount-root.sh +++ b/modules.d/95rootfs-block/mount-root.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh . /lib/dracut-lib.sh @@ -13,7 +15,7 @@ filter_rootopts() { while [ $# -gt 0 ]; do case $1 in rw|ro);; - defaults);; + defaults);; *) v="$v,${1}";; esac @@ -28,32 +30,32 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then && ROOTFS_MOUNTED=yes if ! getarg rd_NO_FSTAB \ - && ! getarg rootflags \ - && [ -f "$NEWROOT/etc/fstab" ] \ - && ! [ -L "$NEWROOT/etc/fstab" ]; then + && ! getarg rootflags \ + && [ -f "$NEWROOT/etc/fstab" ] \ + && ! [ -L "$NEWROOT/etc/fstab" ]; then # if $NEWROOT/etc/fstab contains special mount options for # the root filesystem, # remount it with the proper options - rootfs="auto" - rootopts="defaults" - while read dev mp fs opts rest; do + rootfs="auto" + rootopts="defaults" + while read dev mp fs opts rest; do # skip comments [ "${dev%%#*}" != "$dev" ] && continue if [ "$mp" = "/" ]; then - rootfs=$fs - rootopts=$opts - break + rootfs=$fs + rootopts=$opts + break fi - done < "$NEWROOT/etc/fstab" + done < "$NEWROOT/etc/fstab" - rootopts=$(filter_rootopts $rootopts) + rootopts=$(filter_rootopts $rootopts) - if [ -n "$rootopts" ]; then + if [ -n "$rootopts" ]; then umount $NEWROOT info "Remounting ${root#block:} with -o $rootopts,$rflags" mount -t "$rootfs" -o "$rflags","$rootopts" \ "${root#block:}" "$NEWROOT" 2>&1 | vinfo - fi + fi fi fi diff --git a/modules.d/95rootfs-block/parse-block.sh b/modules.d/95rootfs-block/parse-block.sh index 6dac7c16..d1e3c8ce 100755 --- a/modules.d/95rootfs-block/parse-block.sh +++ b/modules.d/95rootfs-block/parse-block.sh @@ -1,14 +1,17 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + case "$root" in block:LABEL=*|LABEL=*) - root="${root#block:}" - root="$(echo $root | sed 's,/,\\x2f,g')" - root="block:/dev/disk/by-label/${root#LABEL=}" + root="${root#block:}" + root="$(echo $root | sed 's,/,\\x2f,g')" + root="block:/dev/disk/by-label/${root#LABEL=}" rootok=1 ;; block:UUID=*|UUID=*) - root="${root#block:}" - root="block:/dev/disk/by-uuid/${root#UUID=}" + root="${root#block:}" + root="block:/dev/disk/by-uuid/${root#UUID=}" rootok=1 ;; /dev/*) - root="block:${root}" + root="block:${root}" rootok=1 ;; esac diff --git a/modules.d/95terminfo/install b/modules.d/95terminfo/install index a118df97..05096456 100755 --- a/modules.d/95terminfo/install +++ b/modules.d/95terminfo/install @@ -1,8 +1,11 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # terminfo bits make things work better if you fall into interactive mode for TERMINFODIR in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [ -d ${TERMINFODIR} ] && break + [ -d ${TERMINFODIR} ] && break done [ -d ${TERMINFODIR} ] && \ - dracut_install $(find ${TERMINFODIR} -type f) + dracut_install $(find ${TERMINFODIR} -type f) diff --git a/modules.d/95udev-rules/install b/modules.d/95udev-rules/install index 53783aae..ee32b564 100755 --- a/modules.d/95udev-rules/install +++ b/modules.d/95udev-rules/install @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # FIXME: would be nice if we didn't have to know which rules to grab.... # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies # of the rules we want so that we just copy those in would be best @@ -26,23 +29,23 @@ fi inst_rules "$moddir/61-persistent-storage.rules" for i in \ -ata_id \ -cdrom_id \ -create_floppy_devices \ -edd_id \ -firmware.sh \ -firmware \ -firmware.agent \ -hotplug.functions \ -fw_unit_symlinks.sh \ -hid2hci \ -path_id \ -scsi_id \ -usb_id \ -vol_id \ -pcmcia-socket-startup \ -pcmcia-check-broken-cis \ -; do + ata_id \ + cdrom_id \ + create_floppy_devices \ + edd_id \ + firmware.sh \ + firmware \ + firmware.agent \ + hotplug.functions \ + fw_unit_symlinks.sh \ + hid2hci \ + path_id \ + scsi_id \ + usb_id \ + vol_id \ + pcmcia-socket-startup \ + pcmcia-check-broken-cis \ + ; do [ -e /lib/udev/$i ] && dracut_install /lib/udev/$i done diff --git a/modules.d/95udev-rules/load-modules.sh b/modules.d/95udev-rules/load-modules.sh index b5929643..36972fdf 100755 --- a/modules.d/95udev-rules/load-modules.sh +++ b/modules.d/95udev-rules/load-modules.sh @@ -1,6 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # Implement blacklisting for udev-loaded modules modprobe -b "$@" - -# vim: set et ts=4: diff --git a/modules.d/95uswsusp/check b/modules.d/95uswsusp/check index 4b3f8fbb..3df4e4e5 100755 --- a/modules.d/95uswsusp/check +++ b/modules.d/95uswsusp/check @@ -1,2 +1,5 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + [ -x /usr/sbin/resume ] || [ -x /usr/lib/suspend/resume ] diff --git a/modules.d/95uswsusp/install b/modules.d/95uswsusp/install index 68307630..61b8edde 100755 --- a/modules.d/95uswsusp/install +++ b/modules.d/95uswsusp/install @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + for bin in /usr/sbin/resume /usr/lib/suspend/resume do [ -x "${bin}" ] && break diff --git a/modules.d/95uswsusp/parse-uswsusp.sh b/modules.d/95uswsusp/parse-uswsusp.sh index 7a0925f3..b89e85d1 100755 --- a/modules.d/95uswsusp/parse-uswsusp.sh +++ b/modules.d/95uswsusp/parse-uswsusp.sh @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + if resume=$(getarg resume=) && ! getarg noresume; then export resume else @@ -6,11 +9,11 @@ else fi case "$resume" in - LABEL=*) - resume="$(echo $resume | sed 's,/,\\x2f,g')" - resume="/dev/disk/by-label/${resume#LABEL=}" ;; - UUID=*) - resume="/dev/disk/by-uuid/${resume#UUID=}" ;; + LABEL=*) \ + resume="$(echo $resume | sed 's,/,\\x2f,g')" + resume="/dev/disk/by-label/${resume#LABEL=}" ;; + UUID=*) \ + resume="/dev/disk/by-uuid/${resume#UUID=}" ;; esac if splash=$(getarg splash=); then diff --git a/modules.d/95uswsusp/resume-uswsusp.sh b/modules.d/95uswsusp/resume-uswsusp.sh index ce0e3d23..e8d3b700 100755 --- a/modules.d/95uswsusp/resume-uswsusp.sh +++ b/modules.d/95uswsusp/resume-uswsusp.sh @@ -1,11 +1,14 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + case "$splash" in quiet ) - a_splash="-P splash=y" - ;; + a_splash="-P splash=y" + ;; * ) - a_splash="-P splash=n" - ;; + a_splash="-P splash=n" + ;; esac if [ -n "$resume" ]; then diff --git a/modules.d/95zfcp/check b/modules.d/95zfcp/check index a26196cf..3090f6d5 100755 --- a/modules.d/95zfcp/check +++ b/modules.d/95zfcp/check @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + arch=$(uname -m) [ "$arch" = "s390" -o "$arch" = "s390x" ] || exit 1 diff --git a/modules.d/95zfcp/install b/modules.d/95zfcp/install index 8e35eb75..4169d9c4 100755 --- a/modules.d/95zfcp/install +++ b/modules.d/95zfcp/install @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + inst_hook cmdline 30 "$moddir/parse-zfcp.sh" dracut_install tr diff --git a/modules.d/95zfcp/installkernel b/modules.d/95zfcp/installkernel index d8b197d9..85694cec 100755 --- a/modules.d/95zfcp/installkernel +++ b/modules.d/95zfcp/installkernel @@ -1,5 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh instmods zfcp - + diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh index 4ec91ede..2c0a60f2 100755 --- a/modules.d/95zfcp/parse-zfcp.sh +++ b/modules.d/95zfcp/parse-zfcp.sh @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + getarg rd_NO_ZFCPCONF && rm /etc/zfcp.conf for zfcp_arg in $(getargs 'rd_ZFCP='); do diff --git a/modules.d/95zfcp/zfcpconf.sh b/modules.d/95zfcp/zfcpconf.sh index 4eb1ab61..b53acd91 100755 --- a/modules.d/95zfcp/zfcpconf.sh +++ b/modules.d/95zfcp/zfcpconf.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # config file syntax: # deviceno WWPN FCPLUN @@ -22,34 +24,34 @@ CONFIG=/etc/zfcp.conf PATH=/bin:/usr/bin:/sbin:/usr/sbin if [ -f "$CONFIG" ]; then - if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then - modprobe zfcp - fi - if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then - return - fi - tr "A-Z" "a-z" < $CONFIG| while read line; do - case $line in - \#*) ;; - *) - [ -z "$line" ] && continue - set $line - if [ $# -eq 5 ]; then - DEVICE=$1 - SCSIID=$2 - WWPN=$3 - SCSILUN=$4 - FCPLUN=$5 - echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN" - elif [ $# -eq 3 ]; then - DEVICE=${1##*0x} - WWPN=$2 - FCPLUN=$3 - fi - echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online - [ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \ - && echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add - ;; - esac - done + if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then + modprobe zfcp + fi + if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then + return + fi + tr "A-Z" "a-z" < $CONFIG| while read line; do + case $line in + \#*) ;; + *) + [ -z "$line" ] && continue + set $line + if [ $# -eq 5 ]; then + DEVICE=$1 + SCSIID=$2 + WWPN=$3 + SCSILUN=$4 + FCPLUN=$5 + echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN" + elif [ $# -eq 3 ]; then + DEVICE=${1##*0x} + WWPN=$2 + FCPLUN=$3 + fi + echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online + [ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \ + && echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add + ;; + esac + done fi diff --git a/modules.d/95znet/check b/modules.d/95znet/check index a26196cf..3090f6d5 100755 --- a/modules.d/95znet/check +++ b/modules.d/95znet/check @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + arch=$(uname -m) [ "$arch" = "s390" -o "$arch" = "s390x" ] || exit 1 diff --git a/modules.d/95znet/install b/modules.d/95znet/install index ff85db69..ecf09c58 100755 --- a/modules.d/95znet/install +++ b/modules.d/95znet/install @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + inst_hook cmdline 30 "$moddir/parse-ccw.sh" inst /lib/udev/ccw_init inst_rules 81-ccw.rules diff --git a/modules.d/95znet/parse-ccw.sh b/modules.d/95znet/parse-ccw.sh index 7960e6ae..01f0cbec 100755 --- a/modules.d/95znet/parse-ccw.sh +++ b/modules.d/95znet/parse-ccw.sh @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + for ccw_arg in $(getargs 'rd_CCW=') $(getargs 'rd_ZNET='); do echo $ccw_arg >> /etc/ccw.conf done diff --git a/modules.d/98selinux/check b/modules.d/98selinux/check index 751b0026..fa9ede2c 100755 --- a/modules.d/98selinux/check +++ b/modules.d/98selinux/check @@ -1,4 +1,7 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + [[ $1 = '-h' ]] && { [ -x "/usr/sbin/load_policy" -o -x "/sbin/load_policy" ] || exit 1 exit 0 diff --git a/modules.d/98selinux/install b/modules.d/98selinux/install index 4216c776..6d640489 100755 --- a/modules.d/98selinux/install +++ b/modules.d/98selinux/install @@ -1,2 +1,5 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + inst_hook pre-pivot 50 "$moddir/selinux-loadpolicy.sh" diff --git a/modules.d/98selinux/selinux-loadpolicy.sh b/modules.d/98selinux/selinux-loadpolicy.sh index 99599939..7cb794b6 100755 --- a/modules.d/98selinux/selinux-loadpolicy.sh +++ b/modules.d/98selinux/selinux-loadpolicy.sh @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # FIXME: load selinux policy. this should really be done after we switchroot rd_load_policy() @@ -13,52 +16,52 @@ rd_load_policy() permissive=0 getarg "enforcing=0" > /dev/null if [ $? -eq 0 -o "$SELINUX" = "permissive" ]; then - permissive=1 + permissive=1 fi # Attempt to load SELinux Policy if [ -x "$NEWROOT/usr/sbin/load_policy" -o -x "$NEWROOT/sbin/load_policy" ]; then - local ret=0 - local out - info "Loading SELinux policy" + local ret=0 + local out + info "Loading SELinux policy" # load_policy does mount /proc and /selinux in # libselinux,selinux_init_load_policy() if [ -x "$NEWROOT/sbin/load_policy" ]; then out=$(chroot "$NEWROOT" /sbin/load_policy -i 2>&1) ret=$? - info $out + info $out else - out=$(chroot "$NEWROOT" /usr/sbin/load_policy -i 2>&1) - ret=$? - info $out + out=$(chroot "$NEWROOT" /usr/sbin/load_policy -i 2>&1) + ret=$? + info $out fi - if [ "$SELINUX" = "disabled" ]; then - return 0; - fi + if [ "$SELINUX" = "disabled" ]; then + return 0; + fi - if [ $ret -eq 0 -o $ret -eq 2 ]; then - # If machine requires a relabel, force to permissive mode - [ -e "$NEWROOT"/.autorelabel ] && ( echo 0 > "$NEWROOT"/selinux/enforce ) + if [ $ret -eq 0 -o $ret -eq 2 ]; then + # If machine requires a relabel, force to permissive mode + [ -e "$NEWROOT"/.autorelabel ] && ( echo 0 > "$NEWROOT"/selinux/enforce ) mount --bind /dev "$NEWROOT/dev" chroot "$NEWROOT" /sbin/restorecon -R /dev - return 0 - fi + return 0 + fi - warn "Initial SELinux policy load failed." - if [ $ret -eq 3 -o $permissive -eq 0 ]; then - warn "Machine in enforcing mode." - warn "Not continuing" - sleep 100d - exit 1 - fi - return 0 + warn "Initial SELinux policy load failed." + if [ $ret -eq 3 -o $permissive -eq 0 ]; then + warn "Machine in enforcing mode." + warn "Not continuing" + sleep 100d + exit 1 + fi + return 0 elif [ $permissive -eq 0 -a "$SELINUX" != "disabled" ]; then - warn "Machine in enforcing mode and cannot execute load_policy." - warn "To disable selinux, add selinux=0 to the kernel command line." - warn "Not continuing" - sleep 100d - exit 1 + warn "Machine in enforcing mode and cannot execute load_policy." + warn "To disable selinux, add selinux=0 to the kernel command line." + warn "Not continuing" + sleep 100d + exit 1 fi } diff --git a/modules.d/98syslog/check b/modules.d/98syslog/check index 3b0eb2cf..8ee80987 100755 --- a/modules.d/98syslog/check +++ b/modules.d/98syslog/check @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # do not add this module by default exit 255 diff --git a/modules.d/98syslog/install b/modules.d/98syslog/install index 1fd1b6f7..ed5958e3 100755 --- a/modules.d/98syslog/install +++ b/modules.d/98syslog/install @@ -1,6 +1,9 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + if type -P rsyslogd >/dev/null; then - installs="rsyslogd /lib/rsyslog/lmnet.so /lib/rsyslog/imklog.so /lib/rsyslog/imuxsock.so" + installs="rsyslogd /lib/rsyslog/lmnet.so /lib/rsyslog/imklog.so /lib/rsyslog/imuxsock.so" elif type -P syslogd >/dev/null; then installs="syslogd" elif type -P syslog-ng >/dev/null; then @@ -9,13 +12,13 @@ else dwarn "Could not find any syslog binary although the syslogmodule is selected to be installed. Please check." fi if [ -n "$installs" ]; then - dracut_install cat - dracut_install $installs - inst_hook cmdline 90 "$moddir/parse-syslog-opts.sh" - inst_hook pre-udev 61 "$moddir/syslog-genrules.sh" - inst_hook pre-pivot 99 "$moddir/syslog-cleanup.sh" - inst_simple "$moddir/rsyslogd-start.sh" /sbin/rsyslogd-start - inst_simple "$moddir/rsyslogd-stop.sh" /sbin/rsyslogd-stop - mkdir -p ${initdir}/etc/templates - inst_simple "${moddir}/rsyslog.conf" /etc/templates + dracut_install cat + dracut_install $installs + inst_hook cmdline 90 "$moddir/parse-syslog-opts.sh" + inst_hook pre-udev 61 "$moddir/syslog-genrules.sh" + inst_hook pre-pivot 99 "$moddir/syslog-cleanup.sh" + inst_simple "$moddir/rsyslogd-start.sh" /sbin/rsyslogd-start + inst_simple "$moddir/rsyslogd-stop.sh" /sbin/rsyslogd-stop + mkdir -p ${initdir}/etc/templates + inst_simple "${moddir}/rsyslog.conf" /etc/templates fi diff --git a/modules.d/98syslog/parse-syslog-opts.sh b/modules.d/98syslog/parse-syslog-opts.sh index 438ab4b4..55d0022c 100755 --- a/modules.d/98syslog/parse-syslog-opts.sh +++ b/modules.d/98syslog/parse-syslog-opts.sh @@ -1,4 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # Parses the syslog commandline options # #Bootparameters: diff --git a/modules.d/98syslog/rsyslogd-start.sh b/modules.d/98syslog/rsyslogd-start.sh index 4bfadc15..7f1830d0 100755 --- a/modules.d/98syslog/rsyslogd-start.sh +++ b/modules.d/98syslog/rsyslogd-start.sh @@ -1,22 +1,25 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # Triggered by udev and starts rsyslogd with bootparameters . /lib/dracut-lib.sh rsyslog_config() { - local server=$1 - shift - local syslog_template=$1 - shift + local server=$1 + shift + local syslog_template=$1 + shift local filters=$* local filter= cat $syslog_template - for filter in $filters; do - echo "${filter} @${server}" + for filter in $filters; do + echo "${filter} @${server}" done -# echo "*.* /tmp/syslog" +# echo "*.* /tmp/syslog" } read server < /tmp/syslog.server @@ -27,6 +30,6 @@ read conf < /tmp/syslog.conf template=/etc/templates/rsyslog.conf if [ -n "$server" ]; then - rsyslog_config "$server" "$template" "$filters" > $conf - /sbin/rsyslogd -c3 + rsyslog_config "$server" "$template" "$filters" > $conf + /sbin/rsyslogd -c3 fi diff --git a/modules.d/98syslog/rsyslogd-stop.sh b/modules.d/98syslog/rsyslogd-stop.sh index a46240fc..3f1a8b27 100755 --- a/modules.d/98syslog/rsyslogd-stop.sh +++ b/modules.d/98syslog/rsyslogd-stop.sh @@ -1,10 +1,13 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # Kills rsyslogd if [ -f /var/run/syslogd.pid ]; then - read pid < /var/run/syslogd.pid - kill $pid - kill -0 $pid && kill -9 $pid + read pid < /var/run/syslogd.pid + kill $pid + kill -0 $pid && kill -9 $pid else warn "rsyslogd-stop: Could not find a pid for rsyslogd. Won't kill it." fi
\ No newline at end of file diff --git a/modules.d/98syslog/syslog-cleanup.sh b/modules.d/98syslog/syslog-cleanup.sh index 4e1c5314..e6b1c139 100755 --- a/modules.d/98syslog/syslog-cleanup.sh +++ b/modules.d/98syslog/syslog-cleanup.sh @@ -1,13 +1,16 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # Just cleans up a previously started syslogd . /lib/dracut-lib.sh if [ -f /tmp/syslog.server ]; then - read syslogtype < /tmp/syslog.type - if [ -e "/sbin/${syslogtype}-stop" ]; then - ${syslogtype}-stop - else - warn "syslog-cleanup: Could not find script to stop syslog of type \"$syslogtype\". Syslog will not be stopped." - fi + read syslogtype < /tmp/syslog.type + if [ -e "/sbin/${syslogtype}-stop" ]; then + ${syslogtype}-stop + else + warn "syslog-cleanup: Could not find script to stop syslog of type \"$syslogtype\". Syslog will not be stopped." + fi fi
\ No newline at end of file diff --git a/modules.d/98syslog/syslog-genrules.sh b/modules.d/98syslog/syslog-genrules.sh index fb11f44b..d2000e05 100755 --- a/modules.d/98syslog/syslog-genrules.sh +++ b/modules.d/98syslog/syslog-genrules.sh @@ -1,29 +1,32 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + # Creates the syslog udev rules to be triggered when interface becomes online. . /lib/dracut-lib.sh detect_syslog() { syslogtype="" if [ -e /sbin/rsyslogd ]; then - syslogtype="rsyslogd" + syslogtype="rsyslogd" elif [ -e /sbin/syslogd ]; then - syslogtype="syslogd" + syslogtype="syslogd" elif [ /sbin/syslog-ng ]; then - syslogtype="syslog-ng" + syslogtype="syslog-ng" else - dwarn "Could not find any syslog binary although the syslogmodule is selected to be installed. Please check." + dwarn "Could not find any syslog binary although the syslogmodule is selected to be installed. Please check." fi echo "$syslogtype" [ -n "$syslogtype" ] -} +} read syslogtype < /tmp/syslog.type if [ -z "$syslogtype" ]; then - syslogtype=$(detect_syslog) - echo $syslogtype > /tmp/syslog.type + syslogtype=$(detect_syslog) + echo $syslogtype > /tmp/syslog.type fi if [ -e "/sbin/${syslogtype}-start" ]; then - printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/initqueue --onetime /sbin/'${syslogtype}'-start $env{INTERFACE}"\n' > /etc/udev/rules.d/70-syslog.rules + printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/initqueue --onetime /sbin/'${syslogtype}'-start $env{INTERFACE}"\n' > /etc/udev/rules.d/70-syslog.rules else - warn "syslog-genrules: Could not find binary to start syslog of type \"$syslogtype\". Syslog will not be started." + warn "syslog-genrules: Could not find binary to start syslog of type \"$syslogtype\". Syslog will not be started." fi diff --git a/modules.d/99base/check b/modules.d/99base/check index de9a2818..b7ba12c7 100755 --- a/modules.d/99base/check +++ b/modules.d/99base/check @@ -1,3 +1,6 @@ #!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + [[ $1 = -d ]] && echo udev-rules exit 0 diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index 06816723..627d2c5b 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -1,7 +1,9 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # returns OK if $1 contains $2 strstr() { - [ "${1#*$2*}" != "$1" ] + [ "${1#*$2*}" != "$1" ] } getarg() { @@ -13,20 +15,20 @@ getarg() { CMDLINE_ETC="$CMDLINE_ETC $line"; done </etc/cmdline; fi - read CMDLINE </proc/cmdline; - CMDLINE="$CMDLINE $CMDLINE_ETC" + read CMDLINE </proc/cmdline; + CMDLINE="$CMDLINE $CMDLINE_ETC" fi for o in $CMDLINE; do - if [ "$o" = "$1" ]; then + if [ "$o" = "$1" ]; then [ "$RDDEBUG" = "yes" ] && set -x; - return 0; + return 0; fi [ "${o%%=*}" = "${1%=}" ] && val=${o#*=}; done if [ -n "$val" ]; then echo $val; [ "$RDDEBUG" = "yes" ] && set -x; - return 0; + return 0; fi [ "$RDDEBUG" = "yes" ] && set -x return 1 @@ -36,27 +38,27 @@ getargs() { set +x local o line found if [ -z "$CMDLINE" ]; then - if [ -e /etc/cmdline ]; then + if [ -e /etc/cmdline ]; then while read line; do CMDLINE_ETC="$CMDLINE_ETC $line"; done </etc/cmdline; fi - read CMDLINE </proc/cmdline; - CMDLINE="$CMDLINE $CMDLINE_ETC" + read CMDLINE </proc/cmdline; + CMDLINE="$CMDLINE $CMDLINE_ETC" fi for o in $CMDLINE; do - if [ "$o" = "$1" ]; then - [ "$RDDEBUG" = "yes" ] && set -x; - return 0; - fi - if [ "${o%%=*}" = "${1%=}" ]; then - echo -n "${o#*=} "; - found=1; - fi + if [ "$o" = "$1" ]; then + [ "$RDDEBUG" = "yes" ] && set -x; + return 0; + fi + if [ "${o%%=*}" = "${1%=}" ]; then + echo -n "${o#*=} "; + found=1; + fi done if [ -n "$found" ]; then [ "$RDDEBUG" = "yes" ] && set -x - return 0; + return 0; fi [ "$RDDEBUG" = "yes" ] && set -x return 1; @@ -80,10 +82,9 @@ getoptcomma() { tmp="${line#*,${opt}=}" echo "${tmp%%,*}" return 0 - ;; - *,${opt},*) return 0 ;; + ;; + *,${opt},*) return 0;; esac - return 1 } @@ -95,7 +96,7 @@ setdebug() { RDDEBUG=yes fi fi - export RDDEBUG + export RDDEBUG fi [ "$RDDEBUG" = "yes" ] && set -x } @@ -136,9 +137,9 @@ die() { check_quiet() { if [ -z "$DRACUT_QUIET" ]; then - DRACUT_QUIET="yes" - getarg rdinfo && DRACUT_QUIET="no" - getarg quiet || DRACUT_QUIET="yes" + DRACUT_QUIET="yes" + getarg rdinfo && DRACUT_QUIET="no" + getarg quiet || DRACUT_QUIET="yes" fi } @@ -146,14 +147,14 @@ warn() { check_quiet echo "<4>dracut Warning: $@" > /dev/kmsg [ "$DRACUT_QUIET" != "yes" ] && \ - echo "dracut Warning: $@" >&2 + echo "dracut Warning: $@" >&2 } info() { check_quiet echo "<6>dracut: $@" > /dev/kmsg [ "$DRACUT_QUIET" != "yes" ] && \ - echo "dracut: $@" + echo "dracut: $@" } vinfo() { @@ -171,8 +172,8 @@ check_occurances() { local count=0 while [ "${str#*$ch}" != "${str}" ]; do - str="${str#*$ch}" - count=$(( $count + 1 )) + str="${str#*$ch}" + count=$(( $count + 1 )) done [ $count -eq $expected ] @@ -187,7 +188,7 @@ incol2() { [ -z "$str" ] && return; while read dummy check restofline; do - [ "$check" = "$str" ] && return 0 + [ "$check" = "$str" ] && return 0 done < $file return 1 } @@ -206,19 +207,19 @@ udevproperty() { [ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version) if [ $UDEVVERSION -ge 143 ]; then - for i in "$@"; do udevadm control --property=$i; done + for i in "$@"; do udevadm control --property=$i; done else - for i in "$@"; do udevadm control --env=$i; done + for i in "$@"; do udevadm control --env=$i; done fi } wait_for_if_up() { local cnt=0 while [ $cnt -lt 20 ]; do - li=$(ip link show $1) - [ -z "${li##*state UP*}" ] && return 0 - sleep 0.1 - cnt=$(($cnt+1)) + li=$(ip link show $1) + [ -z "${li##*state UP*}" ] && return 0 + sleep 0.1 + cnt=$(($cnt+1)) done return 1 } @@ -233,8 +234,8 @@ nfsroot_to_var() { # check if we have a server if strstr "$arg" ':/*' ; then - server="${arg%%:/*}" - arg="/${arg##*:/}" + server="${arg%%:/*}" + arg="/${arg##*:/}" fi path="${arg%%:*}" @@ -251,8 +252,8 @@ nfsroot_to_var() { #Fix kernel legacy style separating path and options with ',' if [ "$path" != "${path#*,}" ] ; then - options=${path#*,} - path=${path%%,*} + options=${path#*,} + path=${path%%,*} fi } @@ -261,24 +262,24 @@ ip_to_var() { local i set -- while [ -n "$v" ]; do - if [ "${v#\[*:*:*\]:}" != "$v" ]; then - # handle IPv6 address - i="${v%%\]:*}" - i="${i##\[}" - set -- "$@" "$i" - v=${v#\[$i\]:} - else - set -- "$@" "${v%%:*}" - v=${v#*:} - fi + if [ "${v#\[*:*:*\]:}" != "$v" ]; then + # handle IPv6 address + i="${v%%\]:*}" + i="${i##\[}" + set -- "$@" "$i" + v=${v#\[$i\]:} + else + set -- "$@" "${v%%:*}" + v=${v#*:} + fi done unset ip srv gw mask hostname dev autoconf case $# in - 0) autoconf="error" ;; - 1) autoconf=$1 ;; - 2) dev=$1; autoconf=$2 ;; - *) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;; + 0) autoconf="error" ;; + 1) autoconf=$1 ;; + 2) dev=$1; autoconf=$2 ;; + *) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;; esac } diff --git a/modules.d/99base/init b/modules.d/99base/init index 2a376ddc..121d70e8 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -1,26 +1,28 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # # Licensed under the GPLv2 # -# Copyright 2008-2009, Red Hat, Inc. +# Copyright 2008-2010, Red Hat, Inc. # Harald Hoyer <harald@redhat.com> # Jeremy Katz <katzj@redhat.com> wait_for_loginit() { if getarg rdinitdebug; then - set +x - exec 0<>/dev/console 1<>/dev/console 2<>/dev/console - # wait for loginit - i=0 - while [ $i -lt 10 ]; do - j=$(jobs) - [ -z "$j" ] && break - [ -z "${j##*Running*}" ] || break - sleep 0.1 - i=$(($i+1)) - done - [ $i -eq 10 ] && kill %1 >/dev/null 2>&1 + set +x + exec 0<>/dev/console 1<>/dev/console 2<>/dev/console + # wait for loginit + i=0 + while [ $i -lt 10 ]; do + j=$(jobs) + [ -z "$j" ] && break + [ -z "${j##*Running*}" ] || break + sleep 0.1 + i=$(($i+1)) + done + [ $i -eq 10 ] && kill %1 >/dev/null 2>&1 while pidof -x /sbin/loginit >/dev/null 2>&1; do for pid in $(pidof -x /sbin/loginit); do @@ -28,7 +30,7 @@ wait_for_loginit() done HARD="-9" done - set -x + set -x fi } @@ -79,12 +81,12 @@ if [ ! -c /dev/ptmx ]; then # try to mount devtmpfs if ! mount -t devtmpfs -omode=0755 udev /dev >/dev/null 2>&1; then # if it failed fall back to normal tmpfs - mount -t tmpfs -omode=0755 udev /dev >/dev/null 2>&1 - # Make some basic devices first, let udev handle the rest - mknod -m 0666 /dev/null c 1 3 - mknod -m 0666 /dev/ptmx c 5 2 - mknod -m 0600 /dev/console c 5 1 - mknod -m 0660 /dev/kmsg c 1 11 + mount -t tmpfs -omode=0755 udev /dev >/dev/null 2>&1 + # Make some basic devices first, let udev handle the rest + mknod -m 0666 /dev/null c 1 3 + mknod -m 0666 /dev/ptmx c 5 2 + mknod -m 0600 /dev/console c 5 1 + mknod -m 0660 /dev/kmsg c 1 11 fi fi @@ -140,8 +142,8 @@ UDEV_LOG_PRIO_ARG=--log-priority UDEV_QUEUE_EMPTY="udevadm settle --timeout=0" if [ $UDEVVERSION -lt 140 ]; then - UDEV_LOG_PRIO_ARG=--log_priority - UDEV_QUEUE_EMPTY="udevadm settle --timeout=1" + UDEV_LOG_PRIO_ARG=--log_priority + UDEV_QUEUE_EMPTY="udevadm settle --timeout=1" fi getarg rdudevinfo && udevadm control $UDEV_LOG_PRIO_ARG=info @@ -163,7 +165,7 @@ i=0 while :; do check_finished && break - + udevsettle check_finished && break @@ -171,9 +173,9 @@ while :; do if [ -f /initqueue/work ]; then rm /initqueue/work fi - + for job in /initqueue/*.sh; do - [ -e "$job" ] || break + [ -e "$job" ] || break job=$job . $job check_finished && break 2 done @@ -199,10 +201,10 @@ while :; do # which report no medium for quiet # some time. for cdrom in /sys/block/sr*; do - [ -e "$cdrom" ] || continue - # skip, if cdrom medium was already found + [ -e "$cdrom" ] || continue + # skip, if cdrom medium was already found strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \ - ID_CDROM_MEDIA && continue + ID_CDROM_MEDIA && continue echo change > "$cdrom/uevent" done @@ -226,8 +228,8 @@ i=0 while :; do [ -d "$NEWROOT/proc" ] && break; for f in /mount/*.sh; do - [ -f "$f" ] && . "$f" - [ -d "$NEWROOT/proc" ] && break; + [ -f "$f" ] && . "$f" + [ -d "$NEWROOT/proc" ] && break; done i=$(($i+1)) @@ -264,7 +266,7 @@ udevadm control --stop-exec-queue HARD="" while pidof udevd >/dev/null 2>&1; do for pid in $(pidof udevd); do - kill $HARD $pid >/dev/null 2>&1 + kill $HARD $pid >/dev/null 2>&1 done HARD="-9" done @@ -272,9 +274,9 @@ done # Clean up the environment for i in $(export -p); do i=${i#declare -x} - i=${i#export} - i=${i%%=*} - [ "$i" = "root" -o "$i" = "PATH" -o "$i" = "HOME" -o "$i" = "TERM" ] || unset $i + i=${i#export} + i=${i%%=*} + [ "$i" = "root" -o "$i" = "PATH" -o "$i" = "HOME" -o "$i" = "TERM" ] || unset $i done initargs="" @@ -284,23 +286,23 @@ if getarg init= >/dev/null ; then ignoreargs="console BOOT_IMAGE" # only pass arguments after init= to the init CLINE=${CLINE#*init=} - set $CLINE - shift - for x in "$@"; do - for s in $ignoreargs; do - [ "${x%%=*}" = $s ] && continue 2 + set $CLINE + shift + for x in "$@"; do + for s in $ignoreargs; do + [ "${x%%=*}" = $s ] && continue 2 + done + initargs="$initargs $x" done - initargs="$initargs $x" - done - unset CLINE + unset CLINE else set $CLINE shift for x in "$@"; do case "$x" in - [0-9]|s|S|single|emergency|auto ) + [0-9]|s|S|single|emergency|auto ) \ initargs="$initargs $x" - ;; + ;; esac done fi @@ -322,5 +324,3 @@ exec switch_root "$NEWROOT" "$INIT" $initargs || { echo "file a bug against dracut." emergency_shell } -# vim:ts=8:sw=4:sts=4:et - diff --git a/modules.d/99base/initqueue b/modules.d/99base/initqueue index cc6e7a85..410f247e 100755 --- a/modules.d/99base/initqueue +++ b/modules.d/99base/initqueue @@ -1,38 +1,45 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh +# +# Licensed under the GPLv2+ +# +# Copyright 2008-2010, Red Hat, Inc. +# Harald Hoyer <harald@redhat.com> . /lib/dracut-lib.sh while [ $# -gt 0 ]; do case "$1" in - --onetime) - onetime="yes";; - --settled) - settled="-settled";; - --unique) - unique="yes";; - --name) - name="$2";shift;; - *) - break;; + --onetime) + onetime="yes";; + --settled) + settled="-settled";; + --unique) + unique="yes";; + --name) + name="$2";shift;; + *) + break;; esac shift done if [ -z "$unique" ]; then - job="${name}$$" + job="${name}$$" else - job="${name:-$1}" - job=${job##*/} + job="${name:-$1}" + job=${job##*/} fi if [ -n "$onetime" ]; then - { - echo '[ -e "$job" ] && rm "$job"' - echo "$@" - } > "/tmp/$$-${job}.sh" + { + echo '[ -e "$job" ] && rm "$job"' + echo "$@" + } > "/tmp/$$-${job}.sh" else - echo "$@" > "/tmp/$$-${job}.sh" + echo "$@" > "/tmp/$$-${job}.sh" fi mv -f "/tmp/$$-${job}.sh" "/initqueue${settled}/${job}.sh" diff --git a/modules.d/99base/install b/modules.d/99base/install index 1d554e58..6fac8515 100755 --- a/modules.d/99base/install +++ b/modules.d/99base/install @@ -1,6 +1,8 @@ -#!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + dracut_install mount mknod mkdir pidof sleep chroot sed ls flock cp mv dmesg \ - rm ln mkfifo less + rm ln mkfifo less if [[ ${ignore_kmodules} = yes ]]; then inst /bin/true ln -s /bin/true "${initdir}"/sbin/modprobe @@ -25,9 +27,10 @@ if type -P switch_root >/dev/null; then dracut_install switch_root else inst "$moddir/switch_root" "/sbin/switch_root" \ - || derror "Failed to install switch_root" + || derror "Failed to install switch_root" fi inst "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh" inst_hook cmdline 10 "$moddir/parse-root-opts.sh" inst_hook cmdline 20 "$moddir/parse-blacklist.sh" mkdir -p "${initdir}/var/run" + diff --git a/modules.d/99base/loginit b/modules.d/99base/loginit index 1fb2a925..ad46008c 100755 --- a/modules.d/99base/loginit +++ b/modules.d/99base/loginit @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh # turn off debugging set +x @@ -9,8 +11,8 @@ QUIET=$1 exec 6>/init.log while read line; do - echo "<7>dracut: $line" >&5 - # if "quiet" is specified we output to /dev/console - [ -n "$QUIET" ] && echo "dracut: $line" - echo "$line" >&6 + echo "<7>dracut: $line" >&5 + # if "quiet" is specified we output to /dev/console + [ -n "$QUIET" ] && echo "dracut: $line" + echo "$line" >&6 done diff --git a/modules.d/99base/parse-blacklist.sh b/modules.d/99base/parse-blacklist.sh index 7020b317..7942772b 100755 --- a/modules.d/99base/parse-blacklist.sh +++ b/modules.d/99base/parse-blacklist.sh @@ -1,5 +1,7 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh for p in $(getargs rdblacklist=); do - echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf + echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf done diff --git a/modules.d/99base/parse-root-opts.sh b/modules.d/99base/parse-root-opts.sh index e2531109..2980d0a5 100755 --- a/modules.d/99base/parse-root-opts.sh +++ b/modules.d/99base/parse-root-opts.sh @@ -1,3 +1,6 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + root=$(getarg root=) if rflags="$(getarg rootflags=)"; then |