#
# based on mkinitrd from RedHat
-RCSID='$Id: geninitrd,v 2.13 2002/02/19 14:43:13 wiget Exp $'
+RCSID='$Id: geninitrd,v 2.14 2002/02/20 10:11:23 wiget Exp $'
PATH=/sbin:$PATH
export PATH
. /etc/rc.d/init.d/functions
COMPRESS="yes"
-FS="rom"
+# INITRDFS is set later (catch obsoleted FS option)
+#INITRDFS="rom"
USERAIDSTART="no"
# it should be safe to remove scsi_mod from here, but I'm not sure...
PRESCSIMODS="-scsi_mod unknown -sd_mod"
. /etc/sysconfig/geninitrd
fi
+if [ "x" = "x$INITRDFS" ] ; then
+ if [ "x" = "x$FS" ] ; then
+ # default value
+ INITRDFS="rom"
+ else
+ echo "Warning: FS configuration options is obsoleted. Use INITRDFS instead" 1>&2
+ INITRDFS="$FS"
+ fi
+fi
+
if [ ! -x /sbin/bsp ] ; then
echo "/sbin/bsp is missing !"
exit 1
fi
PREMODS="$PREMODS $modname"
;;
+ --fs=*)
+ echo "Warning: --fs option is obsoleted. Use --initrdfs instead" 1>&2
+ INITRDFS="`echo $1 | awk -F= '{print $2;}'`"
+ ;;
--initrdfs=*)
- FS="`echo $1 | awk -F= '{print $2;}'`"
+ INITRDFS="`echo $1 | awk -F= '{print $2;}'`"
+ ;;
+ --fs)
+ echo "Warning: --fs option is obsoleted. Use --initrdfs instead" 1>&2
+ INITRDFS="$2"
+ shift
;;
--initrdfs)
- FS="$2"
+ INITRDFS="$2"
shift
;;
--image-version)
usage
fi
-case "$FS" in
+case "$INITRDFS" in
ext2)
if [ ! -x /sbin/mke2fs ]; then
echo "/sbin/mke2fs is missing" 1>&2
fi
;;
*)
- echo "Filesystem $FS on initrd is not supported" 1>&2
+ echo "Filesystem $INITRDFS on initrd is not supported" 1>&2
exit 1
;;
esac
exit 1
fi
-if [ "$FS" = "ext2" ] ; then
+if [ "$INITRDFS" = "ext2" ] ; then
dd if=/dev/zero of="$IMAGE" bs=1k count="$IMAGESIZE" 2> /dev/null
# We have to "echo y |" so that it doesn't complain about $IMAGE not
(cd "$MNTIMAGE"; tar cf - .) | (cd "$MNTPOINT"; tar xf -)
-case "$FS" in
+case "$INITRDFS" in
ext2)
umount "$IMAGE"
;;
mkcramfs "$MNTPOINT" "$IMAGE"
;;
*)
- echo "Filesystem $FS not supported by $0";
+ echo "Filesystem $INITRDFS not supported by $0";
esac
if is_yes "$COMPRESS" ; then