]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
check for getarg() function before sourcing dracut-lib.sh
authorHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 12:07:39 +0000 (13:07 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 15:10:46 +0000 (16:10 +0100)
make use of "type getarg" to check, if we really need to source
dracut-lib.sh

22 files changed:
modules.d/40network/dhclient-script
modules.d/40network/ifup
modules.d/40network/netroot
modules.d/40network/parse-ip-opts.sh
modules.d/90crypt/crypt-lib.sh
modules.d/90dmraid/dmraid.sh
modules.d/90dmsquash-live/dmsquash-live-root
modules.d/90lvm/lvm_scan.sh
modules.d/90mdraid/mdadm_auto.sh
modules.d/90mdraid/mdcontainer_start.sh
modules.d/90mdraid/mdraid_start.sh
modules.d/95fcoe/fcoe-up
modules.d/95iscsi/iscsiroot
modules.d/95nbd/nbdroot
modules.d/95nfs/nfsroot
modules.d/95nfs/parse-nfsroot.sh
modules.d/95rootfs-block/mount-root.sh
modules.d/98syslog/parse-syslog-opts.sh
modules.d/98syslog/rsyslogd-start.sh
modules.d/98syslog/syslog-cleanup.sh
modules.d/98syslog/syslog-genrules.sh
modules.d/99base/initqueue

index 0bc6463e29cbbe172902d465eac8830a6014c386..1ca3f100592610dff3703b20d35d1de376d788df 100755 (executable)
@@ -48,7 +48,7 @@ PATH=$PATH:/sbin:/usr/sbin
 
 export PS4="dhclient.$interface.$$ + "
 exec >>/run/initramfs/initlog.pipe 2>>/run/initramfs/initlog.pipe
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 # We already need a set netif here
 netif=$interface
index 74e8a48d75b7f9f78f12871fb066f0b9f520902c..73c3579e98a9333eda6efc9b78805516e6336286 100755 (executable)
@@ -7,7 +7,7 @@
 #
 PATH=$PATH:/sbin:/usr/sbin
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 # Run dhclient
 do_dhcp() {
@@ -84,7 +84,7 @@ PATH=$PATH:/sbin:/usr/sbin
 
 export PS4="ifup.$1.$$ + "
 exec >>/run/initramfs/initlog.pipe 2>>/run/initramfs/initlog.pipe
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 # Huh? No $1?
 [ -z "$1" ] && exit 1
index 3e9fe3551827642a0c35245d380f4cd06db984d3..2fdb1c796b37a5ec948a2aaa8e49b60015b72eca 100755 (executable)
@@ -4,7 +4,7 @@
 
 PATH=$PATH:/sbin:/usr/sbin
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 # Huh? Empty $1?
 [ -z "$1" ] && exit 1
index d4e501890e532d2cf437b5dca4b124e5add31b63..b6021c6e4f2cf8728577bfc16338b9e70b8e345d 100755 (executable)
@@ -14,7 +14,7 @@
 # routing,dns,dhcp-options,etc.
 #
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 # Check if ip= lines should be used
 if getarg ip= >/dev/null ; then
index 09e793da6f4cd65d298503a7cf54d4e88d252866..26f99503fe858a4db5fb4bfd7fbe4f84a43f66d6 100644 (file)
@@ -2,7 +2,7 @@
 # -*- 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
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 # Try to mount specified device (by path, by UUID or by label) and check
 # the path with 'test'.
index febc561439729320e9f9880356f8d99faa5c25e4..f913d84dffcb0413ecbe89a1b8b6aa02244121b8 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- 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
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 DM_RAIDS=$(getargs rd.dm.uuid rd_DM_UUID=)
 
index 20b0a47582ddb36776b6e1ed0542d1510782f784..9d83c6deafac39ce2ee887eb003006ea99a70d1e 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- 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
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 [ -f /tmp/root.info ] && . /tmp/root.info
 
 PATH=$PATH:/sbin:/usr/sbin
index 757361587e62696f1a512f864e59d12f72b1e13a..3d3afcd1bb4c2febdc7d89f5abc8bb644cfc6a51 100755 (executable)
@@ -4,7 +4,7 @@
 
 # run lvm scan if udev has settled
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 VGS=$(getargs rd.lvm.vg rd_LVM_VG=)
 LVS=$(getargs rd.lvm.lv rd_LVM_LV=)
index ee189b72a8a732a3984fd931347c1759301a7945..0bfcd948338e3f67892c69e8dbd32995fcdb70a9 100755 (executable)
@@ -1,7 +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
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 info "Autoassembling MD Raid"    
 /sbin/mdadm -As --auto=yes --run 2>&1 | vinfo
index 4d8229e897578819fd159a508443beed10f55d5e..25e41c4b31ed8e5594f292814adda74499b59573 100755 (executable)
@@ -1,7 +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
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 md=$1
 udevadm control --stop-exec-queue
index 2f335127c08154b96731878849bef624d643d715..088d9b15dedb9aad12df24536aa743dc2250011d 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- 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
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 # run mdadm if udev has settled
 info "Assembling MD RAID arrays"
 udevadm control --stop-exec-queue
index def843ceefa18b40177f3e2075f2c43155fbd559..c13fb7fdeef5cb06080754ef8500853364907ba8 100755 (executable)
@@ -15,7 +15,7 @@ PATH=$PATH:/sbin:/usr/sbin
 
 export PS4="fcoe-up.$1.$$ + "
 exec >>/run/initramfs/initlog.pipe 2>>/run/initramfs/initlog.pipe
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 netif=$1
 dcb=$2
index 4d9879277506bfcabf2cc95a7b0958ae22ceb033..03ef085ac91e3e2e5d8b110b3eaaa50289eb656d 100755 (executable)
@@ -8,7 +8,7 @@
 # iscsistart needs this.
 #
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 PATH=$PATH:/sbin:/usr/sbin
 
index 995ca3938f7d029e061a86ad3b8144c8f626e66f..b16b44f9598cb6d500a1ad97115780ed659b7205 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- 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
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 PATH=$PATH:/sbin:/usr/sbin
 
index 0a537db8500ea5a7d35396d7db296d90f8c36f0f..b5d62e4b304d98e96cbc52cb879ea6f2f0172805 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- 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
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 PATH=$PATH:/sbin:/usr/sbin
 
index 2e301013e666eea9cf2189bd6c0576bfad5e3584..4d8cbdaada88a71935a5d521aec00d85d164f42d 100755 (executable)
@@ -25,7 +25,7 @@
 # NFSv3 is used.
 #
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 #Don't continue if root is ok
 [ -n "$rootok" ] && return
index f29af88afcf1659bc3619694862417d5a77af068..9f86ba82bcabf333e7ab83df62bd9983ba1196c5 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- 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
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 filter_rootopts() {
     rootopts=$1
index b1c74424133d2be69c0a453b3a91526979b44267..ea582fca4a75415103082ce228fed90220cd61eb 100755 (executable)
@@ -9,7 +9,7 @@
 #sysloglevel=level  What level has to be logged
 #syslogtype=rsyslog|syslog|syslogng  
 #                   Don't auto detect syslog but set it
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 syslogserver=$(getarg syslog.server syslog)
 syslogfilters=$(getargs syslog.filter filter)
index 7f1830d07a01e511868bc4702170493417aa94fb..56d9e578f6e8bab8c59ee3dfa834936b4ff785c5 100755 (executable)
@@ -4,7 +4,7 @@
 
 # Triggered by udev and starts rsyslogd with bootparameters
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 rsyslog_config() {
     local server=$1
index e6b1c1396a982bcb44f155e06d30b1dec1253dfa..88f35039b84ab1ef37d816e5fb0f89167c976126 100755 (executable)
@@ -4,7 +4,7 @@
 
 # Just cleans up a previously started syslogd
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 if [ -f /tmp/syslog.server ]; then
     read syslogtype < /tmp/syslog.type
index 0aa3df0261c23be5b585b78a00ddd131f5e266a4..61597a9b282140ded61341a48a10535e05e19cbc 100755 (executable)
@@ -3,7 +3,7 @@
 # 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
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
 detect_syslog() {
     syslogtype=""
index 410f247e61701c6fbea7386bdad7921db0e02702..b5395512a3084b9855b17f93647c56cb6ceb262c 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2008-2010, Red Hat, Inc.
 # Harald Hoyer <harald@redhat.com>
 
-. /lib/dracut-lib.sh
+type getarg >/dev/null || . /lib/dracut-lib.sh
 
 while [ $# -gt 0 ]; do
     case "$1" in