Upgrading Kernel of an old Angstrom image

Hello everyone,
I’ve been trying to update the kernel of some old Angstrom images (3.8.13 kernel), so that I would be able to flash them on newer Beaglebone Black boards. As far as I understand it, the issue lies in the new eMMC “format”, which the old images won’t even see under /dev/.

Reading some old topics on the subject, I thought I could manually update the kernel, keeping everything else as is. I was able to rebuild a 3.8.13 kernel with the needed patches using yakbuild, which gave me a zImage file, a few tar archives (dtbs, firmware, modules) and a config file.

I thought at this point I could simply replace the corresponding files on the image I have (as is suggested in this other topic as well), but the file configuration seems to be different.
On the old image, I have a small FAT partition, which contains MLO, u-boot.image and uEnv.txt (which only contains a line to load some of the default overlays) as well as the “Getting Started” package; the main partition has a /boot folder containing some dtbs (among which am335x-boneblack.dtb, which should be the base description of the board) and a uImage file.
I’m aware instead that newer images have MLO and u-boot.image in a raw mode, with the /boot folder containing uEnv.txt and the zImage (and maybe a config file?).

Is there a way to upgrade the kernel in this situation? I tried various replacing corresponding files in various ways, but either the old kernel would boot or there would be no boot at all. I’ve also tried replacing the u-boot.image and MLO with a newly built one, but it didn’t seem to help (maybe I need to add some uEnv paramaters?). I’ve also had a look at the upgrad_kernel script, but I’m not sure it would be compatible with opkg and with this older configuration of the boot files.

Just as a note, I’m aware Angstrom is old and deprecated; unfortunately I need it to run certain programs, for which we don’t have the full source code and dependencies anymore.

Yakbuild should generate 3 objects under deploy; device-tree, uimage, and kernel modules

Just copy the new am335x-boneblack.dtb and uImage file over in the boot partition…

And just extract the kernel modules in the other.

No reason to mess with the other boot files…

Regards,

I did get the device tree files and the modules, but instead of a uImage I got a zImage file. Could I simply replace the uImage in the /boot folder with the zImage (by renaming to uImage first?)? Or would I need to add some parameters to uEnv as well?

uImage is zImage with a u-boot wrapper… it’s been a long time since I personally used mkimage, there’s a short way to convert it on the command line…

But, i don’t remember, so do it the long way, edit build_kernel.sh:

Change:

#image=uImage
#address=LOADADDR=${ZRELADDR}

to:

image=uImage
address=LOADADDR=0x80008000

and rerun…

Regards,

Thank you very much for your help, that seems to have worked fine, and I can now boot.
However, it looks like I still can’t see the eMMC under /dev while booting from the SD card (with the new kernel loaded). I’ll have to try re-building it either with a newer kernel revision or by making sure the patches were in the proper folder (local_patches).

EDIT: A newer revision seems to have fixed the issue, now I can see the eMMC while booting off the SD card.

I’m sorry to bother you again, but after replacing the kernel files, I became unable to connect to the BBB via ssh by USB, as I have been doing so far (or at least it doesn’t always allow me to). The “Getting Started” partition also does not show up as it usually does; the serial connection works perfectly fine and allows me to log in as usual. Could I have missed some setting in the kernel config phase?

I’m posting here the boot log I get via serial connection, in case it reveals anything of use.

U-Boot SPL 2013.04-dirty (Jul 10 2013 - 14:02:53)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img

U-Boot 2013.04-dirty (Jul 10 2013 - 14:02:53)

I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: No NAND device found!!!
0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment

musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
Net: not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
mmc0 is current device
micro SD card found
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 0
reading uEnv.txt
143 bytes read in 3 ms (45.9 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc …
gpio: pin 55 (gpio 55) value is 1
5580432 bytes read in 966 ms (5.5 MiB/s)
gpio: pin 56 (gpio 56) value is 1
26118 bytes read in 22 ms (1.1 MiB/s)
Booting from mmc …

Booting kernel from Legacy Image at 80007fc0 …

Image Name: Linux-3.8.13-bone86
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 5580368 Bytes = 5.3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum … OK

Flattened Device Tree blob at 80f80000

Booting using the fdt blob at 0x80f80000
XIP Kernel Image … OK
OK
Using Device Tree in place at 80f80000, end 80f89605

Starting kernel …

Uncompressing Linux… done, booting the kernel.
[ 0.223554] omap2_mbox_probe: platform not supported
[ 0.498981] tps65217-bl tps65217-bl: failed to find backlight node
[ 0.499003] tps65217-bl tps65217-bl: DT parse failed.
[ 0.578321] bone-capemgr bone_capemgr.9: slot #0: No cape found
[ 0.615427] bone-capemgr bone_capemgr.9: slot #1: No cape found
[ 0.652536] bone-capemgr bone_capemgr.9: slot #2: No cape found
[ 0.689646] bone-capemgr bone_capemgr.9: slot #3: No cape found
[ 0.721325] omap_hsmmc mmc.5: of_parse_phandle_with_args of ‘reset’ failed
[ 0.785729] pinctrl-single 44e10800.pinmux: pin 44e10854 already requested by 44e10800.pinmux; cannot claim for gpio-leds.8
[ 0.797422] pinctrl-single 44e10800.pinmux: pin-21 (gpio-leds.8) status -22
[ 0.804720] pinctrl-single 44e10800.pinmux: could not request pin 21 on device pinctrl-single
[ 1.433347] systemd[1]: [/lib/systemd/system/netmanager.service:6] Failed to parse service type, ignoring: net
[ 3.934754] libphy: PHY 4a101000.mdio:01 not found
[ 3.939862] net eth0: phy 4a101000.mdio:01 not found on slave 1
systemd-fsck[85]: Angstrom: clean, 47265/194688 files, 387404/786432 blocks

.—O—.
| | .-. o o
| | |-----.-----.-----.| | .----…-----.-----.
| | | __ | —‘| ‘–.| .-’| | |
| | | | | |— || --’| | | ’ | | | |
‘—’—‘–’–‘–. |-----’‘----’‘–’ ‘-----’-‘-’-’
-’ |
‘—’

The Angstrom Distribution beaglebone ttyO0

Angstrom v2012.12 - Kernel 3.8.13-bone86

beaglebone login:

the usb gadget drivers are modules…

Did you copy the newly built kernel modules over the old ones?

Does lsmod show anything?

lsmod

If it’s blank, then they are missing…

Regards,

I’ll check lsmod as soon as I’m able; the patched modules were copied to a different folder (ie the original kernel was in 3.8.13 and the new one is 3.8.13-bone86). In that folder I can see under drivers/usb a g_mass_storage, which sounds similar to the usb mass storage gadget mentioned in other boot logs I had saved.

The new directory is fine, you might have to run depmod, or whatever angstrom used…

I finally had some time to check back on the usb issue; I found the following warning/error while rebuilding the kernel:
"warning: (USB_MUSB_HDRC) selects TWL6030_USB which has unmet direct dependencies (USB_SUPPORT && (USB || USB_GADGET) && TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS) "
Does this mean that I have to find and enable those modules in the menuconfig that appears early in the kernel compiling process?

To be clear, this is a relatively minor thing, I was able to get everything else to work as expected thanks to your prior help. I haven’t yet tried flashing the eMMC, but that should go smoothly, since I can see it under /dev with the patched kernel.

Feel free to fix-up this message, but TWL6030_USB was used on the PandaBoard, for Angstrom and the BBB it is not needed.

Regards,

I see, I’ll have a look as soon as I can.

I have one last question related to the initial topic; to perform the eMMC flashing at this point, what do you suggest? I did find this init script, but I believe my current image is missing both initramfs-tools and u-boot-tools.

Would the fact that the sd partition is larger than the space available on the eMMC be an issue? I have been trying to shrink it (by using resize2fs and fsck), but for the moment it won’t let me shrink it further (despite the fact that, according to dumpe2fs, a large percentage of the partition is empty). If I were able to shrink to the proper size, I assume I could then just dd the sd card onto the eMMC.

EDIT: I was able to shrink the working partition to a size compatible with the eMMC; at that point I created a .img.gz file and used zcat to write it to the eMMC while booting off the sd. Everything seems to be working fine.

This sounds really bizarre since the relevant rule says:

	select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA

and neither of those preconditions are (or should be) met on a -bone kernel, so TWL6030_USB shouldn’t get selected.