reformat source code
authorHarald Hoyer <harald@redhat.com>
Fri, 10 Sep 2010 13:23:06 +0000 (15:23 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 10 Sep 2010 13:34:36 +0000 (15:34 +0200)
removed tabs and set indention to 4 spaces
added emacs and vi format headers

173 files changed:
dracut
dracut-catimages
dracut-functions
dracut-gencmdline
dracut-update-initramfs
lsinitrd
mkinitrd-dracut.sh
modules.d/00bootchart/check
modules.d/00bootchart/install
modules.d/00dash/check
modules.d/00dash/install
modules.d/01fips/check
modules.d/01fips/fips.sh
modules.d/01fips/install
modules.d/01fips/installkernel
modules.d/10i18n/check
modules.d/10i18n/console_init
modules.d/10i18n/install
modules.d/10i18n/parse-i18n.sh
modules.d/10rpmversion/check
modules.d/10rpmversion/install
modules.d/10rpmversion/version.sh
modules.d/40network/check
modules.d/40network/dhclient-script
modules.d/40network/dhcp-root.sh
modules.d/40network/ifname-genrules.sh
modules.d/40network/ifup
modules.d/40network/install
modules.d/40network/installkernel
modules.d/40network/kill-dhclient.sh
modules.d/40network/net-genrules.sh
modules.d/40network/netroot
modules.d/40network/parse-bridge.sh
modules.d/40network/parse-ifname.sh
modules.d/40network/parse-ip-opts.sh
modules.d/45ifcfg/check
modules.d/45ifcfg/install
modules.d/45ifcfg/write-ifcfg.sh
modules.d/50gensplash/check
modules.d/50gensplash/gensplash-emergency.sh
modules.d/50gensplash/gensplash-newroot.sh
modules.d/50gensplash/gensplash-pretrigger.sh
modules.d/50gensplash/install
modules.d/50plymouth/check
modules.d/50plymouth/install
modules.d/50plymouth/installkernel
modules.d/50plymouth/plymouth-emergency.sh
modules.d/50plymouth/plymouth-newroot.sh
modules.d/50plymouth/plymouth-populate-initrd
modules.d/50plymouth/plymouth-pretrigger.sh
modules.d/60xen/check
modules.d/60xen/install
modules.d/60xen/installkernel
modules.d/60xen/xen-pre-udev.sh
modules.d/90btrfs/check
modules.d/90btrfs/install
modules.d/90crypt/check
modules.d/90crypt/crypt-cleanup.sh
modules.d/90crypt/cryptroot-ask.sh
modules.d/90crypt/install
modules.d/90crypt/installkernel
modules.d/90crypt/parse-crypt.sh
modules.d/90dm/check
modules.d/90dm/dm-pre-udev.sh
modules.d/90dm/install
modules.d/90dm/installkernel
modules.d/90dmraid/check
modules.d/90dmraid/dmraid.sh
modules.d/90dmraid/install
modules.d/90dmraid/parse-dm.sh
modules.d/90dmsquash-live/check
modules.d/90dmsquash-live/dmsquash-live-genrules.sh
modules.d/90dmsquash-live/dmsquash-live-root
modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh
modules.d/90dmsquash-live/install
modules.d/90dmsquash-live/parse-dmsquash-live.sh
modules.d/90kernel-modules/install
modules.d/90kernel-modules/installkernel
modules.d/90kernel-modules/parse-kernel.sh
modules.d/90lvm/check
modules.d/90lvm/install
modules.d/90lvm/lvm_scan.sh
modules.d/90lvm/parse-lvm.sh
modules.d/90mdraid/check
modules.d/90mdraid/install
modules.d/90mdraid/installkernel
modules.d/90mdraid/md-noimsm.sh
modules.d/90mdraid/md_finished.sh
modules.d/90mdraid/mdadm_auto.sh
modules.d/90mdraid/mdcontainer_start.sh
modules.d/90mdraid/mdmon-pre-udev.sh
modules.d/90mdraid/mdraid-cleanup.sh
modules.d/90mdraid/mdraid_start.sh
modules.d/90mdraid/parse-md.sh
modules.d/90multipath/check
modules.d/90multipath/install
modules.d/90multipath/installkernel
modules.d/90multipath/multipathd-stop.sh
modules.d/90multipath/multipathd.sh
modules.d/95dasd/check
modules.d/95dasd/install
modules.d/95dasd/installkernel
modules.d/95dasd/parse-dasd.sh
modules.d/95dasd_mod/check
modules.d/95dasd_mod/install
modules.d/95dasd_mod/installkernel
modules.d/95dasd_mod/parse-dasd-mod.sh
modules.d/95debug/check
modules.d/95debug/install
modules.d/95fcoe/check
modules.d/95fcoe/fcoe-genrules.sh
modules.d/95fcoe/fcoe-up
modules.d/95fcoe/install
modules.d/95fcoe/installkernel
modules.d/95fcoe/parse-fcoe.sh
modules.d/95iscsi/check
modules.d/95iscsi/install
modules.d/95iscsi/installkernel
modules.d/95iscsi/iscsiroot
modules.d/95iscsi/mount-lun.sh
modules.d/95iscsi/parse-iscsiroot.sh
modules.d/95nbd/check
modules.d/95nbd/install
modules.d/95nbd/installkernel
modules.d/95nbd/nbdroot
modules.d/95nbd/parse-nbdroot.sh
modules.d/95nfs/check
modules.d/95nfs/install
modules.d/95nfs/installkernel
modules.d/95nfs/nfsroot
modules.d/95nfs/nfsroot-cleanup.sh
modules.d/95nfs/parse-nfsroot.sh
modules.d/95resume/install
modules.d/95resume/parse-resume.sh
modules.d/95resume/resume-genrules.sh
modules.d/95resume/resume.sh
modules.d/95rootfs-block/block-genrules.sh
modules.d/95rootfs-block/install
modules.d/95rootfs-block/mount-root.sh
modules.d/95rootfs-block/parse-block.sh
modules.d/95terminfo/install
modules.d/95udev-rules/install
modules.d/95udev-rules/load-modules.sh
modules.d/95uswsusp/check
modules.d/95uswsusp/install
modules.d/95uswsusp/parse-uswsusp.sh
modules.d/95uswsusp/resume-uswsusp.sh
modules.d/95zfcp/check
modules.d/95zfcp/install
modules.d/95zfcp/installkernel
modules.d/95zfcp/parse-zfcp.sh
modules.d/95zfcp/zfcpconf.sh
modules.d/95znet/check
modules.d/95znet/install
modules.d/95znet/parse-ccw.sh
modules.d/98selinux/check
modules.d/98selinux/install
modules.d/98selinux/selinux-loadpolicy.sh
modules.d/98syslog/check
modules.d/98syslog/install
modules.d/98syslog/parse-syslog-opts.sh
modules.d/98syslog/rsyslogd-start.sh
modules.d/98syslog/rsyslogd-stop.sh
modules.d/98syslog/syslog-cleanup.sh
modules.d/98syslog/syslog-genrules.sh
modules.d/99base/check
modules.d/99base/dracut-lib.sh
modules.d/99base/init
modules.d/99base/initqueue
modules.d/99base/install
modules.d/99base/loginit
modules.d/99base/parse-blacklist.sh
modules.d/99base/parse-root-opts.sh

diff --git a/dracut b/dracut
index f4778ae..ee2f79f 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -1,11 +1,13 @@
 #!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
 # 
 # Generator script for a dracut initramfs
 # Tries to retain some degree of compatibility with the command line
 # of the various mkinitrd implementations out there
 #
 
-# Copyright 2005-2009 Red Hat, Inc.  All rights reserved.
+# Copyright 2005-2010 Red Hat, Inc.  All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,7 +26,8 @@
 
 usage() {
 #                                                       80x25 linebreak here ^
-       echo "Usage: $0 [OPTION]... <initramfs> <kernel-version>
+    cat << EOF
+Usage: $0 [OPTION]... <initramfs> <kernel-version>
 Creates initial ramdisk images for preloading modules
 
   -f, --force           Overwrite existing initramfs file.
@@ -48,21 +51,21 @@ Creates initial ramdisk images for preloading modules
   --no-kernel           Do not install kernel drivers and firmware files
   --ignore-kernel-modules
                         Don't try to load modules. It automatically implies
-                        '--no-kernel'. It's assumed that everything needed
-                        is built into kernel.
+                         '--no-kernel'. It's assumed that everything needed
+                         is built into kernel.
   --strip               Strip binaries in the initramfs
   --nostrip             Do not strip binaries in the initramfs (default)
   --mdadmconf           Include local /etc/mdadm.conf
   --nomdadmconf         Do not include local /etc/mdadm.conf
   --lvmconf             Include local /etc/lvm/lvm.conf
-  --nolvmconf             Do not include local /etc/lvm/lvm.conf
+  --nolvmconf           Do not include local /etc/lvm/lvm.conf
   -h, --help            This message
   --debug               Output debug information of the build process
   -v, --verbose         Verbose output during the build process
   -c, --conf [FILE]     Specify configuration file to use.
                          Default: /etc/dracut.conf
-  --confdir [DIR]       Specify configuration directory to use *.conf files from.
-                         Default: /etc/dracut.conf.d
+  --confdir [DIR]       Specify configuration directory to use *.conf files 
+                         from. Default: /etc/dracut.conf.d
   -l, --local           Local mode. Use modules from the current working
                          directory instead of the system-wide installed in
                          /usr/share/dracut/modules.d.
@@ -76,17 +79,17 @@ Creates initial ramdisk images for preloading modules
   -I, --install [LIST]  Install the space separated list of files into the
                          initramfs.
   --gzip                Compress the generated initramfs using gzip.
-                        This will be done by default, unless another
-                        compression option or --no-compress is passed.
+                         This will be done by default, unless another
+                         compression option or --no-compress is passed.
   --bzip2               Compress the generated initramfs using bzip2.
-                        Make sure your kernel has bzip2 decompression support
-                        compiled in, otherwise you will not be able to boot.
-  --lzma                  Compress the generated initramfs using lzma.
-                        Make sure your kernel has lzma support compiled in, 
-                        otherwise you will not be able to boot.
+                         Make sure your kernel has bzip2 decompression support
+                         compiled in, otherwise you will not be able to boot.
+  --lzma                Compress the generated initramfs using lzma.
+                         Make sure your kernel has lzma support compiled in, 
+                         otherwise you will not be able to boot.
   --no-compress         Do not compress the generated initramfs.  This will
-                        override any other compression options.
-"
+                         override any other compression options.
+EOF
 }
 
 # Little helper function for reading args from the commandline.
@@ -98,44 +101,44 @@ read_arg() {
     # $3 = arg parameter
     local rematch='^[^=]*=(.*)$'
     if [[ $2 =~ $rematch ]]; then
-       read "$1" <<< "${BASH_REMATCH[1]}"
+        read "$1" <<< "${BASH_REMATCH[1]}"
     else
-       read "$1" <<< "$3"
-       # There is no way to shift our callers args, so
-       # return 1 to indicate they should do it instead.
-       return 1
+        read "$1" <<< "$3"
+        # There is no way to shift our callers args, so
+        # return 1 to indicate they should do it instead.
+        return 1
     fi
 }
 
 while (($# > 0)); do
     case ${1%%=*} in
-       -m|--modules)  read_arg dracutmodules_l      "$@" || shift;;
-       -o|--omit)     read_arg omit_dracutmodules_l "$@" || shift;;
-       -a|--add)      read_arg add_dracutmodules_l  "$@" || shift;;
-       -d|--drivers)  read_arg drivers_l            "$@" || shift;;
-       --add-drivers) read_arg add_drivers_l        "$@" || shift;;
-       --filesystems) read_arg filesystems_l        "$@" || shift;;
-       -k|--kmoddir)  read_arg drivers_dir_l        "$@" || shift;;
-       -c|--conf)     read_arg conffile             "$@" || shift;;
-       --confdir)     read_arg confdir              "$@" || shift;;
-       -I|--install)  read_arg install_items        "$@" || shift;;
-       --fwdir)       read_arg fw_dir_l             "$@" || shift;;
-       -f|--force)    force=yes;;
-       --kernel-only) kernel_only="yes"; no_kernel="no";;
-       --no-kernel)   kernel_only="no"; no_kernel="yes";;
-       --strip)       do_strip_l="yes";;
-       --nostrip)     do_strip_l="no";;
+        -m|--modules)  read_arg dracutmodules_l      "$@" || shift;;
+        -o|--omit)     read_arg omit_dracutmodules_l "$@" || shift;;
+        -a|--add)      read_arg add_dracutmodules_l  "$@" || shift;;
+        -d|--drivers)  read_arg drivers_l            "$@" || shift;;
+        --add-drivers) read_arg add_drivers_l        "$@" || shift;;
+        --filesystems) read_arg filesystems_l        "$@" || shift;;
+        -k|--kmoddir)  read_arg drivers_dir_l        "$@" || shift;;
+        -c|--conf)     read_arg conffile             "$@" || shift;;
+        --confdir)     read_arg confdir              "$@" || shift;;
+        -I|--install)  read_arg install_items        "$@" || shift;;
+        --fwdir)       read_arg fw_dir_l             "$@" || shift;;
+        -f|--force)    force=yes;;
+        --kernel-only) kernel_only="yes"; no_kernel="no";;
+        --no-kernel)   kernel_only="no"; no_kernel="yes";;
+        --strip)       do_strip_l="yes";;
+        --nostrip)     do_strip_l="no";;
         --mdadmconf)   mdadmconf_l="yes";;
         --nomdadmconf) mdadmconf_l="no";;
         --lvmconf)     lvmconf_l="yes";;
         --nolvmconf)   lvmconf_l="no";;
