From c6cbba4d52f90c23c71cf6e383bd143329391516 Mon Sep 17 00:00:00 2001 From: short <> Date: Fri, 29 Aug 2003 11:05:39 +0000 Subject: [PATCH] Use absolute pathname to call all subcommands. - We do not have "/sbin" in $PATH in some situation on Shrike. --- kernel/Linux/prepmod.in | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/kernel/Linux/prepmod.in b/kernel/Linux/prepmod.in index d74c8af..da224a7 100755 --- a/kernel/Linux/prepmod.in +++ b/kernel/Linux/prepmod.in @@ -96,7 +96,8 @@ my($load)=@_; my $modproberc; if ($load) { - do { ($modproberc=_system $_) and cluck "$_ failed - ignoring"; } for ("depmod -aq","modprobe lufs"); + do { ($modproberc=_system $_) and cluck "$_ failed - ignoring"; } + for ("/sbin/depmod -aq","/sbin/modprobe lufs"); } exit ($modproberc ? 1 : 0) if !$lufsmnt_bin; do { exec $lufsmnt_bin,@ARGV; }; @@ -108,7 +109,7 @@ my $filesystems=_readfile "/proc/filesystems"; # 'lufs' may be built-in _pass if $filesystems=~/\blufs$/m; my $modules=_readfile "/proc/modules"; # 'lufs' may be already loaded _pass if $modules=~/^lufs\b/m; -_pass if !_system "modprobe lufs 2>/dev/null"; +_pass if !_system "/sbin/modprobe lufs 2>/dev/null"; my $proc_version=_readfile "/proc/version"; my $uname_r=($proc_version=~/^Linux version (\S+)/)[0] || _readfile "uname -r|"; @@ -138,7 +139,7 @@ else { # depmod(1) will take the larget symlink name - we must create directory for it. if (build($kernel,$uname_r,$_)) { do { cluck "Failed to symlink $_"; next; } - if _system "rm -rf $moduledir; mkdir -p $moduledir; ln -s $_ $moduledir/lufs.o"; + if _system "/bin/rm -rf $moduledir; /bin/mkdir -p $moduledir; /bin/ln -s $_ $moduledir/lufs.o"; _pass 1; } } @@ -146,8 +147,9 @@ else { local $_; for (<$modbindir/*-$uname_r*/*.o>,<$modbindir/*-${uname_r_base}*/*.o>,<$modbindir/*/*.o>) { - next if _system "rmmod lufs 2>/dev/null; insmod -o lufs -p $_ 2>/dev/null"; - do { cluck "Failed to symlink $_"; next; } if _system "rm -rf $moduledir; mkdir -p $moduledir; ln -s $_ $moduledir/lufs.o"; + next if _system "/sbin/rmmod lufs 2>/dev/null; /sbin/insmod -o lufs -p $_ 2>/dev/null"; + do { cluck "Failed to symlink $_"; next; } + if _system "/bin/rm -rf $moduledir; /bin/mkdir -p $moduledir; /bin/ln -s $_ $moduledir/lufs.o"; _pass 1; } confess "lufs module not loaded: Try running $basedir/prepmod to see more."; @@ -162,7 +164,7 @@ my($kernel,$uname_r,$destmodule)=@_; my $kdebug=""; do { $kdebug=$_ if !/^@/; } for ('@KDEBUG_FLAGS@'); - my $cmdline="gcc" + my $cmdline="/usr/bin/gcc" .($quiet ? " 2>/dev/null" : "") ." -Wall -Wstrict-prototypes -Wno-trigraphs" ." -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2" @@ -182,11 +184,11 @@ my($kernel,$uname_r,$destmodule)=@_; || (!$config && !$autoconf); # assume modversions if not known my @objects=map({ my $o=$_; $o=~s/[.]c$/.o/; $o; } @sources); - return !_system "set -e; mkdir -p `dirname $destmodule`; rm -f $destmodule;" + return !_system "set -e; /bin/mkdir -p `dirname $destmodule`; /bin/rm -f $destmodule;" .(!$vardir ? "" : " cd $vardir;") ." $cmdline -c ".join(" ",map({ srcdir($uname_r)."/".$_; } @sources)).";" - ." ld -r -o $destmodule ".join(" ",@objects).";" - ." rm -f ".join(" ",@objects); + ." /usr/bin/ld -r -o $destmodule ".join(" ",@objects).";" + ." /bin/rm -f ".join(" ",@objects); } @@ -210,9 +212,9 @@ my($rpm)=@_; my $uname_r; $uname_r||=($rpm=~m#/kernel-source-([^-]+-[^-]+)[.][^.]+[.]rpm$#)[0]; my $uname_r_base=($uname_r=~/^([^-]+)/)[0]; - _system "rm -rf $tmp_dir; mkdir $tmp_dir; set -e;" + _system "/bin/rm -rf $tmp_dir; /bin/mkdir $tmp_dir; set -e;" # Here we will extract even some false 'include's but we filter dirs just for speed/space. - ." rpm2cpio '$rpm' | (cd $tmp_dir; cpio -id --quiet ./usr/src/linux*/{.config,include/*})" + ." /usr/bin/rpm2cpio '$rpm' | (cd $tmp_dir; /bin/cpio -id --quiet ./usr/src/linux*/{.config,include/*})" and confess "Extraction of: $rpm"; my $dir; do { $dir||=$_ if -d $_; } for ($tmp_dir."/usr/src/linux-$uname_r"); @@ -249,7 +251,7 @@ RHCONFIG_H_NOBOOT_EOF prebuild_kernel $dir,$vendor,$uname_r.$smp.".".$arch; } } - _system "rm -rf $tmp_dir" and confess "Deletion of: $tmp_dir"; + _system "/bin/rm -rf $tmp_dir" and confess "Deletion of: $tmp_dir"; } sub prebuild_dir -- 1.8.3.1