Skip to contentSkip to conversation

building yocto image from git always switches branch

DISCUSSION Volker Vogelhuber 2 participants 5 messages Mar 12, 2013 – Mar 15, 2013

lore
Share & tools
lore
#0 lore raw

I currently try to create a kernel and rootfs image based on yocto 1.3. I cloned the poky git repository and switched to danny branch.

For some reason during the bitbake run for creating the image the branch of my local git repository is always switched to master, which of course won't match with the other layers I checked out for danny.

Currently I do the following:

#!/bin/bash

if [ ! -e poky ]; then
git clone git://git.yoctoproject.org/poky.git
cd poky
git checkout -b danny remotes/origin/danny
cd ..
fi
if [ ! -e poky/meta-ti ]; then
git clone -b danny git://git.yoctoproject.org/meta-ti poky/meta-ti
fi

After the checkout I copy some configuration files to the build/conf directory within the poky directory (bblayers.conf, local.conf) and an additional layer for our specific hardware module.

When I change to the build directory and start building the image using bitbake, there seems to be a git call somewhere in the recipes that switches the branch of the poky git checkout back to master. Of course that results in a total misbehaviour of the build process, as the underlaying recipes changes during the build.

Can someone explain that behaviour? Is that a bug or is there something I'm doing wrong.

Kind regards,
Volker

#1 lore raw
Quoted 5 lines · Volker Vogelhuber

When I change to the build directory and start building the image using bitbake, there seems to be a git call somewhere in the recipes that switches the branch of the poky git checkout back to master. Of course that results in a total misbehaviour of the build process, as the underlaying recipes changes during the build.

It turned out, my own kernel recipe included recipes-kernel/linux/linux-yocto.inc
which seems to require that the kernel is checked out from a git repository. After removing this include and only inherit from kernel.bbclass it worked as expected.

#2 lore raw
Quoted 7 lines · Volker Vogelhuber
Quoted 5 lines · Volker Vogelhuber

When I change to the build directory and start building the image using bitbake, there seems to be a git call somewhere in the recipes that switches the branch of the poky git checkout back to master. Of course that results in a total misbehaviour of the build process, as the underlaying recipes changes during the build.

Quoted 5 lines

It turned out, my own kernel recipe included recipes-kernel/linux/linux-yocto.inc
which seems to require that the kernel is checked out from a git repository. After removing this include and only inherit from kernel.bbclass it worked as expected.

Interesting. Are you working out of yocto/oe-core master ? The linux yocto kernel support should always fail if the kernel source dir isn't a git repo (or convert it into one) and not impact the main yocto/oe-core tree.

Cheers,

Bruce

Quoted 7 lines

_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#3 lore raw

Hi,

Quoted 4 lines

Interesting. Are you working out of yocto/oe-core master ? The linux yocto kernel support should always fail if the kernel source dir isn't a git repo (or convert it into one) and not impact the main yocto/oe-core tree.

As mentioned in the first post, I checked out the danny branch.

I used the following bitbake recipe for kernel compilation:

inherit kernel
require recipes-kernel/linux/linux-yocto.inc

SECTION = "kernel"
LICENSE = "GPLv2"

LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

DESCRIPTION = "Linux kernel for the tao-boards"
KERNEL_IMAGETYPE = "uImage"
KERNEL_CC_append += "-mno-unaligned-access "

COMPATIBLE_MACHINE = "(tao)"

PV = "2.6.37"

MACHINE_KERNEL_PR_append = "c+tn"

SRC_URI = "file://linux-2.6.37-tn.tar.xz \
           file://defconfig \
           file://nonetwork.patch \
           file://rtc.patch \
	   file://multitouch.patch"

S = "${WORKDIR}/linux-2.6.37-tn"

# Sadly perf is broken:

do_compile_perf() {
	:
}
do_validate_branches() {
	  :
}
do_install_perf() {
	:
}

After I removed the require recipes-kernel/linux/linux-yocto.inc line it worked. As you can see I have a .tar.xz file for the kernel source, so no git. But the git command within the linux-yocto.inc file realizes, that there is a git repository. But it's not one from the kernel, but from the poky repository the whole build environment is located in.

#4 lore raw
Quoted 51 lines · Volker Vogelhuber

Hi,

Quoted 4 lines

Interesting. Are you working out of yocto/oe-core master ? The linux yocto kernel support should always fail if the kernel source dir isn't a git repo (or convert it into one) and not impact the main yocto/oe-core tree.

As mentioned in the first post, I checked out the danny branch.

I used the following bitbake recipe for kernel compilation:

inherit kernel
require recipes-kernel/linux/linux-yocto.inc

SECTION = "kernel"
LICENSE = "GPLv2"

LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

DESCRIPTION = "Linux kernel for the tao-boards"
KERNEL_IMAGETYPE = "uImage"
KERNEL_CC_append += "-mno-unaligned-access "

COMPATIBLE_MACHINE = "(tao)"

PV = "2.6.37"

MACHINE_KERNEL_PR_append = "c+tn"

SRC_URI = "file://linux-2.6.37-tn.tar.xz \
            file://defconfig \
            file://nonetwork.patch \
            file://rtc.patch \
	   file://multitouch.patch"

S = "${WORKDIR}/linux-2.6.37-tn"

# Sadly perf is broken:

do_compile_perf() {
	:
}
do_validate_branches() {
	  :
}
do_install_perf() {
	:
}
Quoted 6 lines

After I removed the require recipes-kernel/linux/linux-yocto.inc line it worked. As you can see I have a .tar.xz file for the kernel source, so no git. But the git command within the linux-yocto.inc file realizes, that there is a git repository. But it's not one from the kernel, but from the poky repository the whole build environment is located in.

Hmmm. This is definitely supposed to error in the build process. If you use linux-yocto-custom as a baseline recipe (from meta-skeleton), you'll find the tgz that is unpacked by the build system is converted to a git repository before the build starts, allow all the tool extensions to work with configs that for one reason or another can't use a git backed tree.

I just tested it here, and it worked, using the latest code in master.

Cheers,

Bruce

Quoted 9 lines

_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto