]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
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 f4778aeb70162f1276af856e05d1f310acf16b87..ee2f79ff96e29d76f67440e25d7dadccf10655ac 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 d49d0e2a4b3c66a7577545487df9928a7947237d..88c404d944f05da37fe9e85239ffa6d208965d98 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 f2b7ffbdcef18e16e98fa8ccb4c87af5fc55d3f2..421f2c7428ffad1469a3a4c5eca0f8d020b23da2 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 20662196a000014fa432034a5c2a80b022d9142c..37424fa72f019fd940dfb214f11a3257d9a7af36 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 36a98a23f4f627839213d29d28e2eaef0213defb..259c7744aed75df7a950caeb14c436771fb2d4e3 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 4221fa8b5a784a7652b64e82f08e325cc4044c25..de7383162c085ac501a24e76f599f31b9d4fc8d8 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 320a9fed7b1e20f180504950e538046fe2f2e6ef..085af2b95a8fcf164e266d56ab94e9c1cb0bb968 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 dfb39474af8679062749c0bc3bef73218a8b0327..1e2f863e717d3db11962307b75fd930dfaf547a7 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 873881574a2ad98be32d58da489f966beed7c03a..efef9e7a9e1c6d667c0f5e3e955509ecb33bbf2f 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 8e12d07e68a8c2891589257f64cc455e9bf7e650..d18c69c35caa587c1300593d334c80a74cb54644 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 a197573c954902f15d67a7277fb675e33407788d..6203546d8bcb2ab75377a66d6ec5baa53020387a 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 9d8d2e6653ca6e111b211e18ab25444780339cda..7856e39e6bee5e5843b5560a30593533c164878e 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 fbd809e8223ad6586eb30a5efb8e9bd3124ca96d..0596839864ea6b3b0a06f9378cb0801ce5ddc9c0 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 f74ea6a7bb13d42d4686418f4652c8f2d9f79566..622ce2179ef78623d73bb7ae92bfc7fa249e62bd 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 bce58e46b8b544d02f265916418a7c31312a6da3..daa248dc81db9cb8a3eaa0926b86325a61127adf 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 8c3cbfc39d945c2c5c4a5e3c3980d6252018cb2c..e0292c8ba9aafd304bac8e0d69d768e7afdee26e 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 a5cdfb70cc9e0bdd2abe573bb90ce78cf731542b..f8f9bf36065c7346154e24698b83fd2dee8e59ca 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 83999e53de4c7fd2e13cca1679e67b0e8b9a6810..433c7e700481ec303e9f1b06588d6a10933862f1 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 785b51be945c90d569da105dfc1ac7acf9cc4f55..0d41eb70f81ce7397bdfcd3e4c11382b021ab801 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 f479d219bb86acfd84581031b8dc0800e50519bc..4002ae4aebeb67b024cb46edc87b191c61f8ef6d 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 1fd0005f0e8334c117764530a09f8180a12fd032..8fa9be0a4b6958041eb7dc8e2774b9c25f0f1fbd 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 8af23b5764049129e0b4471bce2735ce5362658b..8f010fb7cab729f084f1e1ce156c3e7b81cad800 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 4e2a5fdcd90f01c388d4c94e5997c500a0ed574f..26b56b3bb396339d29880852546711a787b43d8c 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 1f5c4c0a8f836bcb298c9fabd8167132bf36c7f7..4b566d0caec948a86aecf7c17d3c822bac14778d 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 644b5ef02e6ab9def4042483365ca5fa4aa6471a..f716bc6f859d8b00272039bb8089aaa611b2a560 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 5186e9190c24e4e0b52f956edf2d02e50f10a0c6..e188c88be88acee4074c5f33d3500dd9151179ba 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 6ef101046aef7b2f16bf2a17548b553eef21174f..5cd6fc5e8ec5d2b16690b816fb7d00c31303522a 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 d406f2ec4612e53b735ca9b801eae9628a8cff3f..a95ba2abe6d0f90d88415623c728920e8d39262e 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 4c7adcd4b20bf84008c5e9c5fd456d01c7621bde..1c9ce7dfc06e9b8ab0803517d8e165feeba06381 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 54b3344379d12d954059322f56d52ffe4b5d7fbe..5d02099182f99240b2f9716c03093bb7cd322dbe 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 7a26909648d755da4a4838d4e3bee5002aa9ec63..f8e605651c91fb7d7a76fa4190d3cbbaf1758070 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 6a24d418c04348f7c85755f5a3ebbdb40324225a..81a9ad3f90201b7e2662ec9bdfa105a4ed4c88f0 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 218485ab7265dcd469776d74586bfd5549a82d0b..984192f487deefdf2aac57e9c40ba549d6ef2721 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 aba847501a55caf8ea83fbb537c1c2d2e7a9c396..4c3c70e44ed506fc74fe402a52846b749688c12b 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 a3c9597fa7a763ec5a2022bb39295ef45a52f556..b4954a26f248b2f9311406c05bdbc90542dc99b2 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 b8e40d91e3aa938a5387acbdbee3b07c096f6608..636df1d82df28d3e95867279f9d037e88137aca9 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 2d0edd0c7f1fa4f22deb9b3d36e5d3208e89c4ba..ba456c269bc9d417f33b1536aa38fbab5f339c53 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 f5989ef0d62532f2f02c7ee4f1c18959ac2c7e52..ac3bd909fb9412669870ce92f70d4443397cc7e2 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 90b88741fb8c2934e429ba63c74c2ce13a148cff..eebce204950076ae53bc8924c2166761758959ef 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 01e639b3bf6cc79ded048df7eaf7e5492319ca0e..813a2b2033c92f4fc3ec2bd19d73f8de8bc1769b 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 ed2d421fd0d316b0b3fb34f5f9cacc83824ec848..7c41b5d38641ddec475a43d63fa0b33f261a2736 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 f1b0d312710e227d8e44be2bc314be6667e03ed6..47bd9a083bc63e892a801b68aa689d6efe9dabed 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 1ad2c95a443c56d289dfd194a8401e7d37c3911b..2f6dcc56c832604825d561d0529f2280a04dff5d 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 40f201646eedbb24b38d789c6cc7d4a85574c156..f11c9fd4cf069b25c449bc7ba837849b72d43395 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 ba5ef89545cc5ae79652cba4f640e24d9474ee9d..7a0c237b955478f531fc52dd4b82811314910563 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 9f3291dae6e87797e542bb3589b786cf101fdda2..d84eee9dd94bc5ede13b163176e6a9e69ef423a8 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 311933097bc142cd64118da8b8078820fb5b7a10..d54b55acc13d530f8c245408e584d838788a3240 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 be563cdd7a46adb7518673e66b5bc0e68ebc9a4b..e03e98d03a2afb2d4587f6de71f83ee0db925256 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 aa3d8fa29b58ca759130f35e9d88073b56ee8051..199cab025039149f1d1caf4e1962594f8b2225fe 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 36f9966fe0da8a67dbded28bb1b1e1efadf549b6..6662ec7a445bd2344e6d8e89c4ca511e0ea06b35 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 6b9cabe5734cc31020f2ae6d95c6fa38b7665f5f..55129ac5474519bb60545e70ac0defe0b3934639 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 6ae0060f35bf4696de555df5f410caafb2f55b03..08f3f0a5b7a16e9dd2614e4429977ae108f1b6f2 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 cb1406423356c592d2556c52f4ed824e39509686..7c1ffd526010a8a26a5ecdd8ad8ac7b38b5f4095 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 96faf44dc16bd733e9daf62ff1f3cc5437229a6c..6d5616e353a592425ccce8d5d408b831ff0ec456 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 c562cb8c7ba0a07a0ab651e73fe7903955deee8f..03c5293526cf9d54a9fbe48e8c8f5b7ec37d19a6 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 c6a8f48f294981d76b6a333cdf9adf10a87096df..af934fc8403d46f17297f11af83a876ae09ad4f8 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 b89d9a0998cd9058d4187bb9cadbff884cd6ea69..3ac80764ee8e0f2e766228152f48951b56f45ecb 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 1242b1cad191699eb341e5625e283735aec470ae..e9fc6bacfcc2a8f71d7c2379bb1df94b1e9d00b5 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 efec56c115a7219028a723581c41675457d9fe31..45b5fe74bd8b21c1fc8bb34a2c092a23d0d62665 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 0a1a8e06654878d4eff05aba53b67e9937272f2a..a518bc3ddd7c7ddaefb340cab80624e600ef0196 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 de154a5cf65f240b0bd8c88e45a75ccbfe45594d..f41e5ac84e27873251c0653d29ddcbffbfd32e4e 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 c42ff80d9777dfddbb3fa74efd96b751fab5feff..888b1b024a848b2f5621c7ae4f480000f68116af 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 008f04fcf6fdb77566be72004baaa9dbf292c622..3a95d0138bf1ec38ad184460dfa1ae7ccd214fff 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 dfa454195ac07b212dc53ec49f310b5983356fb3..a016ea28af58a4672463273c8bea7102df9f23bb 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 f77d94571808622e0f3ae21de8ce983037faef00..28e53b3ac5066d0681dc9bcbcf14c84a0ed325b4 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 f5a8ad9c5f576b3865e911b37c0f867607c132f3..f9fdfcb7d59df62627955f6ee815c512c10dd490 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 b93de0991cb36ffd8a8ff42f9fb8734c73588edd..fd7dde73a157c3bc114f8cb361449aa8646f46a8 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 dba655b994b3d237e526ccc66504fed98e3978b1..f7f96594bfcf33324e1d427e1f622353d04ad3b3 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 52fd0a27fca1dc6f0df7cb82b399433ba90b648d..7626bdcb8bbeabee1dac4375a51f5d32c8665ee8 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 63780bd19fe6e3ffb3d846a69ebf61ca711682e7..b722c409a7806b10cb8c38380c7bf9923fd43084 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 ae7306e09802a269f671395d784970926f6b3e8b..c25b2b82b3cc92beeacfe9c0cecb0060e1e1a2dc 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 c2aee3a2e0f6e49c10d505c6c9b2a506c84780fe..dd49397b6df7a29320bd49be50aad73415be7725 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 1b7fe192ef5aa7c6bf06abcbc33472c2802cfeca..1716a68778882cf76e62353a9a3d8cb195f832c4 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 fa771f847c7f56f97bc9645a3872dbbe99a9bc2d..f4c25f7f772baf403eeb75f0240a47b127f033d7 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 daa4c45fba133f93f491d69ac35e2d7147bd9fb1..ddbc90cdd12ed02926a3ead78f48039f8aa328dd 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 24b854e7b807572e6dcdd02f4b5f55b4cf13e031..dfab959f9c062fcd15fc08b5f107b18624e8cea5 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 2f19d0c2e685d873d5d875b4f51daa09cff097a0..9810d1218c1902deda12efb418a19812f02ff37c 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 e679b101b49556d4758c7588f3511288e69a8b7f..5b3b4f2ddac5a4020f408a305499538fbddbdbe5 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 6278daca881820df8cd3abe234459562269bf60e..7b2503dc872e9393c46ac993164e7004da96b820 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 26f39cb52aa7d80981b221478a2333ad467b0476..c2110642a87b54343a129548c00339093ca75fff 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 71fd3860211b9df504e6d3374e563042b42b6d5c..8c409906aef86722328c045c7654b116f1bd6575 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 784329ea9479cf6fbe532d888acce7e0631d2ddb..0a8a6e3a82f1a0c432be8748a8d82f210ad416f0 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 5e93d3ef1fe186fa933cdd2c7b378d0a5879c6d3..e85d43e417614257d94babf393a1303f1c716060 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 77aa1f59cc21cf95e3573856a2c4b88cb2bb44ab..6996d8449fc5cc958072611f3e9a7635ff7c71b7 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 6045aaf904d605f58bfe66b05b8adeebba2e4cf7..80abda382bcec54f133073ccc3a72cb43b441052 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 d26bafacf0504f3f4f535cc5e6857aa42dba722c..679ac8e04236542b68301db549b4dae4a1338164 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 a08f676bd1ec212fec91689422134e9e2d7284f9..299c90100af8495e3bd6c86a1530c9cfb1bcf756 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 0958251a7aa3bba4ce3ad3bffefd6e488d981e2d..784a22724d67f501bb901ce41207d30e7bd7c3e8 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 a971a5a1797110bd4987e5e52f9797f5490e733c..ee189b72a8a732a3984fd931347c1759301a7945 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 46340a2f0e9fad680595463af7c205f7085090ae..4d8229e897578819fd159a508443beed10f55d5e 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 3fc7eb7709d275329757634f1e750f902d1b35a6..a683022da9472d8f11c6a58c5eb77af990a85bbd 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 f4b7810eb095b6cd57b3a55f373e1f77d8a84ca0..ea9e1792d95dc6a04a011a44b51cc81a0deb3134 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 b7cca55dedd227ff7fe6f81059ed6d68fea662f6..2f335127c08154b96731878849bef624d643d715 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 5d03d5c2c0498a0aa6cac3c4a0bf8ffd23a72d59..7f98d034ab22e971145bacbee18b39790446f665 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 511c5d59ab0136ca2d07487e38445095d5910f14..39d1fd2943a593f1a28f4e7251d83f52afe9719c 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 d42e41158f4417d673c4cc32b41837d7cff09cc6..a48d6c6e19cad549eaaf2cfb72db971c0698872e 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 c2f4ec0db563d3882a7c8f8383af49ffd279b4cb..dbbbd272547c024d4a6540a9b680da59af440046 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 9244aa310a621af133ada8964676e98cbc73bc71..e6a0c08664558123fcc952fa4cc1647b3bcc4925 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 c9a2b3f236cdc394c448e2557d350e7df7546805..72ca2ef383562397552d3de88bae5bce8b6cd168 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 72ad84668cc2af8620a8266201851c7209f4185e..d9b6117f143cf0109966860d0ea2b89252e7081f 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 f73cc556233ef13b1a49274321b4a650b36197e2..54503dbcf866beee90994a3dc90c3112daa60833 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 1f8b372135eabdf6fe35e5223f1ca0d4d9eacd1f..450f06e00f38037eaac9c580d97fd308c40c5c19 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 47bcfe4c2ef36c778352d4188ce20c7118e72c31..edf0eb47636d72ba893dc40af50e9746a546df78 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 a26196cf36bb611875c6ec5b821b690c73e2fc83..dcd2421688dbbf51772cf46a8c008a7cfba49e5a 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 7e66db7d32f50a8cb18108fe64436c827aef63cb..3a74a7a77d715470d10fb7a14f1bf24ccc8eb1c8 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 c83c1943ccc1c97a4cfbb0bcdd9dd9e14a91116e..f8ba37a2fbd42c8e1fb2a49f79bcd64278d1fce0 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 80ceb2f80dd10a6bdbeb42b83a619bc81f0a0b9f..38a9275c2c14f85ed7eb9d14a58dd921055f4eb0 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 da9bfd79aa5ed7870f4867aff97e1245f83a2099..d61ec696253e47b0e29bfdaf20d5bf8b3f6bc079 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 46a479088c6d5e3a5665d5bba3315bb250a03ac6..9ca32ea19027d498bc5d845de86654b9453e4121 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 50405a8bc5c24b5d4b2981abae82f4dd8c2b13aa..e3bd344aa4123eb7bf0576a09af03c938035857f 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 5750bd1ce6655007084c7cf6a78113d843086746..d87f72c51352b3c055121b7c3a68c78c540e7db7 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 7a89e3ee58a5b2ad3576f6c79d81ceba95eac038..46075073e6bacabf0dbd637864f559f32df9f517 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 db08a342711c984796ea049a06c3ee8ee3c4fa7b..9621fc98d5f0320d4755e5d3cba372a1b4a82234 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 5ce7ca883f898c1c85aa23594c4b957ba7364ad1..4f1aec6fef5fd4ebe0504be5422d547b4358d75a 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 26a5a1a2c6edbe948440f0135ce69f7629352f65..492cca00ba94cd5d31e39004ab8ec6d46b4bb0c4 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 55cb53ba3fc4e1721b7bd7768142893971d05829..f943359224e38d2225c947046160f1b6e9cd4693 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 6386410b4d3a35f17ed82a26b33482b8930abb5d..a0db7c553a00203d8894fe8bece9195371bb2e2c 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 ae0b6e04f784108233ab8d2ef056cd9f422be499..80dd63902c056f687ebc78daa703531ac6697fc2 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 23e26a6144b10c43bf1c88854dee1cf4a4fc3f93..ebad9c8d021432bad63e1004b160d0da020c91b4 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 d0b6458793148f1c1a899350044509c584a0cc06..0eadfd26cdcef74b6686ef09064b3034248847a1 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 7b82b10f48a7be00699b38cf80fdd55c9df73aac..644fee2c28ab2bc00d662b909120924d8a0f6ba5 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 aa69a4119ef702cb624c181a51e68087ef8d4cd9..adbeb7a2e54b1e854db7253365c329ad0ac7247a 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 b4673fcbfb8a25802a22110372bd6308d904f4af..1fcd952fcd0179f99035d55b27baae51a5c45e81 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 c8eea5ec510bcaf4c607a2ae4d8b1780392b60cf..38d413d30b29b2e68f59bf2ec49cd731f744cfba 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 51a1a9462d6625ff26e463a543959828841bcdfa..995ca3938f7d029e061a86ad3b8144c8f626e66f 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 000ac6ed8e3aaa97c9414a5228ea73e6344d53ad..4edcf17ac9cbc9a3b84a932a4fe0fc2906f0d821 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 adb53dd8575b1c8ccf796dc9d7b3957f7ec75976..5eb2d6a0b84f265dd85762724f942c216f0c0750 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 f0f53cc90fed5d4845237eb0c72990115b24ffb8..57f55dbf05d1c15fba53df178fb3c6f37c2b388f 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 fa31aa23884a60ce31e37ef816a41082b9120719..b4f6d99c806203082d0bb07e0470d2c10574d639 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 6ae4e0be68af8f8f5d048a952a65b99a6fb57b16..0a537db8500ea5a7d35396d7db296d90f8c36f0f 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 02a99a6791b913728624c6691d9dac3ae4b2d087..fbc2876f187ca5159f620db1db893b14475e09c8 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 910dd26888dc029da5a6c87ad41799f29d3f501e..06de9fa1df9bb15d08bd7402a4537152f169edc5 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 9200f9575dde25d79fbe77983368428f03e52e2e..779d0765d70285372d265d485b37c5573a9d7621 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 94d711268802e87617a343252f8c41f3eddd945c..2c7661f63a8126409ab26a6e64bf179abf4ed3e9 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 a2718b3e990431ae8554fd5b6a3021e53b16097c..fc14f83dfef0e604bd0986f762b36fdb3e40c25b 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 8bb4114f5ef7d772cf1e4529c7972fb5cd5ce01e..ee55414874be0400834d18b4b7d2976773acb68b 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 caafb650203620b57d96c11731c7f8a28c77c75b..873385c497f8dbcdaa03ddb67869b615c4994ce9 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 9fdc121acf718c264dec3cd6bda8972fcf5f58ee..60b47c599b65d2623c4ca942f95e4e80c5ca89b4 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 c6b24dad193d7d3c1623c98cb170f306d9d2bc6f..c26ad0ddf92184d249bd8f54b92739f48fa73ab8 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 6dac7c16a8fa653cfb591a0111bbe29ec9ab2b7d..d1e3c8ceed6ccd3aa632d7baf22c2f9e3bc3274b 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 a118df9720abf89076b87c8130ffbc24e5e6a421..05096456b6696c5fb673faa51328fba7e1db1c84 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 53783aae0285da18d6c229275823608d83e0c897..ee32b564721909156515c81ab3d552792b7e785b 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 b5929643ebb75b181d5bf80f81500d591d483ebb..36972fdfe10e783fa3d17320dfd9251627477b90 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 4b3f8fbbbe9d2d34af95e3dfbb2ba3444622f10e..3df4e4e5aff3754bbad4b5a28fa2d6f89ac265ee 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 68307630f74dc49070f2ff4ae42d5adb88621f3c..61b8eddefa0bf1c3b95d0438b6d8138f24f63f92 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 7a0925f358a1613efc664f899346988b2bb10780..b89e85d1f36d0574033f642e85d9ec9401cedf3a 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 ce0e3d234abceb68b2c776cdb9866ecfec1a2305..e8d3b7008985a7076897c7c63d4197cf20aac09a 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 a26196cf36bb611875c6ec5b821b690c73e2fc83..3090f6d5a59ec3bcff1d3cf608badecec5ae0a4d 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 8e35eb75df3055564eca394516a7e0634aa9a77f..4169d9c44755e9ead884f4083732420771e6c88b 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 d8b197d9366ee100c810ed4c45fa1981131582b3..85694cec845f95380a377a2aed0b02dd9d3b1d7c 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 4ec91ede6c260081e3a919175104da36c6e1d920..2c0a60f2f7c81d5a302a52ca22fa391bcc2a1520 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 4eb1ab61fca82461209cb803e95cc3b03e3f666e..b53acd918b0c2238fb438dcb057ca03fb9db538e 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 a26196cf36bb611875c6ec5b821b690c73e2fc83..3090f6d5a59ec3bcff1d3cf608badecec5ae0a4d 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 ff85db694faf57fd65a11e50ca06859e4dbded1b..ecf09c58af1d31d6382c3d61444d52610a6b936d 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 7960e6ae4dcb52fb11bdaf38790bc744ff88c181..01f0cbecf7c4d89423c91aaf2bcd095d825394c6 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 751b0026f8e522d92a4a6f62faa42cd7da7a406c..fa9ede2c2e0e458b7a0fcb67d39ff93004af57a8 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 4216c776acbe6d801b3a843fcb833b7cec09e6f9..6d640489161e279e9f9d7a9ba11af1a970a90d54 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 995999395b6a10731d0fa29ecca84e99c213ac4b..7cb794b68969fe05a072e9175633b17314dc1391 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 3b0eb2cf9725398ee2d85916c096a77214079deb..8ee809879d2091b2352e87e52c97426cccd23eff 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 1fd1b6f7d633d743461b1317a75f174876da300e..ed5958e3ab6ad47cbdc9e71795c71cea0ff08476 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 438ab4b4e5a08245cc3231ec8b5f0222bba74cb1..55d0022cbedc78a04c0ea910f8e1976e1f85811c 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 4bfadc15228b221e12aeb183f0218cd847b04834..7f1830d07a01e511868bc4702170493417aa94fb 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 a46240fcedd775ce3599b47befb4c01bab560349..3f1a8b2774c62259b78b84572524cd51d92c0599 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 4e1c53147a21c4f493817e4062307b252d9e1455..e6b1c1396a982bcb44f155e06d30b1dec1253dfa 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 fb11f44ba32da470deecdc186aad698e8f4921d4..d2000e05753f3d767b569d3e10fab60b653ba063 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 de9a2818e2028cf4a15b4b065c27b94c725fc069..b7ba12c70b35c8f5ecbeef0ab4e08beec8490d15 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 06816723d3857a92e37456b136aaa8b4fc371745..627d2c5b1072328e1c53bbf68f9cc5435057cb17 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 2a376ddc3aeaf4954324295fefc9f54bb44481ed..121d70e8d7111cb05c3579855087e6480bb101d2 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 cc6e7a85e044d70a21eb07ebb1a37175652e3e0d..410f247e61701c6fbea7386bdad7921db0e02702 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 1d554e58e0e838c6ec6b13b845e6a3638a100ee7..6fac8515bccbda8bf11ba6d573b5ff51b68a2883 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 1fb2a9250ed6aafddfdaff50142484ac7c4dc7b4..ad46008cd77088e19c0cdba9f59b41db0bc3d2ec 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 7020b317ad5f671275354c5e952daf250cb7e75c..7942772bb6c8cbfdb329a7ab60b6daec697d2608 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 e25311094a0b1a988a7ca734c49c04b8d71ba8e8..2980d0a5caa7646db97a2333ea78609988984cfb 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