fi
# only need to add each module once
- if echo $MODULES | grep $fmPath >/dev/null 2>&1 ; then : ; else
+ tmpFmPath=`echo $fmPath|awk -F/ '{for(i=1;i<NF;i++) { printf("%s\\/",$i); } { print $NF; }}'`
+ if is_yes "`echo $MODULES | awk '/"'$tmpFmPath'"/ { print "yes"; }' `" ; then : ; else
MODULES="$MODULES $fmPath"
fi
}
while [ $# -gt 0 ]; do
case $1 in
--fstab*)
- if echo $1 | grep '=' >/dev/null ; then
+ if is_yes "`echo $1 | awk '/=/ { print "yes"; }'`" ; then
fstab=`echo $1 | awk -F= '{print $2;}'`
else
fstab=$2
;;
--with*)
- if echo $1 | grep '=' >/dev/null ; then
+ if is_yes "`echo $1 | awk '/=/ { print "yes"; }'`" ; then
modname=`echo $1 | awk -F= '{print $2;}'`
else
modname=$2
force=1
;;
--preload)
- if echo $1 | grep '=' >/dev/null ; then
+ if is_yes "`echo $1 | awk '/=/ { print "yes"; }'`" ; then
modname=`echo $1 | awk -F= '{print $2;}'`
else
modname=$2
done
rootdev=$(awk '{ if ($2 == "/") { print $1; }}' $fstab)
-if is_yes "$PROBESCSI" && echo "$rootdev" | grep -q "^/dev/sd" ; then
+if is_yes "$PROBESCSI" && is_yes "`echo "$rootdev" | awk '/^\/dev\/sd/ { print "yes"; }'`" ; then
for n in $PRESCSIMODS; do
if [ "$n" = "unknown" ] ; then
modulefile=/etc/conf.modules
fi
if [ -f $modulefile ]; then
- scsimodules=`grep scsi_hostadapter $modulefile | grep -v '^[ ]*#' | LC_ALL=C sort -u | awk '{ print $3 }'`
+ scsimodules=`awk '/scsi_hostadapter/ && ! /^[\t ]*#/ { print $3; }' $modulefile| LC_ALL=C sort -u`
for n in $scsimodules; do
# for now allow scsi modules to come from anywhere. There are some
# RAID controllers with drivers in block/
fi
-if is_yes "$PROBEIDE" && echo "$rootdev" | grep -q "^/dev/hd" ; then
+if is_yes "$PROBEIDE" && is_yes "`echo "$rootdev" | awk '/^\/dev\/hd/ { print "yes"; }'`" ; then
for n in $PREIDEMODS; do
findmodule $n
done
if is_yes "$PROBERAID" ; then
# load appropriate raid devices if necessary
- if grep '^/dev/md' $fstab | grep -v noauto >/dev/null 2>&1 ; then
- for number in $(grep '^[ ]*raid-level' /etc/raidtab |
- awk '{print $2}' | LC_ALL=C sort -u) ; do
+ if is_yes "`awk '/^\/dev\/md/ && ! /noauto/ { print "yes"; }' $fstab`" ; then
+ for number in $(awk '/^[\t ]*raid-level/ { print $2; }' /etc/raidtab | LC_ALL=C sort -u) ; do
case $number in
[0145])
findmodule raid$number
fi
# check to see if we need to set up a loopback filesystem
-if echo $rootdev | cut -d/ -f3 | grep loop >/dev/null; then
+if is_yes "`echo $rootdev | cut -d/ -f3 | awk '/loop/ { print "yes"; }'`" ; then
key="^# $(echo $rootdev | cut -d/ -f3 | tr '[a-z]' '[A-Z]'):"
- if ! grep "$key" $fstab > /dev/null; then
+ if ! is_yes "`awk '/'$key'/ { print( "yes"); }' $fstab`" ; then
echo "The root filesystem is on a $rootdev, but there is no magic entry in $fstab" 1>&2
echo "for this device. Consult the geninitrd man page for more information" 2>&2
exit 1
fi
- line=$(grep "$key" $fstab)
+ line=`awk '/'$key'/ { print $0; }' $fstab`
loopDev=$(echo $line | awk '{print $3}')
loopFs=$(echo $line | awk '{print $4}')
loopFile=$(echo $line | awk '{print $5}')