Skip to contentSkip to conversation

Don't use absolute paths for utilities

PATCH In review Seewer Philippe 3 participants 5 messages Jul 2, 2009 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't use absolute paths for utilities

dracut +0 -0
index 826fbda..1d440ef 100755
@@ -61,6 +61,8 @@ while (($# > 0)); do
    shift

done

+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH +

[[ $debug ]] && { 
    export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
    set -x

@@ -138,8 +140,8 @@ echo $mods_to_load
## final stuff that has to happen

# generate module dependencies for the initrd
-if ! /sbin/depmod -a -b "$initdir" $kernel; then
-    echo "\"/sbin/depmod -a $kernel\" failed."
+if ! depmod -a -b "$initdir" $kernel; then
+    echo "\"depmod -a $kernel\" failed."
    exit 1
fi
dracut-functions +0 -0
index 8fbfa97..e525179 100755
@@ -307,7 +307,7 @@ instmods() {

fi
inst_simple "$modpath"
done
- for fw in $(/sbin/modinfo -F firmware $mod 2>/dev/null); do
+ for fw in $(modinfo -F firmware $mod 2>/dev/null); do

		    if [[ -f /lib/firmware/$fw ]]; then
			inst_simple "/lib/firmware/$fw"
		    else

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

dracut

Quoted 1 line · Seewer Philippe
dracut +0 -0

It would be good if your commit message mentioned why it is not a good idea to use absolute paths, eg different distros put things in different places, etc.
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1246545040.28989.7.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org

#4 lore raw
Quoted 6 lines · David Dillow

dracut

Quoted 1 line · Seewer Philippe
dracut +0 -0

It would be good if your commit message mentioned why it is not a good idea to use absolute paths, eg different distros put things in different places, etc.

We've had the discussion about absolute paths and distros a few times, so it should be obvious. --
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 11 lines · Seewer Philippe
Quoted 6 lines · David Dillow

dracut

Quoted 1 line · Seewer Philippe
dracut +0 -0

It would be good if your commit message mentioned why it is not a good idea to use absolute paths, eg different distros put things in different places, etc.

We've had the discussion about absolute paths and distros a few times, so it should be obvious.

We have, on the list and in IRC, but newcomers to the project will only have the commit log. Our commit text has often been of the same quality as
int i = 0; /* set i to zero */

and I'd like to see it improve. This isn't directed solely at you -- many of us are guilty, including myself.

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to a message not in the archive
Quoted 28 lines · Seewer Philippe
dracut +0 -0
index 826fbda..1d440ef 100755
@@ -61,6 +61,8 @@ while (($# > 0)); do

shift
done

dracut +2 -0
+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
+

[[ $debug ]] && { export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): '; set -x

dracut +2 -2
@@ -138,8 +140,8 @@ echo $mods_to_load
 ## final stuff that has to happen
 
 # generate module dependencies for the initrd
-if ! /sbin/depmod -a -b "$initdir" $kernel; then
- echo "\"/sbin/depmod -a $kernel\" failed."
+if ! depmod -a -b "$initdir" $kernel; then
+ echo "\"depmod -a $kernel\" failed."

exit 1
fi

dracut-functions +0 -0
index 8fbfa97..e525179 100755
@@ -307,7 +307,7 @@ instmods() {
Quoted 8 lines

fi
inst_simple "$modpath"
done
- for fw in $(/sbin/modinfo -F firmware $mod 2>/dev/null); do
+ for fw in $(modinfo -F firmware $mod 2>/dev/null); do if [[ -f /lib/firmware/$fw ]]; then
inst_simple "/lib/firmware/$fw"
else

pushed
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html