From 45e331302268490cfb532ea6fe827cba1351ec5b Mon Sep 17 00:00:00 2001 From: Roman Kyrylych Date: Sat, 8 Mar 2008 19:22:48 +0200 Subject: Use full path to binaries everywhere Signed-off-by: Roman Kyrylych --- functions | 12 ++++----- rc.shutdown | 6 ++--- rc.single | 10 ++++---- rc.sysinit | 82 ++++++++++++++++++++++++++++++------------------------------- 4 files changed, 55 insertions(+), 55 deletions(-) diff --git a/functions b/functions index 38c633c..bbc773c 100644 --- a/functions +++ b/functions @@ -4,7 +4,7 @@ # width: -STAT_COL=$(stty size) +STAT_COL=$(/bin/stty size) # strip the rows number, we just want columns STAT_COL=${STAT_COL##* } if [ "$STAT_COL" = "0" ]; then @@ -19,7 +19,7 @@ fi STAT_COL=$(($STAT_COL - 13)) # disable colors on broken terminals -TERM_COLORS="$(tput colors 2>/dev/null)" +TERM_COLORS="$(/bin/tput colors 2>/dev/null)" if [ $? = 3 ]; then TERM_COLORS=8 elif [ -n "${TERM_COLORS}" ]; then @@ -130,12 +130,12 @@ status() { # daemons: add_daemon() { - [ -d /var/run/daemons ] || mkdir -p /var/run/daemons - touch /var/run/daemons/$1 + [ -d /var/run/daemons ] || /bin/mkdir -p /var/run/daemons + /bin/touch /var/run/daemons/$1 } rm_daemon() { - rm -f /var/run/daemons/$1 + /bin/rm -f /var/run/daemons/$1 } ck_daemon() { @@ -145,7 +145,7 @@ ck_daemon() { source_functions() { if [ -d /etc/rc.d/functions.d/ ]; then - for f in $(ls /etc/rc.d/functions.d/); do + for f in $(/bin/ls /etc/rc.d/functions.d/); do . /etc/rc.d/functions.d/$f done fi diff --git a/rc.shutdown b/rc.shutdown index c414535..1ea8b17 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -33,7 +33,7 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then done # find any leftover daemons and shut them down in reverse order if [ -d /var/run/daemons ]; then - for daemon in $(ls -1t /var/run/daemons); do + for daemon in $(/bin/ls -1t /var/run/daemons); do /etc/rc.d/$daemon stop done fi @@ -73,7 +73,7 @@ fi stat_done # removing psmouse module to fix some reboot issues on newer laptops -modprobe -r psmouse >/dev/null 2>&1 +/sbin/modprobe -r psmouse >/dev/null 2>&1 # Write to wtmp file before unmounting /sbin/halt -w @@ -87,7 +87,7 @@ stat_busy "Unmounting Filesystems" stat_done # Kill non-root encrypted partition mappings -if [ -f /etc/crypttab -a -n "$(grep -v ^# /etc/crypttab | grep -v ^$)" ]; then +if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)" ]; then stat_busy "Deactivating encrypted volumes:" CS=/sbin/cryptsetup.static do_uncrypt() { diff --git a/rc.single b/rc.single index 5f55eeb..9c940a5 100755 --- a/rc.single +++ b/rc.single @@ -12,7 +12,7 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then # Shutdown daemons let i=${#DAEMONS[@]} while [[ i -gt 0 ]]; do - if [[ $(echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l) -eq 1 ]]; then + if [[ $(echo ${DAEMONS[$i]} | /bin/grep '^[^\!]' | /usr/bin/wc -l) -eq 1 ]]; then /etc/rc.d/${DAEMONS[$i]#@} stop fi let i=i-1 @@ -39,11 +39,11 @@ if [ "$PREVLEVEL" != "N" ]; then if [ -x /etc/start_udev -a -d /sys/block ]; then # We have a start_udev script and /sys appears to be mounted, use UDev status "Starting UDev Daemon" /etc/start_udev - if [ "$(pidof -o %PPID /sbin/udevd)" ]; then + if [ "$(/bin/pidof -o %PPID /sbin/udevd)" ]; then # If an old udevd is kicking around, we'll have to remount pts and shm - umount /dev/shm /dev/pts >/dev/null 2>&1 - mount /dev/pts - mount /dev/shm + /bin/umount /dev/shm /dev/pts >/dev/null 2>&1 + /bin/mount /dev/pts + /bin/mount /dev/shm fi else # Static /dev, our last resort diff --git a/rc.sysinit b/rc.sysinit index f539fef..6c90ce9 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -17,8 +17,8 @@ printhl "Distributed under the GNU General Public License (GPL)" printsep # mount /proc and our RAM /dev -mount -n -t ramfs none /dev -mount -n -t proc none /proc +/bin/mount -n -t ramfs none /dev +/bin/mount -n -t proc none /proc # Create our default nodes that minilogd may need /bin/mknod /dev/null c 1 3 @@ -26,13 +26,13 @@ mount -n -t proc none /proc /bin/mknod /dev/console c 5 1 # More initial /dev setup that udev doesn't do -ln -snf /proc/self/fd /dev/fd -ln -snf /proc/self/fd/0 /dev/stdin -ln -snf /proc/self/fd/1 /dev/stdout -ln -snf /proc/self/fd/2 /dev/stderr -ln -snf /proc/kcore /dev/core -mkdir /dev/pts -mkdir /dev/shm +/bin/ln -snf /proc/self/fd /dev/fd +/bin/ln -snf /proc/self/fd/0 /dev/stdin +/bin/ln -snf /proc/self/fd/1 /dev/stdout +/bin/ln -snf /proc/self/fd/2 /dev/stderr +/bin/ln -snf /proc/kcore /dev/core +/bin/mkdir /dev/pts +/bin/mkdir /dev/shm # start up our mini logger until syslog takes over @@ -40,17 +40,17 @@ mkdir /dev/shm # anything more serious than KERN_WARNING goes to the console # 'verbose' cmdline parameter enables more messages -if grep -q " verbose" /proc/cmdline; then +if /bin/grep -q " verbose" /proc/cmdline; then /bin/dmesg -n 8 else /bin/dmesg -n 3 fi # mount /sys -mount -n -t sysfs none /sys +/bin/mount -n -t sysfs none /sys # mount usbfs /sbin/modprobe usbcore >/dev/null 2>&1 -grep -qw usbfs /proc/filesystems && mount -n -t usbfs none /proc/bus/usb +/bin/grep -qw usbfs /proc/filesystems && /bin/mount -n -t usbfs none /proc/bus/usb # enable rtc access /bin/mkdir /dev/misc/bin/ @@ -60,12 +60,12 @@ grep -qw usbfs /proc/filesystems && mount -n -t usbfs none /proc/bus/usb HWCLOCK_PARAMS="--hctosys" if [ "$HARDWARECLOCK" = "UTC" ]; then - HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc" + HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc" else - HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime" + HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime" fi if [ "$USEDIRECTISA" != "no" ]; then - HWCLOCK_PARAMS="$HWCLOCK_PARAMS --directisa" + HWCLOCK_PARAMS="$HWCLOCK_PARAMS --directisa" fi # Set clock early to fix some bugs with filesystem checks @@ -79,8 +79,8 @@ if [ -x /sbin/udevadm -a -d /sys/block ]; then #status "Starting UDev Daemon" /etc/start_udev init stat_busy "Starting UDev Daemon" - mkdir /dev/pts - mkdir /dev/shm + /bin/mkdir /dev/pts + /bin/mkdir /dev/shm /sbin/udevd --daemon stat_done else @@ -102,14 +102,14 @@ if ! [ "$load_modules" = "off" ]; then if [ -d /proc/acpi ]; then stat_busy "Loading standard ACPI modules" ACPI_MODULES="ac battery button fan processor thermal" - k="$(echo $BLACKLIST ${MOD_BLACKLIST[@]} | sed 's|-|_|g')" - j="$(echo ${MODULES[@]} | sed 's|-|_|g')" + k="$(echo $BLACKLIST ${MOD_BLACKLIST[@]} | /bin/sed 's|-|_|g')" + j="$(echo ${MODULES[@]} | /bin/sed 's|-|_|g')" #add disabled MODULES (!) to blacklist - much requested feature for m in ${j}; do [ "$m" != "${m#!}" ] && k="${k} ${m#!}" done # add disablemodules= from commandline to blacklist - k="${k} $(echo ${disablemodules} | sed 's|-|_|g' | sed 's|,| |g')" + k="${k} $(echo ${disablemodules} | /bin/sed 's|-|_|g' | /bin/sed 's|,| |g')" for n in ${ACPI_MODULES}; do if ! echo ${k} | /bin/grep "\<$n\>" 2>&1 >/dev/null; then /sbin/modprobe $n > /dev/null 2>&1 @@ -120,7 +120,7 @@ if ! [ "$load_modules" = "off" ]; then fi # run udev uevents -if pidof -o %PPID /sbin/udevd >/dev/null; then +if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then #status "Loading UDev uevents" /etc/start_udev uevents stat_busy "Loading UDev uevents" udevstart="$(date +%s%0N)" @@ -128,13 +128,13 @@ if pidof -o %PPID /sbin/udevd >/dev/null; then /sbin/udevadm settle stat_done udevend="$(date +%s%0N)" - printhl " UDev uevent processing time: $((($udevend-$udevstart)/1000000))ms\n" + printhl " UDev uevent processing time: $((($udevend-$udevstart)/1000000))ms\n" fi # bring up the loopback interface if [ -d /sys/class/net/lo ]; then stat_busy "Bringing up loopback interface" - ifconfig lo 127.0.0.1 up + /sbin/ifconfig lo 127.0.0.1 up if [ $? -ne 0 ]; then stat_fail else @@ -145,14 +145,14 @@ fi # If using an encrypted root fs, we should find the root dev in the initrd # FIXME: obsoleted by initramfs and udev if [ -e /initrd/dev/mapper/root ]; then - mkdir /dev/mapper 2>/dev/null - cp -a /initrd/dev/mapper/root /dev/mapper/root + /bin/mkdir /dev/mapper 2>/dev/null + /bin/cp -a /initrd/dev/mapper/root /dev/mapper/root fi # If necessary, find md devices and manually assemble RAID arrays if [ -f /etc/mdadm.conf -a "$(grep ^ARRAY /etc/mdadm.conf 2>/dev/null)" ]; then # udev won't create these md nodes, so we do it ourselves - for dev in $(grep ^ARRAY /etc/mdadm.conf | awk '{print $2}'); do + for dev in $(/bin/grep ^ARRAY /etc/mdadm.conf | /bin/awk '{print $2}'); do path=$(echo $dev | sed 's|/[^/]*$||') node=$(echo $dev | sed "s|^$path/||") minor=$(echo $node | sed 's|^[^0-9]*||') @@ -165,7 +165,7 @@ fi # FIXME: obsoleted by initramfs if [ -f /initrd/linuxrc ]; then stat_busy "Freeing memory from Initial Ramdisk" - umount /initrd 2>/dev/null + /bin/umount /initrd 2>/dev/null /sbin/blockdev --flushbufs /dev/rd/0 2>/dev/null stat_done fi @@ -186,7 +186,7 @@ if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then fi # Set up non-root encrypted partition mappings -if [ -f /etc/crypttab -a -n "$(grep -v ^# /etc/crypttab | grep -v ^$)" ]; then +if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)" ]; then /sbin/modprobe -q dm-mod 2>/dev/null stat_busy "Unlocking encrypted volumes:" csfailed=0 @@ -211,7 +211,7 @@ if [ -f /etc/crypttab -a -n "$(grep -v ^# /etc/crypttab | grep -v ^$)" ]; then $CS -d /dev/urandom $copts create $cname $csrc >/dev/null if [ $? -eq 0 ]; then stat_append "creating swapspace.." - mkswap -L $cname /dev/mapper/$cname >/dev/null + /sbin/mkswap -L $cname /dev/mapper/$cname >/dev/null fi fi elif [ "${cpass}" = "ASK" ]; then @@ -284,7 +284,7 @@ if [ -x /sbin/fsck ]; then echo "* *" echo "************************************************************" echo - sleep 15 + /bin/sleep 15 else echo echo "***************** FILESYSTEM CHECK FAILED ****************" @@ -314,16 +314,16 @@ stat_busy "Mounting Local Filesystems" # make sure / gets written to /etc/mtab /bin/mount -o remount,rw / # re-mount /proc , /sys and usbfs so they can be written to /etc/mtab -umount /proc/bus/usb +/bin/umount /proc/bus/usb if [ -e /proc/mounts ]; then - grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts >> /etc/mtab + /bin/grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts >> /etc/mtab fi -if grep -qw usbfs /proc/filesystems; then +if /bin/grep -qw usbfs /proc/filesystems; then # Some people use custom permissions for their usbfs - if grep -v "^#" /etc/fstab | grep -qw /proc/bus/usb ; then - mount /proc/bus/usb + if /bin/grep -v "^#" /etc/fstab | /bin/grep -qw /proc/bus/usb ; then + /bin/mount /proc/bus/usb else - mount -t usbfs none /proc/bus/usb + /bin/mount -t usbfs none /proc/bus/usb fi fi # now mount all the local filesystems @@ -356,11 +356,11 @@ stat_busy "Removing Leftover Files" /bin/rm -f /var/lock/* &>/dev/null /bin/rm -rf /tmp/* /tmp/.* &>/dev/null /bin/rm -f /forcefsck &>/dev/null -(cd /var/run && find . ! -type d -exec rm -f -- {} \; ) +(cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; ) : > /var/run/utmp # Keep {x,k,g}dm happy with xorg -mkdir /tmp/.ICE-unix && chmod 1777 /tmp/.ICE-unix -mkdir /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix +/bin/mkdir /tmp/.ICE-unix && /bin/chmod 1777 /tmp/.ICE-unix +/bin/mkdir /tmp/.X11-unix && /bin/chmod 1777 /tmp/.X11-unix stat_done #status "Updating Shared Library Links" /sbin/ldconfig @@ -379,7 +379,7 @@ status "Updating Module Dependencies" /sbin/depmod -A # Flush old locale settings : >/etc/profile.d/locale.sh -chmod 755 /etc/profile.d/locale.sh +/bin/chmod 755 /etc/profile.d/locale.sh # Set user defined locale [ -z "$LOCALE" ] && LOCALE="en_US" stat_busy "Setting Locale: $LOCALE" @@ -454,7 +454,7 @@ fi # Save our dmesg output from this boot if [ -f /var/log/dmesg.log ]; then - rm /var/log/dmesg.log + /bin/rm /var/log/dmesg.log fi /bin/dmesg > /var/log/dmesg.log -- cgit v1.2.3