From: Alan H. <al...@us...> - 2003-12-30 19:55:11
|
Update of /cvsroot/ipcop/ipcop/src/nash In directory sc8-pr-cvs1:/tmp/cvs-serv9515/src/nash Modified Files: mkinitrd Log Message: fix to use grep -E instead of egrep and gawk instead of awk Index: mkinitrd =================================================================== RCS file: /cvsroot/ipcop/ipcop/src/nash/mkinitrd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkinitrd 30 Dec 2003 17:40:08 -0000 1.1 --- mkinitrd 30 Dec 2003 19:55:07 -0000 1.2 *************** *** 65,69 **** [ -n "$verbose" ] && echo -n "Looking for deps of module $1" ! deps=$(awk 'BEGIN { searched=ARGV[2]; ARGV[2]=""; rc=1 } \ function modname(filename) { match(filename, /\/([^\/]+)\.k?o/, ret); return ret[1] } \ function show() { if (orig == searched) { print dep; orig=""; rc=0; exit } } \ --- 65,69 ---- [ -n "$verbose" ] && echo -n "Looking for deps of module $1" ! deps=$(gawk 'BEGIN { searched=ARGV[2]; ARGV[2]=""; rc=1 } \ function modname(filename) { match(filename, /\/([^\/]+)\.k?o/, ret); return ret[1] } \ function show() { if (orig == searched) { print dep; orig=""; rc=0; exit } } \ *************** *** 95,99 **** fi ! if echo $builtins | egrep -q '(^| )'$modName'( |$)' ; then [ -n "$verbose" ] && echo "module $modName assumed to be built in" set +x --- 95,99 ---- fi ! if echo $builtins | grep -E -q '(^| )'$modName'( |$)' ; then [ -n "$verbose" ] && echo "module $modName assumed to be built in" set +x *************** *** 123,127 **** for modExt in o.gz o ko ; do if [ -d /lib/modules/$kernel/updates ]; then ! fmPath=`(cd /lib/modules/$kernel/updates; echo find . -name $modName.$modExt -type f | /sbin/nash --quiet) | /bin/awk {'print $1; exit;'}` fi --- 123,127 ---- for modExt in o.gz o ko ; do if [ -d /lib/modules/$kernel/updates ]; then ! fmPath=`(cd /lib/modules/$kernel/updates; echo find . -name $modName.$modExt -type f | /sbin/nash --quiet) | gawk {'print $1; exit;'}` fi *************** *** 131,135 **** fi ! fmPath=`(cd /lib/modules/$kernel; echo find . -name $modName.$modExt -type f | /sbin/nash --quiet) | /bin/awk {'print $1; exit;'}` if [ -f /lib/modules/$kernel/$fmPath ]; then break --- 131,135 ---- fi ! fmPath=`(cd /lib/modules/$kernel; echo find . -name $modName.$modExt -type f | /sbin/nash --quiet) | gawk {'print $1; exit;'}` if [ -f /lib/modules/$kernel/$fmPath ]; then break *************** *** 293,297 **** if ! echo access -w $t | /sbin/nash --quiet; then continue; fi ! fs=$(df -T $t 2>/dev/null | awk '{line=$1;} END {printf $2;}') if [ "$fs" != "tmpfs" ]; then TMPDIR=$t --- 293,297 ---- if ! echo access -w $t | /sbin/nash --quiet; then continue; fi ! fs=$(df -T $t 2>/dev/null | gawk '{line=$1;} END {printf $2;}') if [ "$fs" != "tmpfs" ]; then TMPDIR=$t *************** *** 319,323 **** for fs in / /boot ; do esc=$(echo $fs | sed 's,/,\\/,g') ! dev=$(mount | awk "/ on ${esc} / { print \$1 }" | sed 's/[0-9]*$//' | cut -d/ -f3) if [ "$(echo $dev | cut -c1-2)" = sd ]; then if [ `which kudzu 2>/dev/null` ]; then --- 319,323 ---- for fs in / /boot ; do esc=$(echo $fs | sed 's,/,\\/,g') ! dev=$(mount | gawk "/ on ${esc} / { print \$1 }" | sed 's/[0-9]*$//' | cut -d/ -f3) if [ "$(echo $dev | cut -c1-2)" = sd ]; then if [ `which kudzu 2>/dev/null` ]; then *************** *** 333,337 **** if [ -n "$needusb" ]; then ! drivers=$(awk '/^alias usb-controller[0-9]* / { print $3}' < /etc/modules.conf) if [ -n "$drivers" ]; then for driver in $drivers; do --- 333,337 ---- if [ -n "$needusb" ]; then ! drivers=$(gawk '/^alias usb-controller[0-9]* / { print $3}' < /etc/modules.conf) if [ -n "$drivers" ]; then for driver in $drivers; do *************** *** 350,354 **** if [ -f $modulefile ]; then ! scsimodules=`grep "alias[[:space:]]scsi_hostadapter" $modulefile | grep -v '^[ ]*#' | LC_ALL=C sort -u | awk '{ print $3 }'` if [ -n "$scsimodules" ]; then --- 350,354 ---- if [ -f $modulefile ]; then ! scsimodules=`grep "alias[[:space:]]scsi_hostadapter" $modulefile | grep -v '^[ ]*#' | LC_ALL=C sort -u | gawk '{ print $3 }'` if [ -n "$scsimodules" ]; then *************** *** 392,397 **** # /proc/mdstat suggests ! # note that the awk below contains a space and a tab ! for level in $(awk '/^md[0-9][0-9]*[ ]*:/ { print $4 }' \ /proc/mdstat | sort -u); do case $level in --- 392,397 ---- # /proc/mdstat suggests ! # note that the gawk below contains a space and a tab ! for level in $(gawk '/^md[0-9][0-9]*[ ]*:/ { print $4 }' \ /proc/mdstat | sort -u); do case $level in *************** *** 411,415 **** if [ -n "$startraid" ]; then ! raiddevices=$(awk '/^md[0-9][0-9]*[ ]*:/ { print $1 }' \ /proc/mdstat | sort) fi --- 411,415 ---- if [ -n "$startraid" ]; then ! raiddevices=$(gawk '/^md[0-9][0-9]*[ ]*:/ { print $1 }' \ /proc/mdstat | sort) fi *************** *** 417,421 **** # check to see if we need to set up a loopback filesystem ! rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab) if echo $rootdev | cut -d/ -f3 | grep -q loop ; then key="^# $(echo $rootdev | cut -d/ -f3 | tr '[a-z]' '[A-Z]'):" --- 417,421 ---- # check to see if we need to set up a loopback filesystem ! rootdev=$(gawk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab) if echo $rootdev | cut -d/ -f3 | grep -q loop ; then key="^# $(echo $rootdev | cut -d/ -f3 | tr '[a-z]' '[A-Z]'):" *************** *** 427,433 **** line=$(grep "$key" $fstab) ! loopDev=$(echo $line | awk '{print $3}') ! loopFs=$(echo $line | awk '{print $4}') ! loopFile=$(echo $line | awk '{print $5}') basicmodules="$basicmodules -loop" --- 427,433 ---- line=$(grep "$key" $fstab) ! loopDev=$(echo $line | gawk '{print $3}') ! loopFs=$(echo $line | gawk '{print $4}') ! loopFile=$(echo $line | gawk '{print $5}') basicmodules="$basicmodules -loop" *************** *** 443,448 **** fi ! rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab) ! rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab) # in case the root filesystem is modular --- 443,448 ---- fi ! rootfs=$(gawk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab) ! rootopts=$(gawk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab) # in case the root filesystem is modular *************** *** 532,536 **** # FIXME -- this won't work if you're using devfs if [ -n "$root_lvm" ]; then ! pvs=$(/sbin/pvscan | grep " PV " | /bin/awk {'print $5;'} |sed 's/"//g') for pv in $pvs; do cp $verbose --parents -a $pv $MNTIMAGE/ --- 532,536 ---- # FIXME -- this won't work if you're using devfs if [ -n "$root_lvm" ]; then ! pvs=$(/sbin/pvscan | grep " PV " | gawk {'print $5;'} |sed 's/"//g') for pv in $pvs; do cp $verbose --parents -a $pv $MNTIMAGE/ |