[readonly/geninitrd/BUSYBOX: 18/113] Updated to use bsp.
draenog
draenog at pld-linux.org
Sat Nov 2 19:11:32 CET 2013
commit a0a82190c4d891e5a6edd56c2c9d9c774be8fcc5
Author: Michal Moskal <michal at moskal.me>
Date: Fri Dec 15 16:05:18 2000 +0000
Updated to use bsp.
svn-id: @1170
geninitrd | 99 ++++++++++++++++++++++++++++++++++-------------------
geninitrd.sysconfig | 3 ++
2 files changed, 66 insertions(+), 36 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index a999295..e63712d 100755
--- a/geninitrd
+++ b/geninitrd
@@ -26,6 +26,7 @@ FS="rom"
PROBESCSI="yes"
PROBEIDE="yes"
PROBERAID="yes"
+USEBSP="yes"
if [ -f /etc/sysconfig/initrd ] ; then
. /etc/sysconfig/initrd
@@ -49,8 +50,9 @@ fstab="/etc/fstab"
usage () {
echo "usage: `basename $0` [--version] [-v] [-f] [--ifneeded] [--preload <module>]" >&2
- echo " [--omit-scsi-modules] [--omit-raid-modules] [--omit-ide-modules] [--with=<module>]" >&2
- echo " [--image-version] [--fstab=<fstab>] [--nocompress] [--fs=rom|ext2|cram]" >&2
+ echo " [--omit-scsi-modules] [--omit-raid-modules] [--omit-ide-modules]" >&2
+ echo " [--with=<module>] [--image-version] [--fstab=<fstab>] [--nocompress]" >&2
+ echo " [--fs=rom|ext2|cram] [--no-bsp]" >&2
echo " <initrd-image> <kernel-version>" >&2
echo " (ex: `basename $0` /boot/initrd-2.2.5-15.img 2.2.5-15)" >&2
exit 1
@@ -117,6 +119,10 @@ inst() {
while [ $# -gt 0 ]; do
case $1 in
+ --no-bsp)
+ USEBSP="no"
+ ;;
+
--fstab*)
if is_yes "`echo $1 | awk '/=/ { print "yes"; }'`" ; then
fstab=`echo $1 | awk -F= '{print $2;}'`
@@ -316,6 +322,9 @@ if is_yes "`echo $rootdev | cut -d/ -f3 | awk '/loop/ { print "yes"; }'`" ; then
else # Check for other filesystems
rootFs=`awk '{if ($2 == "/") {print $3}}' $fstab`
findmodule "-$rootFs"
+ # don't have any clue, how is this supposed to work,
+ # anyway no bsp
+ USEBSP="no"
fi
for n in $BASICMODULES; do
@@ -368,9 +377,6 @@ mkdir -p $MNTIMAGE/{lib,bin,etc,dev,loopfs}
# We don't need this directory, so let's save space
rm -rf $MNTPOINT/lost+found
-inst /bin/trash "$MNTIMAGE/bin/sh"
-inst /sbin/insmod.static "$MNTIMAGE/bin/insmod"
-
for MODULE in $MODULES; do
cp $verbose -a /lib/modules/$kernel/$MODULE $MNTIMAGE/lib
done
@@ -378,39 +384,60 @@ done
# mknod'ing the devices instead of copying them works both with and
# without devfs...
mknod $MNTIMAGE/dev/console c 5 1
-mknod $MNTIMAGE/dev/null c 1 3
-mknod $MNTIMAGE/dev/ram b 1 1
-mknod $MNTIMAGE/dev/systty c 4 0
-for i in 1 2 3 4; do
- mknod $MNTIMAGE/dev/tty$i c 4 1
-done
-mknod $MNTIMAGE/dev/zero c 1 5
-
-echo "#!/bin/sh" > $RCFILE
-echo "" >> $RCFILE
-
-for MODULE in $MODULES; do
- module=`echo $MODULE | awk -F/ '{ $0=$NF } /.o$/ { $0=substr($0,1,length($0)-2); } { print $0; }'`
- options=`awk '{ if($1 == "options" && $2 == "'${module}'") { for(i=3;i<=NF;i++) printf("%s ",$i); }}' $modulefile`
- if [ -n "$verbose" ]; then
- echo "Loading module $module with options $options"
- fi
- echo "echo \"Loading $module module\"" >> $RCFILE
- echo "insmod /lib/$module.o $options" >> $RCFILE
-done
-
-if [ -n "$loopDev" ]; then
- if [ ! -d /initrd ]; then
- mkdir /initrd
+if is_yes "$USEBSP" ; then
+ s=$MNTIMAGE/etc/startup
+ inst /sbin/bsp "$RCFILE"
+ echo "# autogenerated startup" > $s
+ echo "" >> $s
+
+ for MODULE in $MODULES; do
+ module=`echo $MODULE | awk -F/ '{ $0=$NF } /.o$/ { $0=substr($0,1,length($0)-2); } { print $0; }'`
+ options=`awk '{ if($1 == "options" && $2 == "'${module}'") { for(i=3;i<=NF;i++) printf("%s ",$i); }}' $modulefile`
+
+ if [ -n "$verbose" ]; then
+ echo "Loading module $module with options $options"
+ fi
+ echo "insmod $module.o $options" >> $s
+ done
+else
+ inst /bin/trash "$MNTIMAGE/bin/sh"
+ inst /sbin/insmod.static "$MNTIMAGE/bin/insmod"
+
+ mknod $MNTIMAGE/dev/null c 1 3
+ mknod $MNTIMAGE/dev/ram b 1 1
+ mknod $MNTIMAGE/dev/systty c 4 0
+ for i in 1 2 3 4; do
+ mknod $MNTIMAGE/dev/tty$i c 4 1
+ done
+ mknod $MNTIMAGE/dev/zero c 1 5
+
+ echo "#!/bin/sh" > $RCFILE
+ echo "" >> $RCFILE
+
+ for MODULE in $MODULES; do
+ module=`echo $MODULE | awk -F/ '{ $0=$NF } /.o$/ { $0=substr($0,1,length($0)-2); } { print $0; }'`
+ options=`awk '{ if($1 == "options" && $2 == "'${module}'") { for(i=3;i<=NF;i++) printf("%s ",$i); }}' $modulefile`
+
+ if [ -n "$verbose" ]; then
+ echo "Loading module $module with options $options"
+ fi
+ echo "echo \"Loading $module module\"" >> $RCFILE
+ echo "insmod /lib/$module.o $options" >> $RCFILE
+ done
+
+ if [ -n "$loopDev" ]; then
+ if [ ! -d /initrd ]; then
+ mkdir /initrd
+ fi
+
+ cp -a $loopDev $MNTIMAGE/dev
+ cp -a $rootdev $MNTIMAGE/dev
+ echo "echo Mounting device containing loopback root filesystem" >> $RCFILE
+ echo "mount -t $loopFs $loopDev /loopfs" >> $RCFILE
+ echo "echo Setting up loopback device $rootdev" >> $RCFILE
+ echo "losetup $rootdev /loopfs$loopFile" >> $RCFILE
fi
-
- cp -a $loopDev $MNTIMAGE/dev
- cp -a $rootdev $MNTIMAGE/dev
- echo "echo Mounting device containing loopback root filesystem" >> $RCFILE
- echo "mount -t $loopFs $loopDev /loopfs" >> $RCFILE
- echo "echo Setting up loopback device $rootdev" >> $RCFILE
- echo "losetup $rootdev /loopfs$loopFile" >> $RCFILE
fi
chmod +x $RCFILE
diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
index 0b36b29..03bc990 100644
--- a/geninitrd.sysconfig
+++ b/geninitrd.sysconfig
@@ -15,3 +15,6 @@
## Do install RAID modules (if RAID is used)?
#PROBERAID=yes
+
+## Do use /sbin/bsp as command processor
+#USEBSP=yes
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/0999a53e93eedcf489380684b998ce04aaddf11c
More information about the pld-cvs-commit
mailing list