Skip to contentSkip to conversation

Problems creating a new BSP

DISCUSSION Tim Cussins 3 participants 5 messages May 18, 2011 – May 19, 2011

lore
Share & tools
lore
#0 lore raw

Hi all,

I've been having trouble getting my own kernel built and it's time to go to the list :)

The problem: As part of my bsp I want a kernel that's based on the yocto tree, but is built for my machine. Mu current setup fails to build it :(

(1) I've been following the steps outlined here:

http://www.yoctoproject.org/docs/bsp-guide/bsp-guide.html

(2) I'm tracking the bernard branch of poky.

(3) My new meta directory (meta-tephra) is inside the top-level of my poky checkout. Here's what's in there (find):

./recipes-kernel
./recipes-kernel/linux ./recipes-kernel/linux/linux-yocto-stable_git.bbappend ./recipes-kernel/linux/linux-yocto-stable ./recipes-kernel/linux/linux-yocto-stable/defconfig ./conf
./conf/machine
./conf/machine/tephra.conf
./conf/layer.conf
./images
./images/poky-image-tephra-sdk.bb

(4) Contents of tephra.conf

TARGET_ARCH = "arm"
MACHINE_FEATURES = "kernel26"
IMAGE_FSTYPES ?= "tar.bz2 ext3"
ROOT_FLASH_SIZE = "280"
IMAGE_ROOTFS_SIZE_ext2 ?= "280000"
IMAGE_ROOTFS_SIZE_ext3 ?= "280000"
# Don't include kernels in standard images RDEPENDS_kernel-base = "" PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-stable" #PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" EXTRA_IMAGEDEPENDS += ""
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""
require conf/machine/include/tune-arm1136jf-s.inc KERNEL_IMAGETYPE = "uImage"
SERIAL_CONSOLE = "115200 ttyS0"

(5) Contents of linux-yocto-stable_git.bbappend

FILESEXTRAPATHS := "${THISDIR}/${PN}"
COMPATIBLE_MACHINE_tephra = "tephra"
KMACHINE_tephra = "arm_versatile_926ejs"
SRC_URI += "file://defconfig"

(6) Contents of defconfig

Same as mx3_defconfig (for freescale iMX 3)

(6b) for completeness here's layer.conf

# We have a conf directory, add to BBPATH
BBPATH := "${BBPATH}:${LAYERDIR}"

# We have a recipes directory containing .bb and .bbappend files, add to BBFILES

BBFILES := "${BBFILES} \
            ${LAYERDIR}/recipes*/*/*.bb \
            ${LAYERDIR}/recipes*/*/*.bbappend \
            ${LAYERDIR}/images/*.bb"

BBFILE_COLLECTIONS += "tephra"
BBFILE_PATTERN_tephra := "^${LAYERDIR}/"
BBFILE_PRIORITY_tephra = "5"

(7) Minor confusion - When I invoke

bitbake virtual/kernel -DDDD -v

The process warns during the start of kernel_do_compile() (from kernel.bbclass) that

"Warning: make dep is unnecessary now."

It's trying to build deps - fair enough, as the value of KERNEL_MAJOR_VERSION is 'None' because that information is taken from the kernel build output:

  oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"

but this won't generate

include/generated/utsrelease.h

which is where the kernel version now lives. Changing the line to generate this target ensures that utsrelease.h is built, but KERNEL_MAJOR_VERSION is still 'None'.

I'm pretty confused by this and need help :)

(8) Major problem - The copying of my defconfig into .config causes the kernel build to terminate with:

linux is not clean, please run 'make mrproper'

Commenting out the defconfig reference in my bbappend:

#SRC_URI += "file://defconfig"

allows the kernel build to complete, but obviously not with the configuration I was after :(

Any insight into what I'm doing wrong (either philosophically or technically) would be awesome.

Thanks in advance,

Tim

#1 lore raw
Quoted 7 lines · Tim Cussins

Hi all,

I've been having trouble getting my own kernel built and it's time to go to the list :)

