Custom eMMC Flasher

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.

I’ve also stumbled across Robert C Nelson’s image builder which can apparently be used to create an eMMC flasher, but I also haven’t had any luck with this. It seems like the expected workflow for this is to use it build the original SD card image and then have it convert it into an eMMC flashing image. I might be off-base on that but that’s what it looks like. Since I’m trying to flash stuff that’s already built, would I just need to put all of the files (MLO, u-boot.img, zImage and a tar’d up root FS) in a particular directory and then run that utiity with the --bbb-flasher option?

I haven’t moved files. I moved entire flash image. Firstly, created working 2GB SD card, then copied it on the linux PC to a file using DD tool. Then booted from SD, mounted NFS to see the file and DDed into /dev/mmcblk1. If you bother with silent of DD tool, you may use great PV utility e.g: pv /dev/sdb | dd of=my_sd_image.bin
Note, when booted from SD, SD device is /dev/mmcblk0 and eMMC is /dev/mmcblk1. When booted from eMMC, /dev/mmcblk0 is eMMC!
Cheers,
Piotr.

W dniu środa, 30 kwietnia 2014 00:17:40 UTC+2 użytkownik kip…@ualberta.ca napisał:

Hey Piotr, thanks for the reply. I wasn’t able to get NFS going, but I was able to get my board mounted using SSHFS. When I look at the mounted filesystem, there are mmcblk0 and mmcblk1, so I tried writing my image into mmcblk1 using dd if=mySD.img of=/home/myName/dev/mmcblk1 and got an error: “dd: failed to open '/home/myName/sshMount/dev/mmcblk1”. When I mounted the filesystem via SSH I authenticated as root, and I tried running the dd command on my host as su, so I’m not really sure how many more permissions I can give myself. Do you have any ideas as to why the board is locking me out?

I didn’t fully copy the dd error message in my previous post. The full message is:

dd: failed to open ‘/home/mkipper/haha/dev/mmcblk1’: Permission denied

That’s why I’m curious why I’m not allowed permission even though I’m signed in as root

Hi,
Maybe the simplest would be to use a 4GB SD card, with e.g. ubuntu image from http://elinux.org/BeagleBoardUbuntu#Saucy_13.10. There is enough space to store 2GB file.
Regards,
Piotr.