T3 H40
T3 H40

Reputation: 2436

How do I handle fixes for bugs, that have not been made part of a version branch?

Currently, I work on creating a yocto image for the beaglebone black, using the morty branch. I followed the tutorial here, mostly successful. At some point I encountered the following error:

Fetcher failure for URL: 'http://www.lartmaker.nl/lartware/port/devmem2.c'. Checksum mismatch! File: '/home/user/bbb/downloads/devmem2.c' has md5 checksum e23f236e94be4c429aa1ceac0f01544b when be12c0132a1ae118cbf5e79d98427c1d was expected [...]

I did some research, and found that this problem is known, and fixed with this commit to the meta-openembedded repo - it occurred because of changes in the devmem2 code. As the fixing commit was made to the master branch, I decided to override my local morty copy of devmem2.bb. Doing so worked fine, and I was able to download and compile my image from command line using bitbake qt5-image.

After doing so, I decided to give Toaster a go. I added the required layers to a new Toaster project and ran a build of the qt5-image (which is part of the meta-bbb layer). However, I ran into the same error as before, as Toaster downloads its own copies of the repositories. I tried doing the same as before, overriding the devmem2.bb - without success, as Toaster checks out the current version from the VCS and therefore reverts my changes.

Now, what I want to know is what would be the correct way of action, or what are my options?

Openembedded advises to write to the mailing list in cases of checksum errors. But I am hesitant about this, as it is not really an open problem anymore and I don't exactly know what I am doing. But manually overriding recipes is dangerous and feels just plain wrong; even while working.

Obviously, I am still new to yocto and even newer to Toaster, so this problem might be a beginners error (pretty sure, actually).

Upvotes: 0

Views: 227

Answers (1)

Jerome H
Jerome H

Reputation: 36

The recipe devmem2.bb in the branch Krogoth is broken because the mirror http://www.lartmaker.nl/lartware/port/devmem2.c is not available.

The cleanest way to fix this issue would be to create another layer. Copy meta-openembedded/meta-oe/recipes-support/devmem2 to meta-newlayer/recipes-support/devmem2. Rename meta-newlayer/recipes-support/devmem2/devmem2.bb in devmem2.bbapend and replace everything inside it by :

SUMMARY = "Simple program to read/write from/to any location in memory"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://devmem2.c;endline=28;md5=dd68f2b0a5184b3db3dc25c99e0bd0cd"
PR = "r7"

SRC_URI = "https://raw.githubusercontent.com/radii/devmem2/master/devmem2.c \
           file://devmem2-fixups-2.patch;apply=yes;striplevel=0"
S = "${WORKDIR}"

CFLAGS += "-DFORCE_STRICT_ALIGNMENT"

do_compile() {
    ${CC} -o devmem2 devmem2.c ${CFLAGS} ${LDFLAGS}
}

do_install() {
    install -d ${D}${bindir}
    install devmem2 ${D}${bindir}
}

SRC_URI[md5sum] = "be12c0132a1ae118cbf5e79d98427c1d"
SRC_URI[sha256sum] = "ec382c90af3ef2f49695ff14a4d6521e58ac482c4e29d6c9ebca8768f699c191"

That fixed the issue for me.

Upvotes: 1

Related Questions