Saturday, 6 December 2014

Creating a bootable SD card for Banana Pi

The minimal Debian rootfs + kernel  can fit into <1GB  space.  I am using a 16GB, class 10 Kingston micro SD with and adaptor.  I usually wipe the the first 50MB before setting up the partitions and boot loader.
 dd if=/dev/zero of=/dev/sdb bs=1M count=50  
U-boot can load the kernel from an ext4 filesystem. But in this case I will create two partitions. One 16MB vfat partition for kernel+fex and rest of the disk for ext4 root filesystem
 { echo 1,16,0x0c; echo 17,,,; } | sfdisk /dev/sdb  
This is how the 16GB SD is paritioned by the above command:
   Device Boot   Start     End   Blocks  Id System  
 /dev/sdb1      2048    34815    16384  c W95 FAT32 (LBA)  
 /dev/sdb2      34816  31260671  15612928  83 Linux  
format the two partitions:
 mkfs.vfat /dev/sdb1  
 mkfs.ext4 /dev/sdb2  
now can write the u-boot bootloader which was described in building uboot for banana pi
 dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8  
We need three components, apart from the boot loader for a working system:

  • fex file - in binary form, called script.bin - the allwinner way of describing the hardware.
  • uImage - u-boot loadable kernel 
  • debian root filesytem -
These are documented in separate blogs - follow the hyperlinks above

No comments:

Post a Comment