[readonly/geninitrd/devel: 223/334] initramfs support, use it by default for kernel > 2.5.0.
draenog
draenog at pld-linux.org
Sat Nov 2 19:30:16 CET 2013
commit 48413b7f48a4f4b5ec82a533b303d3f4cd2e4d20
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Fri Jul 2 19:36:24 2004 +0000
initramfs support, use it by default for kernel > 2.5.0.
svn-id: @4292
geninitrd | 38 ++++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 10 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index c5ebe3c..7887db4 100755
--- a/geninitrd
+++ b/geninitrd
@@ -656,16 +656,6 @@ if [ -r /etc/sysconfig/bootsplash ] ; then
. /etc/sysconfig/bootsplash
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 /bin/initrd-busybox ] ; then
echo "/bin/initrd-busybox is missing !"
exit 1
@@ -793,6 +783,20 @@ fi
pack_version="`echo "$kernel"|awk -F. '{print sprintf("%03d%03d",$1,$2)}'`"
pack_version_long="`echo "$kernel"|awk -F. '{print sprintf("%03d%03d%03d",$1,$2,$3)}'`"
+if [ "x" = "x$INITRDFS" ] ; then
+ if [ "x" = "x$FS" ] ; then
+ # default value
+ if [ "$pack_version" -ge "002005" ] ; then
+ INITRDFS="initramfs"
+ else
+ INITRDFS="rom"
+ fi
+ else
+ echo "Warning: FS configuration options is obsoleted. Use INITRDFS instead" 1>&2
+ INITRDFS="$FS"
+ fi
+fi
+
if [ "$pack_version" -ge "002005" ] ; then
modext=".ko"
insmod="insmod"
@@ -829,6 +833,16 @@ case "$INITRDFS" in
exit 1
fi
;;
+ initramfs)
+ if [ ! -x /bin/cpio ]; then
+ echo "/bin/cpio is missing" 1>&2
+ exit 1
+ fi
+ if [ ! -x /usr/bin/find ]; then
+ echo "/usr/bin/find is missing" 1>&2
+ exit 1
+ fi
+ ;;
*)
echo "Filesystem $INITRDFS on initrd is not supported" 1>&2
exit 1
@@ -939,6 +953,7 @@ mknod "$MNTIMAGE/dev/null" c 1 3
mknod "$MNTIMAGE/dev/zero" c 1 5
s="$RCFILE"
+ln -s /linuxrc /init
inst /bin/initrd-busybox "$MNTIMAGE/bin/sh"
ln -s sh "$MNTIMAGE/bin/busybox"
@@ -1144,6 +1159,9 @@ case "$INITRDFS" in
cram)
mkcramfs "$MNTPOINT" "$IMAGE"
;;
+ initramfs)
+ find $MNTPOINT -printf "./%P\n" | cpio -H newc -o > "$IMAGE"
+ ;;
*)
echo "Filesystem $INITRDFS not supported by $0";
esac
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/398807324938659207036e520c0950a61ef50c11
More information about the pld-cvs-commit
mailing list