How to create a Debian eMMC flasher image?

5,137 views
Skip to first unread message

Joshua Datko

unread,
Oct 24, 2013, 10:03:39 PM10/24/13
to beagl...@googlegroups.com

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

Robert Nelson

unread,
Oct 24, 2013, 10:14:48 PM10/24/13
to Beagle Board
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,

--
Robert Nelson
http://www.rcn-ee.com/

Joshua Datko

unread,
Oct 25, 2013, 10:56:15 AM10/25/13
to beagl...@googlegroups.com
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




--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/gkVwuE7324U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Robert Nelson

unread,
Oct 25, 2013, 11:23:39 AM10/25/13
to Beagle Board
On Fri, Oct 25, 2013 at 9:56 AM, Joshua Datko <jbd...@gmail.com> wrote:
> 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. ;)

> 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..

Joshua Datko

unread,
Oct 25, 2013, 11:32:52 AM10/25/13
to beagl...@googlegroups.com
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
-----------------------------
/: Scheme missing.

So, I'll just run with the --uboot flag ;)

Thanks again,

Josh


Robert Nelson

unread,
Oct 25, 2013, 11:43:36 AM10/25/13
to Beagle Board
On Fri, Oct 25, 2013 at 10:32 AM, Joshua Datko <jbd...@gmail.com> wrote:
> 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
> -----------------------------
> /: Scheme missing.

opps, should finish that file, untested..

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

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

pabloc...@gmail.com

unread,
Nov 16, 2013, 4:23:34 PM11/16/13
to beagl...@googlegroups.com
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

gen...@gmail.com

unread,
Nov 27, 2013, 6:16:31 PM11/27/13
to beagl...@googlegroups.com
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. ;-)

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

Robert Nelson

unread,
Nov 27, 2013, 7:16:40 PM11/27/13
to Beagle Board
On Wed, Nov 27, 2013 at 5:16 PM, <gen...@gmail.com> wrote:
> 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?

By default i'm calling sfdisk via:

1,96,0xe,*
,,,-

So if you want a 3rd partition of 100MB, this should do it:

1,96,0xe,*
,196,,
,,,-

> 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. ;-)

"./build_image.sh" by default is setup to push out all my release, 3
ubuntu ones and 2 debian ones..

If you compare directly compare the new "beagleboard.org_image.sh"
with "build_image.sh" you can see where i limited it to only debian
wheezy and one kernel.. Note that script does a few other things too,
it is defintelly not qemu safe, run on pure armv7 hardware (multi
core)..

>
> 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?

I've tried to do that with this:
https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-make-microSD-flasher-from-eMMC.sh

but it'll only work if you used one of my image as a base, as it
relies on a boot script i had installed by default and a custom
uEnv.txt..

Carl-Fredrik Sundström

unread,
Feb 2, 2014, 2:18:28 AM2/2/14
to beagl...@googlegroups.com
Are the instructions in this thread still current ? I would like to build a custom debian mmc flash image with my choice of packages.

Reply all
Reply to author
Forward
0 new messages