Site Tools


sosbootr5

SOSBOOT r5 alpha

r5 is update for sosboot (r4). Main reason for r5 is we need a way to switch from fastboot to u-boot in single step. r4 don't have some tools and shell features.

Main changes upon r4

  • buildroot updated to use additional features
  • 3.0 kernel switched to 3.8
  • ram image support (don't need to flash image to partition 5 or 6)

Usage

Download ram image and use nvflash or tegrarcm to run it on ac100:

tegrarcm –bct=ac100.bct –bootloader=sos-uboot-r5-alpha.bin –loadaddr=0x108000

or

nvflash --bl sos-uboot-r5-alpha.bin --sync

NOTE: current image is too big to fit partition 5 (in nvflash numeration).

U-boot

r5 contains script that changes fastboot to u-boot. But there is some restrictions…

U-boot don't boot kernels < 3.8 (exact version is unknown, 3.8 is next step after 3.1.x for ac100). Script was tested on few machines but it may contain bugs.

Simple switch

  • Create backup of partitions 2, 3, 4, 5 and 6 to restore ac100 in case of script failure.
  • Make sure you have supported kernel.
  • Load sosboot r5 image to ram (see instruction above)
  • Wait for shell prompt
  • Run ./switch-to-uboot
  • Read output and follow instructions

Script will do:

  • analize current emmc partition table
  • search boot image on partition LNX (6 in nvflash numeration). Partition 5 is analized but not used yet.
  • dump kernel and ram image from boot partition

If everything is ok you will get promtp to continue operation. If you are ready press y and then enter. Script will do:

  • generate new bct to use u-boot bootloader
  • write new bct and bootloader
  • use dumped partition config to create GPT partitions with same size and place as before
  • format partition SOS (5 in nvflash numeration) and LNX (6 in nvflash numeration) with ext2
  • place kernel and initrd on LNX partition
  • generate boot script with current cmdline for kernel and initrd (from LNX partition)
  • compile boot script and put it on partition SOS (5 in nvflash numeration)

How it works

Default partition table contains following partitions:

  • 2: BCT for boot configuration
  • 3: PT for partition table
  • 4: EBT for extended bootloader a.k.a fastboot
  • 5: SOS for reserved boot image
  • 6: LNX for primary boot image
  • 7: MBR for ordinary master boot record (contains links to APP, CAC, MSC, EM1)
  • 8: APP (android)
  • 9: CAC (android)
  • 10: MSC (android)
  • 11: EM1 for extended boot record (contains links to UDA, EM2)
  • 12: UDA (android)
  • 13: EM2 for extended boot record (contains link to UDB)
  • 14: UDB for user data (android)

BCT, PT and EBT are partially placed in hidden sectors (kernel shows this sectors as mmcblk0bootX partitions). Some part is placed in non-hidden sectors (mmcblk0 device).

To use u-boot we need to generate new BCT (that will links to u-boot instead of fastboot). New BCT and u-boot image can be placed on mmcblk0bootX partitions (we don't need space on mmcblk0 anymore). In this case we can use GPT partition table on mmcblk0 device. We don't need auxiliary partitions MBR, EM1 and EM2 in GPT (also we don't need BCT, PT, EBT becase this partitions isn't placed/started on mmcblk0).

Sources

Sosboot r5: https://www.gitorious.org/~stuw/ac100/stuws-sosboot

Switch-to-uboot scripts: https://github.com/Stuw/ac100-self-installers

Build procedure same as for r4

Retrieve git repository:

$ git clone git://gitorious.org/~stuw/ac100/stuws-sosboot.git

Built it:

$ cd stuws-sosboot
$ ./build_all

Please note that build has been only tested on a cross-compile environment

sosbootr5.txt · Last modified: 2013/06/24 08:26 by stuw