From a314fdd3235cd2f0e6a7616d0f9aabfefcb41e73 Mon Sep 17 00:00:00 2001 From: Rod Whitby Date: Sun, 20 Feb 2005 13:54:15 +0000 Subject: Merge bk://nslu2-linux@nslu2-linux.bkbits.net/openembedded into home.(none):/home/slug/openembedded 2005/02/21 00:23:13+10:30 (none)!rwhitby Silenced the stderr output from all the calls to dd in switchbox linuxrc BKrev: 421896870aIHYmRWho_49HKMf6ltyw --- packages/busybox/switchbox-1.00/linuxrc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'packages/busybox') diff --git a/packages/busybox/switchbox-1.00/linuxrc b/packages/busybox/switchbox-1.00/linuxrc index 117bd33c64..9f6ae7869b 100644 --- a/packages/busybox/switchbox-1.00/linuxrc +++ b/packages/busybox/switchbox-1.00/linuxrc @@ -7,14 +7,14 @@ prefroot= /bin/mount -t proc proc /proc /bin/echo "0x0100" > /proc/sys/kernel/real-root-dev -sysconflen=`/bin/dd if=/dev/mtd1 bs=4 count=1 | hexdump -n 6 -e '"%02d"'` -ipaddr=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 | grep ip_addr | sed -e s/ip_addr=//` -netmask=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 | grep netmask | sed -e s/netmask=//` -gateway=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 | grep gateway | sed -e s/gateway=//` -nfsrootloc=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 | grep nfsroot | sed -e s/nfsroot=// | cut -d, -f 1` -nfsrootopts=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 | grep nfsroot | sed -e s/nfsroot=// | cut -d, -f 2- | sed -e s/\"//g` +sysconflen=`/bin/dd if=/dev/mtd1 bs=4 count=1 2>/dev/null | hexdump -n 6 -e '"%02d"'` +ipaddr=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 2>/dev/null | grep ip_addr | sed -e s/ip_addr=//` +netmask=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 2>/dev/null | grep netmask | sed -e s/netmask=//` +gateway=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 2>/dev/null | grep gateway | sed -e s/gateway=//` +nfsrootloc=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 2>/dev/null | grep nfsroot | sed -e s/nfsroot=// | cut -d, -f 1` +nfsrootopts=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 2>/dev/null | grep nfsroot | sed -e s/nfsroot=// | cut -d, -f 2- | sed -e s/\"//g` device=/dev/`/bin/sed -n -e 's/^\(mtd[0-9]*\): .* "FIS directory"/\1/p' /proc/mtd` -length=`/bin/dd if=$device bs=2 skip=2048 | /bin/hexdump -n 4 -e '4/1 "%02X"' $device` +length=`/bin/dd if=$device bs=2 skip=2048 2>/dev/null | /bin/hexdump -n 4 -e '4/1 "%02X"' $device` # Determine desired rootfs if [ -z "$mounted" ] && /bin/mount -rt jffs2 /dev/mtdblock4 /mnt/jffs2 ; then @@ -67,7 +67,7 @@ if [ -n "$prefroot" ] ; then fi elif [ $prefroot = "maintenence" ] ; then - /bin/dd if=/dev/zero of=/dev/ram1 bs=1k count=12k + /bin/dd if=/dev/zero of=/dev/ram1 bs=1k count=12k 2>/dev/null /bin/mkdir /lib /bin/ln -s /mnt/jffs2/lib/* /lib /bin/mkdir /usr/bin @@ -100,7 +100,7 @@ if [ -n "$prefroot" ] ; then # Should the network drivers come from payload or the jffs2? if ( [ "$length" != "FFFFFFFF" ] ); then - /bin/dd if=$device bs=2 skip=2056 | /bin/tar zxvf - + /bin/dd if=$device bs=2 skip=2056 2>/dev/null | /bin/tar zxvf - /sbin/insmod ixp400 /sbin/insmod ixp425_eth /sbin/ifconfig ixp0 up $ipaddr netmask $netmask @@ -144,7 +144,9 @@ fi # Pivot if [ -n "$mounted" ] ; then - /bin/killall portmap + if [ $prefroot = "nfsroot" ] ; then + /bin/killall portmap + fi if [ $mounted != "/mnt/jffs2" ] ; then sleep 1 /bin/umount /mnt/jffs2 @@ -169,7 +171,7 @@ if [ -z "$mounted" ] ; then /bin/echo "Root filesystem cannot be found - dropping into shell ..." if ( [ "$length" != "FFFFFFFF" ] ); then - /bin/dd if=$device bs=2 skip=2056 | /bin/tar zxvf - + /bin/dd if=$device bs=2 skip=2056 2>/dev/null | /bin/tar zxvf - /sbin/insmod ixp400 /sbin/insmod ixp425_eth /sbin/ifconfig ixp0 up $ipaddr netmask $netmask -- cgit v1.2.3