How to create a Debian eMMC flasher image?

How does one build the Debian eMMC flasher image from http://elinux.org/BeagleBoardDebian#eMMC:_BeagleBone_Black ?

First of all, thanks to R. Nelson for making this, it’s great!

I’d like customize the kernel and add some packages and provide a similar image of my own. I think I’m good with how to create and configure the kernel, but I don’t get how to create a rootfs and then install armhf packages into the rootfs so that I can bundle up everything.

Thanks,

Josh

So it's just a two stage process.

https://github.com/RobertCNelson/omap-image-builder
First using "omap-image-builder" i just run the ./build_image.sh script

Which create the base "console" image you see here:
http://elinux.org/BeagleBoardDebian#Demo_Image

Next the "setup_sdcard.sh" is ran with "--img filename" vs "--mmc
/dev/sdX" and the "--bbb-flasher" is enabled that enables/runs this
script on bootup:

https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-copy-microSD-to-eMMC.sh

that flashes the eMMC...

Note: the "omap-image-builder" script was more written for consistency
and building all the images i push out every month then for ease of
use. Sometimes it's easier to just fork the repo and copy the
"build_kernel.sh" script and minimize it for your own needs..

Regards,

Thanks Robert,

I ran the setup_sdcard.sh like this: sudo ./setup_sdcard.sh --img myimage.img --dtb beaglebone --uboot bone. This seemed to do the trick. The script complained about dependencies, which I installed, but it probably should also check for the parted package. Parted was not originally installed, which caused the script to fail. I’ll look around the script and see if I can submit a pull request.

It looks like I can add packages in /var/pkg_list.sh. But if I wanted to add a repo besides the normal repositories, like one would normally do to /etc/apt/sources.list, I didn’t see (or understand) how I could set this up.

Josh

Thanks Robert,

I ran the setup_sdcard.sh like this: sudo ./setup_sdcard.sh --img
myimage.img --dtb beaglebone --uboot bone. This seemed to do the trick.

OH, don't do that... "--dtb" is eventually going to fully replace
"--uboot" ... but no idea what is going to happen when you call them
both. :wink:

The script complained about dependencies, which I installed, but it probably
should also check for the parted package. Parted was not originally
installed, which caused the script to fail. I'll look around the script and
see if I can submit a pull request.

I actually yanked all calls to parted a few months back.. You should
update the setup_sdcard.sh script...

It looks like I can add packages in /var/pkg_list.sh. But if I wanted to
add a repo besides the normal repositories, like one would normally do to
/etc/apt/sources.list, I didn't see (or understand) how I could set this up.

add them here:
https://github.com/RobertCNelson/omap-image-builder/blob/master/scripts/chroot.sh#L194

note, the only reason "deb-src" is commented out with teh # is too
speed up the initial "apt-get" i then use sed to remove the # before
downloading the full "src" pkgs for later archival purposes..

Regards,

Ah, missed that, thanks.

Ok, running with the --uboot option alone works (for me), running with the --dtb option alone produces a error here:

Downloading Device’s Bootloader

opps, should finish that file, untested..

https://github.com/RobertCNelson/omap-image-builder/commit/9649b451c35e71567c8cfe040e49ec0bd796a370

for "bones" --uboot bone is still what i recommend..

Regards,

Hi Robert,

I’m thinking of using your script to copy what I have in the eMMC back to an SD card, to then flash another beagle with the same setup.
Do you think this will work? Looking into the script, it looks like it could work in both ways (the /dev/mmcblX files are inverted when booting from each device, aren’t they?), but maybe I’m missing something dangerous. Should I give it a go?

Thanks,
Pablo

Hi Robert,

I just started to play around with your omap-image-builder scripts. What I’m essentially trying to achieve is a customized version of your BBB flasher image which creates three instead of two partitions. I tried to edit beaglebone-black-copy-eMMC-to-microSD.sh on the flasher SD, thinking that I can “smuggle” my partition in there, but it didn’t work. Maybe I simply failed at the sfdisk arguments, but I’m really not sure where to go from here. Can you give me a hint? Right now, when I run ./build_image.sh, the scripts seems to download a lot from ubuntu’s package servers, not for debian. I tried to edit .project according to my needs but I’m kinda stuck and I don’t think I’m doing it right. :wink:

Another question, once I have a stable system on my beagle bone, can I create a flasher microSD directly from the running system which contains my custom debian install so I can then install it on another beagle bone, too? What would be a way to achieve that?

Thank you for your time,

Oliver

By default i'm calling sfdisk via:

1,96,0xe,*

Are the instructions in this thread still current ? I would like to build a custom debian mmc flash image with my choice of packages.