The problem: As part of my bsp I want a kernel that's based on the yocto tree, but is built for my machine. Mu current setup fails to build it :(

We can definitely get you up and running.

Quoted 40 lines

(1) I've been following the steps outlined here:

 http://www.yoctoproject.org/docs/bsp-guide/bsp-guide.html

(2) I'm tracking the bernard branch of poky.

(3) My new meta directory (meta-tephra) is inside the top-level of my poky checkout. Here's what's in there (find):

./recipes-kernel
./recipes-kernel/linux ./recipes-kernel/linux/linux-yocto-stable_git.bbappend ./recipes-kernel/linux/linux-yocto-stable ./recipes-kernel/linux/linux-yocto-stable/defconfig ./conf
./conf/machine
./conf/machine/tephra.conf
./conf/layer.conf
./images
./images/poky-image-tephra-sdk.bb

(4) Contents of tephra.conf

TARGET_ARCH = "arm"
MACHINE_FEATURES = "kernel26"
IMAGE_FSTYPES ?= "tar.bz2 ext3"
ROOT_FLASH_SIZE = "280"
IMAGE_ROOTFS_SIZE_ext2 ?= "280000"
IMAGE_ROOTFS_SIZE_ext3 ?= "280000"
# Don't include kernels in standard images RDEPENDS_kernel-base = "" PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-stable" #PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" EXTRA_IMAGEDEPENDS += ""
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""
require conf/machine/include/tune-arm1136jf-s.inc KERNEL_IMAGETYPE = "uImage"
SERIAL_CONSOLE = "115200 ttyS0"

Quoted 6 lines

(5) Contents of linux-yocto-stable_git.bbappend

FILESEXTRAPATHS := "${THISDIR}/${PN}"
COMPATIBLE_MACHINE_tephra = "tephra"
KMACHINE_tephra = "arm_versatile_926ejs"
SRC_URI += "file://defconfig"

the recipe names will change slightly in the near future, the linux-yocto_git is also "stable", so if you want something newer than 2.6.34, you can use that as well.

Quoted 38 lines

(6) Contents of defconfig

Same as mx3_defconfig (for freescale iMX 3)

(6b) for completeness here's layer.conf

# We have a conf directory, add to BBPATH
BBPATH := "${BBPATH}:${LAYERDIR}"

# We have a recipes directory containing .bb and .bbappend files, add to BBFILES
BBFILES := "${BBFILES} \
           ${LAYERDIR}/recipes*/*/*.bb \
           ${LAYERDIR}/recipes*/*/*.bbappend \
           ${LAYERDIR}/images/*.bb"

BBFILE_COLLECTIONS += "tephra"
BBFILE_PATTERN_tephra := "^${LAYERDIR}/"
BBFILE_PRIORITY_tephra = "5"

(7) Minor confusion - When I invoke

 bitbake virtual/kernel -DDDD -v

The process warns during the start of kernel_do_compile() (from kernel.bbclass) that

 "Warning: make dep is unnecessary now."

It's trying to build deps - fair enough, as the value of KERNEL_MAJOR_VERSION is 'None' because that information is taken from the kernel build output:

 oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"

but this won't generate

Quoted 7 lines

 include/generated/utsrelease.h

which is where the kernel version now lives. Changing the line to generate this target ensures that utsrelease.h is built, but KERNEL_MAJOR_VERSION is still 'None'.

I'm pretty confused by this and need help :)

I'm not sure about this one at the moment, I've never had this happen, or spent much time poking around in that particular code.

Quoted 5 lines

(8) Major problem - The copying of my defconfig into .config causes the kernel build to terminate with:

 linux is not clean, please run 'make mrproper'

