]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
join $dsrc and $dracutbasedir
authorHarald Hoyer <harald@redhat.com>
Tue, 27 Oct 2009 08:28:53 +0000 (09:28 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 27 Oct 2009 15:02:56 +0000 (16:02 +0100)
dracut
dracut-functions

diff --git a/dracut b/dracut
index c5e9ea77a35421714c3adb99f94e9fc8defcfa96..7b9304f4df228b7b09a74810a3ce6913546102c7 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -108,7 +108,9 @@ export PATH
     set -x
 }
 
-[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
+[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
+
+[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dracutbasedir="$(dirname $0)" 
 
 # if we were not passed a config file, try the default one
 if [[ ! -f $conffile ]]; then
@@ -139,15 +141,15 @@ fw_dir=${fw_dir//:/ }
 
 [[ $hostonly = yes ]] && hostonly="-h"
 
-if [[ -f $dsrc/dracut-functions ]]; then
-   . $dsrc/dracut-functions
+if [[ -f $dracutbasedir/dracut-functions ]]; then
+   . $dracutbasedir/dracut-functions
 else
-   echo "Cannot find $dsrc/dracut-functions. Are you running from a git checkout?"
+   echo "Cannot find $dracutbasedir/dracut-functions. Are you running from a git checkout?"
    echo "Try passing -l as an argument to $0"
    exit 1
 fi
 
-dracutfunctions=$dsrc/dracut-functions
+dracutfunctions=$dracutbasedir/dracut-functions
 export dracutfunctions
 
 # This is kinda legacy -- eventually it should go away.
@@ -176,7 +178,7 @@ trap 'exit 1;' SIGINT # clean up after ourselves no matter how we die.
 # Need to be able to have non-root users read stuff (rpcbind etc)
 chmod 755 "$initdir"
 
-export initdir hookdirs dsrc dracutmodules drivers \
+export initdir hookdirs dracutbasedir dracutmodules drivers \
     fw_dir drivers_dir debug beverbose no_kernel kernel_only \
     add_drivers mdadmconf lvmconf
 
@@ -192,7 +194,7 @@ fi
 check_modules
   
 #source our modules.
-for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
+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
        if [[ $kernel_only = yes ]]; then
index 201e5635c83b12cb498202791adcf10f2eceb6c0..dc7e74df51323ea5714ca02645e8635e1527d467 100755 (executable)
@@ -26,7 +26,7 @@ strstr() { [[ $1 =~ $2 ]]; }
 
 # Log initrd creation.
 if ! [[ $dracutlogfile ]]; then
-    [[ $dsrc = /usr/share/dracut ]] && \
+    [[ $dracutbasedir = /usr/share/dracut ]] && \
        dracutlogfile=/var/log/dracut.log || \
        dracutlogfile=/tmp/dracut.log
 #    [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log
@@ -271,7 +271,7 @@ inst_symlink() {
 # find a rule in the usual places.
 find_rule() {
     [[ -f $1 ]] && { echo "$1"; return 0; }
-    for r in . /lib/udev/rules.d /etc/udev/rules.d $dsrc/rules.d; do
+    for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do
        [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; }
     done
     return 1
@@ -351,7 +351,7 @@ check_module_deps() {
     # if we are already set to be loaded, we do not have to be checked again.
     strstr "$mods_to_load" " $1 " && return
     # turn a module name into a directory, if we can.
-    moddir=$(echo ${dsrc}/modules.d/??${1})
+    moddir=$(echo ${dracutbasedir}/modules.d/??${1})
     [[ -d $moddir && -x $moddir/install ]] || return 1
     # if we do not have a check script, we are unconditionally included
     if [[ -x $moddir/check ]]; then
@@ -385,7 +385,7 @@ should_source_module() {
 }
 
 check_modules() {
-    for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
+    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