[Beta testing needed] Auto SD partitioner and rootfs installer.


Linux-SWAT

Forum Addict!
Joined
Feb 13, 2010
Messages
9,187
Hi !


I'm writing an auto SD partitioner to simplify the Slackware installation.


It's a work that can be reused to create a neat Pandora quick partitioner.


Here what i've done:


I fixed a default setup for each card size, 8G, 16G, 32G etc...


It's a big ext2 partition + 256M swap.


I used one of my 8G card and dumped the partition structure with sfdisk:


sfdisk -d /dev/mmcblk0 > 8G.dump


# partition table of /dev/sde


unit: sectors


/dev/sde1 : start= 8192, size= 14983168, Id=83


/dev/sde2 : start= 14991360, size= 524288, Id=82


/dev/sde3 : start= 0, size= 0, Id= 0


/dev/sde4 : start= 0, size= 0, Id= 0


Using this, i can reproduce this exact structure on any other card:


cat 8G.dump | sfdisk /dev/mmcblk1


1- My question is, what is the margin i should left at the end of the card, as all 8G cards have not the same exact size ? I think of 64M. Do you think it's enough for 8G cards ?


What about bigger cards ?


2- And another question, how to i know which slot is used ? mmcblk0 is the first card inserted, but i would like to know if it's in the left or right slot.
 
Last edited by a moderator:
Is there a variable around, when the OP boots, that says if its booted from the nand or the sd1 ?


Or do i have to grep mount or something like that ?

if (mount | grep ubi0:rootfs\ on\ /\ type)


then what to do


fi


if (mount | grep /dev/root\ on\ /\ type)


then what to do


fi
 
Last edited by a moderator:
Ok, some bash question, how do i extract the /media/NAME/ from:



Code:
PND : /media/NAME/pandora/menu/whatever
 
Some progress here, i figured out how to know which card is where.


It was pretty simple, reading dmesg, mmc0 is the left slot, and mmc1 is the right one.


I continued to write the pnd. I now need to polish it a bit, enhance some things and fully test it.
 
Ok a new version again.


Can also download and install the latest pandora-rootfs.
 
If someone can give me results of sfdisk with 4G, 64G and 128G, i can use some parameters to enhance compatibility.


Do this:


sudo sfdisk -d /dev/mmcblk0


or


sudo sfdisk -d /dev/mmcblk1
 
4 GB =



Code:
/dev/sde1 : start=	 8192, size=  7766016, Id= b

/dev/sde2 : start=		0, size=		0, Id= 0

/dev/sde3 : start=		0, size=		0, Id= 0

/dev/sde4 : start=		0, size=		0, Id= 0



32 GB =



Code:
/dev/sde1 : start=	 8192, size= 63068160, Id= c

/dev/sde2 : start=	    0, size=	    0, Id= 0

/dev/sde3 : start=	    0, size=	    0, Id= 0

/dev/sde4 : start=	    0, size=	    0, Id= 0
 
A bash question, how can i extract the "/media/SDCARD" from that kind of string, whatever "SDCARD" is ?


PND : /media/SDCARD/pandora/menu/sl4p.pnd
 
Last edited by a moderator:
If that's to guess the appdata directory then $APPDATADIR is your friend (whithin the PND laucher script)


else I guess something like :


PND=/media/SDCARD/pandora/menu/sl4p.pnd


CARDNAME=$(echo $PND|cut -f3 -d/)


should do it ;)
 
Actually the input is:

PND : /media/SDCARD/pandora/menu/sl4p.pnd

So i have to find /media/ in it, then what's after until another "/".


I need that precise magic formula, because i'll use it later in another case.


I'm currently enhancing the security of my app, which already works pretty well.
 
Last edited by a moderator:
Ok so i'll check it.


Then you'll test my .pnd with your sd cards ;^).


Thx.
 
Some screenshots:

1.png

2.png

3.png

4.png

5.png

6.png

7.png

8.png

9.png

10.png
 
Back
Top