-       --debug)       debug="yes";;
-       -v|--verbose)  beverbose="yes";;
-       -l|--local)    allowlocal="yes" ;;
-       -H|--hostonly) hostonly_l="yes" ;;
-       --fstab)       use_fstab_l="yes" ;;
-       -h|--help)     usage; exit 1 ;;
-       -i|--include)  include_src="$2"; include_target="$3"; shift 2;;
+        --debug)       debug="yes";;
+        -v|--verbose)  beverbose="yes";;
+        -l|--local)    allowlocal="yes" ;;
+        -H|--hostonly) hostonly_l="yes" ;;
+        --fstab)       use_fstab_l="yes" ;;
+        -h|--help)     usage; exit 1 ;;
+        -i|--include)  include_src="$2"; include_target="$3"; shift 2;;
         --bzip2)       [[ $compress != cat ]] && compress="bzip2 -9";;
         --lzma)          [[ $compress != cat ]] && compress="lzma -9";;
         --no-compress) compress="cat";;
@@ -147,8 +150,8 @@ while (($# > 0)); do
             ignore_kmodules="yes"
             omit_dracutmodules_l+=\ kernel-modules
             ;;
-       -*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
-       *) break ;;
+        -*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
+        *) break ;;
     esac
     shift
 done
@@ -163,7 +166,8 @@ export PATH
 
 [[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
 
-[[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && dracutbasedir="${0%/*}" 
+[[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && \
+    dracutbasedir="${0%/*}" 
 
 # if we were not passed a config file, try the default one
 if [[ ! -f $conffile ]]; then
@@ -182,7 +186,7 @@ fi
 # source our config dir
 if [[ $confdir && -d $confdir ]]; then
     for f in "$confdir"/*.conf; do 
-       [[ -e $f ]] && . "$f"
+        [[ -e $f ]] && . "$f"
     done
 fi
 
@@ -213,11 +217,12 @@ fw_dir=${fw_dir//:/ }
 [[ $compress ]] || compress="gzip -9"
 
 if [[ -f $dracutbasedir/dracut-functions ]]; then
-   . $dracutbasedir/dracut-functions
+    . $dracutbasedir/dracut-functions
 else
-   echo "Cannot find $dracutbasedir/dracut-functions. Are you running from a git checkout?"
-   echo "Try passing -l as an argument to $0"
-   exit 1
+    echo "Cannot find $dracutbasedir/dracut-functions."
+    echo "Are you running from a git checkout?"
+    echo "Try passing -l as an argument to $0"
+    exit 1
 fi
 
 dracutfunctions=$dracutbasedir/dracut-functions
@@ -270,13 +275,16 @@ elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
     exit 1
 fi
 
-hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
+hookdirs="cmdline pre-udev pre-trigger netroot pre-mount"
+hookdirs+=" pre-pivot mount emergency"
 
 [[ $TMPDIR && ! -w $TMPDIR ]] && unset TMPDIR
 readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
 
-trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT # clean up after ourselves no matter how we die.
-trap 'exit 1;' SIGINT # clean up after ourselves no matter how we die.
+# clean up after ourselves no matter how we die.
+trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT 
+# clean up after ourselves no matter how we die.
+trap 'exit 1;' SIGINT 
 
 # Need to be able to have non-root users read stuff (rpcbind etc)
 chmod 755 "$initdir"
@@ -288,29 +296,30 @@ export initdir hookdirs dracutbasedir dracutmodules drivers \
 
 if [[ $kernel_only != yes ]]; then
     # Create some directory structure first
-    for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do 
-       inst_dir "/$d"; 
+    for d in bin sbin usr/bin usr/sbin usr/lib etc \
+        proc sys sysroot tmp dev/pts var/run; do 
+        inst_dir "/$d"; 
     done
 fi
 
 # check all our modules to see if they should be sourced.
 # This builds a list of modules that we will install next.
 check_modules
-  
+
 # source our modules.
 for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
     mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
     if strstr "$mods_to_load" " $mod "; then
-       dinfo "*** Sourcing module $mod"
-       if [[ $kernel_only = yes ]]; then
-           [[ -x $moddir/installkernel ]] && . "$moddir/installkernel"
-       else
-           . "$moddir/install"
-           if [[ $no_kernel != yes && -x $moddir/installkernel ]]; then
-               . "$moddir/installkernel"
-           fi
-       fi
-       mods_to_load=${mods_to_load// $mod /}
+        dinfo "*** Sourcing module $mod"
+        if [[ $kernel_only = yes ]]; then
+            [[ -x $moddir/installkernel ]] && . "$moddir/installkernel"
+        else
+            . "$moddir/install"
+            if [[ $no_kernel != yes && -x $moddir/installkernel ]]; then
+                . "$moddir/installkernel"
+            fi
+        fi
+        mods_to_load=${mods_to_load// $mod /}
     fi
 done
 unset moddir
@@ -330,45 +339,38 @@ if [[ $include_src && $include_target ]]; then
 fi
 
 for item in $install_items; do
-   dracut_install "$item"
+    dracut_install "$item"
 done
 unset item
 
 # make sure that library links are correct and up to date
 cp -ar /etc/ld.so.conf* "$initdir"/etc
-ldconfig -r "$initdir" || [[ $UID != "0" ]] && dinfo "ldconfig might need uid=0 (root) for chroot()"
+ldconfig -r "$initdir" || [[ $UID != "0" ]] && \
+    dinfo "ldconfig might need uid=0 (root) for chroot()"
 
 [[ $beverbose = yes ]] && (du -c "$initdir" | sort -n)
 
 # strip binaries 
 if [[ $do_strip = yes ]] ; then
     for p in strip grep find; do 
-       if ! type -P $p >/dev/null; then
-           derror "Could not find '$p'. You should run $0 with '--nostrip'."
-           do_strip=no
-       fi
+        if ! type -P $p >/dev/null; then
+            derror "Could not find '$p'. You should run $0 with '--nostrip'."
+            do_strip=no
+        fi
     done
 fi
 
 if [[ $do_strip = yes ]] ; then
-    for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '*/lib/modules/*.ko' \) ); do
-       dinfo "Stripping $f"
-       strip -g "$f" 2>/dev/null|| :
-        #
-        # FIXME: only strip -g for now
-        #
-       #strip -g --strip-unneeded "$f" || :
-       #note="-R .note"
-       #if objdump -h $f | grep '^[    ]*[0-9]*[       ]*.note[        ]' -A 1 | \
-       #    grep -q ALLOC; then
-       #    note=
-       #fi
-       #strip -R .comment $note "$f" || :
+    for f in $(find "$initdir" -type f \
+        \( -perm -0100 -or -perm -0010 -or -perm -0001 \
+           -or -path '*/lib/modules/*.ko' \) ); do
+        dinfo "Stripping $f"
+        strip -g "$f" 2>/dev/null|| :
     done
 fi
 
 type hardlink &>/dev/null && {
-       hardlink "$initdir" 2>&1
+    hardlink "$initdir" 2>&1
 }
 
 if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
index d49d0e2..88c404d 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash --norc
-
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+#
 # Copyright 2009 Red Hat, Inc.  All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -31,7 +33,8 @@ derror() {
 
 usage() {
 #                                                       80x25 linebreak here ^
-       echo "Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
+    cat << EOF
+Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
 Creates initial ramdisk image by concatenating several images from the command
 line and /boot/dracut/
 
@@ -45,7 +48,7 @@ line and /boot/dracut/
   -h, --help            This message
   --debug               Output debug information of the build process
   -v, --verbose         Verbose output during the build process
-"
+EOF
 }
 
 
@@ -54,16 +57,16 @@ overlay=/var/lib/dracut/overlay
 
 while (($# > 0)); do
     case $1 in
-       -f|--force) force=yes;;
-       -i|--imagedir) imagedir=$2;shift;;
-       -o|--overlaydir) overlay=$2;shift;;
-       --nooverlay) no_overlay=yes;shift;;
-       --noimagedir) no_imagedir=yes;shift;;
-       -h|--help) usage; exit 1 ;;
-       --debug) debug="yes";;
-       -v|--verbose) beverbose="yes";;
-       -*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
-       *) break ;;
+        -f|--force) force=yes;;
+        -i|--imagedir) imagedir=$2;shift;;
+        -o|--overlaydir) overlay=$2;shift;;
+        --nooverlay) no_overlay=yes;shift;;
+        --noimagedir) no_imagedir=yes;shift;;
+        -h|--help) usage; exit 1 ;;
+        --debug) debug="yes";;
+        -v|--verbose) beverbose="yes";;
+        -*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
+        *) break ;;
     esac
     shift
 done
@@ -108,7 +111,7 @@ fi
 
 if [[ ! $no_imagedir ]]; then
     for i in "$imagedir/"*.img; do
-       [[ -f $i ]] && images+=("$i")
+        [[ -f $i ]] && images+=("$i")
     done
 fi
 
index f2b7ffb..421f2c7 100755 (executable)
@@ -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
 #
 # functions used by dracut and other tools.
 #
@@ -58,8 +60,8 @@ vercmp() {
 # Log initrd creation.
 if ! [[ $dracutlogfile ]]; then
     [[ $dracutbasedir = /usr/share/dracut ]] && \
-       dracutlogfile=/var/log/dracut.log || \
-       dracutlogfile=/tmp/dracut.log
+        dracutlogfile=/var/log/dracut.log || \
+        dracutlogfile=/tmp/dracut.log
 #    [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log
     if [[ -w $dracutlogfile ]]; then
         >"$dracutlogfile"
@@ -99,21 +101,21 @@ get_fs_env() {
     [[ $ID_FS_TYPE ]] && return
 
     if [[ -x /lib/udev/vol_id ]]; then
-       eval $(/lib/udev/vol_id --export $1)
+        eval $(/lib/udev/vol_id --export $1)
     elif find_binary blkid >/dev/null; then
-       eval $(blkid -o udev $1)
+        eval $(blkid -o udev $1)
     else
-       return 1
+        return 1
     fi
 }
 
 get_fs_type() (
     [[ $1 ]] || return
     if [[ $1 != ${1#/dev/block/nfs:} ]] \
-       || [[ $1 != ${1#/dev/block/nfs3:} ]] \
-       || [[ $1 != ${1#/dev/block/nfs4:} ]]; then
-       echo "nfs"
-       return
+        || [[ $1 != ${1#/dev/block/nfs3:} ]] \
+        || [[ $1 != ${1#/dev/block/nfs4:} ]]; then
+        echo "nfs"
+        return
     fi
     get_fs_env $1 || return
     echo $ID_FS_TYPE
@@ -127,32 +129,32 @@ get_fs_uuid() (
 # finds the major:minor of the block device backing the root filesystem.
 find_block_device() {
     local x mpt majmin dev fs misc maj min
-    if [[ $use_fstab != yes ]]; then   
-       while read x x majmin x mpt x x fs misc; do
+    if [[ $use_fstab != yes ]]; then    
+        while read x x majmin x mpt x x fs misc; do
             [[ $fs = nfs ]] && { echo $dev; return 0;}
             [[ $fs = nfs3 ]] && { echo $dev; return 0;}
             [[ $fs = nfs4 ]] && { echo $dev; return 0;}
-           if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then
-               echo $majmin; 
-               return 0 # we have a winner!
-           fi
-       done < /proc/self/mountinfo       
+            if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then
+                echo $majmin; 
+                return 0 # we have a winner!
+            fi
+        done < /proc/self/mountinfo       
     fi
     # fall back to /etc/fstab    
     while read dev mpt fs misc; do
-       if [[ $mpt = $1 ]]; then
+        if [[ $mpt = $1 ]]; then
             [[ $fs = nfs ]] && { echo $dev; return 0;}
             [[ $fs = nfs3 ]] && { echo $dev; return 0;}
             [[ $fs = nfs4 ]] && { echo $dev; return 0;}
             [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=}
             [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=}
-           [[ -b $dev ]] || return 1 # oops, not a block device.
-           ls -nLl "$dev" | { 
-               read x x x x maj min x;
-               maj=${maj//,/}; 
-               echo $maj:$min; 
-           } && return 0
-       fi
+            [[ -b $dev ]] || return 1 # oops, not a block device.
+            ls -nLl "$dev" | { 
+                read x x x x maj min x;
+                maj=${maj//,/}; 
+                echo $maj:$min; 
+            } && return 0
+        fi
     done < /etc/fstab
     return 1;
 }
@@ -169,12 +171,12 @@ check_block_and_slaves() {
     "$1" $2 && return
     check_vol_slaves "$@" && return 0
     if [[ -f /sys/dev/block/$2/../dev ]]; then
-       check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") &&  return 0
+        check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") &&  return 0
     fi
     [[ -d /sys/dev/block/$2/slaves ]] || return 1
     for x in /sys/dev/block/$2/slaves/*/dev; do
         [[ -f $x ]] || continue
-       check_block_and_slaves $1 $(cat "$x") &&  return 0
+        check_block_and_slaves $1 $(cat "$x") &&  return 0
     done
     return 1
 }
@@ -191,19 +193,19 @@ get_numeric_dev() {
 # And the volume group might be bigger than the devices the LV needs.
 check_vol_slaves() {
     for i in /dev/mapper/*; do 
-       lv=$(get_numeric_dev $i)
-       if [[ $lv = $2 ]]; then
-           vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
-           # strip space
-           vg=$(echo $vg)
-           if [[ $vg ]]; then
-               for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \
-                   do
-                   check_block_and_slaves $1 $(get_numeric_dev $pv) \
-                       &&  return 0
-               done
-           fi
-       fi
+        lv=$(get_numeric_dev $i)
+        if [[ $lv = $2 ]]; then
+            vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
+            # strip space
+            vg=$(echo $vg)
+            if [[ $vg ]]; then
+                for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \
+                    do
+                    check_block_and_slaves $1 $(get_numeric_dev $pv) \
+                        &&  return 0
+                done
+            fi
+        fi
     done
     return 1
 }
@@ -286,13 +288,13 @@ inst_library() {
     local src=$1 dest=${2:-$1} lib reallib symlink
     [[ -e $initdir$dest ]] && return 0
     if [[ -L $src ]]; then
-       reallib=$(readlink -f "$src")
-       lib=${src##*/}
-       inst_simple "$reallib" "$reallib"
-       inst_dir "${dest%/*}"
-       (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
+        reallib=$(readlink -f "$src")
+        lib=${src##*/}
+        inst_simple "$reallib" "$reallib"
+        inst_dir "${dest%/*}"
+        (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
     else
-       inst_simple "$src" "$dest"
+        inst_simple "$src" "$dest"
     fi
 
     # Create additional symlinks.  See rev_symlinks description.
@@ -310,7 +312,7 @@ find_binary() {
     local binpath="/bin /sbin /usr/bin /usr/sbin" p
     [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } 
     for p in $binpath; do
-       [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
+        [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
     done
     return 1
 }
@@ -326,33 +328,33 @@ inst_binary() {
     [[ -e $initdir$target ]] && return 0
     # I love bash!
     LC_ALL=C ldd $bin 2>/dev/null | while read line; do
-       [[ $line = 'not a dynamic executable' ]] && return 1
-       if [[ $line =~ not\ found ]]; then
-           derror "Missing a shared library required by $bin."
-           derror "Run \"ldd $bin\" to find out what it is."
-           derror "dracut cannot create an initrd."
-           exit 1
-       fi
-       so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
-       [[ $line =~ $so_regex ]] || continue
-       FILE=${BASH_REMATCH[1]}
-       [[ -e ${initdir}$FILE ]] && continue
-       # see if we are loading an optimized version of a shared lib.
-       lib_regex='^(/lib[^/]*).*'
-       if [[ $FILE =~ $lib_regex ]]; then
+        [[ $line = 'not a dynamic executable' ]] && return 1
+        if [[ $line =~ not\ found ]]; then
+            derror "Missing a shared library required by $bin."
+            derror "Run \"ldd $bin\" to find out what it is."
+            derror "dracut cannot create an initrd."
+            exit 1
+        fi
+        so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
+        [[ $line =~ $so_regex ]] || continue
+        FILE=${BASH_REMATCH[1]}
+        [[ -e ${initdir}$FILE ]] && continue
+        # see if we are loading an optimized version of a shared lib.
+        lib_regex='^(/lib[^/]*).*'
+        if [[ $FILE =~ $lib_regex ]]; then
             TLIBDIR=${BASH_REMATCH[1]}
             BASE=${FILE##*/}
-           # prefer nosegneg libs, then unoptimized ones.
-           for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do
-               [[ -e $f/$BASE ]] || continue
-               FILE=$f/$BASE
-               break
-           done
-           inst_library "$FILE" "$TLIBDIR/$BASE"
+            # prefer nosegneg libs, then unoptimized ones.
+            for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do
+                [[ -e $f/$BASE ]] || continue
+                FILE=$f/$BASE
+                break
+            done
+            inst_library "$FILE" "$TLIBDIR/$BASE"
             IF_dynamic=yes
-           continue
-       fi
-        inst_library "$FILE" 
+            continue
+            fi
+            inst_library "$FILE" 
     done
     inst_simple "$bin" "$target"
 }
@@ -384,7 +386,7 @@ inst_symlink() {
 find_rule() {
     [[ -f $1 ]] && { echo "$1"; return 0; }
     for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do
-       [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; }
+        [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; }
     done
     return 1
 }
@@ -409,14 +411,14 @@ inst() {
     case $# in
         1) ;;
         2) [[ ! $initdir && -d $2 ]] && export initdir=$2
-           [[ $initdir = $2 ]] && set $1;;
+            [[ $initdir = $2 ]] && set $1;;
         3) [[ -z $initdir ]] && export initdir=$2 
-           set $1 $3;;
+            set $1 $3;;
         *) derror "inst only takes 1 or 2 or 3 arguments"
-           exit 1;;
+            exit 1;;
     esac
     for x in inst_symlink inst_script inst_binary inst_simple; do
-       $x "$@" && return 0
+        $x "$@" && return 0
     done
     return 1
 }
@@ -426,31 +428,31 @@ inst() {
 # All hooks should be POSIX/SuS compliant, they will be sourced by init.
 inst_hook() {
     if ! [[ -f $3 ]]; then
-       derror "Cannot install a hook ($3) that does not exist."
-       derror "Aborting initrd creation."
-       exit 1
+        derror "Cannot install a hook ($3) that does not exist."
+        derror "Aborting initrd creation."
+        exit 1
     elif ! strstr "$hookdirs" "$1"; then
-       derror "No such hook type $1. Aborting initrd creation." 
-       exit 1
+        derror "No such hook type $1. Aborting initrd creation." 
+        exit 1
     fi
     inst_simple "$3" "/${1}/${2}${3##*/}"
 }
 
 dracut_install() {
     if [[ $1 = '-o' ]]; then 
-       local optional=yes
-       shift
+        local optional=yes
+        shift
     fi
     while (($# > 0)); do
-       if ! inst "$1" ; then
-           if [[ $optional = yes ]]; then
-               dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
-           else
-               derror "Failed to install $1"
-               exit 1
+        if ! inst "$1" ; then
+            if [[ $optional = yes ]]; then
+                dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
+            else
+                derror "Failed to install $1"
+                exit 1
             fi
-       fi
-       shift
+        fi
+        shift
     done
 }
 
@@ -511,15 +513,15 @@ check_module_deps() {
     [[ -d $moddir && -x $moddir/install ]] || return 1
     # if we do not have a check script, we are unconditionally included
     if [[ -x $moddir/check ]]; then
-       "$moddir/check"
+        "$moddir/check"
         ret=$?
-       # a return value of 255 = load module only as a dependency.
-       ((ret==0||ret==255)) || return 1
-       for dep in $("$moddir/check" -d); do
-           check_module_deps "$dep" && continue
-           dwarning "Dependency $mod failed."
-           return 1
-       done
+        # a return value of 255 = load module only as a dependency.
+        ((ret==0||ret==255)) || return 1
+        for dep in $("$moddir/check" -d); do
+            check_module_deps "$dep" && continue
+            dwarning "Dependency $mod failed."
+            return 1
+        done
     fi
     mods_to_load+=" $1 "
 }
@@ -535,9 +537,9 @@ should_source_module() {
     [[ -x $1/check ]] || return 0
     "$1/check" $hostonly || continue
     for dep in $("$1/check" -d); do
-       check_module_deps "$dep" && continue
-       dwarning "Cannot load dracut module \"$mod\", dependencies failed."
-       return 1
+        check_module_deps "$dep" && continue
+        dwarning "Cannot load dracut module \"$mod\", dependencies failed."
+        return 1
     done
 }
 
@@ -545,33 +547,33 @@ check_modules() {
     local modcheck;
     local mod;
     for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
-       local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
-       # If we are already scheduled to be loaded, no need to check again.
-       strstr " $mods_to_load " " $mod " && continue
-       # This should never happen, but...
-       [[ -d $moddir ]] || continue
+        local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
+        # If we are already scheduled to be loaded, no need to check again.
+        strstr " $mods_to_load " " $mod " && continue
+        # This should never happen, but...
+        [[ -d $moddir ]] || continue
         strstr " $omit_dracutmodules " " $mod " && continue
 
         if ! strstr " $dracutmodules $add_dracutmodules " " $mod "; then
             # module not in our list
-           if [[ $dracutmodules = all ]]; then
+            if [[ $dracutmodules = all ]]; then
                 # check, if we can install this module
-               should_source_module "$moddir" || continue
+                should_source_module "$moddir" || continue
             else
                 # skip this module
                 continue
             fi
-       else
-           if [ -x "$moddir/check" ] \
+        else
+            if [ -x "$moddir/check" ] \
                 && "$moddir/check" -d > /dev/null 2>&1; then
-               check_module_deps "$mod" || {
-                   dwarning "Cannot load dracut module \"$mod\", dependencies failed."
+                check_module_deps "$mod" || {
+                    dwarning "Cannot load dracut module \"$mod\", dependencies failed."
                     continue
                 }
             fi
         fi
 
-       mods_to_load+=" $mod "
+        mods_to_load+=" $mod "
     done
 
     modcheck=$add_dracutmodules
@@ -589,18 +591,18 @@ install_kmod_with_fw() {
     local modname=${1##*/} fwdir found
     modname=${modname%.ko*}
     inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \
-       return 0 # no need to go further if the module is already installed
+        return 0 # no need to go further if the module is already installed
     for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
-       found=''
-       for fwdir in $fw_dir; do
-           if [[ -d $fwdir && -f $fwdir/$fw ]]; then
-               inst_simple "$fwdir/$fw" "/lib/firmware/$fw"
-               found=yes
-           fi
-       done
-       if [[ $found != yes ]]; then
-           dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\""
-       fi
+        found=''
+        for fwdir in $fw_dir; do
+            if [[ -d $fwdir && -f $fwdir/$fw ]]; then
+                inst_simple "$fwdir/$fw" "/lib/firmware/$fw"
+                found=yes
+            fi
+        done
+        if [[ $found != yes ]]; then
+            dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\""
+        fi
     done
 }
 
@@ -614,9 +616,9 @@ for_each_kmod_dep() {
     local func=$1 kmod=$2 cmd modpapth options
     shift 2
     modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \
-       while read cmd modpath options; do
-           [[ $cmd = insmod ]] || continue
-           $func $modpath
+        while read cmd modpath options; do
+        [[ $cmd = insmod ]] || continue
+        $func $modpath
     done
 }
 
@@ -630,16 +632,16 @@ for_each_kmod_dep() {
 # This function returns the full filenames of modules that match $1
 filter_kernel_modules () (
     if ! [[ $hostonly ]]; then
-       filtercmd='find "$srcmods/kernel/drivers" -name "*.ko" -o -name "*.ko.gz"'
+        filtercmd='find "$srcmods/kernel/drivers" -name "*.ko" -o -name "*.ko.gz"'
     else
-       filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename -k $kernel'
+        filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename -k $kernel'
     fi
     for modname in $(eval $filtercmd); do
         case $modname in
             *.ko) "$1" "$modname" && echo "$modname";;
             *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko
-                     $1 $initdir/$$.ko && echo "$modname"
-                     rm -f $initdir/$$.ko;;
+                $1 $initdir/$$.ko && echo "$modname"
+                rm -f $initdir/$$.ko;;
         esac
     done
 )
@@ -649,46 +651,46 @@ instmods() {
     [[ $no_kernel = yes ]] && return
     local mod mpargs modpath modname cmd moddirname
     while (($# > 0)); do
-       mod=${1%.ko*}
-       case $mod in
-           =*) # This introduces 2 incompatible meanings for =* arguments
+        mod=${1%.ko*}
+        case $mod in
+            =*) 
+                # This introduces 2 incompatible meanings for =* arguments
                 # to instmods.  We need to decide which one to keep.
-               if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then 
-                   instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block")
-               elif [ -f $srcmods/modules.${mod#=} ]; then
-                   instmods $mpargs $(cat ${srcmods}/modules.${mod#=} )
-               else
-                   instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*")
-               fi
-               ;;
-           --*) mod=${mod##*/}
-                 mpargs+=" $mod";;
+                if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then 
+                    instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block")
+                elif [ -f $srcmods/modules.${mod#=} ]; then
+                    instmods $mpargs $(cat ${srcmods}/modules.${mod#=} )
+                else
+                    instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*")
+                fi
+                ;;
+            --*) 
+                mod=${mod##*/}
+                mpargs+=" $mod";;
             i2o_scsi) shift; continue;; # Do not load this diagnostic-only module
-           *)  mod=${mod##*/}
+            *)  mod=${mod##*/}
                 # if we are already installed, skip this module and go on
-               # to the next one.
-               [[ -f $initdir/$1 ]] && { shift; continue; }
-               # If we are building a host-specific initramfs and this
-               # module is not already loaded, move on to the next one.
-               [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \
-               ! echo $add_drivers | grep -qe "\<${mod}\>" &&  {
-                   shift; continue; 
-               }
-
-               # We use '-d' option in modprobe only if modules prefix path
-               # differs from default '/'.  This allows us to use Dracut with
-               # old version of modprobe which doesn't have '-d' option.
-               moddirname=${srcmods%%/lib/modules/*}
-               [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/"
-
-               # ok, load the module, all its dependencies, and any firmware
-               # it may require
-               for_each_kmod_dep install_kmod_with_fw $mod \
-                   --set-version $kernel ${moddirname}
-               ;;
-       esac      
-       shift
-    done
-} 
+                # to the next one.
+                [[ -f $initdir/$1 ]] && { shift; continue; }
+                # If we are building a host-specific initramfs and this
+                # module is not already loaded, move on to the next one.
+                [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \
+                    ! echo $add_drivers | grep -qe "\<${mod}\>" &&  {
+                    shift; continue; 
+                }
 
-# vim:ts=8:sw=4:sts=4:et
+                # We use '-d' option in modprobe only if modules prefix path
+                # differs from default '/'.  This allows us to use Dracut with
+                # old version of modprobe which doesn't have '-d' option.
+                moddirname=${srcmods%%/lib/modules/*}
+                [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/"
+
+                # ok, load the module, all its dependencies, and any firmware
+                # it may require
+                for_each_kmod_dep install_kmod_with_fw $mod \
+                    --set-version $kernel ${moddirname}
+                ;;
+    esac      
+    shift
+    done
+} 
\ No newline at end of file
index 2066219..37424fa 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/bash --norc
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
 #
 # Copyright 2005-2009 Red Hat, Inc.  All rights reserved.
 #
@@ -43,13 +45,13 @@ function get_verbose() {
 
 
 function get_numeric_dev() {
-(
-    fmt="%d:%d"
-    if [ "$1" == "hex" ]; then
-        fmt="%x:%x"
-    fi
-    ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
-) 2>/dev/null
+    (
+        fmt="%d:%d"
+        if [ "$1" == "hex" ]; then
+            fmt="%x:%x"
+        fi
+        ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
+    ) 2>/dev/null
 }
 
 
@@ -173,7 +175,7 @@ finddevnoinsys() {
     majmin="$1"
     if [ -n "$majmin" ]; then
         dev=$(for x in /sys/block/* ; do find $x/ -name dev ; done | while read device ; do \
-              echo "$majmin" | cmp -s $device && echo $device ; done)
+            echo "$majmin" | cmp -s $device && echo $device ; done)
         if [ -n "$dev" ]; then
             dev=${dev%%/dev}
             dev=${dev%%/}
@@ -309,7 +311,7 @@ iscsi_set_parameters() {
         iscsi_get_rec_val $tmpfile "node.session.auth.password" 
         chap_pw="-w ${result}"
     else
-       chap=""
+        chap=""
     fi
 
     iscsi_get_rec_val $tmpfile "node.session.auth.username_in"
@@ -319,7 +321,7 @@ iscsi_set_parameters() {
         iscsi_get_rec_val $tmpfile "node.session.auth.password_in" 
         chap_in_pw="-W ${result}"
     else
-       chap_in=""
+        chap_in=""
     fi
 
     rm $tmpfile
@@ -395,29 +397,29 @@ handledm() {
     done << EOF
         $(dmsetup table -j $major -m $minor 2>/dev/null)
 EOF
-    local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
-    local vg=$(lvshow "/dev/mapper/$name")
-    local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks") 
-    if [ -n "$vg" ]; then
-        vg=`echo $vg` # strip whitespace
-        case " $vg_list " in
-        *" $vg "*) ;;
-        *)  vg_list="$vg_list $vg"
-            [ -z "$nolvm" ] && find_base_dm_mods
-            ;;
-        esac
-    fi
-    for raid in $raids ; do
-        if [ "$raid" == "$name" ]; then
-            case " $DMRAIDS " in
-                *" $raid "*) ;;
-                *)  DMRAIDS="$DMRAIDS $raid"
-                    [ -z "$nodmraid" ] && find_base_dm_mods
+        local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
+        local vg=$(lvshow "/dev/mapper/$name")
+        local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks") 
+        if [ -n "$vg" ]; then
+            vg=`echo $vg` # strip whitespace
+            case " $vg_list " in
+                *" $vg "*) ;;
+                *)  vg_list="$vg_list $vg"
+                    [ -z "$nolvm" ] && find_base_dm_mods
                     ;;
             esac
-            break
         fi
-    done
+        for raid in $raids ; do
+            if [ "$raid" == "$name" ]; then
+                case " $DMRAIDS " in
+                    *" $raid "*) ;;
+                    *)  DMRAIDS="$DMRAIDS $raid"
+                        [ -z "$nodmraid" ] && find_base_dm_mods
+                        ;;
+                esac
+                break
+            fi
+        done
 }
 
 handleiscsi() {
@@ -440,25 +442,25 @@ handleraid() {
         return 0
     fi
 
-    levels=$(awk "/^$1[         ]*:/ { print\$4 }" /proc/mdstat)
+    levels=$(awk "/^$1[  ]*:/ { print\$4 }" /proc/mdstat)
 
     for level in $levels ; do
         case $level in
-        linear)
-            start=1
-            ;;
-        multipath)
-            start=1
-            ;;
-        raid[01] | raid10)
-            start=1
-            ;;
-        raid[456])
-            start=1
-            ;;
-        *)
-            error "raid level $level (in /proc/mdstat) not recognized"
-            ;;
+            linear)
+                start=1
+                ;;
+            multipath)
+                start=1
+                ;;
+            raid[01] | raid10)
+                start=1
+                ;;
+            raid[456])
+                start=1
+                ;;
+            *)
+                error "raid level $level (in /proc/mdstat) not recognized"
+                ;;
         esac
     done
     if [ "$start" = 1 ]; then
@@ -474,7 +476,7 @@ lvshow() {
 
 vgdisplay() {
     lvm vgdisplay --ignorelockingfailure -v $1 2>/dev/null |
-        sed -n 's/PV Name//p'
+    sed -n 's/PV Name//p'
 }
 
 dmmods_found="n"
@@ -508,78 +510,78 @@ while [ $# -gt 0 ]; do
                 shift
             fi
             ;;
-       --rootdev*)
+        --rootdev*)
             if [ "$1" != "${1##--rootdev=}" ]; then
                 rootdev="${1##--rootdev=}"
             else
                 rootdev="$2"
                 shift
             fi
-           ;;
-       --thawdev*)
+            ;;
+        --thawdev*)
             if [ "$1" != "${1##--thawdev=}" ]; then
                 thawdev="${1##--thawdev=}"
             else
                 thawdev="$2"
                 shift
             fi
-           ;;
-       --rootfs*)
+            ;;
+        --rootfs*)
             if [ "$1" != "${1##--rootfs=}" ]; then
                 rootfs="${1##--rootfs=}"
             else
                 rootfs="$2"
                 shift
             fi
-           ;;
-       --rootopts*)
+            ;;
+        --rootopts*)
             if [ "$1" != "${1##--rootopts=}" ]; then
                 rootopts="${1##--rootopts=}"
             else
                 rootopts="$2"
                 shift
             fi
-           ;;
-       --root*)
+            ;;
+        --root*)
             if [ "$1" != "${1##--root=}" ]; then
                 root="${1##--root=}"
             else
                 root="$2"
                 shift
             fi
-           ;;
-       --loopdev*)
+            ;;
+        --loopdev*)
             if [ "$1" != "${1##--loopdev=}" ]; then
                 loopdev="${1##--loopdev=}"
             else
                 loopdev="$2"
                 shift
             fi
-           ;;
-       --loopfs*)
+            ;;
+        --loopfs*)
             if [ "$1" != "${1##--loopfs=}" ]; then
                 loopfs="${1##--loopfs=}"
             else
                 loopfs="$2"
                 shift
             fi
-           ;;
-       --loopopts*)
+            ;;
+        --loopopts*)
             if [ "$1" != "${1##--loopopts=}" ]; then
                 loopopts="${1##--loopopts=}"
             else
                 loopopts="$2"
                 shift
             fi
-           ;;
-       --looppath*)
+            ;;
+        --looppath*)
             if [ "$1" != "${1##--looppath=}" ]; then
                 looppath="${1##--looppath=}"
             else
                 looppath="$2"
                 shift
             fi
-           ;;
+            ;;
         --help)
             usage -n
             ;;
@@ -597,33 +599,33 @@ while [ $# -gt 0 ]; do
     shift
 done
 
-    [ -z "$rootfs" ] && rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
-    [ -z "$rootopts" ] && rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
-    [ -z "$rootopts" ] && rootopts="defaults"
+[ -z "$rootfs" ] && rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
+[ -z "$rootopts" ] && rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
+[ -z "$rootopts" ] && rootopts="defaults"
 
 
-    [ -z "$rootdev" ] && rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab)
+[ -z "$rootdev" ] && rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab)
     # check if it's nfsroot
-    physdev=""
-    if [ "$rootfs" == "nfs" ]; then
-        if [ "x$net_list" == "x" ]; then
-            handlenfs $rootdev
-        fi
-    else
-        # check if it's root by label
-        rdev=$rootdev
-        rdev=$(resolve_device_name "$rdev")
-        rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
-        findstoragedriver "$rdev"
+physdev=""
+if [ "$rootfs" == "nfs" ]; then
+    if [ "x$net_list" == "x" ]; then
+        handlenfs $rootdev
     fi
+else
+        # check if it's root by label
+    rdev=$rootdev
+    rdev=$(resolve_device_name "$rdev")
+    rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
+    findstoragedriver "$rdev"
+fi
 
     # find the first swap dev which would get used for swsusp
-    [ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
-    swsuspdev="$thawdev"
-    if [ -n "$swsuspdev" ]; then
-        swsuspdev=$(resolve_device_name "$swsuspdev")
-       findstoragedriver "$swsuspdev"
-    fi
+[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
+swsuspdev="$thawdev"
+if [ -n "$swsuspdev" ]; then
+    swsuspdev=$(resolve_device_name "$swsuspdev")
+    findstoragedriver "$swsuspdev"
+fi
 
 
 cemit()
@@ -678,7 +680,7 @@ fi
 
 if [ -z "$nolvm" -a -n "$vg_list" ]; then    
     for vg in $vg_list; do 
-       echo -n "rd_LVM_VG=$vg "
+        echo -n "rd_LVM_VG=$vg "
     done
 else
     echo -n "rd_NO_LVM "
@@ -712,4 +714,3 @@ if [ -n "$rootdev" ]; then
 fi
 
 echo
-# vim:ts=8:sw=4:sts=4:et
index 36a98a2..259c774 100755 (executable)
@@ -1,4 +1,6 @@
-#!/bin/sh
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
 
 STATEDIR=/var/lib/dracut
 BOOTDIR=/boot
@@ -11,23 +13,23 @@ version=""
 set -e
 
 if        $USETRIGGERS                                         \
-       && [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ]                \
-       && [ $# = 1 ]                                           \
-       && [ x"$1" = x-u ]                                      \
-       && dpkg-trigger --check-supported 2>/dev/null
+    && [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ]                \
+    && [ $# = 1 ]                                           \
+    && [ x"$1" = x-u ]                                      \
+    && dpkg-trigger --check-supported 2>/dev/null
 then
-       if dpkg-trigger --no-await update-initramfs; then
-               echo "dracut-update-initramfs: deferring update (trigger activated)"
-               exit 0
-       fi
+    if dpkg-trigger --no-await update-initramfs; then
+        echo "dracut-update-initramfs: deferring update (trigger activated)"
+        exit 0
+    fi
 fi
 
 usage()
 {
-       if [ -n "${1}" ]; then
-               printf "${@}\n\n" >&2
-       fi
-       cat >&2 << EOF
+    if [ -n "${1}" ]; then
+        printf "${@}\n\n" >&2
+    fi
+    cat >&2 << EOF
 Usage: ${0} [OPTION]...
 
 Options:
@@ -41,422 +43,422 @@ Options:
  -h            This message
 
 EOF
-       exit 1
+    exit 1
 }
 
 # chroot check
 chrooted()
 {
         # borrowed from udev's postinst
-        if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
+    if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
                 # the devicenumber/inode pair of / is the same as that of
                 # /sbin/init's root, so we're *not* in a chroot and hence
                 # return false.
-                return 1
-        fi
-        return 0
+        return 1
+    fi
+    return 0
 }
 
 mild_panic()
 {
-       if [ -n "${1}" ]; then
-               printf "${@}\n" >&2
-       fi
-       exit 0
+    if [ -n "${1}" ]; then
+        printf "${@}\n" >&2
+    fi
+    exit 0
 }
 
 panic()
 {
-       if [ -n "${1}" ]; then
-               printf "${@}\n" >&2
-       fi
-       exit 1
+    if [ -n "${1}" ]; then
+        printf "${@}\n" >&2
+    fi
+    exit 1
 }
 
 verbose()
 {
-       if [ "${verbose}" = 1 ]; then
-               printf "${@}\n"
-       fi
+    if [ "${verbose}" = 1 ]; then
+        printf "${@}\n"
+    fi
 }
 
 version_exists()
 {
-       [ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ]
-       return $?
+    [ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ]
+    return $?
 }
 
 set_initramfs()
 {
-       initramfs="${BOOTDIR}/dracut.img-${version}"
+    initramfs="${BOOTDIR}/dracut.img-${version}"
 }
 
 
 # backup initramfs while running
 backup_initramfs()
 {
-       [ ! -r "${initramfs}" ] && return 0
-       initramfs_bak="${initramfs}.dpkg-bak"
-       [ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}"
-       ln -f "${initramfs}" "${initramfs_bak}" \
-               || cp -a "${initramfs}" "${initramfs_bak}"
-       verbose "Keeping ${initramfs_bak}"
+    [ ! -r "${initramfs}" ] && return 0
+    initramfs_bak="${initramfs}.dpkg-bak"
+    [ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}"
+    ln -f "${initramfs}" "${initramfs_bak}" \
+        || cp -a "${initramfs}" "${initramfs_bak}"
+    verbose "Keeping ${initramfs_bak}"
 }
 
 # keep booted initramfs
 backup_booted_initramfs()
 {
-       initramfs_bak="${initramfs}.dpkg-bak"
+    initramfs_bak="${initramfs}.dpkg-bak"
 
        # first time run thus no backup
-       [ ! -r "${initramfs_bak}" ] && return 0
+    [ ! -r "${initramfs_bak}" ] && return 0
 
        # chroot with no /proc
-       [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0
+    [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0
 
        # no kept backup wanted
-       [ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0
+    [ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0
 
        # no backup yet
-       if [ ! -r "${initramfs}.bak" ]; then
-               mv -f ${initramfs_bak} "${initramfs}.bak"
-               verbose "Backup ${initramfs}.bak"
-               return 0
-       fi
+    if [ ! -r "${initramfs}.bak" ]; then
+        mv -f ${initramfs_bak} "${initramfs}.bak"
+        verbose "Backup ${initramfs}.bak"
+        return 0
+    fi
 
        # keep booted initramfs
-       uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime)
-       if [ -n "$uptime_days" ]; then
-               boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days})
-       fi
-       if [ -n "${boot_initramfs}" ]; then
-               mv -f "${initramfs_bak}" "${initramfs}.bak"
-               verbose "Backup ${initramfs}.bak"
-               return 0
-       fi
-       verbose "Removing current backup ${initramfs_bak}"
-       rm -f ${initramfs_bak}
+    uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime)
+    if [ -n "$uptime_days" ]; then
+        boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days})
+    fi
+    if [ -n "${boot_initramfs}" ]; then
+        mv -f "${initramfs_bak}" "${initramfs}.bak"
+        verbose "Backup ${initramfs}.bak"
+        return 0
+    fi
+    verbose "Removing current backup ${initramfs_bak}"
+    rm -f ${initramfs_bak}
 }
 
 # nuke generated copy
 remove_initramfs()
 {
-       [ -z "${initramfs_bak}" ] && return 0
-       rm -f "${initramfs_bak}"
-       verbose "Removing ${initramfs_bak}"
+    [ -z "${initramfs_bak}" ] && return 0
+    rm -f "${initramfs_bak}"
+    verbose "Removing ${initramfs_bak}"
 }
 
 
 generate_initramfs()
 {
-       echo "dracut-update-initramfs: Generating ${initramfs}"
-       OPTS=""
-       if [ "${verbose}" = 1 ]; then
-               OPTS="-v ${OPTS}"
-       fi
+    echo "dracut-update-initramfs: Generating ${initramfs}"
+    OPTS=""
+    if [ "${verbose}" = 1 ]; then
+        OPTS="-v ${OPTS}"
+    fi
        ##WORK HERE!
-       if dracut ${OPTS} "${initramfs}.new" "${version}"; then
-               mv -f "${initramfs}.new" "${initramfs}"
-               set_sha1
-       else
-               mkinitramfs_return="$?"
-               remove_initramfs
-               rm -f "${initramfs}.new"
-               if [ "$mkinitramfs_return" = "2" ]; then
+    if dracut ${OPTS} "${initramfs}.new" "${version}"; then
+        mv -f "${initramfs}.new" "${initramfs}"
+        set_sha1
+    else
+        mkinitramfs_return="$?"
+        remove_initramfs
+        rm -f "${initramfs}.new"
+        if [ "$mkinitramfs_return" = "2" ]; then
                        # minversion wasn't met, exit 0
-                       exit 0
-               fi
-               echo "update-initramfs: failed for ${initramfs}"
-               exit $mkinitramfs_return
-       fi
+            exit 0
+        fi
+        echo "update-initramfs: failed for ${initramfs}"
+        exit $mkinitramfs_return
+    fi
 }
 
 # lilo call
 run_lilo()
 {
        # show lilo errors on failure
-       if ! lilo -t  > /dev/null 2>&1 ; then
-               echo "ERROR lilo fails for new ${initramfs}:"
-               echo
-               lilo -t
-       fi
-       lilo
+    if ! lilo -t  > /dev/null 2>&1 ; then
+        echo "ERROR lilo fails for new ${initramfs}:"
+        echo
+        lilo -t
+    fi
+    lilo
 }
 
 # check if lilo is on mbr
 mbr_check()
 {
        # try to discover grub|grub2 and be happy
-       [ -r /boot/grub/grub.cfg ] \
-               && groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \
-                       /boot/grub/grub.cfg)
-       [ -r /boot/grub/menu.lst ] \
-               && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \
-                       /boot/grub/menu.lst)
-       [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \
-               && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map)
-       [ -n "${dev}" ] && [ -r ${dev} ] \
-               && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \
-               | grep -q GRUB && return 0
+    [ -r /boot/grub/grub.cfg ] \
+        && groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \
+        /boot/grub/grub.cfg)
+    [ -r /boot/grub/menu.lst ] \
+        && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \
+        /boot/grub/menu.lst)
+    [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \
+        && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map)
+    [ -n "${dev}" ] && [ -r ${dev} ] \
+        && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \
+        | grep -q GRUB && return 0
 
        # check out lilo.conf for validity
-       boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf)
-       [ -z "${boot}" ] && return 0
-       case ${boot} in
-       /dev/md/*)
-               if [ -r /proc/mdstat ]; then
-                       MD=${boot#/dev/md/}
-                       boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \
-                       /proc/mdstat)"
-               fi
-               ;;
-       /dev/md*)
-               if [ -r /proc/mdstat ]; then
-                       MD=${boot#/dev/}
-                       boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \
-                       /proc/mdstat)"
-               fi
-               ;;
-       esac
-       [ ! -r "${boot}" ] && return 0
-       dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \
-               && run_lilo && return 0
+    boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf)
+    [ -z "${boot}" ] && return 0
+    case ${boot} in
+        /dev/md/*)
+            if [ -r /proc/mdstat ]; then
+                MD=${boot#/dev/md/}
+                boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \
+                    /proc/mdstat)"
+            fi
+            ;;
+        /dev/md*)
+            if [ -r /proc/mdstat ]; then
+                MD=${boot#/dev/}
+                boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \
+                    /proc/mdstat)"
+            fi
+            ;;
+    esac
+    [ ! -r "${boot}" ] && return 0
+    dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \
+        && run_lilo && return 0
 
        # no idea which bootloader is used
-       echo
-       echo "WARNING: grub and lilo installed."
-       echo "If you use grub as bootloader everything is fine."
-       echo "If you use lilo as bootloader you must run lilo!"
-       echo
+    echo
+    echo "WARNING: grub and lilo installed."
+    echo "If you use grub as bootloader everything is fine."
+    echo "If you use lilo as bootloader you must run lilo!"
+    echo
 }
 
 # Invoke bootloader
 run_bootloader()
 {
        # if both lilo and grub around, figure out if lilo needs to be run
-       if ( command -v update-grub >/dev/null 2>&1 \
-               || [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \
-       && ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then
-               [ -r "${KPKGCONF}" ] && \
-               do_b=$(awk  '/^do_bootloader/{print $3}' "${KPKGCONF}")
-               if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
-               || [ "${do_b}" = "YES" ]; then
-                       run_lilo
-                       return 0
-               elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
-               || [ "${do_b}" = "NO" ]; then
-                       return 0
-               fi
+    if ( command -v update-grub >/dev/null 2>&1 \
+        || [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \
+        && ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then
+        [ -r "${KPKGCONF}" ] && \
+            do_b=$(awk  '/^do_bootloader/{print $3}' "${KPKGCONF}")
+        if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
+            || [ "${do_b}" = "YES" ]; then
+            run_lilo
+            return 0
+        elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
+            || [ "${do_b}" = "NO" ]; then
+            return 0
+        fi
 
                # do_bootloader unconfigured
-               mbr_check
-               return 0
-       fi
-       if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then
-               run_lilo
-               return 0
-       fi
-       if command -v elilo >/dev/null 2>&1; then
-               elilo
-               return 0
-       fi
-       if [ -r /etc/zipl.conf ]; then
-               zipl
-       fi
-       if flash-kernel --supported >/dev/null 2>&1; then
-               flash-kernel ${version}
-       fi
+        mbr_check
+        return 0
+    fi
+    if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then
+        run_lilo
+        return 0
+    fi
+    if command -v elilo >/dev/null 2>&1; then
+        elilo
+        return 0
+    fi
+    if [ -r /etc/zipl.conf ]; then
+        zipl
+    fi
+    if flash-kernel --supported >/dev/null 2>&1; then
+        flash-kernel ${version}
+    fi
 }
 
 compare_sha1()
 {
-       sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1
-       return $?
+    sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1
+    return $?
 }
 
 # Note that this must overwrite so that updates work.
 set_sha1()
 {
-       sha1sum "${initramfs}" > "${STATEDIR}/${version}"
+    sha1sum "${initramfs}" > "${STATEDIR}/${version}"
 }
 
 delete_sha1()
 {
-       rm -f "${STATEDIR}/${version}"
+    rm -f "${STATEDIR}/${version}"
 }
 
 # ro /boot is not modified
 ro_boot_check()
 {
        # check irrelevant inside of a chroot
-       if [ ! -r /proc/mounts ] || chrooted; then
-               return 0
-       fi
-
-       boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \
-               && $2 == "/boot") print "ro"}' /proc/mounts)
-       if [ -n "${boot_opts}" ]; then
-               echo "WARNING: /boot is ro mounted."
-               echo "update-initramfs: Not updating ${initramfs}"
-               exit 0
-       fi
+    if [ ! -r /proc/mounts ] || chrooted; then
+        return 0
+    fi
+
+    boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \
+        && $2 == "/boot") print "ro"}' /proc/mounts)
+    if [ -n "${boot_opts}" ]; then
+        echo "WARNING: /boot is ro mounted."
+        echo "update-initramfs: Not updating ${initramfs}"
+        exit 0
+    fi
 }
 
 get_sorted_versions()
 {
-       version_list=""
-
-       for gsv_x in "${STATEDIR}"/*; do
-               gsv_x="$(basename "${gsv_x}")"
-               if [ "${gsv_x}" = '*' ]; then
-                       return 0
-               fi
-               worklist=""
-               for gsv_i in $version_list; do
-                       if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
-                               worklist="${worklist} ${gsv_x} ${gsv_i}"
-                               gsv_x=""
-                       else
-                               worklist="${worklist} ${gsv_i}"
-                       fi
-               done
-               if [ "${gsv_x}" != "" ]; then
-                       worklist="${worklist} ${gsv_x}"
-               fi
-               version_list="${worklist}"
-       done
-
-       verbose "Available versions: ${version_list}"
+    version_list=""
+
+    for gsv_x in "${STATEDIR}"/*; do
+        gsv_x="$(basename "${gsv_x}")"
+        if [ "${gsv_x}" = '*' ]; then
+            return 0
+        fi
+        worklist=""
+        for gsv_i in $version_list; do
+            if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
+                worklist="${worklist} ${gsv_x} ${gsv_i}"
+                gsv_x=""
+            else
+                worklist="${worklist} ${gsv_i}"
+            fi
+        done
+        if [ "${gsv_x}" != "" ]; then
+            worklist="${worklist} ${gsv_x}"
+        fi
+        version_list="${worklist}"
+    done
+
+    verbose "Available versions: ${version_list}"
 }
 
 set_current_version()
 {
-       if [ -f /boot/dracut.img-`uname -r` ]; then
-               version=`uname -r`
-       fi
+    if [ -f /boot/dracut.img-`uname -r` ]; then
+        version=`uname -r`
+    fi
 }
 
 set_linked_version()
 {
-       if [ -e /initrd.img ] && [ -L /initrd.img ]; then
-               linktarget="$(basename "$(readlink /initrd.img)")"
-       fi
+    if [ -e /initrd.img ] && [ -L /initrd.img ]; then
+        linktarget="$(basename "$(readlink /initrd.img)")"
+    fi
 
-       if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then
-               linktarget="$(basename "$(readlink /boot/initrd.img)")"
-       fi
+    if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then
+        linktarget="$(basename "$(readlink /boot/initrd.img)")"
+    fi
 
-       if [ -z "${linktarget}" ]; then
-               return
-       fi
+    if [ -z "${linktarget}" ]; then
+        return
+    fi
 
-       version="${linktarget##*img-}"
+    version="${linktarget##*img-}"
 }
 
 set_highest_version()
 {
-       get_sorted_versions
-       set -- ${version_list}
-       version=${1}
+    get_sorted_versions
+    set -- ${version_list}
+    version=${1}
 }
 
 create()
 {
-       if [ -z "${version}" ]; then
-               usage "Create mode requires a version argument"
-       fi
+    if [ -z "${version}" ]; then
+        usage "Create mode requires a version argument"
+    fi
 
-       set_initramfs
+    set_initramfs
 
-       if [ "${takeover}" = 0 ]; then
-               if version_exists "${version}"; then
-                       panic "Cannot create version ${version}: already exists"
-               fi
+    if [ "${takeover}" = 0 ]; then
+        if version_exists "${version}"; then
+            panic "Cannot create version ${version}: already exists"
+        fi
 
-               if [ -e "${initramfs}" ]; then
-                       panic "${initramfs} already exists, cannot create."
-               fi
-       fi
+        if [ -e "${initramfs}" ]; then
+            panic "${initramfs} already exists, cannot create."
+        fi
+    fi
 
-       generate_initramfs
+    generate_initramfs
 }
 
 update()
 {
-       if [ "${update_initramfs}" = "no" ]; then
-               echo "update-initramfs: Not updating initramfs."
-               exit 0
-       fi
+    if [ "${update_initramfs}" = "no" ]; then
+        echo "update-initramfs: Not updating initramfs."
+        exit 0
+    fi
 
-       if [ -z "${version}" ]; then
-               set_highest_version
-       fi
+    if [ -z "${version}" ]; then
+        set_highest_version
+    fi
 
-       if [ -z "${version}" ]; then
-               set_linked_version
-       fi
+    if [ -z "${version}" ]; then
+        set_linked_version
+    fi
 
-       if [ -z "${version}" ]; then
-               set_current_version
-       fi
+    if [ -z "${version}" ]; then
+        set_current_version
+    fi
 
-       if [ -z "${version}" ]; then
-               verbose "Nothing to do, exiting."
-               exit 0
-       fi
+    if [ -z "${version}" ]; then
+        verbose "Nothing to do, exiting."
+        exit 0
+    fi
 
-       set_initramfs
+    set_initramfs
 
-       ro_boot_check
+    ro_boot_check
 
-       altered_check
+    altered_check
 
-       backup_initramfs
+    backup_initramfs
 
-       generate_initramfs
+    generate_initramfs
 
-       run_bootloader
+    run_bootloader
 
-       backup_booted_initramfs
+    backup_booted_initramfs
 }
 
 delete()
 {
-       if [ -z "${version}" ]; then
-               usage "Delete mode requires a version argument"
-       fi
+    if [ -z "${version}" ]; then
+        usage "Delete mode requires a version argument"
+    fi
 
-       set_initramfs
+    set_initramfs
 
-       if [ ! -e "${initramfs}" ]; then
-               panic "Cannot delete ${initramfs}, doesn't exist."
-       fi
+    if [ ! -e "${initramfs}" ]; then
+        panic "Cannot delete ${initramfs}, doesn't exist."
+    fi
 
-       if ! version_exists "${version}"; then
-               panic "Cannot delete version ${version}: Not created by this utility."
-       fi
+    if ! version_exists "${version}"; then
+        panic "Cannot delete version ${version}: Not created by this utility."
+    fi
 
-       altered_check
+    altered_check
 
-       echo "update-initramfs: Deleting ${initramfs}"
+    echo "update-initramfs: Deleting ${initramfs}"
 
-       delete_sha1
+    delete_sha1
 
-       rm -f "${initramfs}"
+    rm -f "${initramfs}"
 }
 
 # Check for update mode on existing and modified initramfs
 altered_check()
 {
        # No check on takeover
-       [ "${takeover}" = 1 ] && return 0
-       if [ ! -e "${initramfs}" ]; then
-               mild_panic "${initramfs} does not exist. Cannot update."
-       fi
-       if ! compare_sha1; then
-               echo "update-initramfs: ${initramfs} has been altered." >&2
-               mild_panic "update-initramfs: Cannot update. Override with -t option."
-       fi
+    [ "${takeover}" = 1 ] && return 0
+    if [ ! -e "${initramfs}" ]; then
+        mild_panic "${initramfs} does not exist. Cannot update."
+    fi
+    if ! compare_sha1; then
+        echo "update-initramfs: ${initramfs} has been altered." >&2
+        mild_panic "update-initramfs: Cannot update. Override with -t option."
+    fi
 }
 
 # Defaults
@@ -468,91 +470,91 @@ takeover=0
 ##
 
 while getopts "k:cudyvtb:h?" flag; do
-       case "${flag}" in
-       k)
-               version="${OPTARG}"
-               ;;
-       c)
-               mode="c"
-               ;;
-       d)
-               mode="d"
-               ;;
-       u)
-               mode="u"
-               ;;
-       v)
-               verbose="1"
-               ;;
-       y)
-               yes="1"
-               ;;
-       t)
-               takeover="1"
-               ;;
-       b)
-               BOOTDIR="${OPTARG}"
-               if [ ! -d "${BOOTDIR}" ]; then
-                       echo "Error: ${BOOTDIR} is not a directory."
-                       exit 1
-               fi
-               ;;
-       h|?)
-               usage
-               ;;
-       esac
+    case "${flag}" in
+        k)
+            version="${OPTARG}"
+            ;;
+        c)
+            mode="c"
+            ;;
+        d)
+            mode="d"
+            ;;
+        u)
+            mode="u"
+            ;;
+        v)
+            verbose="1"
+            ;;
+        y)
+            yes="1"
+            ;;
+        t)
+            takeover="1"
+            ;;
+        b)
+            BOOTDIR="${OPTARG}"
+            if [ ! -d "${BOOTDIR}" ]; then
+                echo "Error: ${BOOTDIR} is not a directory."
+                exit 1
+            fi
+            ;;
+        h|?)
+            usage
+            ;;
+    esac
 done
 
 shift $((${OPTIND} - 1))
 
 if [ $# -ne 0 ]; then
-       echo "Invalid argument for option -k."
-       usage
+    echo "Invalid argument for option -k."
+    usage
 fi
 
 # Validate arguments
 if [ -z "${mode}" ]; then
-       usage "You must specify at least one of -c, -u, or -d."
+    usage "You must specify at least one of -c, -u, or -d."
 fi
 
 if [ "${version}" = "all" ] \
-       || ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then
-       : FIXME check for --yes, and if not ask are you sure
-       get_sorted_versions
-       if [ -z "${version_list}" ]; then
-               verbose "Nothing to do, exiting."
-               exit 0
-       fi
-
-       OPTS="-b ${BOOTDIR}"
-       if [ "${verbose}" = "1" ]; then
-               OPTS="${OPTS} -v"
-       fi
-       if [ "${takeover}" = "1" ]; then
-               OPTS="${OPTS} -t"
-       fi
-       if [ "${yes}" = "1" ]; then
-               OPTS="${OPTS} -y"
-       fi
-       for u_version in ${version_list}; do
+    || ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then
+    : FIXME check for --yes, and if not ask are you sure
+    get_sorted_versions
+    if [ -z "${version_list}" ]; then
+        verbose "Nothing to do, exiting."
+        exit 0
+    fi
+
+    OPTS="-b ${BOOTDIR}"
+    if [ "${verbose}" = "1" ]; then
+        OPTS="${OPTS} -v"
+    fi
+    if [ "${takeover}" = "1" ]; then
+        OPTS="${OPTS} -t"
+    fi
+    if [ "${yes}" = "1" ]; then
+        OPTS="${OPTS} -y"
+    fi
+    for u_version in ${version_list}; do
                # Don't stop if one version doesn't work.
-               set +e
-               verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}"
-               "${0}" -${mode} -k "${u_version}" ${OPTS}
-               set -e
-       done
-       exit 0
+        set +e
+        verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}"
+        "${0}" -${mode} -k "${u_version}" ${OPTS}
+        set -e
+    done
+    exit 0
 fi
 
 
 case "${mode}" in
-       c)
-               create
-               ;;
-       d)
-               delete
-               ;;
-       u)
-               update
-               ;;
+    c)
+        create
+        ;;
+    d)
+        delete
+        ;;
+    u)
+        update
+        ;;
 esac
index 4221fa8..de73831 100755 (executable)
--- a/lsinitrd
+++ b/lsinitrd
@@ -1,4 +1,23 @@
 #!/bin/bash 
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+#
+# Copyright 2005-2010 Harald Hoyer <harald@redhat.com>
+# Copyright 2005-2010 Red Hat, Inc.  All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
 
 [[ $# -eq 1 ]] || { echo "Usage: $(basename $0) <initramfs file>" ; exit 1 ; }
 [[ -f $1 ]]    || { echo "$1 does not exist" ; exit 1 ; }
index 320a9fe..085af2b 100644 (file)
@@ -98,5 +98,3 @@ if [[ $basicmodules ]]; then
 else
        dracut $dracut_args "$target" "$kernel"
 fi
-
-# vim:ts=8:sw=4:sts=4:et
index dfb3947..1e2f863 100644 (file)
@@ -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
index 8738815..efef9e7 100644 (file)
@@ -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 
index 8e12d07..d18c69c 100755 (executable)
@@ -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
index a197573..6203546 100755 (executable)
@@ -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
 
index 9d8d2e6..7856e39 100755 (executable)
@@ -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
index fbd809e..0596839 100755 (executable)
@@ -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
index f74ea6a..622ce21 100755 (executable)
@@ -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
index bce58e4..daa248d 100755 (executable)
@@ -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
index 8c3cbfc..e0292c8 100755 (executable)
@@ -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
index a5cdfb7..f8f9bf3 100755 (executable)
@@ -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}
 }
 
 
index 83999e5..433c7e7 100755 (executable)
@@ -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} ]] || {
index 785b51b..0d41eb7 100755 (executable)
@@ -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
index f479d21..4002ae4 100755 (executable)
@@ -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 ]
 
index 1fd0005..8fa9be0 100755 (executable)
@@ -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")
index 8af23b5..8f010fb 100755 (executable)
@@ -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
index 4e2a5fd..26b56b3 100755 (executable)
@@ -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
index 1f5c4c0..4b566d0 100755 (executable)
@@ -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
 
index 644b5ef..f716bc6 100755 (executable)
@@ -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
index 5186e91..e188c88 100755 (executable)
@@ -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
index 6ef1010..5cd6fc5 100755 (executable)
@@ -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
index d406f2e..a95ba2a 100755 (executable)
@@ -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
index 4c7adcd..1c9ce7d 100755 (executable)
@@ -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
index 54b3344..5d02099 100755 (executable)
@@ -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
index 7a26909..f8e6056 100755 (executable)
@@ -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
index 6a24d41..81a9ad3 100755 (executable)
@@ -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
index 218485a..984192f 100755 (executable)
@@ -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
 }
 
index aba8475..4c3c70e 100755 (executable)
@@ -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!
 #
index a3c9597..b4954a2 100755 (executable)
@@ -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
index b8e40d9..636df1d 100755 (executable)
@@ -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
index 2d0edd0..ba456c2 100755 (executable)
@@ -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"
index f5989ef..ac3bd90 100755 (executable)
@@ -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
 
index 90b8874..eebce20 100755 (executable)
@@ -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
index 01e639b..813a2b2 100755 (executable)
@@ -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
index ed2d421..7c41b5d 100755 (executable)
@@ -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
index f1b0d31..47bd9a0 100755 (executable)
@@ -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
index 1ad2c95..2f6dcc5 100755 (executable)
@@ -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 
index 40f2016..f11c9fd 100755 (executable)
@@ -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 ]]
index ba5ef89..7a0c237 100755 (executable)
@@ -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" \
index 9f3291d..d84eee9 100755 (executable)
@@ -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
index 3119330..d54b55a 100755 (executable)
@@ -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
index be563cd..e03e98d 100755 (executable)
@@ -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
index aa3d8fa..199cab0 100755 (executable)
@@ -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
index 36f9966..6662ec7 100755 (executable)
@@ -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
index 6b9cabe..55129ac 100755 (executable)
@@ -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
index 6ae0060..08f3f0a 100755 (executable)
@@ -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
index cb14064..7c1ffd5 100755 (executable)
@@ -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 \
index 96faf44..6d5616e 100755 (executable)
@@ -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
index c562cb8..03c5293 100755 (executable)
@@ -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
 
index c6a8f48..af934fc 100755 (executable)
@@ -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
index b89d9a0..3ac8076 100755 (executable)
@@ -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
 }
 
index 1242b1c..e9fc6ba 100755 (executable)
@@ -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
index efec56c..45b5fe7 100755 (executable)
@@ -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
index 0a1a8e0..a518bc3 100755 (executable)
@@ -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"
index de154a5..f41e5ac 100755 (executable)
@@ -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
 
index c42ff80..888b1b0 100755 (executable)
@@ -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
index 008f04f..3a95d01 100755 (executable)
@@ -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
 
index dfa4541..a016ea2 100755 (executable)
@@ -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 
index f77d945..28e53b3 100755 (executable)
@@ -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"
index f5a8ad9..f9fdfcb 100755 (executable)
@@ -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
 
index b93de09..fd7dde7 100755 (executable)
@@ -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
 }
 
index dba655b..f7f9659 100755 (executable)
@@ -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
index 52fd0a2..7626bdc 100755 (executable)
@@ -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
index 63780bd..b722c40 100755 (executable)
@@ -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"
index ae7306e..c25b2b8 100755 (executable)
@@ -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
index c2aee3a..dd49397 100755 (executable)
@@ -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
index 1b7fe19..1716a68 100755 (executable)
@@ -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
index fa771f8..f4c25f7 100755 (executable)
@@ -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
index daa4c45..ddbc90c 100755 (executable)
@@ -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
index 24b854e..dfab959 100755 (executable)
@@ -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
index 2f19d0c..9810d12 100755 (executable)
@@ -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"
index e679b10..5b3b4f2 100755 (executable)
@@ -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
index 6278dac..7b2503d 100755 (executable)
@@ -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
index 26f39cb..c211064 100755 (executable)
@@ -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
 }
 
index 71fd386..8c40990 100755 (executable)
@@ -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
 
index 784329e..0a8a6e3 100755 (executable)
@@ -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
index 5e93d3e..e85d43e 100755 (executable)
@@ -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
index 77aa1f5..6996d84 100755 (executable)
@@ -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
 }
 
index 6045aaf..80abda3 100755 (executable)
@@ -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 
 
index d26bafa..679ac8e 100755 (executable)
@@ -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
 
index a08f676..299c901 100755 (executable)
@@ -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
index 0958251..784a227 100755 (executable)
@@ -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
index a971a5a..ee189b7 100755 (executable)
@@ -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"    
index 46340a2..4d8229e 100755 (executable)
@@ -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
index 3fc7eb7..a683022 100755 (executable)
@@ -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
index f4b7810..ea9e179 100755 (executable)
@@ -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
index b7cca55..2f33512 100755 (executable)
@@ -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
 
index 5d03d5c..7f98d03 100755 (executable)
@@ -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
index 511c5d5..39d1fd2 100755 (executable)
@@ -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
index d42e411..a48d6c6 100755 (executable)
@@ -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 \
index c2f4ec0..dbbbd27 100755 (executable)
@@ -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'
index 9244aa3..e6a0c08 100755 (executable)
@@ -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=""
index c9a2b3f..72ca2ef 100755 (executable)
@@ -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
index 72ad846..d9b6117 100755 (executable)
@@ -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
 
index f73cc55..54503db 100755 (executable)
@@ -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
index 1f8b372..450f06e 100755 (executable)
@@ -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
 
index 47bcfe4..edf0eb4 100755 (executable)
@@ -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=","
index a26196c..dcd2421 100755 (executable)
@@ -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 
 
index 7e66db7..3a74a7a 100755 (executable)
@@ -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
 
index c83c194..f8ba37a 100755 (executable)
@@ -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
-       
+
 
index 80ceb2f..38a9275 100755 (executable)
@@ -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
 
index da9bfd7..d61ec69 100755 (executable)
@@ -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
index 46a4790..9ca32ea 100755 (executable)
@@ -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
index 50405a8..e3bd344 100755 (executable)
@@ -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
index 5750bd1..d87f72c 100755 (executable)
@@ -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
index 7a89e3e..4607507 100755 (executable)
@@ -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>
index db08a34..9621fc9 100755 (executable)
@@ -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 
index 5ce7ca8..4f1aec6 100755 (executable)
@@ -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
index 26a5a1a..492cca0 100755 (executable)
@@ -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>
index 55cb53b..f943359 100755 (executable)
@@ -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
index 6386410..a0db7c5 100755 (executable)
@@ -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
index ae0b6e0..80dd639 100755 (executable)
@@ -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
index 23e26a6..ebad9c8 100755 (executable)
@@ -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
index d0b6458..0eadfd2 100755 (executable)
@@ -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
index 7b82b10..644fee2 100755 (executable)
@@ -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
 
index aa69a41..adbeb7a 100755 (executable)
@@ -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
 
index b4673fc..1fcd952 100755 (executable)
@@ -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"
 
index c8eea5e..38d413d 100755 (executable)
@@ -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
index 51a1a94..995ca39 100755 (executable)
@@ -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
index 000ac6e..4edcf17 100755 (executable)
@@ -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
index adb53dd..5eb2d6a 100755 (executable)
@@ -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
 
index f0f53cc..57f55db 100755 (executable)
@@ -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%|}
 
index fa31aa2..b4f6d99 100755 (executable)
@@ -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
index 6ae4e0b..0a537db 100755 (executable)
@@ -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
index 02a99a6..fbc2876 100755 (executable)
@@ -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
 
index 910dd26..06de9fa 100755 (executable)
@@ -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
index 9200f95..779d076 100755 (executable)
@@ -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"
index 94d7112..2c7661f 100755 (executable)
@@ -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
index a2718b3..fc14f83 100755 (executable)
@@ -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
index 8bb4114..ee55414 100755 (executable)
@@ -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
 }
index caafb65..873385c 100755 (executable)
@@ -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
index 9fdc121..60b47c5 100755 (executable)
@@ -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"
index c6b24da..c26ad0d 100755 (executable)
@@ -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
index 6dac7c1..d1e3c8c 100755 (executable)
@@ -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
index a118df9..0509645 100755 (executable)
@@ -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)
index 53783aa..ee32b56 100755 (executable)
@@ -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
 
index b592964..36972fd 100755 (executable)
@@ -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:
index 4b3f8fb..3df4e4e 100755 (executable)
@@ -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 ]
index 6830763..61b8edd 100755 (executable)
@@ -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 
index 7a0925f..b89e85d 100755 (executable)
@@ -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
index ce0e3d2..e8d3b70 100755 (executable)
@@ -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
index a26196c..3090f6d 100755 (executable)
@@ -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 
 
index 8e35eb7..4169d9c 100755 (executable)
@@ -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
 
index d8b197d..85694ce 100755 (executable)
@@ -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
-       
+
 
index 4ec91ed..2c0a60f 100755 (executable)
@@ -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
index 4eb1ab6..b53acd9 100755 (executable)
@@ -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
index a26196c..3090f6d 100755 (executable)
@@ -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 
 
index ff85db6..ecf09c5 100755 (executable)
@@ -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
index 7960e6a..01f0cbe 100755 (executable)
@@ -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
index 751b002..fa9ede2 100755 (executable)
@@ -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
index 4216c77..6d64048 100755 (executable)
@@ -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"
index 9959993..7cb794b 100755 (executable)
@@ -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
 }
 
index 3b0eb2c..8ee8098 100755 (executable)
@@ -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
index 1fd1b6f..ed5958e 100755 (executable)
@@ -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
index 438ab4b..55d0022 100755 (executable)
@@ -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:
index 4bfadc1..7f1830d 100755 (executable)
@@ -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 
index a46240f..3f1a8b2 100755 (executable)
@@ -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
index 4e1c531..e6b1c13 100755 (executable)
@@ -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
index fb11f44..d2000e0 100755 (executable)
@@ -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
index de9a281..b7ba12c 100755 (executable)
@@ -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
index 0681672..627d2c5 100755 (executable)
@@ -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
 }
 
index 2a376dd..121d70e 100755 (executable)
@@ -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
-
index cc6e7a8..410f247 100755 (executable)
@@ -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"
index 1d554e5..6fac851 100755 (executable)
@@ -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"
+
index 1fb2a92..ad46008 100755 (executable)
@@ -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
index 7020b31..7942772 100755 (executable)
@@ -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
index e253110..2980d0a 100755 (executable)
@@ -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