2016-04-27 14:20:56 +00:00
|
|
|
inherit kernel-uboot uboot-sign
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
|
|
|
python __anonymous () {
|
2016-12-14 21:13:04 +00:00
|
|
|
kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
|
2016-05-25 08:47:16 +00:00
|
|
|
if 'fitImage' in kerneltypes.split():
|
2016-12-14 21:13:04 +00:00
|
|
|
depends = d.getVar("DEPENDS")
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
depends = "%s u-boot-mkimage-native dtc-native" % depends
|
|
|
|
d.setVar("DEPENDS", depends)
|
|
|
|
|
2017-10-06 12:12:57 +00:00
|
|
|
if d.getVar("UBOOT_ARCH") == "mips":
|
|
|
|
replacementtype = "vmlinuz.bin"
|
|
|
|
elif d.getVar("UBOOT_ARCH") == "x86":
|
2016-07-15 20:40:54 +00:00
|
|
|
replacementtype = "bzImage"
|
|
|
|
else:
|
|
|
|
replacementtype = "zImage"
|
|
|
|
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
|
|
|
|
# to kernel.bbclass . We have to override it, since we pack zImage
|
|
|
|
# (at least for now) into the fitImage .
|
2016-12-14 21:13:04 +00:00
|
|
|
typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
|
2016-05-25 08:47:16 +00:00
|
|
|
if 'fitImage' in typeformake.split():
|
2016-07-15 20:40:54 +00:00
|
|
|
d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', replacementtype))
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2016-12-14 21:13:04 +00:00
|
|
|
image = d.getVar('INITRAMFS_IMAGE')
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
if image:
|
2016-05-26 13:55:16 +00:00
|
|
|
d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
|
2016-04-27 14:20:56 +00:00
|
|
|
|
|
|
|
# Verified boot will sign the fitImage and append the public key to
|
2017-03-13 11:09:38 +00:00
|
|
|
# U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling
|
2016-04-27 14:20:56 +00:00
|
|
|
# the fitImage:
|
2017-01-12 03:24:36 +00:00
|
|
|
if d.getVar('UBOOT_SIGN_ENABLE') == "1":
|
2016-12-14 21:13:04 +00:00
|
|
|
uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
|
2016-04-27 14:20:56 +00:00
|
|
|
d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_deploy' % uboot_pn)
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
}
|
|
|
|
|
2016-04-27 14:20:55 +00:00
|
|
|
# Options for the device tree compiler passed to mkimage '-D' feature:
|
|
|
|
UBOOT_MKIMAGE_DTCOPTS ??= ""
|
|
|
|
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
#
|
|
|
|
# Emit the fitImage ITS header
|
|
|
|
#
|
2016-05-26 13:55:16 +00:00
|
|
|
# $1 ... .its filename
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
fitimage_emit_fit_header() {
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
/dts-v1/;
|
|
|
|
|
|
|
|
/ {
|
|
|
|
description = "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}";
|
|
|
|
#address-cells = <1>;
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Emit the fitImage section bits
|
|
|
|
#
|
2016-05-26 13:55:16 +00:00
|
|
|
# $1 ... .its filename
|
|
|
|
# $2 ... Section bit type: imagestart - image section start
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
# confstart - configuration section start
|
|
|
|
# sectend - section end
|
|
|
|
# fitend - fitimage end
|
|
|
|
#
|
|
|
|
fitimage_emit_section_maint() {
|
2016-05-26 13:55:16 +00:00
|
|
|
case $2 in
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
imagestart)
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
|
|
|
images {
|
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
confstart)
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
|
|
|
configurations {
|
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
sectend)
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
};
|
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
fitend)
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
};
|
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Emit the fitImage ITS kernel section
|
|
|
|
#
|
2016-05-26 13:55:16 +00:00
|
|
|
# $1 ... .its filename
|
|
|
|
# $2 ... Image counter
|
|
|
|
# $3 ... Path to kernel image
|
|
|
|
# $4 ... Compression type
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
fitimage_emit_section_kernel() {
|
|
|
|
|
|
|
|
kernel_csum="sha1"
|
|
|
|
|
|
|
|
ENTRYPOINT=${UBOOT_ENTRYPOINT}
|
2017-03-25 18:03:55 +00:00
|
|
|
if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
|
2017-10-06 12:12:54 +00:00
|
|
|
ENTRYPOINT=`${HOST_PREFIX}nm vmlinux | \
|
|
|
|
awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
fi
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
|
|
|
kernel@${2} {
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
description = "Linux kernel";
|
2016-05-26 13:55:16 +00:00
|
|
|
data = /incbin/("${3}");
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
type = "kernel";
|
|
|
|
arch = "${UBOOT_ARCH}";
|
|
|
|
os = "linux";
|
2016-05-26 13:55:16 +00:00
|
|
|
compression = "${4}";
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
load = <${UBOOT_LOADADDRESS}>;
|
|
|
|
entry = <${ENTRYPOINT}>;
|
|
|
|
hash@1 {
|
|
|
|
algo = "${kernel_csum}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Emit the fitImage ITS DTB section
|
|
|
|
#
|
2016-05-26 13:55:16 +00:00
|
|
|
# $1 ... .its filename
|
|
|
|
# $2 ... Image counter
|
|
|
|
# $3 ... Path to DTB image
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
fitimage_emit_section_dtb() {
|
|
|
|
|
|
|
|
dtb_csum="sha1"
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
|
|
|
fdt@${2} {
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
description = "Flattened Device Tree blob";
|
2016-05-26 13:55:16 +00:00
|
|
|
data = /incbin/("${3}");
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
type = "flat_dt";
|
|
|
|
arch = "${UBOOT_ARCH}";
|
|
|
|
compression = "none";
|
|
|
|
hash@1 {
|
|
|
|
algo = "${dtb_csum}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2016-07-15 20:40:54 +00:00
|
|
|
#
|
|
|
|
# Emit the fitImage ITS setup section
|
|
|
|
#
|
|
|
|
# $1 ... .its filename
|
|
|
|
# $2 ... Image counter
|
|
|
|
# $3 ... Path to setup image
|
|
|
|
fitimage_emit_section_setup() {
|
|
|
|
|
|
|
|
setup_csum="sha1"
|
|
|
|
|
|
|
|
cat << EOF >> ${1}
|
|
|
|
setup@${2} {
|
|
|
|
description = "Linux setup.bin";
|
|
|
|
data = /incbin/("${3}");
|
|
|
|
type = "x86_setup";
|
|
|
|
arch = "${UBOOT_ARCH}";
|
|
|
|
os = "linux";
|
|
|
|
compression = "none";
|
|
|
|
load = <0x00090000>;
|
|
|
|
entry = <0x00090000>;
|
|
|
|
hash@1 {
|
|
|
|
algo = "${setup_csum}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
#
|
|
|
|
# Emit the fitImage ITS ramdisk section
|
|
|
|
#
|
|
|
|
# $1 ... .its filename
|
|
|
|
# $2 ... Image counter
|
|
|
|
# $3 ... Path to ramdisk image
|
|
|
|
fitimage_emit_section_ramdisk() {
|
|
|
|
|
|
|
|
ramdisk_csum="sha1"
|
2017-01-20 19:28:53 +00:00
|
|
|
ramdisk_ctype="none"
|
2016-10-21 12:07:27 +00:00
|
|
|
ramdisk_loadline=""
|
|
|
|
ramdisk_entryline=""
|
|
|
|
|
|
|
|
if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then
|
|
|
|
ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;"
|
|
|
|
fi
|
|
|
|
if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then
|
|
|
|
ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;"
|
|
|
|
fi
|
2016-05-26 13:55:16 +00:00
|
|
|
|
2017-01-20 19:28:53 +00:00
|
|
|
case $3 in
|
|
|
|
*.gz)
|
|
|
|
ramdisk_ctype="gzip"
|
|
|
|
;;
|
|
|
|
*.bz2)
|
|
|
|
ramdisk_ctype="bzip2"
|
|
|
|
;;
|
|
|
|
*.lzma)
|
|
|
|
ramdisk_ctype="lzma"
|
|
|
|
;;
|
|
|
|
*.lzo)
|
|
|
|
ramdisk_ctype="lzo"
|
|
|
|
;;
|
|
|
|
*.lz4)
|
|
|
|
ramdisk_ctype="lz4"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
|
|
|
ramdisk@${2} {
|
2017-01-20 19:28:53 +00:00
|
|
|
description = "${INITRAMFS_IMAGE}";
|
2016-05-26 13:55:16 +00:00
|
|
|
data = /incbin/("${3}");
|
|
|
|
type = "ramdisk";
|
|
|
|
arch = "${UBOOT_ARCH}";
|
|
|
|
os = "linux";
|
2017-01-20 19:28:53 +00:00
|
|
|
compression = "${ramdisk_ctype}";
|
2016-10-21 12:07:27 +00:00
|
|
|
${ramdisk_loadline}
|
|
|
|
${ramdisk_entryline}
|
2016-05-26 13:55:16 +00:00
|
|
|
hash@1 {
|
|
|
|
algo = "${ramdisk_csum}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
#
|
|
|
|
# Emit the fitImage ITS configuration section
|
|
|
|
#
|
2016-05-26 13:55:16 +00:00
|
|
|
# $1 ... .its filename
|
|
|
|
# $2 ... Linux kernel ID
|
2017-03-17 15:33:03 +00:00
|
|
|
# $3 ... DTB image name
|
2016-05-26 13:55:16 +00:00
|
|
|
# $4 ... ramdisk ID
|
2016-07-15 20:40:54 +00:00
|
|
|
# $5 ... config ID
|
2017-03-17 15:33:03 +00:00
|
|
|
# $6 ... default flag
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
fitimage_emit_section_config() {
|
|
|
|
|
|
|
|
conf_csum="sha1"
|
2016-04-27 14:20:56 +00:00
|
|
|
if [ -n "${UBOOT_SIGN_ENABLE}" ] ; then
|
|
|
|
conf_sign_keyname="${UBOOT_SIGN_KEYNAME}"
|
|
|
|
fi
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
|
|
|
# Test if we have any DTBs at all
|
2016-07-15 20:40:54 +00:00
|
|
|
conf_desc="Linux kernel"
|
|
|
|
kernel_line="kernel = \"kernel@${2}\";"
|
|
|
|
fdt_line=""
|
|
|
|
ramdisk_line=""
|
2017-03-17 15:33:03 +00:00
|
|
|
setup_line=""
|
|
|
|
default_line=""
|
2016-07-15 20:40:54 +00:00
|
|
|
|
|
|
|
if [ -n "${3}" ]; then
|
|
|
|
conf_desc="${conf_desc}, FDT blob"
|
2016-05-26 13:55:16 +00:00
|
|
|
fdt_line="fdt = \"fdt@${3}\";"
|
2016-07-15 20:40:54 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${4}" ]; then
|
|
|
|
conf_desc="${conf_desc}, ramdisk"
|
2016-05-26 13:55:16 +00:00
|
|
|
ramdisk_line="ramdisk = \"ramdisk@${4}\";"
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
fi
|
2016-07-15 20:40:54 +00:00
|
|
|
|
|
|
|
if [ -n "${5}" ]; then
|
|
|
|
conf_desc="${conf_desc}, setup"
|
|
|
|
setup_line="setup = \"setup@${5}\";"
|
|
|
|
fi
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2017-03-17 15:33:03 +00:00
|
|
|
if [ "${6}" = "1" ]; then
|
|
|
|
default_line="default = \"conf@${3}\";"
|
|
|
|
fi
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
2017-03-17 15:33:03 +00:00
|
|
|
${default_line}
|
|
|
|
conf@${3} {
|
|
|
|
description = "${6} ${conf_desc}";
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
${kernel_line}
|
|
|
|
${fdt_line}
|
2016-05-26 13:55:16 +00:00
|
|
|
${ramdisk_line}
|
2016-07-15 20:40:54 +00:00
|
|
|
${setup_line}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
hash@1 {
|
|
|
|
algo = "${conf_csum}";
|
|
|
|
};
|
2016-04-27 14:20:56 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
if [ ! -z "${conf_sign_keyname}" ] ; then
|
|
|
|
|
2016-07-15 20:40:54 +00:00
|
|
|
sign_line="sign-images = \"kernel\""
|
|
|
|
|
|
|
|
if [ -n "${3}" ]; then
|
|
|
|
sign_line="${sign_line}, \"fdt\""
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${4}" ]; then
|
|
|
|
sign_line="${sign_line}, \"ramdisk\""
|
2016-04-27 14:20:56 +00:00
|
|
|
fi
|
|
|
|
|
2016-07-15 20:40:54 +00:00
|
|
|
if [ -n "${5}" ]; then
|
|
|
|
sign_line="${sign_line}, \"setup\""
|
|
|
|
fi
|
|
|
|
|
|
|
|
sign_line="${sign_line};"
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
2016-04-27 14:20:56 +00:00
|
|
|
signature@1 {
|
|
|
|
algo = "${conf_csum},rsa2048";
|
|
|
|
key-name-hint = "${conf_sign_keyname}";
|
2016-05-26 13:55:16 +00:00
|
|
|
${sign_line}
|
2016-04-27 14:20:56 +00:00
|
|
|
};
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
cat << EOF >> ${1}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
};
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
#
|
|
|
|
# Assemble fitImage
|
|
|
|
#
|
|
|
|
# $1 ... .its filename
|
|
|
|
# $2 ... fitImage name
|
|
|
|
# $3 ... include ramdisk
|
|
|
|
fitimage_assemble() {
|
|
|
|
kernelcount=1
|
|
|
|
dtbcount=""
|
2017-03-17 15:33:03 +00:00
|
|
|
DTBS=""
|
2016-05-26 13:55:16 +00:00
|
|
|
ramdiskcount=${3}
|
2016-07-15 20:40:54 +00:00
|
|
|
setupcount=""
|
2016-05-26 13:55:16 +00:00
|
|
|
rm -f ${1} arch/${ARCH}/boot/${2}
|
|
|
|
|
|
|
|
fitimage_emit_fit_header ${1}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Step 1: Prepare a kernel image section.
|
|
|
|
#
|
|
|
|
fitimage_emit_section_maint ${1} imagestart
|
|
|
|
|
|
|
|
uboot_prep_kimage
|
|
|
|
fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Step 2: Prepare a DTB image section
|
|
|
|
#
|
2017-03-25 18:03:55 +00:00
|
|
|
if [ -n "${KERNEL_DEVICETREE}" ]; then
|
2016-05-26 13:55:16 +00:00
|
|
|
dtbcount=1
|
|
|
|
for DTB in ${KERNEL_DEVICETREE}; do
|
|
|
|
if echo ${DTB} | grep -q '/dts/'; then
|
|
|
|
bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
|
|
|
|
DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
|
|
|
|
fi
|
|
|
|
DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
|
|
|
|
if [ ! -e "${DTB_PATH}" ]; then
|
|
|
|
DTB_PATH="arch/${ARCH}/boot/${DTB}"
|
|
|
|
fi
|
|
|
|
|
2017-10-06 12:12:53 +00:00
|
|
|
DTB=$(echo "${DTB}" | tr '/' '_')
|
2017-03-17 15:33:03 +00:00
|
|
|
DTBS="${DTBS} ${DTB}"
|
|
|
|
fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
|
2016-05-26 13:55:16 +00:00
|
|
|
done
|
|
|
|
fi
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
#
|
2016-07-15 20:40:54 +00:00
|
|
|
# Step 3: Prepare a setup section. (For x86)
|
|
|
|
#
|
2017-03-25 18:03:55 +00:00
|
|
|
if [ -e arch/${ARCH}/boot/setup.bin ]; then
|
2016-07-15 20:40:54 +00:00
|
|
|
setupcount=1
|
|
|
|
fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Step 4: Prepare a ramdisk section.
|
2016-05-26 13:55:16 +00:00
|
|
|
#
|
|
|
|
if [ "x${ramdiskcount}" = "x1" ] ; then
|
2017-01-20 19:28:53 +00:00
|
|
|
# Find and use the first initramfs image archive type we find
|
|
|
|
for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
|
2017-03-30 07:59:58 +00:00
|
|
|
initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
|
2017-01-20 19:28:53 +00:00
|
|
|
echo "Using $initramfs_path"
|
|
|
|
if [ -e "${initramfs_path}" ]; then
|
|
|
|
fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2016-05-26 13:55:16 +00:00
|
|
|
fi
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
fitimage_emit_section_maint ${1} sectend
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
# Force the first Kernel and DTB in the default config
|
|
|
|
kernelcount=1
|
2017-03-25 18:03:55 +00:00
|
|
|
if [ -n "${dtbcount}" ]; then
|
2016-07-15 20:40:54 +00:00
|
|
|
dtbcount=1
|
|
|
|
fi
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
#
|
2016-07-15 20:40:54 +00:00
|
|
|
# Step 5: Prepare a configurations section
|
2016-05-26 13:55:16 +00:00
|
|
|
#
|
|
|
|
fitimage_emit_section_maint ${1} confstart
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2017-03-25 18:03:55 +00:00
|
|
|
if [ -n "${DTBS}" ]; then
|
2017-03-17 15:33:03 +00:00
|
|
|
i=1
|
|
|
|
for DTB in ${DTBS}; do
|
|
|
|
fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
|
|
|
|
i=`expr ${i} + 1`
|
|
|
|
done
|
|
|
|
fi
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
fitimage_emit_section_maint ${1} sectend
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
fitimage_emit_section_maint ${1} fitend
|
|
|
|
|
|
|
|
#
|
2016-07-15 20:40:54 +00:00
|
|
|
# Step 6: Assemble the image
|
2016-05-26 13:55:16 +00:00
|
|
|
#
|
|
|
|
uboot-mkimage \
|
|
|
|
${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
|
|
|
|
-f ${1} \
|
|
|
|
arch/${ARCH}/boot/${2}
|
|
|
|
|
|
|
|
#
|
2016-07-15 20:40:54 +00:00
|
|
|
# Step 7: Sign the image and add public key to U-Boot dtb
|
2016-05-26 13:55:16 +00:00
|
|
|
#
|
|
|
|
if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then
|
2016-04-27 14:20:55 +00:00
|
|
|
uboot-mkimage \
|
|
|
|
${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
|
2016-05-26 13:55:16 +00:00
|
|
|
-F -k "${UBOOT_SIGN_KEYDIR}" \
|
|
|
|
-K "${DEPLOY_DIR_IMAGE}/${UBOOT_DTB_BINARY}" \
|
|
|
|
-r arch/${ARCH}/boot/${2}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
do_assemble_fitimage() {
|
|
|
|
if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
|
|
|
|
cd ${B}
|
|
|
|
fitimage_assemble fit-image.its fitImage
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
addtask assemble_fitimage before do_install after do_compile
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
do_assemble_fitimage_initramfs() {
|
|
|
|
if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \
|
|
|
|
test -n "${INITRAMFS_IMAGE}" ; then
|
|
|
|
cd ${B}
|
|
|
|
fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
addtask assemble_fitimage_initramfs before do_deploy after do_install
|
|
|
|
|
|
|
|
|
2016-04-15 10:19:46 +00:00
|
|
|
kernel_do_deploy[vardepsexclude] = "DATETIME"
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
kernel_do_deploy_append() {
|
|
|
|
# Update deploy directory
|
2016-05-25 08:47:16 +00:00
|
|
|
if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
cd ${B}
|
|
|
|
echo "Copying fit-image.its source file..."
|
2016-05-25 08:47:16 +00:00
|
|
|
its_base_name="fitImage-its-${PV}-${PR}-${MACHINE}-${DATETIME}"
|
|
|
|
its_symlink_name=fitImage-its-${MACHINE}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its
|
2016-05-25 08:47:16 +00:00
|
|
|
linux_bin_base_name="fitImage-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}"
|
|
|
|
linux_bin_symlink_name=fitImage-linux.bin-${MACHINE}
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin
|
|
|
|
|
2016-05-26 13:55:16 +00:00
|
|
|
if [ -n "${INITRAMFS_IMAGE}" ]; then
|
|
|
|
echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
|
2017-03-30 07:59:58 +00:00
|
|
|
its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
|
|
|
|
its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE_NAME}
|
2016-05-26 13:55:16 +00:00
|
|
|
install -m 0644 fit-image-${INITRAMFS_IMAGE}.its ${DEPLOYDIR}/${its_initramfs_base_name}.its
|
2017-03-30 07:59:58 +00:00
|
|
|
fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
|
|
|
|
fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE_NAME}
|
2016-05-26 13:55:16 +00:00
|
|
|
install -m 0644 arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} ${DEPLOYDIR}/${fit_initramfs_base_name}.bin
|
|
|
|
fi
|
|
|
|
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
cd ${DEPLOYDIR}
|
|
|
|
ln -sf ${its_base_name}.its ${its_symlink_name}.its
|
|
|
|
ln -sf ${linux_bin_base_name}.bin ${linux_bin_symlink_name}.bin
|
2016-05-26 13:55:16 +00:00
|
|
|
|
|
|
|
if [ -n "${INITRAMFS_IMAGE}" ]; then
|
|
|
|
ln -sf ${its_initramfs_base_name}.its ${its_initramfs_symlink_name}.its
|
|
|
|
ln -sf ${fit_initramfs_base_name}.bin ${fit_initramfs_symlink_name}.bin
|
|
|
|
fi
|
kernel: Add basic fitImage support
This patch adds support for generating a kernel fitImage, which is
a a successor to the uImage format. Unlike uImage, which could only
contain the kernel image itself, the fitImage can contain all kinds
of artifacts, like the kernel image, device tree blobs, initramfs
images, binary firmwares etc. Furthermore, the fitImage supports
different kinds of checksums, not only CRC32 like the uImage did.
Last, but not least, fitImage supports signatures such that either
the whole image or it's parts can be signed and then in turn can
be verified by the bootloader.
So far we only add support for wrapping the kernel image and DTB
into the fitImage. The fitImage uses the sha1 checksum, which is
the default.
(From OE-Core rev: d92664278cfd0fdb455f78f73f2c44a9ee1716e4)
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>
2015-05-14 12:31:12 +00:00
|
|
|
fi
|
|
|
|
}
|