From: Harald Hoyer Date: Fri, 25 Mar 2011 12:07:39 +0000 (+0100) Subject: check for getarg() function before sourcing dracut-lib.sh X-Git-Tag: 009~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9f1e3d1f47c9749494a108ecedfa5b4fc6f7d41;p=platform%2Fupstream%2Fdracut.git check for getarg() function before sourcing dracut-lib.sh make use of "type getarg" to check, if we really need to source dracut-lib.sh --- diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script index 0bc6463..1ca3f10 100755 --- a/modules.d/40network/dhclient-script +++ b/modules.d/40network/dhclient-script @@ -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 diff --git a/modules.d/40network/ifup b/modules.d/40network/ifup index 74e8a48..73c3579 100755 --- a/modules.d/40network/ifup +++ b/modules.d/40network/ifup @@ -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 diff --git a/modules.d/40network/netroot b/modules.d/40network/netroot index 3e9fe35..2fdb1c7 100755 --- a/modules.d/40network/netroot +++ b/modules.d/40network/netroot @@ -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 diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh index d4e5018..b6021c6 100755 --- a/modules.d/40network/parse-ip-opts.sh +++ b/modules.d/40network/parse-ip-opts.sh @@ -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 diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh index 09e793d..26f9950 100644 --- a/modules.d/90crypt/crypt-lib.sh +++ b/modules.d/90crypt/crypt-lib.sh @@ -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'. diff --git a/modules.d/90dmraid/dmraid.sh b/modules.d/90dmraid/dmraid.sh index febc561..f913d84 100755 --- a/modules.d/90dmraid/dmraid.sh +++ b/modules.d/90dmraid/dmraid.sh @@ -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=) diff --git a/modules.d/90dmsquash-live/dmsquash-live-root b/modules.d/90dmsquash-live/dmsquash-live-root index 20b0a47..9d83c6d 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root +++ b/modules.d/90dmsquash-live/dmsquash-live-root @@ -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 diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh index 7573615..3d3afcd 100755 --- a/modules.d/90lvm/lvm_scan.sh +++ b/modules.d/90lvm/lvm_scan.sh @@ -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=) diff --git a/modules.d/90mdraid/mdadm_auto.sh b/modules.d/90mdraid/mdadm_auto.sh index ee189b7..0bfcd94 100755 --- a/modules.d/90mdraid/mdadm_auto.sh +++ b/modules.d/90mdraid/mdadm_auto.sh @@ -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 diff --git a/modules.d/90mdraid/mdcontainer_start.sh b/modules.d/90mdraid/mdcontainer_start.sh index 4d8229e..25e41c4 100755 --- a/modules.d/90mdraid/mdcontainer_start.sh +++ b/modules.d/90mdraid/mdcontainer_start.sh @@ -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 diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh index 2f33512..088d9b1 100755 --- a/modules.d/90mdraid/mdraid_start.sh +++ b/modules.d/90mdraid/mdraid_start.sh @@ -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 diff --git a/modules.d/95fcoe/fcoe-up b/modules.d/95fcoe/fcoe-up index def843c..c13fb7f 100755 --- a/modules.d/95fcoe/fcoe-up +++ b/modules.d/95fcoe/fcoe-up @@ -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 diff --git a/modules.d/95iscsi/iscsiroot b/modules.d/95iscsi/iscsiroot index 4d98792..03ef085 100755 --- a/modules.d/95iscsi/iscsiroot +++ b/modules.d/95iscsi/iscsiroot @@ -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 diff --git a/modules.d/95nbd/nbdroot b/modules.d/95nbd/nbdroot index 995ca39..b16b44f 100755 --- a/modules.d/95nbd/nbdroot +++ b/modules.d/95nbd/nbdroot @@ -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 diff --git a/modules.d/95nfs/nfsroot b/modules.d/95nfs/nfsroot index 0a537db..b5d62e4 100755 --- a/modules.d/95nfs/nfsroot +++ b/modules.d/95nfs/nfsroot @@ -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 diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh index 2e30101..4d8cbda 100755 --- a/modules.d/95nfs/parse-nfsroot.sh +++ b/modules.d/95nfs/parse-nfsroot.sh @@ -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 diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh index f29af88..9f86ba8 100755 --- a/modules.d/95rootfs-block/mount-root.sh +++ b/modules.d/95rootfs-block/mount-root.sh @@ -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 diff --git a/modules.d/98syslog/parse-syslog-opts.sh b/modules.d/98syslog/parse-syslog-opts.sh index b1c7442..ea582fc 100755 --- a/modules.d/98syslog/parse-syslog-opts.sh +++ b/modules.d/98syslog/parse-syslog-opts.sh @@ -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) diff --git a/modules.d/98syslog/rsyslogd-start.sh b/modules.d/98syslog/rsyslogd-start.sh index 7f1830d..56d9e57 100755 --- a/modules.d/98syslog/rsyslogd-start.sh +++ b/modules.d/98syslog/rsyslogd-start.sh @@ -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 diff --git a/modules.d/98syslog/syslog-cleanup.sh b/modules.d/98syslog/syslog-cleanup.sh index e6b1c13..88f3503 100755 --- a/modules.d/98syslog/syslog-cleanup.sh +++ b/modules.d/98syslog/syslog-cleanup.sh @@ -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 diff --git a/modules.d/98syslog/syslog-genrules.sh b/modules.d/98syslog/syslog-genrules.sh index 0aa3df0..61597a9 100755 --- a/modules.d/98syslog/syslog-genrules.sh +++ b/modules.d/98syslog/syslog-genrules.sh @@ -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="" diff --git a/modules.d/99base/initqueue b/modules.d/99base/initqueue index 410f247..b539551 100755 --- a/modules.d/99base/initqueue +++ b/modules.d/99base/initqueue @@ -7,7 +7,7 @@ # Copyright 2008-2010, Red Hat, Inc. # Harald Hoyer -. /lib/dracut-lib.sh +type getarg >/dev/null || . /lib/dracut-lib.sh while [ $# -gt 0 ]; do case "$1" in