Enter code here...
Hi All,
I have been trying to update the eMMC on a BBB that I just received with no success. The board booted off the eMMC when I first received it.
Following the steps at http://beagleboard.org/Getting%20Started I got to the step “Update board with latest software” and downloaded the Angstrom version dated 2013-06-20 from http://beagleboard.org/latest-images by following the links on the getting started page. Later I discovered there is a newer version of the flasher image at http://circuitco.com/support/index.php?title=Updating_The_Software called the Production Image 2013.09.04 and downloaded it.
I had previously installed the utilities needed, and successfully expanded and copied the image to a 4G SD card. I booted from the SD card using a 1A power supply and everything seemed to work as expected for about 5 minutes, then all the user LEDs turned off and nothing more happened.
At this point the board would no longer boot from the eMMC, but I could boot from the SD card. I downloaded and burned the image called SD Boot 2013.08.21 (the current production image) from the circuitco.com Updating the Software page to a different SD card. The BBB boots from that SD card and runs as expected. I reloaded the first SD card with that SD Boot image to verify that the SD card worked correctly, and it did. I then reloaded it with the flasher image and tried again. Same result, all LEDs off and appeared hung after about 5 minutes. I had read that the eMMC flashing process takes about 45 minutes, so I tried waiting for an hour and the LEDS never changed. The board still would not boot from the eMMC after the long wait.
I connected a serial debug cable to see if there was an error that would explain what might be going wrong, but I didn’t find anything useful. However, the serial cable did allow me to login and poke around after the LEDs turned off. I found the page at http://www.crashcourse.ca/wiki/index.php/BBB_software_update_process which explains how the flasher image is supposed to work and I dug into the emmc.sh and mkcard.sh scripts that do the flashing.
Seeing nothing out of the ordinary I tried running the emmc.sh script manually so I could see the progress messages and any error messages. Those messages are copied below.
`
root@beaglebone:~# /usr/bin/emmc.sh 2>&1 | tee emmc.log
Valid EEPROM header found
/usr/bin/emmc.sh: line 35: blockdev: command not found
Paritioning eMMC
16+0 records in
16+0 records out
1+0 records in
1+0 records out
DISK SIZE - 1920991232 bytes
CYLINDERS - 233
Checking that no-one is using this disk right now …
OK
Disk /dev/mmcblk1: 233 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 3069161472 does not have an msdos signature
sfdisk: /dev/mmcblk1: unrecognized partition table type
sfdisk: No partitions found
Old situation:
New situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/mmcblk1p1 * 0+ 8 9- 72261 c W95 FAT32 (LBA)
/dev/mmcblk1p2 9 232 224 1799280 83 Linux
/dev/mmcblk1p3 0 - 0 0 0 Empty
/dev/mmcblk1p4 0 - 0 0 0 Empty
Successfully wrote the new partition table
Re-reading the partition table …
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
./mkcard.sh: line 38: kpartx: command not found
umount: /dev/mmcblk1p1: not mounted
mkfs.vfat 2.11 (12 Mar 2005)
umount: /dev/mmcblk1p2: not mounted
mke2fs 1.42.1 (17-Feb-2012)
Discarding device blocks: done
Filesystem label=Angstrom
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
112672 inodes, 449820 blocks
22491 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=461373440
14 block groups
32768 blocks per group, 32768 fragments per group
8048 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
./mkcard.sh: line 82: kpartx: command not found
Mounting partitions
Copying bootloader files
/usr/bin/emmc.sh: line 54: blockdev: command not found
Extracting rootfs
Populating VFAT partition
/usr/bin/emmc.sh: line 66: /media/2/etc/dogtag: No such file or directory
Generating machine ID
Spawning namespace container on /media/2 (console is /dev/pts/0).
Timezone Universal does not exist in container, not updating container timezone.
execv() failed: No such file or directory
Container failed with error code 1.
Running Postinsts
Spawning namespace container on /media/2 (console is /dev/pts/0).
Timezone Universal does not exist in container, not updating container timezone.
execv() failed: No such file or directory
Container failed with error code 1.
Spawning namespace container on /media/2 (console is /dev/pts/0).
Timezone Universal does not exist in container, not updating container timezone.
Container failed with error code 1.
ln: /media/2/etc/systemd/system/xinetd.service: No such file or directory
touch: /media/2/etc/default/locale: No such file or directory
/usr/bin/emmc.sh: line 111: blockdev: command not found
ID.txt found
START.htm missing - ERROR
md5sum: can’t open ‘/media/2/usr/share/pixmaps/backgrounds/gnome/angstrom-default.jpg’: No such file or directory
Wallpaper MD5sum failed
/usr/bin/emmc.sh: line 153: blockdev: command not found
100000+0 records in
100000+0 records out
ERRORS found: , START.htm, bgmd5
root@beaglebone:~#
`
There are a couple of problems with these scripts. First, the mkcard.sh script uses a bad test to see if the kpartx command exists. The test used always passes and the the script tries to execute kpartx even though it is not installed in the flasher image. This leads to the following errors:
`
./mkcard.sh: line 38: kpartx: command not found ./mkcard.sh: line 82: kpartx: command not found
`
I think the script should quote the output of the which command before testing if it is executable like this. Without the double quotes the test is always true if the which command returns nothing (i.e. when the kpartx commnad doesn’t exist).
`
if [ -x “which kpartx
” ]; then
kpartx -a -v ${DRIVE}
fi
`
Second the emmc.sh script tries to execute the blockdev command a few times leading to the following errors because this command is not available in the flasher image.
`
/usr/bin/emmc.sh: line 35: blockdev: command not found /usr/bin/emmc.sh: line 54: blockdev: command not found /usr/bin/emmc.sh: line 111: blockdev: command not found /usr/bin/emmc.sh: line 153: blockdev: command not found
`
After the “Extracting rootfs” progress message there are several errors saying no such file or directory. The first is after the script tries to write to a file.
`
echo “Cloud9 GNOME Image 2013.09.04” > ${PART2MOUNT}/etc/dogtag
`
The problem is that the /etc directory does not exist in the filesystem created on the second partition. This filesystem is created by expanding the tar archive into the linux partition on the eMMC.
`
echo “Extracting rootfs”
tar zxf Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone.rootfs.tar.gz -C ${PART2MOUNT}
`
Using the -t option to tar to list the contents rather than expanding them I looked at the contents of the rootfs archive.
`
./
./bin/
./bin/egrep
./bin/chmod
./bin/chmod.coreutils
./bin/chgrp
./bin/ps.procps
./bin/traceroute6
./bin/chattr
./bin/ls.coreutils
./bin/deluser
./bin/mount.util-linux
./bin/systemd-notify
./bin/more.util-linux
./bin/pidof
./bin/dnsdomainname
./bin/cpio
./bin/dmesg.util-linux
./bin/tar
./bin/pwd.coreutils
./bin/adduser
./bin/sed.sed
./bin/kill.util-linux
./bin/dd
./bin/df
./bin/busybox
./bin/date.coreutils
./bin/date
./bin/stty
./bin/grep.grep
./bin/addgroup
./bin/ps
./bin/rmdir.coreutils
./bin/zcat
./bin/uname.coreutils
./bin/tracepath6
./bin/ping.iputils
./bin/dmesg
./bin/tinylogin
./bin/dd.coreutils
./bin/cp
./bin/rm.coreutils
./bin/gunzip
./bin/ls
./bin/pidof.sysvinit
./bin/netstat
./bin/tempfile.debianutils
./bin/true.coreutils
./bin/false.coreutils
./bin/ping
./bin/mkdir.coreutils
./bin/ping6
./bin/gzip
./bin/mkdir
./bin/mknod
./bin/more
./bin/rm
./bin/tar.tar
./bin/vi
./bin/run-parts.debianutils
./bin/ash
./bin/stty.coreutils
./bin/sleep.coreutils
./bin/ip
./bin/systemd-inhibit
./bin/ln.coreutils
./bin/sh
./bin/cat.coreutils
./bin/systemd-tmpfiles
./bin/tracepath
./bin/dumpkmap
./bin/su
./bin/systemd-machine-id-setup
./bin/login
./bin/umount.util-linux
./bin/sync.coreutils
./bin/systemd-tty-ask-password-agent
./bin/mount
./bin/gzip.gzip
./bin/mknod.coreutils
./bin/cat
./bin/sed
./bin/chgrp.coreutils
./bin/echo.coreutils
./bin/zcat.gzip
./bin/cp.coreutils
./bin/touch
./bin/ln
./bin/arping
./bin/chown.coreutils
./bin/touch.coreutils
./bin/bash
./bin/hostname
./bin/lsmod
./bin/kmod
./bin/systemd-ask-password
./bin/base64
./bin/rmdir
./bin/sleep
./bin/fgrep.grep
./bin/lsmod.kmod
./bin/sync
./bin/umount
./bin/usleep
./bin/uname
./bin/loginctl
./bin/delgroup
./bin/chown
./bin/fgrep
./bin/kill.procps
./bin/gunzip.gzip
./bin/grep
./bin/login.shadow
./bin/ping6.iputils
./bin/echo
./bin/systemctl
./bin/kill.coreutils
./bin/mktemp
./bin/true
./bin/false
./bin/journalctl
./bin/pwd
./bin/mv
./bin/mv.coreutils
./bin/egrep.grep
./bin/kill
./sbin/
./sbin/rtmon
./sbin/modprobe
./sbin/switch_root
./sbin/fdisk
./sbin/blockdev.util-linux
./sbin/hdparm
./sbin/insmod.kmod
./sbin/routel
./sbin/ifconfig
./sbin/pivot_root.util-linux
./sbin/swapon
./sbin/logread
./sbin/fsck.minix.util-linux
./sbin/mkfs.minix
./sbin/killall5
./sbin/setconsole
./sbin/e4defrag
./sbin/fsck.minix
./sbin/vipw
./sbin/losetup.util-linux
./sbin/logsave
./sbin/zcav
./sbin/mklost+found
./sbin/fsck.ext4
./sbin/debugfs
./sbin/sysctl.procps
./sbin/reboot
./sbin/route
./sbin/getty.tinylogin
./sbin/ctrlaltdel
./sbin/hdparm.hdparm
./sbin/insmod
./sbin/routef
./sbin/losetup
./sbin/mkfs.ext4dev
./sbin/depmod.kmod
./sbin/ifcfg
./sbin/modprobe.kmod
./sbin/rmmod.kmod
./sbin/getty
./sbin/dumpe2fs
./sbin/readprofile
./sbin/sysctl
./sbin/halt
./sbin/depmod
./sbin/mkswap.util-linux
./sbin/loadkmap
./sbin/fsck.ext3
./sbin/e2fsck
./sbin/ldconfig
./sbin/udhcpc
./sbin/mkfs.ext2
./sbin/mkfs.ext4
./sbin/bonnie++
./sbin/umount.udisks
./sbin/vigr
./sbin/ifup
./sbin/fsck.ext4dev
./sbin/rtpr
./sbin/resize2fs
./sbin/hwclock
./sbin/swapoff.util-linux
./sbin/lsmod
./sbin/modinfo
./sbin/start-stop-daemon
./sbin/pivot_root
./sbin/blockdev
./sbin/init
./sbin/vigr.shadow
./sbin/agetty
./sbin/nologin
./sbin/mkfs.minix.util-linux
./sbin/sulogin
./sbin/fsck
./sbin/badblocks
./sbin/ip.iproute2
./sbin/swapon.util-linux
./sbin/cfdisk
./sbin/e2image
./sbin/fsck.ext2
./sbin/klogd
./sbin/tc
./sbin/vipw.shadow
./sbin/syslogd
./sbin/filefrag
./sbin/rmmod
./sbin/fsck.util-linux
./sbin/hwclock.util-linux
./sbin/poweroff
./sbin/swapoff
./sbin/shutdown
./sbin/mkswap
./sbin/e2undo
./sbin/e2freefrag
./sbin/mkfs.ext3
./sbin/modinfo.kmod
./sbin/mke2fs
./sbin/fdisk.util-linux
./sbin/ifdown
./media/
./media/card/
./media/realroot/
./media/mmc1/
./media/ram/
./media/net/
./media/hdd/
./media/cf/
./media/union/
./home/
./home/xuser/
./home/root/
./mnt/
./mnt/card
./mnt/ram
./mnt/net
./mnt/cf
./usr/
./usr/bin/
./usr/bin/exo-desktop-item-edit
./usr/bin/identify
./usr/bin/realpath
./usr/bin/colrm
./usr/bin/sensible-browser.debianutils
./usr/bin/dvbv5-scan
./usr/bin/wvRTF
./usr/bin/modutil
./usr/bin/aconnect
./usr/bin/cytune
./usr/bin/sg_write_same
./usr/bin/timeout
./usr/bin/strsclnt
./usr/bin/xargs
./usr/bin/eu-ar
./usr/bin/pkaction
./usr/bin/wvText
./usr/bin/prlimit
./usr/bin/wvPS
./usr/bin/arm-angstrom-linux-gnueabi-nm
./usr/bin/tset
./usr/bin/vdir.coreutils
./usr/bin/sensible-pager.debianutils
./usr/bin/sum.coreutils
./usr/bin/gpg-error-config
./usr/bin/sg_sat_set_features
./usr/bin/expr
./usr/bin/x11vnc
./usr/bin/wvDVI
./usr/bin/resolv-test
./usr/bin/dbus-daemon
./usr/bin/ivtv-ctl
./usr/bin/rsaperf
./usr/bin/gst-xmlinspect-0.10
./usr/bin/arecord
./usr/bin/roff2pdf
./usr/bin/vim
./usr/bin/lesskey
./usr/bin/sg_luns
./usr/bin/free
./usr/bin/newgrp
./usr/bin/afmtodit
./usr/bin/users.coreutils
./usr/bin/bzcat
./usr/bin/sg_vpd
./usr/bin/refer
./usr/bin/sg_write_buffer
./usr/bin/gnome-session
./usr/bin/gvfs-set-attribute
./usr/bin/freetype-config
./usr/bin/sftp
./usr/bin/md5sum
./usr/bin/arm-angstrom-linux-gnueabi-g++
./usr/bin/private-network-test
./usr/bin/wvWare
./usr/bin/pk-example-frobnicate
./usr/bin/eu-elfcmp
./usr/bin/run-parts
./usr/bin/evtest-capture
./usr/bin/dvb-fe-tool
./usr/bin/xfce4-about
./usr/bin/avahi-resolve
./usr/bin/tsort
./usr/bin/mcookie
./usr/bin/compile_et
./usr/bin/csplit
./usr/bin/strip
./usr/bin/clear
./usr/bin/arm-angstrom-linux-gnueabi-readelf
./usr/bin/lslocks
./usr/bin/localectl
./usr/bin/xzcmp
./usr/bin/pip_stress
./usr/bin/ionice
./usr/bin/setarch
./usr/bin/chattr
./usr/bin/pre-grohtml
./usr/bin/xrandr
./usr/bin/avconv
./usr/bin/pwdx.procps
./usr/bin/rnano
./usr/bin/xmlcatalog
./usr/bin/expiry
./usr/bin/xkbcomp
./usr/bin/sg_ses
./usr/bin/sg_rtpg
./usr/bin/dirname.coreutils
./usr/bin/gnome-keyring-daemon
./usr/bin/bzless
./usr/bin/xzfgrep
./usr/bin/arm-angstrom-linux-gnueabi-as
./usr/bin/perl5.14.2
./usr/bin/sha384sum
./usr/bin/chsh.shadow
./usr/bin/basename.coreutils
./usr/bin/desktop-file-validate
./usr/bin/xdg-desktop-menu
./usr/bin/pathchk
./usr/bin/sg_unmap
./usr/bin/eqn2graph
./usr/bin/script
./usr/bin/g++
./usr/bin/savelog.debianutils
./usr/bin/gtester-report
./usr/bin/hcitool
./usr/bin/sg_prevent
./usr/bin/arm-angstrom-linux-gnueabi-cpp
./usr/bin/scp
./usr/bin/p7content
./usr/bin/gvfs-monitor-dir
./usr/bin/pmap.procps
./usr/bin/flushdisk
./usr/bin/vbi-test
./usr/bin/dbclient
./usr/bin/bluetooth-properties
./usr/bin/grn
./usr/bin/fuser
./usr/bin/btoa
./usr/bin/tftp
./usr/bin/xminicom
./usr/bin/chcon
./usr/bin/eu-make-debug-archive
./usr/bin/runcon.coreutils
./usr/bin/sha1sum.coreutils
./usr/bin/flex
./usr/bin/metacity-message
./usr/bin/update-alternatives
./usr/bin/gvfs-tree
./usr/bin/gnome-desktop-item-edit
./usr/bin/pp
./usr/bin/wvCleanLatex
./usr/bin/uptime
./usr/bin/tlb
./usr/bin/cc
./usr/bin/eject
./usr/bin/certcgi
`
As you can see there is no /etc directory in this archive, hence no /etc directory in the filesystem created on the eMMC linux partition. It seems to me this archive is missing some key pieces.
Later, near the end of the messages, the script reports that START.htm can’t be found.
`
START.htm missing - ERROR
`
This file is supposed to be copied from the directory /usr/share/beaglebone-getting-started in the new linux partition, but that directory is also missing from the archive.
Next, the wallpaper checksum test fails because the directory /usr/share does not exist. This directory is also missing from the archive.
`
md5sum: can’t open ‘/media/2/usr/share/pixmaps/backgrounds/gnome/angstrom-default.jpg’: No such file or directory
Wallpaper MD5sum failed
`
Finally, the user LEDs are turned off by the script because of the previous errors by the test at the end of the emmc.sh script.
`
echo “ERRORS found: ${ERROR}”
if [ -e /sys/class/leds/beaglebone:green:usr0/trigger ] ; then
echo none > /sys/class/leds/beaglebone:green:usr0/trigger
echo none > /sys/class/leds/beaglebone:green:usr1/trigger
echo none > /sys/class/leds/beaglebone:green:usr2/trigger
echo none > /sys/class/leds/beaglebone:green:usr3/trigger
fi
`
So now I know why the LEDs are off (because the flasher script turned them off) and why it takes about 5 minutes to fail (because the rootfs archive in the flasher image is missing key parts, so it is expanded in 5 minutes instead of 45 minutes).
Perhaps the flasher image I downloaded is corrupt, but I have no easy way to verify that because there are no MD5 sums posted for the image files along with the download links. I suspect the image is OK but I am downloading it again to compare the two files.
I know this is a long post, but I thought the detail might help someone to fix these errors and make the flashing process run more smoothly, since I see that many people have had problems when doing this. Also, I suspect that this update may have been a waste of my time since I think my BBB may have had this 09.04 version of the software installed in the eMMC when it shipped last week. It would be helpful to add the info about checking the current version from the top of the http://circuitco.com/support/index.php?title=Updating_The_Software page to the Getting Started page so that users can check if they really need to do an update before they waste a lot of time.
I look forward to working with my new BBB.
Dennis Cote