I can help with this one. There was a change to the defconfig processing late in the 1.0 cycle that missed being tested against defconfig kernel builds against yocto (since the default boards don't do this). It copies the defconfig into the source directory, which isn't what we want since the src/build is split.

I put a fix into master for this, and it should have also been in bernard, but obviously, I'll need to check this.

The fix you can manually do is by applying this chunk to kernel-yocto.bbclass

+# overrides the base kernel_do_configure, since we don't want all the +# defconfig processing in there
+kernel_do_configure() {
+ yes '' | oe_runmake oldconfig
+}
+
+

And then you'll be good to go.

Bruce

Quoted 19 lines

Commenting out the defconfig reference in my bbappend:

 #SRC_URI += "file://defconfig"

allows the kernel build to complete, but obviously not with the configuration I was after :(

Any insight into what I'm doing wrong (either philosophically or technically) would be awesome.

Thanks in advance,

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

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#2 lore raw
Quoted 53 lines · Bruce Ashfield
Quoted 7 lines · Tim Cussins

Hi all,

I've been having trouble getting my own kernel built and it's time to go to the list :)

The problem: As part of my bsp I want a kernel that's based on the yocto tree, but is built for my machine. Mu current setup fails to build it :(

We can definitely get you up and running.

Quoted 42 lines

(1) I've been following the steps outlined here:

http://www.yoctoproject.org/docs/bsp-guide/bsp-guide.html

(2) I'm tracking the bernard branch of poky.

(3) My new meta directory (meta-tephra) is inside the top-level of my poky checkout. Here's what's in there (find):

./recipes-kernel
./recipes-kernel/linux ./recipes-kernel/linux/linux-yocto-stable_git.bbappend ./recipes-kernel/linux/linux-yocto-stable ./recipes-kernel/linux/linux-yocto-stable/defconfig ./conf
./conf/machine
./conf/machine/tephra.conf
./conf/layer.conf
./images
./images/poky-image-tephra-sdk.bb

(4) Contents of tephra.conf

TARGET_ARCH = "arm"
MACHINE_FEATURES = "kernel26"
IMAGE_FSTYPES ?= "tar.bz2 ext3"
ROOT_FLASH_SIZE = "280"
IMAGE_ROOTFS_SIZE_ext2 ?= "280000"
IMAGE_ROOTFS_SIZE_ext3 ?= "280000"
# Don't include kernels in standard images RDEPENDS_kernel-base = "" PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-stable" #PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" EXTRA_IMAGEDEPENDS += ""
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""
require conf/machine/include/tune-arm1136jf-s.inc KERNEL_IMAGETYPE = "uImage"
SERIAL_CONSOLE = "115200 ttyS0"

(5) Contents of linux-yocto-stable_git.bbappend

Quoted 8 lines
Quoted 4 lines

FILESEXTRAPATHS := "${THISDIR}/${PN}"
COMPATIBLE_MACHINE_tephra = "tephra"
KMACHINE_tephra = "arm_versatile_926ejs"
SRC_URI += "file://defconfig"

the recipe names will change slightly in the near future, the linux-yocto_git is also "stable", so if you want something newer than 2.6.34, you can use that as well.

noted. i actually started with 2.6.37 until the wheels fell off :)

Quoted 75 lines
Quoted 38 lines

(6) Contents of defconfig

Same as mx3_defconfig (for freescale iMX 3)

(6b) for completeness here's layer.conf

# We have a conf directory, add to BBPATH
BBPATH := "${BBPATH}:${LAYERDIR}"

# We have a recipes directory containing .bb and .bbappend files, add to BBFILES

BBFILES := "${BBFILES} \
            ${LAYERDIR}/recipes*/*/*.bb \
            ${LAYERDIR}/recipes*/*/*.bbappend \
            ${LAYERDIR}/images/*.bb"

BBFILE_COLLECTIONS += "tephra"
BBFILE_PATTERN_tephra := "^${LAYERDIR}/"
BBFILE_PRIORITY_tephra = "5"

(7) Minor confusion - When I invoke

bitbake virtual/kernel -DDDD -v

The process warns during the start of kernel_do_compile() (from kernel.bbclass) that

"Warning: make dep is unnecessary now."

