From: Stefan Christ <s.christ@phytec.de>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 5/7] linux-dtb.inc: explicit test for empty string not needed
Date: Mon, 19 Oct 2015 10:15:39 +0200 [thread overview]
Message-ID: <1445242541-41638-6-git-send-email-s.christ@phytec.de> (raw)
In-Reply-To: <1445242541-41638-1-git-send-email-s.christ@phytec.de>
The for loop already handles the case when KERNEL_DEVICETREE is empty.
Signed-off-by: Stefan Christ <s.christ@phytec.de>
---
meta/recipes-kernel/linux/linux-dtb.inc | 78 +++++++++++++++------------------
1 file changed, 36 insertions(+), 42 deletions(-)
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
index f44851a..5bfd33b 100644
--- a/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -6,54 +6,48 @@ python __anonymous () {
}
do_compile_append() {
- if test -n "${KERNEL_DEVICETREE}"; then
- for DTB in ${KERNEL_DEVICETREE}; do
- if echo ${DTB} | grep -q '\.dts$'; then
- bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- fi
- oe_runmake ${DTB}
- done
- fi
+ for DTB in ${KERNEL_DEVICETREE}; do
+ if echo ${DTB} | grep -q '\.dts$'; then
+ bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+ DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+ fi
+ oe_runmake ${DTB}
+ done
}
do_install_append() {
- if test -n "${KERNEL_DEVICETREE}"; then
- for DTB in ${KERNEL_DEVICETREE}; do
- if echo ${DTB} | grep -q '\.dts$'; then
- bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- fi
- DTB_BASE_NAME=`basename ${DTB} .dtb`
- DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
- fi
- install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
- done
- fi
+ for DTB in ${KERNEL_DEVICETREE}; do
+ if echo ${DTB} | grep -q '\.dts$'; then
+ bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+ DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+ fi
+ DTB_BASE_NAME=`basename ${DTB} .dtb`
+ DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+ if [ ! -e "${DTB_PATH}" ]; then
+ DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+ fi
+ install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
+ done
}
do_deploy_append() {
- if test -n "${KERNEL_DEVICETREE}"; then
- for DTB in ${KERNEL_DEVICETREE}; do
- if echo ${DTB} | grep -q '\.dts$'; then
- bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- fi
- DTB_BASE_NAME=`basename ${DTB} .dtb`
- DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
- fi
- install -d ${DEPLOYDIR}
- install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
- ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb
- done
- fi
+ for DTB in ${KERNEL_DEVICETREE}; do
+ if echo ${DTB} | grep -q '\.dts$'; then
+ bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+ DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+ fi
+ DTB_BASE_NAME=`basename ${DTB} .dtb`
+ DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+ if [ ! -e "${DTB_PATH}" ]; then
+ DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+ fi
+ install -d ${DEPLOYDIR}
+ install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
+ ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb
+ done
}
pkg_postinst_kernel-devicetree () {
--
1.9.1
next prev parent reply other threads:[~2015-10-19 8:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 8:15 [PATCH 0/7] Two fixes and some changes for linux-dtb.inc Stefan Christ
2015-10-19 8:15 ` [PATCH 1/7] linux-dtb.inc: fix detection of ending '.dts' Stefan Christ
2015-10-19 8:27 ` Nicolas Dechesne
2015-10-19 9:03 ` Stefan Christ
2015-10-19 9:05 ` Nicolas Dechesne
2015-10-19 9:21 ` Stefan Christ
2015-10-19 9:46 ` Nicolas Dechesne
2015-10-23 21:17 ` Burton, Ross
2015-10-26 8:18 ` Stefan Christ
2015-10-19 8:15 ` [PATCH 2/7] linux-dtb.inc: fix file ending detection Stefan Christ
2015-10-19 8:15 ` [PATCH 3/7] linux-dtb.inc: remove unneeded 'cd' Stefan Christ
2015-10-19 8:15 ` [PATCH 4/7] linux-dtb.inc: use same variable name DTB for all elements of KERNEL_DEVICETREE Stefan Christ
2015-10-19 8:15 ` Stefan Christ [this message]
2015-10-19 8:15 ` [PATCH 6/7] linux-dtb.inc: refactor common code to function normalize_dtb Stefan Christ
2015-10-19 8:15 ` [PATCH 7/7] linux-dtb.inc: refactor common code to function get_real_dtb_path_in_kernel Stefan Christ
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1445242541-41638-6-git-send-email-s.christ@phytec.de \
--to=s.christ@phytec.de \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.