How to make boot.scr

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

Hi Goef

Hi Goef

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.

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