* [RFC][PATCH 0/5] Kernel artifacts naming changes
@ 2017-11-20 20:11 Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 1/5] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
` (5 more replies)
0 siblings, 6 replies; 30+ messages in thread
From: Martin Jansa @ 2017-11-20 20:11 UTC (permalink / raw)
To: openembedded-core
This is only RFC, because it wasn't tested in all possible combinations
people might use.
I did some limited testing with raspberrypi3 and raspberrypi3-64 with
default configuration and also our modified naming where rpi builds
were failing and we had to use our own sdcard_image-rpi.bbclass to
work around it.
Basically all our build artifacts from jenkins jobs contain values like
product version, type of build, build number (or just release name for
"release" jobs).
For that we modify variables like:
IMAGE_NAME, IMAGE_LINK_NAME, INITRAMFS_IMAGE_NAME, KERNEL_IMAGE_BASE_NAME,
KERNEL_IMAGE_SYMLINK_NAME, MODULE_IMAGE_BASE_NAME, MODULE_IMAGE_SYMLINK_NAME
and it works OK, but only until some other bbclasses are assuming that
these variables are still using default value (e.g. -${MACHINE} in
KERNEL_IMAGE_SYMLINK_NAME.
Things are actually a bit worse, we want to use the same version suffix
across all artifacts, even when some of them were actually reused from sstate
- e.g. if build number 6 reuses kernel.do_deploy sstate archive created in
build number 5, then kernel artifacts would be named with -5 and image with -6.
So we cannot use vardepsexclude for the build number (like the default
values do for DATETIME). But that would require reexecuting actual kernel
do_deploy task every single build (and as it depends on tasks like kernel.do_install
it's not just relativey fast do_deploy, but whole kernel build).
Instead we changed the variables to create the artifacts without any version
in sstate covered tasks (so kernel.do_deploy produces just files without any
version (like default KERNEL_IMAGE_SYMLINK_NAME) and then we execute separate
very fast do_kernel_fixup task, which adds versioned _hard_ link (instead of
symlink, so that we can update or remove the file without version and the
versioned file is still usable).
And that's still not enough, few found that some tools which we use in do_rootfs
sometimes modify instead of overwrite the file in deploy (so that the file
with versioned name was modified during the next build through the file without
the version).
And as a last step we also had to update many task dependencies, where the task
was depending on do_deploy and we actually needed the task to depend on
do_deploy_fixup.
This RFC doesn't implement it all, but it makes naming all the artifacts in
consistent way a bit easier. If there is an agreement that OE should support
the naming scenario described above, I'll submit the rest of the changes.
Regards,
The following changes since commit a17f3ec910366e9e7551fa24fbc07929b9584341:
dhcp: fix build issue with libxml2 support (2017-11-10 14:44:31 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib jansa/kernel
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=jansa/kernel
Martin Jansa (5):
kernel-devicetree.bbclass: Use lowercase names for shell variables
kernel-devicetree.bbclass: Fix and simplify instalation of DTB files
kernel-devicetree.bbclass: build DTBs with make dtbs
kernel.bbclass: use the consistent naming schema for initramfs
kernel.bbclass: move variables for kernel artifacts names to separate
bbclass
meta/classes/kernel-artifact-names.bbclass | 19 +++++++
meta/classes/kernel-devicetree.bbclass | 89 ++++++++++++------------------
meta/classes/kernel.bbclass | 26 ++-------
3 files changed, 60 insertions(+), 74 deletions(-)
create mode 100644 meta/classes/kernel-artifact-names.bbclass
--
2.7.4
^ permalink raw reply [flat|nested] 30+ messages in thread
* [RFC][PATCH 1/5] kernel-devicetree.bbclass: Use lowercase names for shell variables
2017-11-20 20:11 [RFC][PATCH 0/5] Kernel artifacts naming changes Martin Jansa
@ 2017-11-20 20:11 ` Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 2/5] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
` (4 subsequent siblings)
5 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2017-11-20 20:11 UTC (permalink / raw)
To: openembedded-core
* just to make it more clear what is local shell variable and what is
replaced by bitbake from the metadata and also to prevent the variable
to be incorrectly expanded by bitbake if someone happens to define
e.g. DTB_BASE_NAME
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 80 +++++++++++++++++-----------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 6e08be4..3dca652 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -10,21 +10,21 @@ FILES_kernel-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin"
KERNEL_DEVICETREE_BUNDLE ?= "0"
normalize_dtb () {
- DTB="$1"
- 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'`
+ dtb="$1"
+ 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
- echo "${DTB}"
+ echo "$dtb"
}
get_real_dtb_path_in_kernel () {
- DTB="$1"
- DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+ dtb="$1"
+ dtb_path="${B}/arch/${ARCH}/boot/dts/$dtb"
+ if [ ! -e "$dtb_path" ]; then
+ dtb_path="${B}/arch/${ARCH}/boot/$dtb"
fi
- echo "${DTB_PATH}"
+ echo "$dtb_path"
}
do_configure_append() {
@@ -50,61 +50,61 @@ do_configure_append() {
}
do_compile_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- oe_runmake ${DTB}
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ oe_runmake $dtb
done
}
do_install_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- DTB_EXT=${DTB##*.}
- DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
- install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT}
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
+ dtb_base_name=`basename $dtb ."$dtb_ext"`
+ install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT}
+ dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
cat ${D}/${KERNEL_IMAGEDEST}/$type \
- ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} \
- > ${D}/${KERNEL_IMAGEDEST}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
+ > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
fi
done
done
}
do_deploy_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- DTB_EXT=${DTB##*.}
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb ."$dtb_ext"`
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- DTB_NAME=`echo ${base_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
+ dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
install -d ${DEPLOYDIR}
- install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}
- ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT}
- ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_BASE_NAME}.${DTB_EXT}
+ install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
+ ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
+ ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
cat ${DEPLOYDIR}/$type \
- ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
- > ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin
- ln -sf ${DTB_NAME}.${DTB_EXT}.bin ${DEPLOYDIR}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ${DEPLOYDIR}/$dtb_name.$dtb_ext \
+ > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
+ ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
- ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
- > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin
- ln -sf ${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin \
- ${DEPLOYDIR}/${type}-initramfs-${DTB_BASE_NAME}.${DTB_EXT}-${MACHINE}.bin
+ ${DEPLOYDIR}/$dtb_name.$dtb_ext \
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
+ ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
fi
fi
done
--
2.7.4
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [RFC][PATCH 2/5] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files
2017-11-20 20:11 [RFC][PATCH 0/5] Kernel artifacts naming changes Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 1/5] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
@ 2017-11-20 20:11 ` Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 3/5] kernel-devicetree.bbclass: build DTBs with make dtbs Martin Jansa
` (3 subsequent siblings)
5 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2017-11-20 20:11 UTC (permalink / raw)
To: openembedded-core
* add 2 new variables:
KERNEL_DTB_BASE_NAME
KERNEL_DTB_SYMLINK_NAME
instead of reusing KERNEL_IMAGE_SYMLINK_NAME and than expecting that
default value ${MACHINE} was being used in e.g.:
DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
* install normal DTB files only once even if there is multiple entries
in KERNEL_IMAGETYPE_FOR_MAKE and don't prefix them with the type of
the kernel image, use the KERNEL_IMAGETYPE_FOR_MAKE as a prefix only
when installing them bundled with kernel or initramfs image.
* deploy the files from ${D}/${KERNEL_IMAGEDEST}/ instead of kernel
build directory, so that we don't need to call
DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
again in do_deploy
* create all links in do_deploy task, because default KERNEL_DTB_BASE_NAME
like KERNEL_IMAGE_BASE_NAME contains PKGR and PKGR is different in
do_install and do_deploy, because kernel.bbclass calls
meta/classes/kernel.bbclass:do_install[prefuncs] += "package_get_auto_pr"
meta/classes/kernel.bbclass:do_deploy[prefuncs] += "package_get_auto_pr"
* the filenames are a bit different, but with separate variable it
should be easier for other bbclasses which use these DTB files to
find them correctly, just use either the cannonical name
$dtb_base_name.$dtb_ext or $dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
because PKGR (and other PKG* variables) might be different in your
task and kernel.do_deploy task.
* fix DTB files being deployed with incorrect filenames when
KERNEL_IMAGE_SYMLINK_NAME isn't set to ${MACHINE}, e.g. instead of
the default:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 07:41 deploy/images/raspberrypi3-64/Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/Image-lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
I was getting:
-rw-r--r-- 2 bitbake bitbake 1348 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi-master-20171120102653.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
and e.g. sdcard_image-rpi.bbclass from meta-raspberrypi:
https://github.com/agherzan/meta-raspberrypi/blob/37e4e18f4a745ce8dc11f7e40a29da0859ff13c6/classes/sdcard_image-rpi.bbclass
was failing in:
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
because ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb doesn't exist in my
build, due to
DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
not replacing whole "${KERNEL_IMAGE_SYMLINK_NAME}" (read ${MACHINE})
with just ${DTB_BASE_NAME}
* with this change applied the deploy dir looks like this:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-raspberrypi3-64.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
and works correctly even with DISTRO using different naming scheme
* the sdcard_image-rpi.bbclass still needs to be modified, I've provided
updated version here:
https://github.com/agherzan/meta-raspberrypi/pull/159
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 47 +++++++++++-----------------------
meta/classes/kernel.bbclass | 3 +++
2 files changed, 18 insertions(+), 32 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 3dca652..de12f26 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -60,20 +60,9 @@ do_install_append() {
for dtbf in ${KERNEL_DEVICETREE}; do
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb .$dtb_ext`
dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
- dtb_base_name=`basename $dtb ."$dtb_ext"`
install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
- for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
-
- if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
- cat ${D}/${KERNEL_IMAGEDEST}/$type \
- ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
- > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
- fi
- done
done
}
@@ -81,30 +70,24 @@ do_deploy_append() {
for dtbf in ${KERNEL_DEVICETREE}; do
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
- dtb_base_name=`basename $dtb ."$dtb_ext"`
+ dtb_base_name=`basename $dtb .$dtb_ext`
+ install -d ${DEPLOYDIR}
+ install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
+ ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
+ ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
- symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
- install -d ${DEPLOYDIR}
- install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
- ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
- ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
-
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
- cat ${DEPLOYDIR}/$type \
- ${DEPLOYDIR}/$dtb_name.$dtb_ext \
- > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
- ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
-
+ cat ${D}/${KERNEL_IMAGEDEST}/$type \
+ ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext \
+ > ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
+ ln -sf $type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
+ ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
- ${DEPLOYDIR}/$dtb_name.$dtb_ext \
- > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
- ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
- ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
+ ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
+ ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
fi
fi
done
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 756707a..8752af7 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -618,6 +618,9 @@ KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package signatures
KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
--
2.7.4
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [RFC][PATCH 3/5] kernel-devicetree.bbclass: build DTBs with make dtbs
2017-11-20 20:11 [RFC][PATCH 0/5] Kernel artifacts naming changes Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 1/5] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 2/5] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
@ 2017-11-20 20:11 ` Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 4/5] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
` (2 subsequent siblings)
5 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2017-11-20 20:11 UTC (permalink / raw)
To: openembedded-core
* migrate meta-raspberrypi change from Khem Raj:
https://github.com/agherzan/meta-raspberrypi/commit/6c4de0b5fe44b8e661f1391ee8540a7f04d75315#diff-9b732ab86ef3483bb0e54684c28fd84b
to be applied for all MACHINEs
* as a bonus, the raspberrypi3-64 won't be built twice
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index de12f26..1a1aa69 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -50,10 +50,8 @@ do_configure_append() {
}
do_compile_append() {
- for dtbf in ${KERNEL_DEVICETREE}; do
- dtb=`normalize_dtb "$dtbf"`
- oe_runmake $dtb
- done
+ cc_extra=$(get_cc_option)
+ oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
}
do_install_append() {
--
2.7.4
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [RFC][PATCH 4/5] kernel.bbclass: use the consistent naming schema for initramfs
2017-11-20 20:11 [RFC][PATCH 0/5] Kernel artifacts naming changes Martin Jansa
` (2 preceding siblings ...)
2017-11-20 20:11 ` [RFC][PATCH 3/5] kernel-devicetree.bbclass: build DTBs with make dtbs Martin Jansa
@ 2017-11-20 20:11 ` Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 5/5] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2017-11-21 11:58 ` [RFC][PATCH 0/5] Kernel artifacts naming changes Otavio Salvador
5 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2017-11-20 20:11 UTC (permalink / raw)
To: openembedded-core
* use INITRAMFS_BASE_NAME and INITRAMFS_SYMLINK_NAME variables, like
other kernel artifacts are using
* use "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" instead of
"${PV}-${PR}-${MACHINE}-${DATETIME}" to be consistent with other files
* allow to modify default symlink name with INITRAMFS_SYMLINK_NAME
instead of currently used:
initramfs_symlink_name=${type}-initramfs-${MACHINE}
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel.bbclass | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 8752af7..9ec7dd2 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -199,8 +199,6 @@ copy_initramfs() {
echo "Finished copy of initramfs into ./usr"
}
-INITRAMFS_BASE_NAME ?= "initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}"
-INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
do_bundle_initramfs () {
if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
echo "Creating a kernel image with a bundled initramfs..."
@@ -628,6 +626,10 @@ MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
MODULE_TARBALL_DEPLOY ?= "1"
+INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+
kernel_do_deploy() {
for type in ${KERNEL_IMAGETYPES} ; do
base_name=${type}-${KERNEL_IMAGE_BASE_NAME}
@@ -646,17 +648,14 @@ kernel_do_deploy() {
ln -sf ${base_name}.bin ${DEPLOYDIR}/${type}
done
- cd ${B}
- # Update deploy directory
- for type in ${KERNEL_IMAGETYPES} ; do
- if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
- echo "Copying deploy ${type} kernel-initramfs image and setting up links..."
+ if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
+ for type in ${KERNEL_IMAGETYPES} ; do
initramfs_base_name=${type}-${INITRAMFS_BASE_NAME}
- initramfs_symlink_name=${type}-initramfs-${MACHINE}
+ initramfs_symlink_name=${type}-${INITRAMFS_SYMLINK_NAME}
install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin
ln -sf ${initramfs_base_name}.bin ${DEPLOYDIR}/${initramfs_symlink_name}.bin
- fi
- done
+ done
+ fi
}
do_deploy[cleandirs] = "${DEPLOYDIR}"
do_deploy[dirs] = "${DEPLOYDIR} ${B}"
--
2.7.4
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [RFC][PATCH 5/5] kernel.bbclass: move variables for kernel artifacts names to separate bbclass
2017-11-20 20:11 [RFC][PATCH 0/5] Kernel artifacts naming changes Martin Jansa
` (3 preceding siblings ...)
2017-11-20 20:11 ` [RFC][PATCH 4/5] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
@ 2017-11-20 20:11 ` Martin Jansa
2017-11-21 11:58 ` [RFC][PATCH 0/5] Kernel artifacts naming changes Otavio Salvador
5 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2017-11-20 20:11 UTC (permalink / raw)
To: openembedded-core
* this makes it easier to access these variables from some other bbclass
e.g. sdcard_image-rpi.bbclass in meta-raspberry where we need to know
how some files in deploy are named, but we cannot inherit kernel.bbclass
as it's used in image recipe not kernel recipe
* alternatively we can move these to bitbake.conf like similar image variables are:
meta/conf/bitbake.conf:IMAGE_BASENAME = "${PN}"
meta/conf/bitbake.conf:IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
meta/conf/bitbake.conf:IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-artifact-names.bbclass | 19 +++++++++++++++++++
meta/classes/kernel.bbclass | 18 +-----------------
2 files changed, 20 insertions(+), 17 deletions(-)
create mode 100644 meta/classes/kernel-artifact-names.bbclass
diff --git a/meta/classes/kernel-artifact-names.bbclass b/meta/classes/kernel-artifact-names.bbclass
new file mode 100644
index 0000000..d696888
--- /dev/null
+++ b/meta/classes/kernel-artifact-names.bbclass
@@ -0,0 +1,19 @@
+KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+# Don't include the DATETIME variable in the sstate package signatures
+KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+
+KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
+
+MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+
+MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
+MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
+MODULE_TARBALL_DEPLOY ?= "1"
+
+INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 9ec7dd2..455f939 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -612,23 +612,7 @@ do_sizecheck[dirs] = "${B}"
addtask sizecheck before do_install after do_strip
-KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-# Don't include the DATETIME variable in the sstate package signatures
-KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
-KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
-MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
-# Don't include the DATETIME variable in the sstate package signatures
-MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
-MODULE_TARBALL_DEPLOY ?= "1"
-
-INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
-INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+inherit kernel-artifact-names
kernel_do_deploy() {
for type in ${KERNEL_IMAGETYPES} ; do
--
2.7.4
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [RFC][PATCH 0/5] Kernel artifacts naming changes
2017-11-20 20:11 [RFC][PATCH 0/5] Kernel artifacts naming changes Martin Jansa
` (4 preceding siblings ...)
2017-11-20 20:11 ` [RFC][PATCH 5/5] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
@ 2017-11-21 11:58 ` Otavio Salvador
2018-07-02 14:16 ` Martin Jansa
5 siblings, 1 reply; 30+ messages in thread
From: Otavio Salvador @ 2017-11-21 11:58 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
Hello Martin,
On Mon, Nov 20, 2017 at 6:11 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
...
> This RFC doesn't implement it all, but it makes naming all the artifacts in
> consistent way a bit easier. If there is an agreement that OE should support
> the naming scenario described above, I'll submit the rest of the changes.
I think it all makes sense and if we preserve current behavior as
default I see it as a very good addition :-)
I didn't test the patches myself and I'd like to do a more extensive
test once you send the full patchset.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [RFC][PATCH 0/5] Kernel artifacts naming changes
2017-11-21 11:58 ` [RFC][PATCH 0/5] Kernel artifacts naming changes Otavio Salvador
@ 2018-07-02 14:16 ` Martin Jansa
2018-07-02 16:56 ` Otavio Salvador
` (3 more replies)
0 siblings, 4 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-02 14:16 UTC (permalink / raw)
To: Otavio Salvador; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
Any comment about this RFC?
Should I send rebased version?
On Tue, Nov 21, 2017 at 12:58 PM Otavio Salvador <
otavio.salvador@ossystems.com.br> wrote:
> Hello Martin,
>
> On Mon, Nov 20, 2017 at 6:11 PM, Martin Jansa <martin.jansa@gmail.com>
> wrote:
> ...
> > This RFC doesn't implement it all, but it makes naming all the artifacts
> in
> > consistent way a bit easier. If there is an agreement that OE should
> support
> > the naming scenario described above, I'll submit the rest of the changes.
>
> I think it all makes sense and if we preserve current behavior as
> default I see it as a very good addition :-)
>
> I didn't test the patches myself and I'd like to do a more extensive
> test once you send the full patchset.
>
> --
> Otavio Salvador O.S. Systems
> http://www.ossystems.com.br http://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
>
[-- Attachment #2: Type: text/html, Size: 1528 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [RFC][PATCH 0/5] Kernel artifacts naming changes
2018-07-02 14:16 ` Martin Jansa
@ 2018-07-02 16:56 ` Otavio Salvador
2018-07-02 22:07 ` [PATCHv2 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
` (2 subsequent siblings)
3 siblings, 0 replies; 30+ messages in thread
From: Otavio Salvador @ 2018-07-02 16:56 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
On Mon, Jul 2, 2018 at 11:16 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> Any comment about this RFC?
>
> Should I send rebased version?
Yes, please.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCHv2 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables
2018-07-02 14:16 ` Martin Jansa
2018-07-02 16:56 ` Otavio Salvador
@ 2018-07-02 22:07 ` Martin Jansa
2018-07-02 22:07 ` [PATCHv2 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
` (2 more replies)
2018-07-04 7:59 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2018-07-04 20:06 ` [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb" Martin Jansa
3 siblings, 3 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-02 22:07 UTC (permalink / raw)
To: openembedded-core
* just to make it more clear what is local shell variable and what is
replaced by bitbake from the metadata and also to prevent the variable
to be incorrectly expanded by bitbake if someone happens to define
e.g. DTB_BASE_NAME
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 80 +++++++++++++-------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 4f80cc62eb..10441475e8 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -10,21 +10,21 @@ FILES_${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-
KERNEL_DEVICETREE_BUNDLE ?= "0"
normalize_dtb () {
- DTB="$1"
- 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'`
+ dtb="$1"
+ 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
- echo "${DTB}"
+ echo "$dtb"
}
get_real_dtb_path_in_kernel () {
- DTB="$1"
- DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+ dtb="$1"
+ dtb_path="${B}/arch/${ARCH}/boot/dts/$dtb"
+ if [ ! -e "$dtb_path" ]; then
+ dtb_path="${B}/arch/${ARCH}/boot/$dtb"
fi
- echo "${DTB_PATH}"
+ echo "$dtb_path"
}
do_configure_append() {
@@ -50,61 +50,61 @@ do_configure_append() {
}
do_compile_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- oe_runmake ${DTB}
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ oe_runmake $dtb
done
}
do_install_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- DTB_EXT=${DTB##*.}
- DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
- install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT}
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
+ dtb_base_name=`basename $dtb ."$dtb_ext"`
+ install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT}
+ dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
cat ${D}/${KERNEL_IMAGEDEST}/$type \
- ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} \
- > ${D}/${KERNEL_IMAGEDEST}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
+ > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
fi
done
done
}
do_deploy_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- DTB_EXT=${DTB##*.}
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb ."$dtb_ext"`
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- DTB_NAME=`echo ${base_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
+ dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
install -d ${DEPLOYDIR}
- install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}
- ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT}
- ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_BASE_NAME}.${DTB_EXT}
+ install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
+ ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
+ ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
cat ${DEPLOYDIR}/$type \
- ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
- > ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin
- ln -sf ${DTB_NAME}.${DTB_EXT}.bin ${DEPLOYDIR}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ${DEPLOYDIR}/$dtb_name.$dtb_ext \
+ > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
+ ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
- ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
- > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin
- ln -sf ${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin \
- ${DEPLOYDIR}/${type}-initramfs-${DTB_BASE_NAME}.${DTB_EXT}-${MACHINE}.bin
+ ${DEPLOYDIR}/$dtb_name.$dtb_ext \
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
+ ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
fi
fi
done
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv2 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files
2018-07-02 22:07 ` [PATCHv2 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
@ 2018-07-02 22:07 ` Martin Jansa
2018-07-02 22:07 ` [PATCHv2 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
2018-07-02 22:07 ` [PATCHv2 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-02 22:07 UTC (permalink / raw)
To: openembedded-core
* add 2 new variables:
KERNEL_DTB_BASE_NAME
KERNEL_DTB_SYMLINK_NAME
instead of reusing KERNEL_IMAGE_SYMLINK_NAME and than expecting that
default value ${MACHINE} was being used in e.g.:
DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
* install normal DTB files only once even if there is multiple entries
in KERNEL_IMAGETYPE_FOR_MAKE and don't prefix them with the type of
the kernel image, use the KERNEL_IMAGETYPE_FOR_MAKE as a prefix only
when installing them bundled with kernel or initramfs image.
* deploy the files from ${D}/${KERNEL_IMAGEDEST}/ instead of kernel
build directory, so that we don't need to call
DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
again in do_deploy
* create all links in do_deploy task, because default KERNEL_DTB_BASE_NAME
like KERNEL_IMAGE_BASE_NAME contains PKGR and PKGR is different in
do_install and do_deploy, because kernel.bbclass calls
meta/classes/kernel.bbclass:do_install[prefuncs] += "package_get_auto_pr"
meta/classes/kernel.bbclass:do_deploy[prefuncs] += "package_get_auto_pr"
* the filenames are a bit different, but with separate variable it
should be easier for other bbclasses which use these DTB files to
find them correctly, just use either the cannonical name
$dtb_base_name.$dtb_ext or $dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
because PKGR (and other PKG* variables) might be different in your
task and kernel.do_deploy task.
* fix DTB files being deployed with incorrect filenames when
KERNEL_IMAGE_SYMLINK_NAME isn't set to ${MACHINE}, e.g. instead of
the default:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 07:41 deploy/images/raspberrypi3-64/Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/Image-lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
I was getting:
-rw-r--r-- 2 bitbake bitbake 1348 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi-master-20171120102653.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
and e.g. sdcard_image-rpi.bbclass from meta-raspberrypi:
https://github.com/agherzan/meta-raspberrypi/blob/37e4e18f4a745ce8dc11f7e40a29da0859ff13c6/classes/sdcard_image-rpi.bbclass
was failing in:
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
because ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb doesn't exist in my
build, due to
DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
not replacing whole "${KERNEL_IMAGE_SYMLINK_NAME}" (read ${MACHINE})
with just ${DTB_BASE_NAME}
* with this change applied the deploy dir looks like this:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-raspberrypi3-64.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
and works correctly even with DISTRO using different naming scheme
* the sdcard_image-rpi.bbclass still needs to be modified, I've provided
updated version here:
https://github.com/agherzan/meta-raspberrypi/pull/159
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 47 ++++++++------------------
meta/classes/kernel.bbclass | 3 ++
2 files changed, 18 insertions(+), 32 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 10441475e8..9c5e125981 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -60,20 +60,9 @@ do_install_append() {
for dtbf in ${KERNEL_DEVICETREE}; do
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb .$dtb_ext`
dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
- dtb_base_name=`basename $dtb ."$dtb_ext"`
install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
- for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
-
- if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
- cat ${D}/${KERNEL_IMAGEDEST}/$type \
- ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
- > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
- fi
- done
done
}
@@ -81,30 +70,24 @@ do_deploy_append() {
for dtbf in ${KERNEL_DEVICETREE}; do
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
- dtb_base_name=`basename $dtb ."$dtb_ext"`
+ dtb_base_name=`basename $dtb .$dtb_ext`
+ install -d ${DEPLOYDIR}
+ install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
+ ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
+ ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
- symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
- install -d ${DEPLOYDIR}
- install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
- ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
- ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
-
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
- cat ${DEPLOYDIR}/$type \
- ${DEPLOYDIR}/$dtb_name.$dtb_ext \
- > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
- ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
-
+ cat ${D}/${KERNEL_IMAGEDEST}/$type \
+ ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext \
+ > ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
+ ln -sf $type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
+ ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
- ${DEPLOYDIR}/$dtb_name.$dtb_ext \
- > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
- ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
- ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
+ ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
+ ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
fi
fi
done
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 3213b932bf..7ce64fd19f 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -663,6 +663,9 @@ KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package signatures
KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv2 3/4] kernel.bbclass: use the consistent naming schema for initramfs
2018-07-02 22:07 ` [PATCHv2 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2018-07-02 22:07 ` [PATCHv2 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
@ 2018-07-02 22:07 ` Martin Jansa
2018-07-02 22:07 ` [PATCHv2 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-02 22:07 UTC (permalink / raw)
To: openembedded-core
* use INITRAMFS_BASE_NAME and INITRAMFS_SYMLINK_NAME variables, like
other kernel artifacts are using
* use "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" instead of
"${PV}-${PR}-${MACHINE}-${DATETIME}" to be consistent with other files
* allow to modify default symlink name with INITRAMFS_SYMLINK_NAME
instead of currently used:
initramfs_symlink_name=${type}-initramfs-${MACHINE}
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel.bbclass | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7ce64fd19f..0045cec819 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -229,8 +229,6 @@ copy_initramfs() {
echo "Finished copy of initramfs into ./usr"
}
-INITRAMFS_BASE_NAME ?= "initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}"
-INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
do_bundle_initramfs () {
if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
echo "Creating a kernel image with a bundled initramfs..."
@@ -673,6 +671,10 @@ MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
MODULE_TARBALL_DEPLOY ?= "1"
+INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+
kernel_do_deploy() {
deployDir="${DEPLOYDIR}"
if [ -n "${KERNEL_DEPLOYSUBDIR}" ]; then
@@ -697,17 +699,14 @@ kernel_do_deploy() {
ln -sf ${base_name}.bin $deployDir/${type}
done
- cd ${B}
- # Update deploy directory
- for type in ${KERNEL_IMAGETYPES} ; do
- if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
- echo "Copying deploy ${type} kernel-initramfs image and setting up links..."
+ if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
+ for type in ${KERNEL_IMAGETYPES} ; do
initramfs_base_name=${type}-${INITRAMFS_BASE_NAME}
- initramfs_symlink_name=${type}-initramfs-${MACHINE}
+ initramfs_symlink_name=${type}-${INITRAMFS_SYMLINK_NAME}
install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs $deployDir/${initramfs_base_name}.bin
ln -sf ${initramfs_base_name}.bin $deployDir/${initramfs_symlink_name}.bin
- fi
- done
+ done
+ fi
}
do_deploy[cleandirs] = "${DEPLOYDIR}"
do_deploy[dirs] = "${DEPLOYDIR} ${B}"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv2 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass
2018-07-02 22:07 ` [PATCHv2 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2018-07-02 22:07 ` [PATCHv2 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
2018-07-02 22:07 ` [PATCHv2 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
@ 2018-07-02 22:07 ` Martin Jansa
2 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-02 22:07 UTC (permalink / raw)
To: openembedded-core
* this makes it easier to access these variables from some other bbclass
e.g. sdcard_image-rpi.bbclass in meta-raspberry where we need to know
how some files in deploy are named, but we cannot inherit kernel.bbclass
as it's used in image recipe not kernel recipe
* alternatively we can move these to bitbake.conf like similar image variables are:
meta/conf/bitbake.conf:IMAGE_BASENAME = "${PN}"
meta/conf/bitbake.conf:IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
meta/conf/bitbake.conf:IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-artifact-names.bbclass | 19 +++++++++++++++++++
meta/classes/kernel.bbclass | 18 +-----------------
2 files changed, 20 insertions(+), 17 deletions(-)
create mode 100644 meta/classes/kernel-artifact-names.bbclass
diff --git a/meta/classes/kernel-artifact-names.bbclass b/meta/classes/kernel-artifact-names.bbclass
new file mode 100644
index 0000000000..d696888322
--- /dev/null
+++ b/meta/classes/kernel-artifact-names.bbclass
@@ -0,0 +1,19 @@
+KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+# Don't include the DATETIME variable in the sstate package signatures
+KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+
+KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
+
+MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+
+MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
+MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
+MODULE_TARBALL_DEPLOY ?= "1"
+
+INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 0045cec819..42efa382ad 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -657,23 +657,7 @@ do_sizecheck[dirs] = "${B}"
addtask sizecheck before do_install after do_strip
-KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-# Don't include the DATETIME variable in the sstate package signatures
-KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
-KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
-MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
-# Don't include the DATETIME variable in the sstate package signatures
-MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
-MODULE_TARBALL_DEPLOY ?= "1"
-
-INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
-INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+inherit kernel-artifact-names
kernel_do_deploy() {
deployDir="${DEPLOYDIR}"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables
2018-07-02 14:16 ` Martin Jansa
2018-07-02 16:56 ` Otavio Salvador
2018-07-02 22:07 ` [PATCHv2 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
@ 2018-07-04 7:59 ` Martin Jansa
2018-07-04 7:59 ` [PATCHv3 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
` (3 more replies)
2018-07-04 20:06 ` [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb" Martin Jansa
3 siblings, 4 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-04 7:59 UTC (permalink / raw)
To: openembedded-core
* just to make it more clear what is local shell variable and what is
replaced by bitbake from the metadata and also to prevent the variable
to be incorrectly expanded by bitbake if someone happens to define
e.g. DTB_BASE_NAME
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 80 +++++++++++++-------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 9866d844ab..5d38d3760d 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -10,21 +10,21 @@ FILES_${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-
KERNEL_DEVICETREE_BUNDLE ?= "0"
normalize_dtb () {
- DTB="$1"
- 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="$1"
+ 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."
fi
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- echo "${DTB}"
+ dtb=`basename $dtb | sed 's,\.dts$,.dtb,g'`
+ echo "$dtb"
}
get_real_dtb_path_in_kernel () {
- DTB="$1"
- DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+ dtb="$1"
+ dtb_path="${B}/arch/${ARCH}/boot/dts/$dtb"
+ if [ ! -e "$dtb_path" ]; then
+ dtb_path="${B}/arch/${ARCH}/boot/$dtb"
fi
- echo "${DTB_PATH}"
+ echo "$dtb_path"
}
do_configure_append() {
@@ -50,61 +50,61 @@ do_configure_append() {
}
do_compile_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- oe_runmake ${DTB}
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ oe_runmake $dtb
done
}
do_install_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- DTB_EXT=${DTB##*.}
- DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
- install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT}
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
+ dtb_base_name=`basename $dtb ."$dtb_ext"`
+ install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT}
+ dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
cat ${D}/${KERNEL_IMAGEDEST}/$type \
- ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} \
- > ${D}/${KERNEL_IMAGEDEST}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
+ > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
fi
done
done
}
do_deploy_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- DTB_EXT=${DTB##*.}
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb ."$dtb_ext"`
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- DTB_NAME=`echo ${base_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
+ dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
install -d ${DEPLOYDIR}
- install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}
- ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT}
- ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_BASE_NAME}.${DTB_EXT}
+ install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
+ ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
+ ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
cat ${DEPLOYDIR}/$type \
- ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
- > ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin
- ln -sf ${DTB_NAME}.${DTB_EXT}.bin ${DEPLOYDIR}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ${DEPLOYDIR}/$dtb_name.$dtb_ext \
+ > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
+ ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
- ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
- > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin
- ln -sf ${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin \
- ${DEPLOYDIR}/${type}-initramfs-${DTB_BASE_NAME}.${DTB_EXT}-${MACHINE}.bin
+ ${DEPLOYDIR}/$dtb_name.$dtb_ext \
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
+ ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
fi
fi
done
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv3 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files
2018-07-04 7:59 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
@ 2018-07-04 7:59 ` Martin Jansa
2018-07-04 8:54 ` Paulo Neves
2018-07-04 7:59 ` [PATCHv3 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
` (2 subsequent siblings)
3 siblings, 1 reply; 30+ messages in thread
From: Martin Jansa @ 2018-07-04 7:59 UTC (permalink / raw)
To: openembedded-core
* add 2 new variables:
KERNEL_DTB_BASE_NAME
KERNEL_DTB_SYMLINK_NAME
instead of reusing KERNEL_IMAGE_SYMLINK_NAME and than expecting that
default value ${MACHINE} was being used in e.g.:
DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
* install normal DTB files only once even if there is multiple entries
in KERNEL_IMAGETYPE_FOR_MAKE and don't prefix them with the type of
the kernel image, use the KERNEL_IMAGETYPE_FOR_MAKE as a prefix only
when installing them bundled with kernel or initramfs image.
* deploy the files from ${D}/${KERNEL_IMAGEDEST}/ instead of kernel
build directory, so that we don't need to call
DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
again in do_deploy
* create all links in do_deploy task, because default KERNEL_DTB_BASE_NAME
like KERNEL_IMAGE_BASE_NAME contains PKGR and PKGR is different in
do_install and do_deploy, because kernel.bbclass calls
meta/classes/kernel.bbclass:do_install[prefuncs] += "package_get_auto_pr"
meta/classes/kernel.bbclass:do_deploy[prefuncs] += "package_get_auto_pr"
* the filenames are a bit different, but with separate variable it
should be easier for other bbclasses which use these DTB files to
find them correctly, just use either the cannonical name
$dtb_base_name.$dtb_ext or $dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
because PKGR (and other PKG* variables) might be different in your
task and kernel.do_deploy task.
* fix DTB files being deployed with incorrect filenames when
KERNEL_IMAGE_SYMLINK_NAME isn't set to ${MACHINE}, e.g. instead of
the default:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 07:41 deploy/images/raspberrypi3-64/Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/Image-lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
I was getting:
-rw-r--r-- 2 bitbake bitbake 1348 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi-master-20171120102653.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
and e.g. sdcard_image-rpi.bbclass from meta-raspberrypi:
https://github.com/agherzan/meta-raspberrypi/blob/37e4e18f4a745ce8dc11f7e40a29da0859ff13c6/classes/sdcard_image-rpi.bbclass
was failing in:
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
because ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb doesn't exist in my
build, due to
DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
not replacing whole "${KERNEL_IMAGE_SYMLINK_NAME}" (read ${MACHINE})
with just ${DTB_BASE_NAME}
* with this change applied the deploy dir looks like this:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-raspberrypi3-64.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
and works correctly even with DISTRO using different naming scheme
* the sdcard_image-rpi.bbclass still needs to be modified, I've provided
updated version here:
https://github.com/agherzan/meta-raspberrypi/pull/159
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 47 ++++++++------------------
meta/classes/kernel.bbclass | 3 ++
2 files changed, 18 insertions(+), 32 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 5d38d3760d..7faa869493 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -60,20 +60,9 @@ do_install_append() {
for dtbf in ${KERNEL_DEVICETREE}; do
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb .$dtb_ext`
dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
- dtb_base_name=`basename $dtb ."$dtb_ext"`
install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
- for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
-
- if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
- cat ${D}/${KERNEL_IMAGEDEST}/$type \
- ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
- > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
- fi
- done
done
}
@@ -81,30 +70,24 @@ do_deploy_append() {
for dtbf in ${KERNEL_DEVICETREE}; do
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
- dtb_base_name=`basename $dtb ."$dtb_ext"`
+ dtb_base_name=`basename $dtb .$dtb_ext`
+ install -d ${DEPLOYDIR}
+ install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
+ ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
+ ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
- symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
- install -d ${DEPLOYDIR}
- install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
- ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
- ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
-
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
- cat ${DEPLOYDIR}/$type \
- ${DEPLOYDIR}/$dtb_name.$dtb_ext \
- > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
- ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
-
+ cat ${D}/${KERNEL_IMAGEDEST}/$type \
+ ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext \
+ > ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
+ ln -sf $type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
+ ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
- ${DEPLOYDIR}/$dtb_name.$dtb_ext \
- > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
- ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
- ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
+ ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
+ ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
fi
fi
done
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 3213b932bf..7ce64fd19f 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -663,6 +663,9 @@ KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package signatures
KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv3 3/4] kernel.bbclass: use the consistent naming schema for initramfs
2018-07-04 7:59 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2018-07-04 7:59 ` [PATCHv3 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
@ 2018-07-04 7:59 ` Martin Jansa
2018-07-04 7:59 ` [PATCHv3 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2018-07-05 8:21 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Richard Purdie
3 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-04 7:59 UTC (permalink / raw)
To: openembedded-core
* use INITRAMFS_BASE_NAME and INITRAMFS_SYMLINK_NAME variables, like
other kernel artifacts are using
* use "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" instead of
"${PV}-${PR}-${MACHINE}-${DATETIME}" to be consistent with other files
* allow to modify default symlink name with INITRAMFS_SYMLINK_NAME
instead of currently used:
initramfs_symlink_name=${type}-initramfs-${MACHINE}
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel.bbclass | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7ce64fd19f..0045cec819 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -229,8 +229,6 @@ copy_initramfs() {
echo "Finished copy of initramfs into ./usr"
}
-INITRAMFS_BASE_NAME ?= "initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}"
-INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
do_bundle_initramfs () {
if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
echo "Creating a kernel image with a bundled initramfs..."
@@ -673,6 +671,10 @@ MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
MODULE_TARBALL_DEPLOY ?= "1"
+INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+
kernel_do_deploy() {
deployDir="${DEPLOYDIR}"
if [ -n "${KERNEL_DEPLOYSUBDIR}" ]; then
@@ -697,17 +699,14 @@ kernel_do_deploy() {
ln -sf ${base_name}.bin $deployDir/${type}
done
- cd ${B}
- # Update deploy directory
- for type in ${KERNEL_IMAGETYPES} ; do
- if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
- echo "Copying deploy ${type} kernel-initramfs image and setting up links..."
+ if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
+ for type in ${KERNEL_IMAGETYPES} ; do
initramfs_base_name=${type}-${INITRAMFS_BASE_NAME}
- initramfs_symlink_name=${type}-initramfs-${MACHINE}
+ initramfs_symlink_name=${type}-${INITRAMFS_SYMLINK_NAME}
install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs $deployDir/${initramfs_base_name}.bin
ln -sf ${initramfs_base_name}.bin $deployDir/${initramfs_symlink_name}.bin
- fi
- done
+ done
+ fi
}
do_deploy[cleandirs] = "${DEPLOYDIR}"
do_deploy[dirs] = "${DEPLOYDIR} ${B}"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv3 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass
2018-07-04 7:59 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2018-07-04 7:59 ` [PATCHv3 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
2018-07-04 7:59 ` [PATCHv3 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
@ 2018-07-04 7:59 ` Martin Jansa
2018-07-05 8:21 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Richard Purdie
3 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-04 7:59 UTC (permalink / raw)
To: openembedded-core
* this makes it easier to access these variables from some other bbclass
e.g. sdcard_image-rpi.bbclass in meta-raspberry where we need to know
how some files in deploy are named, but we cannot inherit kernel.bbclass
as it's used in image recipe not kernel recipe
* alternatively we can move these to bitbake.conf like similar image variables are:
meta/conf/bitbake.conf:IMAGE_BASENAME = "${PN}"
meta/conf/bitbake.conf:IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
meta/conf/bitbake.conf:IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-artifact-names.bbclass | 19 +++++++++++++++++++
meta/classes/kernel.bbclass | 18 +-----------------
2 files changed, 20 insertions(+), 17 deletions(-)
create mode 100644 meta/classes/kernel-artifact-names.bbclass
diff --git a/meta/classes/kernel-artifact-names.bbclass b/meta/classes/kernel-artifact-names.bbclass
new file mode 100644
index 0000000000..d696888322
--- /dev/null
+++ b/meta/classes/kernel-artifact-names.bbclass
@@ -0,0 +1,19 @@
+KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+# Don't include the DATETIME variable in the sstate package signatures
+KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+
+KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
+
+MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+
+MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
+MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
+MODULE_TARBALL_DEPLOY ?= "1"
+
+INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 0045cec819..42efa382ad 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -657,23 +657,7 @@ do_sizecheck[dirs] = "${B}"
addtask sizecheck before do_install after do_strip
-KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-# Don't include the DATETIME variable in the sstate package signatures
-KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
-KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
-MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
-# Don't include the DATETIME variable in the sstate package signatures
-MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
-MODULE_TARBALL_DEPLOY ?= "1"
-
-INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
-INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+inherit kernel-artifact-names
kernel_do_deploy() {
deployDir="${DEPLOYDIR}"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCHv3 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files
2018-07-04 7:59 ` [PATCHv3 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
@ 2018-07-04 8:54 ` Paulo Neves
2018-07-04 9:18 ` Martin Jansa
0 siblings, 1 reply; 30+ messages in thread
From: Paulo Neves @ 2018-07-04 8:54 UTC (permalink / raw)
To: Martin Jansa; +Cc: OE-core
Great work!
The only issue I have with your changes is that this is basically a
rewrite and you mix fixes with refactoring. Would it be possible to
split the patch into smaller patches? This would make it much easier
analyze.
On Wed, Jul 4, 2018 at 9:59 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> * add 2 new variables:
> KERNEL_DTB_BASE_NAME
> KERNEL_DTB_SYMLINK_NAME
> instead of reusing KERNEL_IMAGE_SYMLINK_NAME and than expecting that
> default value ${MACHINE} was being used in e.g.:
> DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
>
> * install normal DTB files only once even if there is multiple entries
> in KERNEL_IMAGETYPE_FOR_MAKE and don't prefix them with the type of
> the kernel image, use the KERNEL_IMAGETYPE_FOR_MAKE as a prefix only
> when installing them bundled with kernel or initramfs image.
>
> * deploy the files from ${D}/${KERNEL_IMAGEDEST}/ instead of kernel
> build directory, so that we don't need to call
> DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
> again in do_deploy
>
> * create all links in do_deploy task, because default KERNEL_DTB_BASE_NAME
> like KERNEL_IMAGE_BASE_NAME contains PKGR and PKGR is different in
> do_install and do_deploy, because kernel.bbclass calls
> meta/classes/kernel.bbclass:do_install[prefuncs] += "package_get_auto_pr"
> meta/classes/kernel.bbclass:do_deploy[prefuncs] += "package_get_auto_pr"
>
> * the filenames are a bit different, but with separate variable it
> should be easier for other bbclasses which use these DTB files to
> find them correctly, just use either the cannonical name
> $dtb_base_name.$dtb_ext or $dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
> because PKGR (and other PKG* variables) might be different in your
> task and kernel.do_deploy task.
>
> * fix DTB files being deployed with incorrect filenames when
> KERNEL_IMAGE_SYMLINK_NAME isn't set to ${MACHINE}, e.g. instead of
> the default:
> -rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 07:41 deploy/images/raspberrypi3-64/Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
> lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/Image-lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
> lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
> I was getting:
> -rw-r--r-- 2 bitbake bitbake 1348 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi.dtbo
> lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi-master-20171120102653.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
> lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
> and e.g. sdcard_image-rpi.bbclass from meta-raspberrypi:
> https://github.com/agherzan/meta-raspberrypi/blob/37e4e18f4a745ce8dc11f7e40a29da0859ff13c6/classes/sdcard_image-rpi.bbclass
> was failing in:
> mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
> because ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb doesn't exist in my
> build, due to
> DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
> not replacing whole "${KERNEL_IMAGE_SYMLINK_NAME}" (read ${MACHINE})
> with just ${DTB_BASE_NAME}
>
> * with this change applied the deploy dir looks like this:
> -rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
> lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
> lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-raspberrypi3-64.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
> and works correctly even with DISTRO using different naming scheme
>
> * the sdcard_image-rpi.bbclass still needs to be modified, I've provided
> updated version here:
> https://github.com/agherzan/meta-raspberrypi/pull/159
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
> meta/classes/kernel-devicetree.bbclass | 47 ++++++++------------------
> meta/classes/kernel.bbclass | 3 ++
> 2 files changed, 18 insertions(+), 32 deletions(-)
>
> diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
> index 5d38d3760d..7faa869493 100644
> --- a/meta/classes/kernel-devicetree.bbclass
> +++ b/meta/classes/kernel-devicetree.bbclass
> @@ -60,20 +60,9 @@ do_install_append() {
> for dtbf in ${KERNEL_DEVICETREE}; do
> dtb=`normalize_dtb "$dtbf"`
> dtb_ext=${dtb##*.}
> + dtb_base_name=`basename $dtb .$dtb_ext`
> dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
> - dtb_base_name=`basename $dtb ."$dtb_ext"`
> install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
> - for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
> - symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
> - dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
> - ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
> -
> - if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
> - cat ${D}/${KERNEL_IMAGEDEST}/$type \
> - ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
> - > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
> - fi
> - done
> done
> }
>
> @@ -81,30 +70,24 @@ do_deploy_append() {
> for dtbf in ${KERNEL_DEVICETREE}; do
> dtb=`normalize_dtb "$dtbf"`
> dtb_ext=${dtb##*.}
> - dtb_base_name=`basename $dtb ."$dtb_ext"`
> + dtb_base_name=`basename $dtb .$dtb_ext`
> + install -d ${DEPLOYDIR}
> + install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
> + ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
> + ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
> for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
> - base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
> - symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
> - dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
> - dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
> - dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
> - install -d ${DEPLOYDIR}
> - install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
> - ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
> - ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
> -
> if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
> - cat ${DEPLOYDIR}/$type \
> - ${DEPLOYDIR}/$dtb_name.$dtb_ext \
> - > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
> - ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
> -
> + cat ${D}/${KERNEL_IMAGEDEST}/$type \
> + ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext \
> + > ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
> + ln -sf $type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
> + ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
> if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
> cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
> - ${DEPLOYDIR}/$dtb_name.$dtb_ext \
> - > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
> - ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
> - ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
> + ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
> + > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
> + ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
> + ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
> fi
> fi
> done
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 3213b932bf..7ce64fd19f 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -663,6 +663,9 @@ KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
> # Don't include the DATETIME variable in the sstate package signatures
> KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
> KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
> +KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
> +KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
> +KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
> MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
> MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
> MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
> --
> 2.17.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCHv3 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files
2018-07-04 8:54 ` Paulo Neves
@ 2018-07-04 9:18 ` Martin Jansa
0 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-04 9:18 UTC (permalink / raw)
To: ptsneves; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 11380 bytes --]
The refactoring is already in the 3 previous patches from these 4. This is
just the final fix, what do you want to separate from this?
On Wed, Jul 4, 2018 at 10:54 AM Paulo Neves <ptsneves@gmail.com> wrote:
> Great work!
>
> The only issue I have with your changes is that this is basically a
> rewrite and you mix fixes with refactoring. Would it be possible to
> split the patch into smaller patches? This would make it much easier
> analyze.
>
>
>
> On Wed, Jul 4, 2018 at 9:59 AM, Martin Jansa <martin.jansa@gmail.com>
> wrote:
> > * add 2 new variables:
> > KERNEL_DTB_BASE_NAME
> > KERNEL_DTB_SYMLINK_NAME
> > instead of reusing KERNEL_IMAGE_SYMLINK_NAME and than expecting that
> > default value ${MACHINE} was being used in e.g.:
> > DTB_SYMLINK_NAME=`echo ${symlink_name} | sed
> "s/${MACHINE}/${DTB_BASE_NAME}/g"`
> >
> > * install normal DTB files only once even if there is multiple entries
> > in KERNEL_IMAGETYPE_FOR_MAKE and don't prefix them with the type of
> > the kernel image, use the KERNEL_IMAGETYPE_FOR_MAKE as a prefix only
> > when installing them bundled with kernel or initramfs image.
> >
> > * deploy the files from ${D}/${KERNEL_IMAGEDEST}/ instead of kernel
> > build directory, so that we don't need to call
> > DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
> > again in do_deploy
> >
> > * create all links in do_deploy task, because default
> KERNEL_DTB_BASE_NAME
> > like KERNEL_IMAGE_BASE_NAME contains PKGR and PKGR is different in
> > do_install and do_deploy, because kernel.bbclass calls
> > meta/classes/kernel.bbclass:do_install[prefuncs] +=
> "package_get_auto_pr"
> > meta/classes/kernel.bbclass:do_deploy[prefuncs] +=
> "package_get_auto_pr"
> >
> > * the filenames are a bit different, but with separate variable it
> > should be easier for other bbclasses which use these DTB files to
> > find them correctly, just use either the cannonical name
> > $dtb_base_name.$dtb_ext or
> $dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
> > because PKGR (and other PKG* variables) might be different in your
> > task and kernel.do_deploy task.
> >
> > * fix DTB files being deployed with incorrect filenames when
> > KERNEL_IMAGE_SYMLINK_NAME isn't set to ${MACHINE}, e.g. instead of
> > the default:
> > -rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 07:41
> deploy/images/raspberrypi3-64/Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
> > lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41
> deploy/images/raspberrypi3-64/Image-lirc-rpi.dtbo ->
> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
> > lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41
> deploy/images/raspberrypi3-64/lirc-rpi.dtbo ->
> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
> > I was getting:
> > -rw-r--r-- 2 bitbake bitbake 1348 Nov 20 10:28
> deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi.dtbo
> > lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28
> deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi-master-20171120102653.dtbo
> -> Image-linux-raspberrypi-lirc-rpi.dtbo
> > lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28
> deploy/images/raspberrypi3-64/lirc-rpi.dtbo ->
> Image-linux-raspberrypi-lirc-rpi.dtbo
> > and e.g. sdcard_image-rpi.bbclass from meta-raspberrypi:
> >
> https://github.com/agherzan/meta-raspberrypi/blob/37e4e18f4a745ce8dc11f7e40a29da0859ff13c6/classes/sdcard_image-rpi.bbclass
> > was failing in:
> > mcopy -i ${WORKDIR}/boot.img -s
> ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb
> ::${DTB_BASE_NAME}.dtb
> > because ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb doesn't exist in my
> > build, due to
> > DTB_SYMLINK_NAME=`echo ${symlink_name} | sed
> "s/${MACHINE}/${DTB_BASE_NAME}/g"`
> > not replacing whole "${KERNEL_IMAGE_SYMLINK_NAME}" (read ${MACHINE})
> > with just ${DTB_BASE_NAME}
> >
> > * with this change applied the deploy dir looks like this:
> > -rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 15:49
> deploy/images/raspberrypi3-64/lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
> > lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49
> deploy/images/raspberrypi3-64/lirc-rpi.dtbo ->
> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
> > lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49
> deploy/images/raspberrypi3-64/lirc-rpi-raspberrypi3-64.dtbo ->
> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
> > and works correctly even with DISTRO using different naming scheme
> >
> > * the sdcard_image-rpi.bbclass still needs to be modified, I've provided
> > updated version here:
> > https://github.com/agherzan/meta-raspberrypi/pull/159
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> > meta/classes/kernel-devicetree.bbclass | 47 ++++++++------------------
> > meta/classes/kernel.bbclass | 3 ++
> > 2 files changed, 18 insertions(+), 32 deletions(-)
> >
> > diff --git a/meta/classes/kernel-devicetree.bbclass
> b/meta/classes/kernel-devicetree.bbclass
> > index 5d38d3760d..7faa869493 100644
> > --- a/meta/classes/kernel-devicetree.bbclass
> > +++ b/meta/classes/kernel-devicetree.bbclass
> > @@ -60,20 +60,9 @@ do_install_append() {
> > for dtbf in ${KERNEL_DEVICETREE}; do
> > dtb=`normalize_dtb "$dtbf"`
> > dtb_ext=${dtb##*.}
> > + dtb_base_name=`basename $dtb .$dtb_ext`
> > dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
> > - dtb_base_name=`basename $dtb ."$dtb_ext"`
> > install -m 0644 $dtb_path
> ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
> > - for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
> > -
> symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
> > - dtb_symlink_name=`echo ${symlink_name} | sed
> "s/${MACHINE}/$dtb_base_name/g"`
> > - ln -sf $dtb_base_name.$dtb_ext
> ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
> > -
> > - if [ "$type" = "zImage" ] && [
> "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
> > - cat ${D}/${KERNEL_IMAGEDEST}/$type \
> > -
> ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
> > - >
> ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
> > - fi
> > - done
> > done
> > }
> >
> > @@ -81,30 +70,24 @@ do_deploy_append() {
> > for dtbf in ${KERNEL_DEVICETREE}; do
> > dtb=`normalize_dtb "$dtbf"`
> > dtb_ext=${dtb##*.}
> > - dtb_base_name=`basename $dtb ."$dtb_ext"`
> > + dtb_base_name=`basename $dtb .$dtb_ext`
> > + install -d ${DEPLOYDIR}
> > + install -m 0644
> ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
> ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
> > + ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
> ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
> > + ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
> ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
> > for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
> > - base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
> > -
> symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
> > - dtb_name=`echo ${base_name} | sed
> "s/${MACHINE}/$dtb_base_name/g"`
> > - dtb_symlink_name=`echo ${symlink_name} | sed
> "s/${MACHINE}/$dtb_base_name/g"`
> > - dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
> > - install -d ${DEPLOYDIR}
> > - install -m 0644 $dtb_path
> ${DEPLOYDIR}/$dtb_name.$dtb_ext
> > - ln -sf $dtb_name.$dtb_ext
> ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
> > - ln -sf $dtb_name.$dtb_ext
> ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
> > -
> > if [ "$type" = "zImage" ] && [
> "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
> > - cat ${DEPLOYDIR}/$type \
> > - ${DEPLOYDIR}/$dtb_name.$dtb_ext \
> > - >
> ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
> > - ln -sf $dtb_name.$dtb_ext.bin
> ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
> > -
> > + cat ${D}/${KERNEL_IMAGEDEST}/$type \
> > +
> ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext \
> > + >
> ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
> > + ln -sf
> $type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
> > +
> ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
> > if [ -e
> "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
> > cat
> ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
> > -
> ${DEPLOYDIR}/$dtb_name.$dtb_ext \
> > - >
> ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
> > - ln -sf
> ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
> > -
> ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
> > +
> ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
> > + >
> ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
> > + ln -sf
> ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
> \
> > +
> ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
> > fi
> > fi
> > done
> > diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> > index 3213b932bf..7ce64fd19f 100644
> > --- a/meta/classes/kernel.bbclass
> > +++ b/meta/classes/kernel.bbclass
> > @@ -663,6 +663,9 @@ KERNEL_IMAGE_BASE_NAME ?=
> "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
> > # Don't include the DATETIME variable in the sstate package signatures
> > KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
> > KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
> > +KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
> > +KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
> > +KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
> > MODULE_IMAGE_BASE_NAME ?=
> "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
> > MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
> > MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
> > --
> > 2.17.1
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 14524 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb"
2018-07-02 14:16 ` Martin Jansa
` (2 preceding siblings ...)
2018-07-04 7:59 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
@ 2018-07-04 20:06 ` Martin Jansa
2018-07-05 7:15 ` Nicolas Dechesne
3 siblings, 1 reply; 30+ messages in thread
From: Martin Jansa @ 2018-07-04 20:06 UTC (permalink / raw)
To: openembedded-core
This reverts commit 2e7f3b2b9318d1e5395ad58131eafb873f614326.
It was breaking quite common use case that the dtb files are in
some subdirectory and then kernel build fails to build them.
As reported by khem:
http://lists.openembedded.org/pipermail/openembedded-core/2018-July/152578.html
me:
http://lists.openembedded.org/pipermail/openembedded-core/2018-July/152579.html
on raspberrypi3 build:
make[3]: *** No rule to make target 'arch/arm/boot/dts/dwc2.dtbo'. Stop.
arch/arm/Makefile:345: recipe for target 'dwc2.dtbo' failed
make[2]: *** [dwc2.dtbo] Error 2
Makefile:146: recipe for target 'sub-make' failed
and trevor on the IRC:
20:35:49 < tlwoerner> the recent 2e7f3b2b9318d1e5395ad58131eafb873f614326 commit in oe-core seems to cause dragonboard-410c's kernel to fail to build
20:36:26 < tlwoerner> for the dragonboard-410c, KERNEL_DEVICETREE is set to "qcom/apq8016-sbc.dtb" but the build failure is:
20:36:37 < tlwoerner> *** No rule to make target 'arch/arm64/boot/dts/dts/qcom/apq8016-sbc.dtb'. Stop.
20:36:44 < tlwoerner> i.e. the "qcom/" is getting removed
20:37:08 < tlwoerner> oops!!
20:37:33 < tlwoerner> wrong copy&paste, the actual error is:
20:37:36 < tlwoerner> *** No rule to make target 'arch/arm64/boot/dts/apq8016-sbc.dtb'. Stop.
20:37:53 < tlwoerner> i.e., the "qcom/" is being stripped out
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 7faa869493..9c5e125981 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -13,8 +13,8 @@ normalize_dtb () {
dtb="$1"
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=`basename $dtb | sed 's,\.dts$,.dtb,g'`
echo "$dtb"
}
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb"
2018-07-04 20:06 ` [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb" Martin Jansa
@ 2018-07-05 7:15 ` Nicolas Dechesne
2018-07-05 8:23 ` Richard Purdie
0 siblings, 1 reply; 30+ messages in thread
From: Nicolas Dechesne @ 2018-07-05 7:15 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
On Wed, Jul 4, 2018 at 10:07 PM Martin Jansa <martin.jansa@gmail.com> wrote:
>
> This reverts commit 2e7f3b2b9318d1e5395ad58131eafb873f614326.
>
> It was breaking quite common use case that the dtb files are in
> some subdirectory and then kernel build fails to build them.
>
> As reported by khem:
> http://lists.openembedded.org/pipermail/openembedded-core/2018-July/152578.html
> me:
> http://lists.openembedded.org/pipermail/openembedded-core/2018-July/152579.html
> on raspberrypi3 build:
>
> make[3]: *** No rule to make target 'arch/arm/boot/dts/dwc2.dtbo'. Stop.
> arch/arm/Makefile:345: recipe for target 'dwc2.dtbo' failed
> make[2]: *** [dwc2.dtbo] Error 2
> Makefile:146: recipe for target 'sub-make' failed
>
> and trevor on the IRC:
> 20:35:49 < tlwoerner> the recent 2e7f3b2b9318d1e5395ad58131eafb873f614326 commit in oe-core seems to cause dragonboard-410c's kernel to fail to build
> 20:36:26 < tlwoerner> for the dragonboard-410c, KERNEL_DEVICETREE is set to "qcom/apq8016-sbc.dtb" but the build failure is:
> 20:36:37 < tlwoerner> *** No rule to make target 'arch/arm64/boot/dts/dts/qcom/apq8016-sbc.dtb'. Stop.
> 20:36:44 < tlwoerner> i.e. the "qcom/" is getting removed
> 20:37:08 < tlwoerner> oops!!
> 20:37:33 < tlwoerner> wrong copy&paste, the actual error is:
> 20:37:36 < tlwoerner> *** No rule to make target 'arch/arm64/boot/dts/apq8016-sbc.dtb'. Stop.
> 20:37:53 < tlwoerner> i.e., the "qcom/" is being stripped out
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Thanks! As reported by Trevor, it's needed for meta-qcom..
Reviewed-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
> ---
> meta/classes/kernel-devicetree.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
> index 7faa869493..9c5e125981 100644
> --- a/meta/classes/kernel-devicetree.bbclass
> +++ b/meta/classes/kernel-devicetree.bbclass
> @@ -13,8 +13,8 @@ normalize_dtb () {
> dtb="$1"
> 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=`basename $dtb | sed 's,\.dts$,.dtb,g'`
> echo "$dtb"
> }
>
> --
> 2.17.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables
2018-07-04 7:59 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
` (2 preceding siblings ...)
2018-07-04 7:59 ` [PATCHv3 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
@ 2018-07-05 8:21 ` Richard Purdie
2018-07-09 15:04 ` Martin Jansa
3 siblings, 1 reply; 30+ messages in thread
From: Richard Purdie @ 2018-07-05 8:21 UTC (permalink / raw)
To: Martin Jansa, openembedded-core
On Wed, 2018-07-04 at 07:59 +0000, Martin Jansa wrote:
> * just to make it more clear what is local shell variable and what is
> replaced by bitbake from the metadata and also to prevent the
> variable
> to be incorrectly expanded by bitbake if someone happens to define
> e.g. DTB_BASE_NAME
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
> meta/classes/kernel-devicetree.bbclass | 80 +++++++++++++-----------
> --
> 1 file changed, 40 insertions(+), 40 deletions(-)
I think something in this series is breaking qemuppc automated testing:
https://autobuilder.yocto.io/builders/nightly-ppc/builds/1129
https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds/1114
Cheers,
Richard
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb"
2018-07-05 7:15 ` Nicolas Dechesne
@ 2018-07-05 8:23 ` Richard Purdie
2018-07-05 8:38 ` Martin Jansa
0 siblings, 1 reply; 30+ messages in thread
From: Richard Purdie @ 2018-07-05 8:23 UTC (permalink / raw)
To: Nicolas Dechesne, Martin Jansa
Cc: Patches and discussions about the oe-core layer
On Thu, 2018-07-05 at 09:15 +0200, Nicolas Dechesne wrote:
> On Wed, Jul 4, 2018 at 10:07 PM Martin Jansa <martin.jansa@gmail.com>
> wrote:
> >
> > This reverts commit 2e7f3b2b9318d1e5395ad58131eafb873f614326.
> >
> > It was breaking quite common use case that the dtb files are in
> > some subdirectory and then kernel build fails to build them.
> >
> > As reported by khem:
> > http://lists.openembedded.org/pipermail/openembedded-core/2018-July
> > /152578.html
> > me:
> > http://lists.openembedded.org/pipermail/openembedded-core/2018-July
> > /152579.html
> > on raspberrypi3 build:
> >
> > make[3]: *** No rule to make target
> > 'arch/arm/boot/dts/dwc2.dtbo'. Stop.
> > arch/arm/Makefile:345: recipe for target 'dwc2.dtbo' failed
> > make[2]: *** [dwc2.dtbo] Error 2
> > Makefile:146: recipe for target 'sub-make' failed
> >
> > and trevor on the IRC:
> > 20:35:49 < tlwoerner> the recent
> > 2e7f3b2b9318d1e5395ad58131eafb873f614326 commit in oe-core seems to
> > cause dragonboard-410c's kernel to fail to build
> > 20:36:26 < tlwoerner> for the dragonboard-410c, KERNEL_DEVICETREE
> > is set to "qcom/apq8016-sbc.dtb" but the build failure is:
> > 20:36:37 < tlwoerner> *** No rule to make target
> > 'arch/arm64/boot/dts/dts/qcom/apq8016-sbc.dtb'. Stop.
> > 20:36:44 < tlwoerner> i.e. the "qcom/" is getting removed
> > 20:37:08 < tlwoerner> oops!!
> > 20:37:33 < tlwoerner> wrong copy&paste, the actual error is:
> > 20:37:36 < tlwoerner> *** No rule to make target
> > 'arch/arm64/boot/dts/apq8016-sbc.dtb'. Stop.
> > 20:37:53 < tlwoerner> i.e., the "qcom/" is being stripped out
>
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
>
> Thanks! As reported by Trevor, it's needed for meta-qcom..
>
> Reviewed-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Just to note that I'm happy to take this but its based on top of
Martin's other patches and those look like they'll need a respin so
this will either have to wait or get rebased...
Cheers,
Richard
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb"
2018-07-05 8:23 ` Richard Purdie
@ 2018-07-05 8:38 ` Martin Jansa
2018-07-05 10:37 ` Richard Purdie
0 siblings, 1 reply; 30+ messages in thread
From: Martin Jansa @ 2018-07-05 8:38 UTC (permalink / raw)
To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 2473 bytes --]
I am out til Sunday, so please someone else please resend just the revert.
Next week I will check the ppc issue and resend the rest (v2 is the same as
v3 except the rebase after this change, so after revert the v2 will apply
cleanly again)
On Thu, Jul 5, 2018, 10:23 Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
> On Thu, 2018-07-05 at 09:15 +0200, Nicolas Dechesne wrote:
> > On Wed, Jul 4, 2018 at 10:07 PM Martin Jansa <martin.jansa@gmail.com>
> > wrote:
> > >
> > > This reverts commit 2e7f3b2b9318d1e5395ad58131eafb873f614326.
> > >
> > > It was breaking quite common use case that the dtb files are in
> > > some subdirectory and then kernel build fails to build them.
> > >
> > > As reported by khem:
> > > http://lists.openembedded.org/pipermail/openembedded-core/2018-July
> > > /152578.html
> > > me:
> > > http://lists.openembedded.org/pipermail/openembedded-core/2018-July
> > > /152579.html
> > > on raspberrypi3 build:
> > >
> > > make[3]: *** No rule to make target
> > > 'arch/arm/boot/dts/dwc2.dtbo'. Stop.
> > > arch/arm/Makefile:345: recipe for target 'dwc2.dtbo' failed
> > > make[2]: *** [dwc2.dtbo] Error 2
> > > Makefile:146: recipe for target 'sub-make' failed
> > >
> > > and trevor on the IRC:
> > > 20:35:49 < tlwoerner> the recent
> > > 2e7f3b2b9318d1e5395ad58131eafb873f614326 commit in oe-core seems to
> > > cause dragonboard-410c's kernel to fail to build
> > > 20:36:26 < tlwoerner> for the dragonboard-410c, KERNEL_DEVICETREE
> > > is set to "qcom/apq8016-sbc.dtb" but the build failure is:
> > > 20:36:37 < tlwoerner> *** No rule to make target
> > > 'arch/arm64/boot/dts/dts/qcom/apq8016-sbc.dtb'. Stop.
> > > 20:36:44 < tlwoerner> i.e. the "qcom/" is getting removed
> > > 20:37:08 < tlwoerner> oops!!
> > > 20:37:33 < tlwoerner> wrong copy&paste, the actual error is:
> > > 20:37:36 < tlwoerner> *** No rule to make target
> > > 'arch/arm64/boot/dts/apq8016-sbc.dtb'. Stop.
> > > 20:37:53 < tlwoerner> i.e., the "qcom/" is being stripped out
> >
> > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> >
> > Thanks! As reported by Trevor, it's needed for meta-qcom..
> >
> > Reviewed-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
>
> Just to note that I'm happy to take this but its based on top of
> Martin's other patches and those look like they'll need a respin so
> this will either have to wait or get rebased...
>
> Cheers,
>
> Richard
>
[-- Attachment #2: Type: text/html, Size: 3713 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb"
2018-07-05 8:38 ` Martin Jansa
@ 2018-07-05 10:37 ` Richard Purdie
0 siblings, 0 replies; 30+ messages in thread
From: Richard Purdie @ 2018-07-05 10:37 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
On Thu, 2018-07-05 at 10:38 +0200, Martin Jansa wrote:
> I am out til Sunday, so please someone else please resend just the
> revert. Next week I will check the ppc issue and resend the rest (v2
> is the same as v3 except the rebase after this change, so after
> revert the v2 will apply cleanly again)
Thanks for the info, I've rebased the revert in -next.
Cheers,
Richard
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables
2018-07-05 8:21 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Richard Purdie
@ 2018-07-09 15:04 ` Martin Jansa
2018-07-09 15:04 ` [PATCHv4 " Martin Jansa
0 siblings, 1 reply; 30+ messages in thread
From: Martin Jansa @ 2018-07-09 15:04 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]
On Thu, Jul 05, 2018 at 09:21:49AM +0100, Richard Purdie wrote:
> On Wed, 2018-07-04 at 07:59 +0000, Martin Jansa wrote:
> > * just to make it more clear what is local shell variable and what is
> > replaced by bitbake from the metadata and also to prevent the
> > variable
> > to be incorrectly expanded by bitbake if someone happens to define
> > e.g. DTB_BASE_NAME
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> > meta/classes/kernel-devicetree.bbclass | 80 +++++++++++++-----------
> > --
> > 1 file changed, 40 insertions(+), 40 deletions(-)
>
> I think something in this series is breaking qemuppc automated testing:
>
> https://autobuilder.yocto.io/builders/nightly-ppc/builds/1129
> https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds/1114
I've sent fix for meta-yocto-bsp here:
https://lists.yoctoproject.org/pipermail/poky/2018-July/011436.html
I don't have the device to test it in runtime, but the fix seems simple
enough that it should work.
Will sent v4 of all 4 oe-core patches, with just link to above added in
one commit message (otherwise it's the same as v2, rebased after the
revert of the other kernel-devicetree.bbclass change from last week).
Cheers,
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCHv4 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables
2018-07-09 15:04 ` Martin Jansa
@ 2018-07-09 15:04 ` Martin Jansa
2018-07-09 15:04 ` [PATCHv4 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
` (2 more replies)
0 siblings, 3 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-09 15:04 UTC (permalink / raw)
To: openembedded-core
* just to make it more clear what is local shell variable and what is
replaced by bitbake from the metadata and also to prevent the variable
to be incorrectly expanded by bitbake if someone happens to define
e.g. DTB_BASE_NAME
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 80 +++++++++++++-------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 4f80cc62eb..10441475e8 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -10,21 +10,21 @@ FILES_${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-
KERNEL_DEVICETREE_BUNDLE ?= "0"
normalize_dtb () {
- DTB="$1"
- 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'`
+ dtb="$1"
+ 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
- echo "${DTB}"
+ echo "$dtb"
}
get_real_dtb_path_in_kernel () {
- DTB="$1"
- DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+ dtb="$1"
+ dtb_path="${B}/arch/${ARCH}/boot/dts/$dtb"
+ if [ ! -e "$dtb_path" ]; then
+ dtb_path="${B}/arch/${ARCH}/boot/$dtb"
fi
- echo "${DTB_PATH}"
+ echo "$dtb_path"
}
do_configure_append() {
@@ -50,61 +50,61 @@ do_configure_append() {
}
do_compile_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- oe_runmake ${DTB}
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ oe_runmake $dtb
done
}
do_install_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- DTB_EXT=${DTB##*.}
- DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
- install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT}
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
+ dtb_base_name=`basename $dtb ."$dtb_ext"`
+ install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT}
+ dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
cat ${D}/${KERNEL_IMAGEDEST}/$type \
- ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} \
- > ${D}/${KERNEL_IMAGEDEST}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
+ > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
fi
done
done
}
do_deploy_append() {
- for DTB in ${KERNEL_DEVICETREE}; do
- DTB=`normalize_dtb "${DTB}"`
- DTB_EXT=${DTB##*.}
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb ."$dtb_ext"`
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- DTB_NAME=`echo ${base_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
- DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
+ dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
+ dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
install -d ${DEPLOYDIR}
- install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}
- ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT}
- ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_BASE_NAME}.${DTB_EXT}
+ install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
+ ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
+ ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
cat ${DEPLOYDIR}/$type \
- ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
- > ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin
- ln -sf ${DTB_NAME}.${DTB_EXT}.bin ${DEPLOYDIR}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ${DEPLOYDIR}/$dtb_name.$dtb_ext \
+ > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
+ ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
- ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
- > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin
- ln -sf ${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin \
- ${DEPLOYDIR}/${type}-initramfs-${DTB_BASE_NAME}.${DTB_EXT}-${MACHINE}.bin
+ ${DEPLOYDIR}/$dtb_name.$dtb_ext \
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
+ ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
fi
fi
done
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv4 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files
2018-07-09 15:04 ` [PATCHv4 " Martin Jansa
@ 2018-07-09 15:04 ` Martin Jansa
2018-07-09 15:04 ` [PATCHv4 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
2018-07-09 15:05 ` [PATCHv4 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-09 15:04 UTC (permalink / raw)
To: openembedded-core
* add 2 new variables:
KERNEL_DTB_BASE_NAME
KERNEL_DTB_SYMLINK_NAME
instead of reusing KERNEL_IMAGE_SYMLINK_NAME and than expecting that
default value ${MACHINE} was being used in e.g.:
DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
* install normal DTB files only once even if there is multiple entries
in KERNEL_IMAGETYPE_FOR_MAKE and don't prefix them with the type of
the kernel image, use the KERNEL_IMAGETYPE_FOR_MAKE as a prefix only
when installing them bundled with kernel or initramfs image.
* deploy the files from ${D}/${KERNEL_IMAGEDEST}/ instead of kernel
build directory, so that we don't need to call
DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
again in do_deploy
* create all links in do_deploy task, because default KERNEL_DTB_BASE_NAME
like KERNEL_IMAGE_BASE_NAME contains PKGR and PKGR is different in
do_install and do_deploy, because kernel.bbclass calls
meta/classes/kernel.bbclass:do_install[prefuncs] += "package_get_auto_pr"
meta/classes/kernel.bbclass:do_deploy[prefuncs] += "package_get_auto_pr"
* the filenames are a bit different, but with separate variable it
should be easier for other bbclasses which use these DTB files to
find them correctly, just use either the cannonical name
$dtb_base_name.$dtb_ext or $dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
because PKGR (and other PKG* variables) might be different in your
task and kernel.do_deploy task.
* fix DTB files being deployed with incorrect filenames when
KERNEL_IMAGE_SYMLINK_NAME isn't set to ${MACHINE}, e.g. instead of
the default:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 07:41 deploy/images/raspberrypi3-64/Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/Image-lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
I was getting:
-rw-r--r-- 2 bitbake bitbake 1348 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi-master-20171120102653.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
and e.g. sdcard_image-rpi.bbclass from meta-raspberrypi:
https://github.com/agherzan/meta-raspberrypi/blob/37e4e18f4a745ce8dc11f7e40a29da0859ff13c6/classes/sdcard_image-rpi.bbclass
was failing in:
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
because ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb doesn't exist in my
build, due to
DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
not replacing whole "${KERNEL_IMAGE_SYMLINK_NAME}" (read ${MACHINE})
with just ${DTB_BASE_NAME}
* with this change applied the deploy dir looks like this:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-raspberrypi3-64.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
and works correctly even with DISTRO using different naming scheme
* the sdcard_image-rpi.bbclass still needs to be modified, I've provided
updated version here:
https://github.com/agherzan/meta-raspberrypi/pull/159
* mpc8315e-rdb.conf MACHINE in meta-yocto-bsp also needs small fix:
https://lists.yoctoproject.org/pipermail/poky/2018-July/011436.html
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-devicetree.bbclass | 47 ++++++++------------------
meta/classes/kernel.bbclass | 3 ++
2 files changed, 18 insertions(+), 32 deletions(-)
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 10441475e8..9c5e125981 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -60,20 +60,9 @@ do_install_append() {
for dtbf in ${KERNEL_DEVICETREE}; do
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb .$dtb_ext`
dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
- dtb_base_name=`basename $dtb ."$dtb_ext"`
install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
- for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
-
- if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
- cat ${D}/${KERNEL_IMAGEDEST}/$type \
- ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
- > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
- fi
- done
done
}
@@ -81,30 +70,24 @@ do_deploy_append() {
for dtbf in ${KERNEL_DEVICETREE}; do
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
- dtb_base_name=`basename $dtb ."$dtb_ext"`
+ dtb_base_name=`basename $dtb .$dtb_ext`
+ install -d ${DEPLOYDIR}
+ install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
+ ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
+ ln -sf $dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
- base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
- symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
- dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
- dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
- install -d ${DEPLOYDIR}
- install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
- ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
- ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
-
if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
- cat ${DEPLOYDIR}/$type \
- ${DEPLOYDIR}/$dtb_name.$dtb_ext \
- > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
- ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
-
+ cat ${D}/${KERNEL_IMAGEDEST}/$type \
+ ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext \
+ > ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
+ ln -sf $type-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
+ ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
- ${DEPLOYDIR}/$dtb_name.$dtb_ext \
- > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
- ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
- ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
+ ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_BASE_NAME}.$dtb_ext.bin \
+ ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext.bin
fi
fi
done
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 3213b932bf..7ce64fd19f 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -663,6 +663,9 @@ KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package signatures
KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv4 3/4] kernel.bbclass: use the consistent naming schema for initramfs
2018-07-09 15:04 ` [PATCHv4 " Martin Jansa
2018-07-09 15:04 ` [PATCHv4 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
@ 2018-07-09 15:04 ` Martin Jansa
2018-07-09 15:05 ` [PATCHv4 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-09 15:04 UTC (permalink / raw)
To: openembedded-core
* use INITRAMFS_BASE_NAME and INITRAMFS_SYMLINK_NAME variables, like
other kernel artifacts are using
* use "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" instead of
"${PV}-${PR}-${MACHINE}-${DATETIME}" to be consistent with other files
* allow to modify default symlink name with INITRAMFS_SYMLINK_NAME
instead of currently used:
initramfs_symlink_name=${type}-initramfs-${MACHINE}
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel.bbclass | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7ce64fd19f..0045cec819 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -229,8 +229,6 @@ copy_initramfs() {
echo "Finished copy of initramfs into ./usr"
}
-INITRAMFS_BASE_NAME ?= "initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}"
-INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
do_bundle_initramfs () {
if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
echo "Creating a kernel image with a bundled initramfs..."
@@ -673,6 +671,10 @@ MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
MODULE_TARBALL_DEPLOY ?= "1"
+INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+
kernel_do_deploy() {
deployDir="${DEPLOYDIR}"
if [ -n "${KERNEL_DEPLOYSUBDIR}" ]; then
@@ -697,17 +699,14 @@ kernel_do_deploy() {
ln -sf ${base_name}.bin $deployDir/${type}
done
- cd ${B}
- # Update deploy directory
- for type in ${KERNEL_IMAGETYPES} ; do
- if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
- echo "Copying deploy ${type} kernel-initramfs image and setting up links..."
+ if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
+ for type in ${KERNEL_IMAGETYPES} ; do
initramfs_base_name=${type}-${INITRAMFS_BASE_NAME}
- initramfs_symlink_name=${type}-initramfs-${MACHINE}
+ initramfs_symlink_name=${type}-${INITRAMFS_SYMLINK_NAME}
install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs $deployDir/${initramfs_base_name}.bin
ln -sf ${initramfs_base_name}.bin $deployDir/${initramfs_symlink_name}.bin
- fi
- done
+ done
+ fi
}
do_deploy[cleandirs] = "${DEPLOYDIR}"
do_deploy[dirs] = "${DEPLOYDIR} ${B}"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCHv4 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass
2018-07-09 15:04 ` [PATCHv4 " Martin Jansa
2018-07-09 15:04 ` [PATCHv4 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
2018-07-09 15:04 ` [PATCHv4 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
@ 2018-07-09 15:05 ` Martin Jansa
2 siblings, 0 replies; 30+ messages in thread
From: Martin Jansa @ 2018-07-09 15:05 UTC (permalink / raw)
To: openembedded-core
* this makes it easier to access these variables from some other bbclass
e.g. sdcard_image-rpi.bbclass in meta-raspberry where we need to know
how some files in deploy are named, but we cannot inherit kernel.bbclass
as it's used in image recipe not kernel recipe
* alternatively we can move these to bitbake.conf like similar image variables are:
meta/conf/bitbake.conf:IMAGE_BASENAME = "${PN}"
meta/conf/bitbake.conf:IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
meta/conf/bitbake.conf:IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/kernel-artifact-names.bbclass | 19 +++++++++++++++++++
meta/classes/kernel.bbclass | 18 +-----------------
2 files changed, 20 insertions(+), 17 deletions(-)
create mode 100644 meta/classes/kernel-artifact-names.bbclass
diff --git a/meta/classes/kernel-artifact-names.bbclass b/meta/classes/kernel-artifact-names.bbclass
new file mode 100644
index 0000000000..d696888322
--- /dev/null
+++ b/meta/classes/kernel-artifact-names.bbclass
@@ -0,0 +1,19 @@
+KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+# Don't include the DATETIME variable in the sstate package signatures
+KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+
+KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
+
+MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+
+MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
+MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
+MODULE_TARBALL_DEPLOY ?= "1"
+
+INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 0045cec819..42efa382ad 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -657,23 +657,7 @@ do_sizecheck[dirs] = "${B}"
addtask sizecheck before do_install after do_strip
-KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-# Don't include the DATETIME variable in the sstate package signatures
-KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
-KERNEL_DTB_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-KERNEL_DTB_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_DTB_SYMLINK_NAME ?= "${MACHINE}"
-MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
-# Don't include the DATETIME variable in the sstate package signatures
-MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
-MODULE_TARBALL_DEPLOY ?= "1"
-
-INITRAMFS_BASE_NAME ?= "initramfs-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
-INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+inherit kernel-artifact-names
kernel_do_deploy() {
deployDir="${DEPLOYDIR}"
--
2.17.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
end of thread, other threads:[~2018-07-09 15:04 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-20 20:11 [RFC][PATCH 0/5] Kernel artifacts naming changes Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 1/5] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 2/5] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 3/5] kernel-devicetree.bbclass: build DTBs with make dtbs Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 4/5] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
2017-11-20 20:11 ` [RFC][PATCH 5/5] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2017-11-21 11:58 ` [RFC][PATCH 0/5] Kernel artifacts naming changes Otavio Salvador
2018-07-02 14:16 ` Martin Jansa
2018-07-02 16:56 ` Otavio Salvador
2018-07-02 22:07 ` [PATCHv2 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2018-07-02 22:07 ` [PATCHv2 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
2018-07-02 22:07 ` [PATCHv2 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
2018-07-02 22:07 ` [PATCHv2 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2018-07-04 7:59 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Martin Jansa
2018-07-04 7:59 ` [PATCHv3 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
2018-07-04 8:54 ` Paulo Neves
2018-07-04 9:18 ` Martin Jansa
2018-07-04 7:59 ` [PATCHv3 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
2018-07-04 7:59 ` [PATCHv3 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2018-07-05 8:21 ` [PATCHv3 1/4] kernel-devicetree.bbclass: Use lowercase names for shell variables Richard Purdie
2018-07-09 15:04 ` Martin Jansa
2018-07-09 15:04 ` [PATCHv4 " Martin Jansa
2018-07-09 15:04 ` [PATCHv4 2/4] kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Martin Jansa
2018-07-09 15:04 ` [PATCHv4 3/4] kernel.bbclass: use the consistent naming schema for initramfs Martin Jansa
2018-07-09 15:05 ` [PATCHv4 4/4] kernel.bbclass: move variables for kernel artifacts names to separate bbclass Martin Jansa
2018-07-04 20:06 ` [PATCH] Revert "kernel-devicetree: Corrected normalize_dtb" Martin Jansa
2018-07-05 7:15 ` Nicolas Dechesne
2018-07-05 8:23 ` Richard Purdie
2018-07-05 8:38 ` Martin Jansa
2018-07-05 10:37 ` Richard Purdie
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.