Revision: 993
http://svn.sourceforge.net/hackndev/?rev=993&view=rev
Author: farcaller
Date: 2007-05-25 12:01:31 -0700 (Fri, 25 May 2007)
Log Message:
-----------
BFUGarux: rewritten garux.h.sh to work without bash. Builds without initrd by default
Modified Paths:
--------------
linux4palm/BFUGarux/garux.h.sh
Modified: linux4palm/BFUGarux/garux.h.sh
===================================================================
--- linux4palm/BFUGarux/garux.h.sh 2007-05-25 18:23:09 UTC (rev 992)
+++ linux4palm/BFUGarux/garux.h.sh 2007-05-25 19:01:31 UTC (rev 993)
@@ -16,7 +16,7 @@
echo "Calculating constants..."
export NUM_PAGES=`du -b image.bin | cut -f1 -d\i`
-export NUM_PAGES=`echo $NUM_PAGES/32768+1 | bc`
+export NUM_PAGES=`echo $((NUM_PAGES/32768+1))`
export RAM_BASE_ADDRESS=`cat mach.h | grep RAM_BASE_ADDRESS | cut -f3 -d\ `
export NUM_IMAGE=`ls -al image.bin |awk '{print $5}'`
@@ -39,12 +39,16 @@
#echo -n "STRING kernelDefaultParam \"mem=" >> garux.rcp
echo -n "#define KernelDefaultParam \"mem=" >> garux.h
echo -n `cat mach.h | grep PHYSICAL_RAM_SIZE | cut -f3 -d\ ` >> garux.h #rcp
-echo -n " initrd=0x" >> garux.h #rcp
-INITRD_BASE_ADDRESS=`echo $RAM_BASE_ADDRESS | cut -f2 -dx`
-INITRD_BASE_ADDRESS=`echo "obase=16; ibase=16; $INITRD_BASE_ADDRESS + 0400000"|bc`
-echo -n $INITRD_BASE_ADDRESS >> garux.h #rcp
-echo -n ",$NUM_INITRD root=/dev/ram0 init=/linuxrc max_loop=255\"" >> garux.h #rcp
-NUM_IMAGE=`echo $NUM_IMAGE/1024 |bc`
+if [ "$INITRD" != "" ]; then
+ echo -n " initrd=" >> garux.h #rcp
+ INITRD_BASE_ADDRESS=`echo $RAM_BASE_ADDRESS | cut -f2 -dx`
+ base_val=`echo $(($INITRD_BASE_ADDRESS+0400000))`
+ INITRD_BASE_ADDRESS=`printf "0x%X" $base_val`
+ echo -n $INITRD_BASE_ADDRESS >> garux.h #rcp
+ echo -n ",$NUM_INITRD" >> garux.h #rcp
+fi
+echo " root=/dev/ram0 init=/linuxrc max_loop=255\"" >> garux.h #rcp
+NUM_IMAGE=`echo $((NUM_IMAGE/1024))`
echo "Num page " $NUM_PAGES
echo "Size image " $NUM_IMAGE
echo >> garux.h #newline
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|