[Runnix-commits] SF.net SVN: runnix: [60] trunk/target/generic/target_skeleton/runnix
Status: Alpha
Brought to you by:
krisk84
From: <kr...@us...> - 2007-05-01 18:48:10
|
Revision: 60 http://svn.sourceforge.net/runnix/?rev=60&view=rev Author: krisk84 Date: 2007-05-01 11:48:05 -0700 (Tue, 01 May 2007) Log Message: ----------- major runnix init improvements Modified Paths: -------------- trunk/target/generic/target_skeleton/runnix Modified: trunk/target/generic/target_skeleton/runnix =================================================================== --- trunk/target/generic/target_skeleton/runnix 2007-04-30 18:04:56 UTC (rev 59) +++ trunk/target/generic/target_skeleton/runnix 2007-05-01 18:48:05 UTC (rev 60) @@ -14,7 +14,7 @@ echo "proc mounted" else echo "Error mounting proc" -exec /bin/sh +/bin/sh fi mount -t tmpfs none /tmp @@ -52,8 +52,8 @@ # Loader not found if [ ! $DEVICE ] then -echo "Runnix device not found." -exec /bin/sh +echo "Runnix device not found" +/bin/sh exit fi @@ -66,15 +66,14 @@ fi done -if [ ! "$RUNIMG" ] +if [ -f $BASE/os/default.conf ] then -# read -p "Please type an image name: " RUNIMG -RUNIMG="auto" +. $BASE/os/default.conf fi -if [ -f $BASE/os/default.conf ] +if [ ! "$RUNIMG" ] then -. $BASE/os/default.conf +RUNIMG="auto" fi #Network support - yikes @@ -102,8 +101,6 @@ fi -fi - if [ "$URL" ] then echo "Checking for updates..." @@ -130,7 +127,7 @@ if `sha1sum -cs $VER.tar.gz.sha1` then -echo "Extracting image - please wait." +echo "Extracting image - please wait" cd $BASE/os tar -xzf /tmp/$VER.tar.gz sync @@ -141,6 +138,7 @@ then mv $BASE/os/$VER/* $BASE/os/ && mv /tmp/ver $BASE/os/ver rmdir $BASE/os/$VER +IMGVER=1 if [ "$USLEEP" ] then @@ -153,6 +151,7 @@ fi fi fi +fi if [ "$RUNIMG" = "auto" ] then @@ -161,21 +160,26 @@ RUNIMG=`ls *.run | tail -n1` fi -#If we have a ver file, override auto value +#If we have a ver file, override auto/default.conf value if [ -f $BASE/os/ver ] then RUNIMG=`cat $BASE/os/ver`.run fi -echo "Verifying image..." +if [ ! "$IMGVER" ] +then +echo "Verifying $RUNIMG..." -if `sha1sum -cs $VER.run.sha1` +if `sha1sum -cs $RUNIMG.sha1` then -echo "Image verified. Booting." +echo "$RUNIMG verified" +IMGVER=1 else -echo "Kris needs to put a reboot, etc in here" +echo "$RUNIMG not verified" fi +fi + if [ -f $BASE/os/$RUNIMG.conf ] then . $BASE/os/$RUNIMG.conf @@ -198,30 +202,59 @@ echo "Root mounted" else echo "Error mounting $RUNIMG root fs" -exec /bin/sh +/bin/sh fi -if [ ! "$INITRD" ] +if [ "$INITRD" ] then -INITRD=$ROOT/boot/initrd.img + +if [ -r "$INITRD" ] +then +echo "Custom initrd $INITRD found" +else +INITRD=$BASE/os/initrd.img +echo "Custom initrd not found - using $INITRD" fi -if [ ! "$KERN" ] +else +echo "Using default initrd" +INITRD=$BASE/os/initrd.img +fi + +if [ "$KERN" ] then + +if [ -r "$KERN" ] +then +echo "Custom kernel $KERN found" +else KERN=$ROOT/boot/bzImage +echo "Custom kernel not found - using $KERN" fi +else +echo "Using default kernel" +KERN=$ROOT/boot/bzImage +fi + +if [ -r "$INITRD" -a -r "$KERN" ] +then +echo "Copying kernel and initrd to ramdisk..." mount -t tmpfs none /mnt/tmp -cp $INITRD /mnt/tmp/initrd.img -cp $KERN /mnt/tmp/bzImage - +cp "$INITRD" /mnt/tmp/initrd.img +cp "$KERN" /mnt/tmp/bzImage +echo "Unmounting image..." umount $ROOT +else +echo "I couldn't find your kernel and/or initrd" +/bin/sh +fi if [ ! "$KCMD" ] then echo "You need to specify a kernel command line" echo "I can't guess that" -exec /bin/sh +/bin/sh fi echo "Trying kexec..." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |