Multiple partition on SD card (boot) - sd-flasher issues

freaky
Hi

there,

I'm trying to get 2 partitions on the SD card, one for superboot/kernel
image and one for the root filesystem.

The issue is I can't seem to get the bootloader working like that.
sd-flasher will show the proper drive letter, but it won't be available
until I click relayout and that repartitions the whole card.

Have tried dd'ing the first 446 bytes (bootsector) from a SD card with
working supertboot and loading that on my SD card, copied the contents of
the working SD card without the ext3 filesystem image but it doesn't boot
:(.

Basically I don't care what bootloader is used, but from what I get it's
not possible to use u-boot without touching the NAND. The basic idea is we
just produce a lot of SD cards, insert those and make sure the S2 switch is
set correctly and just boot from SD.

If it's possible to use just 1 ext2 partition that would be fine too. 

We also need to clone these SD cards. Basically I'm hoping for a small dd
image that contains the boot partition if superboot is required and a small
(partition wised minimalized) ext2 filesystem. So I just need to dd 500MB
or something instead of full 8GB or greater and have just 1 image (SD cards
differ size a lot which hampers with full SD size dd's).

The have a little script call resize2fs on boot the first time to resize
the ext2 partition to the rest of the card's size.

This would allow for easy deployment.

Unfortunately it would seem the sd-flasher does something funky with the
FAT filesystem. Probably requiring fixed location for the .bin file (I
presume the rest of the bootloader code, 446 bytes ain't much).

Any ideas? Basically any bootloader goes as long as I can use small
partitions and grow the last one to the rest of the SD card for fast
cloning without size issues.

TIA

Reggie
It would be useful if you mentioned what board you're using?

Either way, I would do it like this, create your first card, with it's fat
partition, fuse superboot to the card, then using something like gparted,
resize the fat partition, then create the ext2/3/4 partition in the space
you've just freed up.

Now you have a basis to work from, you can put your superboot stuff on the
fat partition as usual, your rootfs on the ext partition, then you can DD
the whole SD card to make a back that you can DD to other cards.

freaky
Hi,

it's the tiny6410. Will try resizing the FAT partition with gparted. Some
insights in what the 'fuse' actually does would still be appreciated tho'
:). It doesn't seem to create a file in the FAT partition at least.

Thanks for the re'.

freaky
Hi,

doubt that what I want will work. Read about sd-flasher reserving something
like 138MB for the bootloader (that seriously a lot...). It would seem this
is at the end of the SD card as the last ~129MB is not partitioned after
relayout/fuse.

That probably also means that even if I get this to boot, the resizing of
/dev/mmcblk0p2 into the rest of the free space will eventually screw over
the bootloader. This might happen directly or once it fills up depending on
what blocks get written.

Placing bootloaders at the end of a disk is really stupid imho. Not sure if
it does that - but the free space at the end is not neglectable. Probably
also explains why SD cards that are a bit smaller and thus cannot contain
the last part don't boot (according to a client - haven't seen it myself
didn't debug it either thus).