[meta-xilinx] meta-topic

Alan DuBoff aland at softorchestra.com
Sun Feb 23 12:46:21 PST 2014


Mike,

One other thing I wanted to mention, I have a simple python script that will
facilitate creating the partitions and moving the files over to the sd card. I
plan to modify that so it will work with the sd_boot recipe, but will keep it
separate because you need to know the physical device to use it (/dev/sdX).

I used it on a Beaglebone project, to allow one of my clients to provision sd
cards. I use sfdisk with geometry files stored on the disk.

I currently only have 4gig and 8gig geometries.

Here's an example of the 4gig geometry I use:
--------------------------
# partition table of /dev/sdd
unit: sectors

/dev/sdd1 : start=     2048, size=   102400, Id= c, bootable
/dev/sdd2 : start=   104448, size=  7522304, Id=83
/dev/sdd3 : start=        0, size=        0, Id= 0
/dev/sdd4 : start=        0, size=        0, Id= 0
--------------------------

then I do something like this: (in my case sys.argv[1] is /dev/sdd)

partition_command = "sfdisk --force " + sys.argv[1] + " " + "< ./4gig-sd-layout";

print "The following command is what is going to be executed:";
print "";
print partition_command;
print "";
print "If this is ok, please enter yes at the prompt";
print "";

user_input = raw_input("To continue, please enter 'yes' (no quotes), anything
else will quit: ")

if user_input != "yes":
        sys.exit(1);

os.system(partition_command);

-- 
Cheers,
Alan




More information about the meta-xilinx mailing list