I’ve been using an SD card to dev on my board similar to the BBB for a while, but I’d like to start using the eMMC instead. I’ve made modifications to U-Boot/the kernel/the root filesystem, so I’d like to be able to flash the eMMC based on my own pre-existing image.
I’m mostly confused by the parameters at the start of the script and what each one represents. These are my assumptions:
IMAGE=
I’m not sure on this. I’m guessing that this is the raw image that will be flashed into the eMMC? Or maybe the output image name?
DEPLOYDIR=
This defaults to the location of the output images from Angstrom’s bitbake build, so my guess is that this is the directory that contains U-Boot images, the filesystem and all that jazz.
MOUNTPOINT=
MOUNTPOINT1=
Based on emmc.sh, it looks like MOUNTPOINT1 is the location of the SD card boot partition and MOUNTPOINT is the location of the file system partition. On my SD card these are currently /media/myname/BEAGLE_BONE and /media/myname/Angstrom, respectively.
FLASHIMG=
The default for this is a tar.gz file for the Linux root file system, so my assumption was that this should be the .tar.gz of my modified root file system in the DEPLOYDIR directory.
SCRATCHDIR=
A temporary directory?
I’ve tried modifying these a few times, but I’ve never gotten the script to get very far. The farthest I’ve ever gotten is when I set IMAGE to an exact image of the SD card I’m booting my board with, and with that same SD card inserted in my computer and mounted. In that case I get the following output:
Trying to attach image file
device-mapper: resume ioctl on loop0p2 failed: Invalid argument
create/reload failed on loop0p2
Loopdev: loop0
/media/myname/BEAGLE_BONE already mounted, trying to unmount
Mounting /dev/mapper/loop0p1
mount: mount point /media/myname/BEAGLE_BONE does not exist
myname@ubuntu:~/Dev/meta-beagleboard/contrib/bone-flash-tool$
I’m not really sure what the loop related errors mean, but it looks like the script is unmounting my SD card boot partition, remounting and it and then failing. /media/myname/BEAGLE_BONE is definitely still there after the scripts fails, so I’m not really sure why this error is being thrown.
Any help understanding this would be appreciated.