Skip to contentSkip to conversation

kernel.bbclass: Create symbolic link to add ${KERNEL_IMAGETYPE} to boot package

PATCH Superseded Franklin S. Cooper Jr 2 participants 5 messages Aug 14, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel.bbclass: Create symbolic link to add ${KERNEL_IMAGETYPE} to boot package

* By default for some platforms U-boot assumes the kernel image is located in the boot directory of the root filesystem.
* The kernel.bbclass already includes the kernel image in the /boot directory but adds a version number to the file name.
* Create a symbolic link that names the kernel image in the exact way that U-boot expects.

---
 meta/classes/kernel.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
meta/classes/kernel.bbclass +1 -0
index e039dfc..248ee71 100644
@@ -109,6 +109,7 @@ kernel_do_install() {
 	install -d ${D}/${KERNEL_IMAGEDEST}
 	install -d ${D}/boot
 	install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
+	ln      -s ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}
 	install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
 	install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
 	install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 linux-dtb.inc: Run dts through the preprocessor

* In the 3.11 kernel some dts files now include C code that must first run through the preprocessor.
* Update building the dtb by first running the dts file through the user's compiler before building using the device tree compiler.
* The logic used is based on mainline u-boot dts/Makefile.

---
 meta/recipes-kernel/linux/linux-dtb.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
meta/recipes-kernel/linux/linux-dtb.inc +4 -1
index 41dd599..f1aafa2 100644
@@ -21,7 +21,10 @@ do_install_append() {
 			DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
 			DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
 			DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
-			dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o ${DTS_BASE_NAME} ${DTS_FILE}
+
+			cat ${DTS_FILE} | \
+				${CPP} -x assembler-with-cpp -I ./include/ -I ./arch/${ARCH}/boot/dts - | \
+				dtc ${KERNEL_DEVICETREE_FLAGS} -O dtb -o ${DTS_BASE_NAME} -i arch/${ARCH}/boot/dts/ -
 			install -m 0644 ${DTS_BASE_NAME} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
 		done
 	fi
Signature · 1 line
1.7.0.4
#2 lore raw

Re: [PATCH] linux-dtb.inc: Run dts through the preprocessor

Quoted 5 lines · Franklin S. Cooper Jr

* In the 3.11 kernel some dts files now include C code that must first run through the preprocessor.
* Update building the dtb by first running the dts file through the user's compiler before building using the device tree compiler.
* The logic used is based on mainline u-boot dts/Makefile.

We are already working through a change from Otavio that changes the way we build DTB files, using the in kernel resources.

So this shouldn't be required in the end, or at least heavily modified.

So I suggest we hold on this change for now, and rebase it once the patch I mentioned
is merged.

Bruce

Quoted 29 lines
---
 meta/recipes-kernel/linux/linux-dtb.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
meta/recipes-kernel/linux/linux-dtb.inc +4 -2
index 41dd599..f1aafa2 100644
@@ -21,7 +21,10 @@ do_install_append() {
                        DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
                        DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
                        DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
-                       dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o ${DTS_BASE_NAME} ${DTS_FILE}
+
+                       cat ${DTS_FILE} | \
+                               ${CPP} -x assembler-with-cpp -I ./include/ -I ./arch/${ARCH}/boot/dts - | \
+                               dtc ${KERNEL_DEVICETREE_FLAGS} -O dtb -o ${DTS_BASE_NAME} -i arch/${ARCH}/boot/dts/ -
                        install -m 0644 ${DTS_BASE_NAME} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
                done
        fi
--

1.7.0.4

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#4 lore raw
In reply to Franklin S. Cooper Jr
Quoted 6 lines · Franklin S. Cooper Jr

* By default for some platforms U-boot assumes the kernel image is located in the boot directory of the root filesystem.
* The kernel.bbclass already includes the kernel image in the /boot directory but adds a version number to the file name.
* Create a symbolic link that names the kernel image in the exact way that U-boot expects.

I swear I've seen this change before, but my grep didn't return a hit ..

Quoted 11 lines
---
 meta/classes/kernel.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
meta/classes/kernel.bbclass +0 -0
index e039dfc..248ee71 100644

meta/classes/kernel.bbclass kernel_do_install() { · line 112

Quoted 4 lines
meta/classes/kernel.bbclass +1 -0
@@ -109,6 +109,7 @@ kernel_do_install() {
        install -d ${D}/${KERNEL_IMAGEDEST}
        install -d ${D}/boot
        install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
+       ln      -s ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}

This should probably be -sf, to match the rest of the linking in the file.

Bruce

Quoted 10 lines
meta/classes/kernel.bbclass +0 -1
        install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
        install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
        install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
--

1.7.0.4

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

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

Re: [PATCH] linux-dtb.inc: Run dts through the preprocessor

In reply to Bruce Ashfield
Quoted 17 lines

-----Original Message-----
From: Bruce Ashfield [mailto:[email protected]]
Sent: Wednesday, August 14, 2013 10:25 AM
To: Cooper Jr., Franklin
Cc: Patches and discussions about the oe-core layer; Otavio Salvador
Subject: Re: [OE-core] [PATCH] linux-dtb.inc: Run dts through the preprocessor

Quoted 5 lines · Franklin S. Cooper Jr

* In the 3.11 kernel some dts files now include C code that must first run through the preprocessor.
* Update building the dtb by first running the dts file through the user's compiler before building using the device tree compiler.
* The logic used is based on mainline u-boot dts/Makefile.

Quoted 7 lines

We are already working through a change from Otavio that changes the way we build DTB files, using the in kernel resources.

So this shouldn't be required in the end, or at least heavily modified.

So I suggest we hold on this change for now, and rebase it once the patch I mentioned is merged.

No issue on my end. As long as one of our patches makes it in master and Dylan I will be happy.

Quoted 47 lines

Bruce

meta/recipes-kernel/linux/linux-dtb.inc do_install_append() { · line 21

Quoted 13 lines
---
 meta/recipes-kernel/linux/linux-dtb.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
meta/recipes-kernel/linux/linux-dtb.inc +0 -0
index 41dd599..f1aafa2 100644
@@ -21,7 +21,10 @@ do_install_append() {
                        DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print

$1}'`

meta/recipes-kernel/linux/linux-dtb.inc do_install_append() { · line 22

Quoted 1 line
meta/recipes-kernel/linux/linux-dtb.inc +0 -0
                        DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed

"s/${MACHINE}/${DTS_BASE_NAME}/g"`

meta/recipes-kernel/linux/linux-dtb.inc do_install_append() { · line 23

Quoted 1 line
meta/recipes-kernel/linux/linux-dtb.inc +0 -0
                        DTB_SYMLINK_NAME=`echo

${KERNEL_IMAGE_SYMLINK_NAME} | sed
"s/${MACHINE}/${DTS_BASE_NAME}/g"`

meta/recipes-kernel/linux/linux-dtb.inc do_install_append() { · line 24

Quoted 1 line
meta/recipes-kernel/linux/linux-dtb.inc +0 -1
-                       dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o

${DTS_BASE_NAME} ${DTS_FILE}

meta/recipes-kernel/linux/linux-dtb.inc do_install_append() {

Quoted 3 lines
meta/recipes-kernel/linux/linux-dtb.inc +3 -0
+
+                       cat ${DTS_FILE} | \
+                               ${CPP} -x assembler-with-cpp -I ./include/ -I

./arch/${ARCH}/boot/dts - | \

meta/recipes-kernel/linux/linux-dtb.inc do_install_append() { · line 29

Quoted 3 lines
meta/recipes-kernel/linux/linux-dtb.inc +2 -0
+                               dtc ${KERNEL_DEVICETREE_FLAGS} -O dtb
+ -o ${DTS_BASE_NAME} -i arch/${ARCH}/boot/dts/ -
                        install -m 0644 ${DTS_BASE_NAME}

${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb

Quoted 9 lines
meta/recipes-kernel/linux/linux-dtb.inc +0 -1
                done
        fi
--

1.7.0.4

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"