BeagleBoneBlack Rebuild Debian Image Using image-builder

= Debian Build Instructions =

Brief Build Instructions
You'll want a fairly beefy ARM system to run this script. Pickup up any beefy armv7-a system, Dual Core+ / 512Mb+ / sata (or usb-sata), running Ubuntu or Debian.

Problem with Cross Build
Why you want a ARM system to build the Debian, the reason is cross build have problem currently. qemu is just not reliable enough to run this build script on x86. Building on x86 through qemu 'sometimes' work, lots of random things can happen. ;) The usual failure point for qemu is:

Using BBB to Build
Well if you do not have a fairly beefy ARM system to run this build script. You can use your BeagleBoneBlack to build debian images for the BeagleBoneBlack ;), Although building speed using BBB board will be very slow (It takes up to several hours depending on you network speed and your SD card speed etc.).

Prepare BBB Board
First thing is to get the official debian image flashed into eMMC of your BeagleBoneBlack board. And after that boot from the eMMC. Beagleboard:BeagleBoneBlack_Debian

Make Sure System Time is Correct
If BBB system time is incorrect, it may result in building failure, so before start building, make sure system time is correct.

Prepare SD Card
Image building requires storage space, so external storage is needed. USB Storage Device may also work, but haven't been tested yet. Build inside SD card tested working. You may need 64GB SD card to perform full build. 16GB SD card may possible if you modify the build scripts to build one single target only. (The full build will build 'debian-x.x-lxde-armhf', 'debian-x.x-lxde-4gb-armhf' and 'debian-x.x-console-armhf', if you are interested in building image for BBB Rev C only for example, you can build 4gb image alone by modifying the build script).

Prepare SD card as ext4 file system. Make sure there's enough free space.

Normally when SD card inserted, it will be mounted automatically by the debian system under /media. However normally you will not be able to run the build, unmount and remount with exec and dev flags is needed.