How to make boot.scr

10,600 views
Skip to first unread message

Geof Cohler

unread,
Feb 21, 2009, 7:18:05 AM2/21/09
to Beagle Board
Hi,

Beagle u-boot appears to look for a boot.scr file. Are there any
instructions on how to create a boot.scr file? What format is it?
etc. I've found notes about it, but no instructions.

Thanks very much.

Best regards,
Geof

Robert Nelson

unread,
Feb 21, 2009, 12:18:12 PM2/21/09
to beagl...@googlegroups.com
Hi Goef

Haven't tested it yet myself, but based on the recent commit:

Say you wanted to run this file (normal.cmd):
****************
if fatload mmc 0 80200000 uImage.bin
then
echo ***** Kernel: /dev/mmcblk0p1/uImage.bin *****
else
echo ***** Kernel: /dev/mtd3 *****
nand read 80200000 280000 400000
fi
if fatload mmc 0 81600000 ramdisk.gz
then
echo ***** RootFS: /dev/mmcblk0p1/ramdisk.gz *****
setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/ram0
rw ramdisk_size=32768 initrd=0x81600000,32M'
else
echo ***** RootFS: /dev/mmcblk0p2 *****
setenv bootargs 'console=ttyS2,115200n8 console=tty0
root=/dev/mmcblk0p2 rw rootwait'
fi
bootm 80200000
****************

you'd issue this mkimage command to create the normal.scr script..

mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Execute
uImage.bin' -d normal.cmd normal.scr

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

Jason Kridner

unread,
Feb 21, 2009, 1:20:27 PM2/21/09
to beagl...@googlegroups.com

On Feb 21, 2009, at 11:18 AM, Robert Nelson wrote:

>
> Hi Goef
>
> On Sat, Feb 21, 2009 at 6:18 AM, Geof Cohler <g.co...@computer.org>
> wrote:
>>
>> Hi,
>>
>> Beagle u-boot appears to look for a boot.scr file. Are there any
>> instructions on how to create a boot.scr file? What format is it?
>> etc. I've found notes about it, but no instructions.

To create the file, you must run mkimage. This is the script used to
make a couple of different files that could be used as boot.scr:
http://gitorious.org/projects/beagleboard-default-u-boot/repos/jason-clone/blobs/for-khasim-rebase/mkbootscr

This command in particular generates a file that can be used as
boot.scr:
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Execute
uImage.bin' -d normal.cmd normal.scr

More than how to create a boot.scr file, with the latest u-boot, there
are 'if' conditions. If boot.scr is not found, u-boot goes on its
merry way.

The default bootcmd is in:
http://gitorious.org/projects/beagleboard-default-u-boot/repos/jason-clone/blobs/for-khasim-rebase/include/configs/omap3_beagle.h

It shows:
if mmcinit; then
if run loadbootscript; then
run bootscript;
else
if run loaduimage; then
if run loadramdisk; then
run ramboot;
else
run mmcboot;
fi;
else run nandboot;
fi;
fi;
else run nandboot; fi

What the above does is first check if the SD card is there. If not,
it just proceeds with nandboot using the flash stored environment.

If the SD card is there, it attempts to load boot.scr and simply run
it such that the bootargs and boot commands can come from there.

If there is no boot.scr, it will attempt to load a ramdisk. And if
there is no ramdisk, it will simply attempt to mount the second SD
card partition as root.

It is still perfectly possible to overwrite the bootcmd, but this
should greatly reduce the need to do so.

I've also added an environment variable called 'optargs' so that you
don't need to overwrite the other commands that create bootargs to set
your video resolution, etc.

Geof Cohler

unread,
Feb 23, 2009, 8:20:12 AM2/23/09
to Beagle Board
This is great. Some notes...

1) I don't see the $optargs stuff on mine. But I'll try reloading
and see what I get. I think it's a great idea.

2) I think you need one more level of "if" in there. But I'm not
sure if it can be done. If the uImage is a DSS uImage, then you need
'video=...mode:1024x768@60' (or something similar). But if the uImage
is a DSS2 uImage, then you need 'omap.video_mode=1024x768MR-16@60' (or
something similar). Can you think of a way to automagically check for
DSS vs. DSS2 and produce the appropriate video args? Does it make
sense?

3) With DSS, you need the 'video=omapfb:vram:2M,vram:4M'. I'm not at
all sure if that's needed (or not) with DSS2. So some clarity there
would be good. I'm not even sure what this really does.

4) I'm not sure if it's generally understood (it wasn't by me until
recently) that if you do a 'NAND ERASE 260000 20000' then power off
and back on, that it will wipe out your env variables and give you all
the default ones. It's a very nice trick. Only caveat is that you
then get an error message about CRC upon bootup -- that you can
ignore.

5) I also think (after a brief review of the code) that if you didn't
specify some of the args that u-boot would default to the correct
settings. Does it make sense to ever just leave it blank?

I'll try to write this up for the wiki once I get some additional
clarity.

Thanks very much.
Geof

On Feb 21, 1:20 pm, Jason Kridner <jkrid...@beagleboard.org> wrote:
> On Feb 21, 2009, at 11:18 AM, Robert Nelson wrote:
>
>
>
> > Hi Goef
>
> > On Sat, Feb 21, 2009 at 6:18 AM, Geof Cohler <g.coh...@computer.org>  
> > wrote:
>
> >> Hi,
>
> >> Beagle u-boot appears to look for a boot.scr file.  Are there any
> >> instructions on how to create a boot.scr file?  What format is it?
> >> etc.  I've found notes about it, but no instructions.
>
> To create the file, you must run mkimage.  This is the script used to  
> make a couple of different files that could be used as boot.scr:http://gitorious.org/projects/beagleboard-default-u-boot/repos/jason-...
>
> This command in particular generates a file that can be used as  
> boot.scr:
> mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Execute  
> uImage.bin' -d normal.cmd normal.scr
>
> More than how to create a boot.scr file, with the latest u-boot, there  
> are 'if' conditions.  If boot.scr is not found, u-boot goes on its  
> merry way.
>
> The default bootcmd is in:http://gitorious.org/projects/beagleboard-default-u-boot/repos/jason-...
> >http://www.rcn-ee.com/- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages