Skip to contentSkip to conversation

linux-dtb: add multi-dtb build support and keep dtb in deploy cache package

PATCH Superseded [email protected] 3 participants 4 messages Jan 6, 2012

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 linux-dtb: add multi-dtb build support and keep dtb in deploy cache package

From: Zhenhua Luo <[email protected]>

---
 meta/recipes-kernel/linux/linux-dtb.inc |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)
meta/recipes-kernel/linux/linux-dtb.inc +21 -9
index 7ec7584..5439810 100644
@@ -13,15 +13,27 @@ python __anonymous () {
 	d.setVar("PACKAGES", "%s kernel-devicetree" % packages)
 }
 
-do_install_append() {
+kernel_do_deploy_append() {
     if test -n "${KERNEL_DEVICETREE}"; then
-	dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE}
-	install -m 0644 devicetree ${D}/boot/devicetree-${KERNEL_VERSION}
-	install -d ${DEPLOY_DIR_IMAGE}
-	install -m 0644 devicetree ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.dtb
-	cd ${DEPLOY_DIR_IMAGE}
-	rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
-	ln -sf ${KERNEL_IMAGE_BASE_NAME}.dtb ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
+        for DTS_FILE in ${KERNEL_DEVICETREE}; do
+            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 devicetree ${DTS_FILE}
+            install -m 0644 devicetree ${D}/boot/devicetree-${DTS_BASE_NAME}-${KERNEL_VERSION}
+            install -d ${DEPLOY_DIR_IMAGE}
+            install -m 0644 devicetree ${DEPLOY_DIR_IMAGE}/${DTB_NAME}.dtb
+            rm -f devicetree
+            cd ${DEPLOY_DIR_IMAGE}
+            rm -f ${DTB_SYMLINK_NAME}.dtb
+            ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
+            cd -
+
+            install -d ${DEPLOYDIR}
+            install -m 0644 ${DEPLOY_DIR_IMAGE}/${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_NAME}.dtb
+            cd ${DEPLOYDIR}
+            ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME=}.dtb
+            cd -
+        done
     fi
 }
-
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 7 lines · On Thu, Jan 5, 2012 at 11:57 PM, <[email protected]> wrote:

+            ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
+            cd -
+
+            install -d ${DEPLOYDIR}
+            install -m 0644 ${DEPLOY_DIR_IMAGE}/${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_NAME}.dtb
+            cd ${DEPLOYDIR}
+            ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME=}.dtb

Can you elaborate why we are doing these things twice? Is on for the cache and one for the current deploy dir or something?

-M

#2 lore raw
In reply to [email protected]
Quoted 33 lines · On 01/05/2012 09:57 PM, [email protected] wrote:

From: Zhenhua Luo<[email protected]>

---
  meta/recipes-kernel/linux/linux-dtb.inc |   30 +++++++++++++++++++++---------
  1 files changed, 21 insertions(+), 9 deletions(-)
meta/recipes-kernel/linux/linux-dtb.inc +9 -8
index 7ec7584..5439810 100644
@@ -13,15 +13,27 @@ python __anonymous () {
  	d.setVar("PACKAGES", "%s kernel-devicetree" % packages)
  }
 
-do_install_append() {
+kernel_do_deploy_append() {
      if test -n "${KERNEL_DEVICETREE}"; then
-	dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE}
-	install -m 0644 devicetree ${D}/boot/devicetree-${KERNEL_VERSION}
-	install -d ${DEPLOY_DIR_IMAGE}
-	install -m 0644 devicetree ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.dtb
-	cd ${DEPLOY_DIR_IMAGE}
-	rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
-	ln -sf ${KERNEL_IMAGE_BASE_NAME}.dtb ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
+        for DTS_FILE in ${KERNEL_DEVICETREE}; do
+            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 devicetree ${DTS_FILE}
+            install -m 0644 devicetree ${D}/boot/devicetree-${DTS_BASE_NAME}-${KERNEL_VERSION}
+            install -d ${DEPLOY_DIR_IMAGE}
+            install -m 0644 devicetree ${DEPLOY_DIR_IMAGE}/${DTB_NAME}.dtb

meta/recipes-kernel/linux/linux-dtb.inc python __anonymous () { · line 35

Quoted 10 lines
meta/recipes-kernel/linux/linux-dtb.inc +10 -0
+            rm -f devicetree
+            cd ${DEPLOY_DIR_IMAGE}
+            rm -f ${DTB_SYMLINK_NAME}.dtb
+            ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
+            cd -
+
+            install -d ${DEPLOYDIR}
+            install -m 0644 ${DEPLOY_DIR_IMAGE}/${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_NAME}.dtb
+            cd ${DEPLOYDIR}
+            ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME=}.dtb

Should there be an '=' at the end of this?

Sau!

Quoted 5 lines
meta/recipes-kernel/linux/linux-dtb.inc +2 -1
+            cd -
+        done
      fi
  }
