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.



Build


You may checkout a stable release revision for your build:



Here, the modified build script was created to build 'debian-x.x-lxde-4gb-armhf' target image only:

Build script run finished:

Image Generation
Next is to generate the final images.

Preparation
Make sure there's no missing dependencies, otherwise you may get below warning and errors, and generated images will not be usable.

To install dependencies, as the debug messages indicated:

Generate Images
Navigate to the deploy directory and run the gift_wrap_final_images.sh:

Images Generated
The final images will be generated: You may find out "bone-debian-7.8-lxde-4gb-armhf-2015-06-24-4gb.img.xz" looks familiar :) Checkout latest BBB Debian images at: http://beagleboard.org/latest-images

Generated Image Testing
Extract the generated image, burn it to SD card, boot and test it:

BBB CPU Frequency
You may check your BBB CPU frequency before doing the build task. To check the frequency: To set to 1GHZ for example: