mirror of
https://git.yoctoproject.org/poky
synced 2026-04-14 17:02:22 +02:00
kernel: Separate out uboot_prep_kimage
Separate the function which prepares the kernel for packing into uImage into separate class, so this function can be reused by the fitImage class. (From OE-Core rev: 2d1f700ad098c942834524891ccc90e3a391a09f) Signed-off-by: Marek Vasut <marex@denx.de> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Koen Kooi <koen@dominion.thruhere.net> Cc: Paul Eggleton <paul.eggleton@linux.intel.com> Cc: Ross Burton <ross.burton@intel.com> Cc: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7f131b8863
commit
bb68c7c9f0
21
meta/classes/kernel-uboot.bbclass
Normal file
21
meta/classes/kernel-uboot.bbclass
Normal file
@@ -0,0 +1,21 @@
|
||||
uboot_prep_kimage() {
|
||||
if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
|
||||
vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
|
||||
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
|
||||
|
||||
if [ "${linux_comp}" != "none" ] ; then
|
||||
rm -f linux.bin
|
||||
gzip -9 linux.bin
|
||||
mv -f "linux.bin${linux_suffix}" linux.bin
|
||||
fi
|
||||
|
||||
echo "${linux_comp}"
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
inherit kernel-uboot
|
||||
|
||||
python __anonymous () {
|
||||
kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
|
||||
if kerneltype == 'uImage':
|
||||
@@ -6,28 +8,6 @@ python __anonymous () {
|
||||
d.setVar("DEPENDS", depends)
|
||||
}
|
||||
|
||||
uboot_prep_kimage() {
|
||||
if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
|
||||
vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
|
||||
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
|
||||
|
||||
if [ "${linux_comp}" != "none" ] ; then
|
||||
rm -f linux.bin
|
||||
gzip -9 linux.bin
|
||||
mv -f "linux.bin${linux_suffix}" linux.bin
|
||||
fi
|
||||
|
||||
echo "${linux_comp}"
|
||||
}
|
||||
|
||||
do_uboot_mkimage() {
|
||||
if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
|
||||
if test "x${KEEPUIMAGE}" != "xyes" ; then
|
||||
|
||||
Reference in New Issue
Block a user