It's trying to build deps - fair enough, as the value of KERNEL_MAJOR_VERSION is 'None' because that information is taken from the kernel build output:

  oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"

but this won't generate

Quoted 7 lines

include/generated/utsrelease.h

which is where the kernel version now lives. Changing the line to generate this target ensures that utsrelease.h is built, but KERNEL_MAJOR_VERSION is still 'None'.

I'm pretty confused by this and need help :)

I'm not sure about this one at the moment, I've never had this happen, or spent much time poking around in that particular code.

Quoted 5 lines

(8) Major problem - The copying of my defconfig into .config causes the kernel build to terminate with:

linux is not clean, please run 'make mrproper'

I can help with this one. There was a change to the defconfig processing late in the 1.0 cycle that missed being tested against defconfig kernel builds against yocto (since the default boards don't do this). It copies the defconfig into the source directory, which isn't what we want since the src/build is split.

I put a fix into master for this, and it should have also been in bernard, but obviously, I'll need to check this.

The fix you can manually do is by applying this chunk to kernel-yocto.bbclass

(quoted diff) +7 -0
+# overrides the base kernel_do_configure, since we don't want all the
+# defconfig processing in there
+kernel_do_configure() {
+        yes '' | oe_runmake oldconfig
+}
+
+
Quoted 1 line

And then you'll be good to go.

great - that's making progress now. fyi the kernel build itself is breaking now, but i reckon i can deal to that :)

Thanks heaps!
T

Quoted 25 lines

Bruce

Quoted 19 lines

Commenting out the defconfig reference in my bbappend:

#SRC_URI += "file://defconfig"

allows the kernel build to complete, but obviously not with the configuration I was after :(

Any insight into what I'm doing wrong (either philosophically or technically) would be awesome.

Thanks in advance,

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

#3 lore raw

Hi Tim,

Quoted 6 lines · Tim Cussins

great - that's making progress now. fyi the kernel build itself is breaking now, but i reckon i can deal to that :)

Thanks heaps!
T

Once you get your kernel compiling would you mind making your working solution available somewhere?
That could serve as a template for others (like myself) since what you try to do is something people will try all the time.

At the moment I'm compiling kernels and boot loaders outside of poky, just utilizing the cross toolchain, but if it's simple enough to add a BSP I would give it a try.

Regards,

Robert..."Software is getting slower more rapidly than hardware becomes faster." - Niklaus Wirth, who attributed it to Martin Reiser.

My public pgp key is available at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x90320BF1

#4 lore raw
In reply to Tim Cussins
Quoted 63 lines · Tim Cussins
Quoted 62 lines · Bruce Ashfield
Quoted 9 lines · Tim Cussins

Hi all,

I've been having trouble getting my own kernel built and it's time to go to
the list :)

The problem: As part of my bsp I want a kernel that's based on the yocto tree, but is built for my machine. Mu current setup fails to build it :(

We can definitely get you up and running.

Quoted 47 lines

(1) I've been following the steps outlined here:

 http://www.yoctoproject.org/docs/bsp-guide/bsp-guide.html

(2) I'm tracking the bernard branch of poky.

(3) My new meta directory (meta-tephra) is inside the top-level of my poky
checkout. Here's what's in there (find):

./recipes-kernel
./recipes-kernel/linux ./recipes-kernel/linux/linux-yocto-stable_git.bbappend ./recipes-kernel/linux/linux-yocto-stable ./recipes-kernel/linux/linux-yocto-stable/defconfig ./conf
./conf/machine
./conf/machine/tephra.conf
./conf/layer.conf
./images
./images/poky-image-tephra-sdk.bb

(4) Contents of tephra.conf

TARGET_ARCH = "arm"
MACHINE_FEATURES = "kernel26"
IMAGE_FSTYPES ?= "tar.bz2 ext3"
ROOT_FLASH_SIZE = "280"
IMAGE_ROOTFS_SIZE_ext2 ?= "280000"
IMAGE_ROOTFS_SIZE_ext3 ?= "280000"
# Don't include kernels in standard images RDEPENDS_kernel-base = "" PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-stable" #PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" EXTRA_IMAGEDEPENDS += ""
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""
require conf/machine/include/tune-arm1136jf-s.inc KERNEL_IMAGETYPE = "uImage"
SERIAL_CONSOLE = "115200 ttyS0"

(5) Contents of linux-yocto-stable_git.bbappend

FILESEXTRAPATHS := "${THISDIR}/${PN}"
COMPATIBLE_MACHINE_tephra = "tephra"
KMACHINE_tephra = "arm_versatile_926ejs"
SRC_URI += "file://defconfig"

Quoted 5 lines
Quoted 3 lines

the recipe names will change slightly in the near future, the linux-yocto_git is also "stable", so if you want something newer than 2.6.34, you can use that as well.

noted. i actually started with 2.6.37 until the wheels fell off :)

Aha. Same error ? Something different ? Either way, if you get back to it, I can help if somethings lurking. If the steps are wrong in the docs, that's also something that would be good to know!

Cheers,

Bruce

Quoted 113 lines
Quoted 78 lines
Quoted 41 lines

(6) Contents of defconfig

Same as mx3_defconfig (for freescale iMX 3)

(6b) for completeness here's layer.conf

# We have a conf directory, add to BBPATH
BBPATH := "${BBPATH}:${LAYERDIR}"

# We have a recipes directory containing .bb and .bbappend files, add to BBFILES
BBFILES := "${BBFILES} \
           ${LAYERDIR}/recipes*/*/*.bb \
           ${LAYERDIR}/recipes*/*/*.bbappend \
           ${LAYERDIR}/images/*.bb"

BBFILE_COLLECTIONS += "tephra"
BBFILE_PATTERN_tephra := "^${LAYERDIR}/"
BBFILE_PRIORITY_tephra = "5"

(7) Minor confusion - When I invoke

 bitbake virtual/kernel -DDDD -v

The process warns during the start of kernel_do_compile() (from kernel.bbclass) that

 "Warning: make dep is unnecessary now."

It's trying to build deps - fair enough, as the value of KERNEL_MAJOR_VERSION is 'None' because that information is taken from the kernel build output:

 oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"

but this won't generate

 include/generated/utsrelease.h

Quoted 7 lines

which is where the kernel version now lives. Changing the line to generate
this target ensures that utsrelease.h is built, but KERNEL_MAJOR_VERSION is
still 'None'.

I'm pretty confused by this and need help :)

I'm not sure about this one at the moment, I've never had this happen, or spent much time poking around in that particular code.

Quoted 5 lines

(8) Major problem - The copying of my defconfig into .config causes the kernel build to terminate with:

 linux is not clean, please run 'make mrproper'

I can help with this one. There was a change to the defconfig processing late in the 1.0 cycle that missed being tested against defconfig kernel builds against yocto (since the default boards don't do this). It copies the defconfig into the source directory, which isn't what we want since the src/build is split.

I put a fix into master for this, and it should have also been in bernard, but obviously, I'll need to check this.

The fix you can manually do is by applying this chunk to kernel-yocto.bbclass

(quoted diff) +7 -0
+# overrides the base kernel_do_configure, since we don't want all the
+# defconfig processing in there
+kernel_do_configure() {
+        yes '' | oe_runmake oldconfig
+}
+
+
Quoted 1 line

And then you'll be good to go.

great - that's making progress now. fyi the kernel build itself is breaking now, but i reckon i can deal to that :)

Thanks heaps!
T

Quoted 25 lines

Bruce

Quoted 19 lines

Commenting out the defconfig reference in my bbappend:

 #SRC_URI += "file://defconfig"

allows the kernel build to complete, but obviously not with the configuration I was after :(

Any insight into what I'm doing wrong (either philosophically or technically) would be awesome.

Thanks in advance,

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

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"