-
#3 lore raw

"=" is needless, I will fix the error. Seems it doesn't impact the result. :)

Best Regards,

Zhenhua

Quoted 70 lines

-----Original Message-----
From: Saul Wold [mailto:[email protected]]
Sent: Friday, January 06, 2012 3:06 PM
To: Patches and discussions about the oe-core layer
Cc: Luo Zhenhua-B19537
Subject: Re: [OE-core] [PATCH oe-core v4] linux-dtb: add multi-dtb build support and keep dtb in deploy cache package

Quoted 5 lines · On 01/05/2012 09:57 PM, [email protected] wrote:

From: Zhenhua Luo<[email protected]>

---
  meta/recipes-kernel/linux/linux-dtb.inc |   30 +++++++++++++++++++++--------

-

meta/recipes-

Quoted 3 lines
  1 files changed, 21 insertions(+), 9 deletions(-)
meta/recipes- renamed from meta/recipes-kernel/linux/linux-dtb.inc +0 -0

kernel/linux/linux-dtb.inc

meta/recipes-kernel/linux/linux-dtb.inc python __anonymous () { · line 18

Quoted 11 lines

index 7ec7584..5439810 100644

meta/recipes-kernel/linux/linux-dtb.inc +1 -2
@@ -13,15 +13,27 @@ python __anonymous () {
  	d.setVar("PACKAGES", "%s kernel-devicetree" % packages)
  }
 
-do_install_append() {
+kernel_do_deploy_append() {
      if test -n "${KERNEL_DEVICETREE}"; then
-	dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree

${KERNEL_DEVICETREE}

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

Quoted 3 lines
meta/recipes-kernel/linux/linux-dtb.inc +0 -3
-	install -m 0644 devicetree ${D}/boot/devicetree-${KERNEL_VERSION}
-	install -d ${DEPLOY_DIR_IMAGE}
-	install -m 0644 devicetree

${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.dtb

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

Quoted 6 lines
meta/recipes-kernel/linux/linux-dtb.inc +3 -3
-	cd ${DEPLOY_DIR_IMAGE}
-	rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
-	ln -sf ${KERNEL_IMAGE_BASE_NAME}.dtb ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
+        for DTS_FILE in ${KERNEL_DEVICETREE}; do
+            DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
+            DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed

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

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

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

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

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

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

${DTS_FILE}

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

Quoted 1 line
meta/recipes-kernel/linux/linux-dtb.inc +1 -0
+            install -m 0644 devicetree ${D}/boot/devicetree-${DTS_BASE_NAME}-

${KERNEL_VERSION}

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

Quoted 10 lines
meta/recipes-kernel/linux/linux-dtb.inc +10 -0
+            install -d ${DEPLOY_DIR_IMAGE}
+            install -m 0644 devicetree ${DEPLOY_DIR_IMAGE}/${DTB_NAME}.dtb
+            rm -f devicetree
+            cd ${DEPLOY_DIR_IMAGE}
+            rm -f ${DTB_SYMLINK_NAME}.dtb
+            ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
+            cd -
+
+            install -d ${DEPLOYDIR}
+            install -m 0644 ${DEPLOY_DIR_IMAGE}/${DTB_NAME}.dtb

${DEPLOYDIR}/${DTB_NAME}.dtb

meta/recipes-kernel/linux/linux-dtb.inc python __anonymous () { · line 35

Quoted 2 lines
meta/recipes-kernel/linux/linux-dtb.inc +2 -0
+            cd ${DEPLOYDIR}
+            ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME=}.dtb

Should there be an '=' at the end of this?

Sau!

Quoted 5 lines
meta/recipes-kernel/linux/linux-dtb.inc +2 -1
+            cd -
+        done
      fi
  }
-