* [PATCH 1/5] kernel-fitimage: sanitize dtb section name (unbreak MIPS)
@ 2017-09-20 9:41 André Draszik
2017-09-20 9:41 ` [PATCH 2/5] kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL support André Draszik
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: André Draszik @ 2017-09-20 9:41 UTC (permalink / raw)
To: openembedded-core
From: André Draszik <adraszik@tycoint.com>
We can't build fitImages for MIPS any more:
| Error: fit-image.its:21.27-28 syntax error
| FATAL ERROR: Unable to parse input tree
| uboot-mkimage: Can't read arch/mips/boot/fitImage.tmp: Invalid argument
Since commit cd2ed7f80b555add07795cc0cbaee866e6c193a3
("kernel-fitimage: dtb sections named by their filenames
and one config section for each dtb"), commit
1ec405ef5df82884c8997878bbe6c66d924b5127 in yocto, dtb
sections are named by the DTB filename, but the filename
can legally be in a subdirectory below
arch/$arch/boot/dts/, and on MIPS all DTBs are actually
in a subdirectory.
If so, mkimage fails with the above error message.
Unbreak this by replacing the offending character
(directory separator /)
Signed-off-by: André Draszik <adraszik@tycoint.com>
---
meta/classes/kernel-fitimage.bbclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 2630b47316..6f1b7667bc 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -351,6 +351,7 @@ fitimage_assemble() {
DTB_PATH="arch/${ARCH}/boot/${DTB}"
fi
+ DTB=$(echo "${DTB}" | tr '/' '_')
DTBS="${DTBS} ${DTB}"
fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
done
--
2.14.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/5] kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL support
2017-09-20 9:41 [PATCH 1/5] kernel-fitimage: sanitize dtb section name (unbreak MIPS) André Draszik
@ 2017-09-20 9:41 ` André Draszik
2017-09-20 9:41 ` [PATCH 3/5] kernel-uimage: optimise " André Draszik
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: André Draszik @ 2017-09-20 9:41 UTC (permalink / raw)
To: openembedded-core
From: André Draszik <adraszik@tycoint.com>
- vmlinux is located in ${B}, not ${S}.
- parsing of nm output got broken completely in commit
b406a89935f148779569fa3770776e009dd51f13 ("kernel-fitimage: add
initramfs support"), commit ec755d2524fcbd9dfded23a576f25c990d405a6c
in yocto
While at it, make awk exit on match to save a few CPU cycles.
Signed-off-by: André Draszik <adraszik@tycoint.com>
---
meta/classes/kernel-fitimage.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 6f1b7667bc..5583b4472e 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -97,8 +97,8 @@ fitimage_emit_section_kernel() {
ENTRYPOINT=${UBOOT_ENTRYPOINT}
if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
- ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
- awk '$4=="${UBOOT_ENTRYSYMBOL}" {print $2}'`
+ ENTRYPOINT=`${HOST_PREFIX}nm vmlinux | \
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
fi
cat << EOF >> ${1}
--
2.14.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/5] kernel-uimage: optimise UBOOT_ENTRYSYMBOL support
2017-09-20 9:41 [PATCH 1/5] kernel-fitimage: sanitize dtb section name (unbreak MIPS) André Draszik
2017-09-20 9:41 ` [PATCH 2/5] kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL support André Draszik
@ 2017-09-20 9:41 ` André Draszik
2017-09-20 9:41 ` [PATCH 4/5] kernel-uboot: support compressed kernel on MIPS André Draszik
2017-09-20 9:41 ` [PATCH 5/5] kernel-fitimage: support MIPS (compressed) André Draszik
3 siblings, 0 replies; 5+ messages in thread
From: André Draszik @ 2017-09-20 9:41 UTC (permalink / raw)
To: openembedded-core
From: André Draszik <adraszik@tycoint.com>
This is the remaining local change to a fix similar to
commit e0b4f018d1c2 ("kernel-uimage.bbclass: Fix up
generation of uImage from vmlinux"):
Make awk exit on match to save a few CPU cycles so as
to make this similar to kernel-fitimage.bbclass
Signed-off-by: André Draszik <adraszik@tycoint.com>
---
meta/classes/kernel-uimage.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/kernel-uimage.bbclass b/meta/classes/kernel-uimage.bbclass
index 7c026abf0b..1d8656e76e 100644
--- a/meta/classes/kernel-uimage.bbclass
+++ b/meta/classes/kernel-uimage.bbclass
@@ -27,7 +27,7 @@ do_uboot_mkimage() {
ENTRYPOINT=${UBOOT_ENTRYPOINT}
if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
ENTRYPOINT=`${HOST_PREFIX}nm ${B}/vmlinux | \
- awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
fi
uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage
--
2.14.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/5] kernel-uboot: support compressed kernel on MIPS
2017-09-20 9:41 [PATCH 1/5] kernel-fitimage: sanitize dtb section name (unbreak MIPS) André Draszik
2017-09-20 9:41 ` [PATCH 2/5] kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL support André Draszik
2017-09-20 9:41 ` [PATCH 3/5] kernel-uimage: optimise " André Draszik
@ 2017-09-20 9:41 ` André Draszik
2017-09-20 9:41 ` [PATCH 5/5] kernel-fitimage: support MIPS (compressed) André Draszik
3 siblings, 0 replies; 5+ messages in thread
From: André Draszik @ 2017-09-20 9:41 UTC (permalink / raw)
To: openembedded-core
From: André Draszik <adraszik@tycoint.com>
MIPS generates vmlinuz.bin when compression in the kernel build is
enabled, including any necessary objcopy so we can leverage that
and skip our manual invocation of objcopy here. We just have to
put the file into the right place for the rest of the build to
find it.
Signed-off-by: André Draszik <adraszik@tycoint.com>
---
meta/classes/kernel-uboot.bbclass | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/meta/classes/kernel-uboot.bbclass b/meta/classes/kernel-uboot.bbclass
index 868e97d7a7..87f02654fa 100644
--- a/meta/classes/kernel-uboot.bbclass
+++ b/meta/classes/kernel-uboot.bbclass
@@ -3,13 +3,19 @@ uboot_prep_kimage() {
vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
linux_suffix=""
linux_comp="none"
+ elif [ -e arch/${ARCH}/boot/vmlinuz.bin ]; then
+ rm -f linux.bin
+ cp -l arch/${ARCH}/boot/vmlinuz.bin linux.bin
+ vmlinux_path=""
+ linux_suffix=""
+ linux_comp="none"
else
vmlinux_path="vmlinux"
linux_suffix=".gz"
linux_comp="gzip"
fi
- ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
+ [ -n "${vmlinux_path}" ] && ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
if [ "${linux_comp}" != "none" ] ; then
gzip -9 linux.bin
--
2.14.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 5/5] kernel-fitimage: support MIPS (compressed)
2017-09-20 9:41 [PATCH 1/5] kernel-fitimage: sanitize dtb section name (unbreak MIPS) André Draszik
` (2 preceding siblings ...)
2017-09-20 9:41 ` [PATCH 4/5] kernel-uboot: support compressed kernel on MIPS André Draszik
@ 2017-09-20 9:41 ` André Draszik
3 siblings, 0 replies; 5+ messages in thread
From: André Draszik @ 2017-09-20 9:41 UTC (permalink / raw)
To: openembedded-core
From: André Draszik <adraszik@tycoint.com>
On MIPS, the compressed kernel image target is vmlinuz.bin
Signed-off-by: André Draszik <adraszik@tycoint.com>
---
meta/classes/kernel-fitimage.bbclass | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 5583b4472e..179185b6b2 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -7,7 +7,9 @@ python __anonymous () {
depends = "%s u-boot-mkimage-native dtc-native" % depends
d.setVar("DEPENDS", depends)
- if d.getVar("UBOOT_ARCH") == "x86":
+ if d.getVar("UBOOT_ARCH") == "mips":
+ replacementtype = "vmlinuz.bin"
+ elif d.getVar("UBOOT_ARCH") == "x86":
replacementtype = "bzImage"
else:
replacementtype = "zImage"
--
2.14.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-09-20 9:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-20 9:41 [PATCH 1/5] kernel-fitimage: sanitize dtb section name (unbreak MIPS) André Draszik
2017-09-20 9:41 ` [PATCH 2/5] kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL support André Draszik
2017-09-20 9:41 ` [PATCH 3/5] kernel-uimage: optimise " André Draszik
2017-09-20 9:41 ` [PATCH 4/5] kernel-uboot: support compressed kernel on MIPS André Draszik
2017-09-20 9:41 ` [PATCH 5/5] kernel-fitimage: support MIPS (compressed) André Draszik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox