On Fri, Mar 21, 2014 at 12:51 PM, Louis Thiery <lo...@apitronics.com> wrote:
> Hello,
>
> I'm trying to leverage the flashing process included in the new Debian
> images to move my own distribution over but I'm confused on the current
> mechanics.
>
> I did find this page: http://elinux.org/Beagleboard:Updating_The_Software
>
> but perhaps that explains how flashing used to work with Angstrom? I wasn't
> able to see the same architecture happening over on the new Debian images
> which works in 15 minutes instead of 45 minutes.

yeah, totally different.  Angstrom extracted a tar.gz into the new
eMMC.  Whereas i'm just using rsync to sync microSD -> eMMC.

>
> I did find /opt/scripts/tools/beaglebone-black-eMMC-flasher.sh but I'm not
> particularly sure of the mechanics.
>
> It seems to me that when the boot button is pressed, the BBB mounts and
> boots from the eMMC-flasher partition. Somehow this script is executed (I
> couldn't find the relevant systemd process) and it copies over everything on
> that same partition over to the eMMC and then powers off.

It's actually a classic init script.  systemd runs it just fine.

You can view it here:
https://github.com/beagleboard/image-builder/blob/master/target/init_scripts/generic-debian.sh

It's stored here: /etc/init.d/boot_scripts.sh

This script takes care of a few generic tasks, setting the clock,
regenerating ssh keys, before calling a board specific script.
(referenced from /boot/uboot/SOC.sh)

This is the board specific script:

https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh

It's stored here: /opt/scripts/boot/am335x_evm.sh

It takes care of flashing blank eeprom, getting the mac address,
setting up the gadget drivers, enablng the local dhcp server, calling
the flasher.sh script, and finishing the microSD resize when needed.

> Next time, I boot from the eMMC, how does the script knows to not execute,
> seeing as it can't really copy the eMMC to the eMMC... How does all this
> work?

That depends:

If the flasher "microSD" is still installed, it WILL flash the eMMC "again"..

If you re-add the "trigger" file:

https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L110

It will attempt the flash the "other" media..

If you look closely, the flasher script doesn't care if it's microSD
or eMMC, it's designed to flash the "other" media:

https://github.com/RobertCNelson/boot-scripts/blob/master/tools/beaglebone-black-eMMC-flasher.sh#L39

Regards,

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

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to