aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdellatif El Khlifi <abdellatif.elkhlifi@arm.com>2020-07-01 15:16:15 +0100
committersudipto paul <sudipto.paul@arm.com>2020-07-28 12:12:42 +0100
commit6f3a6e65ef46a10270f5f84e04c99a48ab20f38b (patch)
tree5bf9dec1284578840eefe5e2f18975234d697fa2
parent9f9a20564e571b359aa756b10be8f3e69a7913f8 (diff)
arm-image: introducing the layer
meta-arm-image layer provides the following: - Introducing a common image recipe shared between multiple platforms. The image recipe name is arm-reference-image.bb - Helper classes (cramfs-xip, u-bootimg, wic_nopt) - Cramfs tools recipe Each platform can extend arm-reference-image by including inc files to provide custom image settings tailored to the selected machine. This layer is intended to hold arm-reference-image, the image includes and classes. Change-Id: I36b28a1cef5d4c209631b7292c5b3b33081d2cb1 Signed-off-by: Rui Miguel Silva <rui.silva@arm.com> Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
-rw-r--r--README.md29
-rw-r--r--classes/cramfs-xip.bbclass9
-rw-r--r--classes/u-bootimg.bbclass11
-rw-r--r--classes/wic_nopt.bbclass9
-rw-r--r--conf/layer.conf15
-rw-r--r--recipes-core/cramfs-tools/cramfs-tools_2.1.bb25
-rw-r--r--recipes-core/images/arm-reference-image.bb9
7 files changed, 107 insertions, 0 deletions
diff --git a/README.md b/README.md
index e69de29..c4592da 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,29 @@
+Introduction
+------------
+This repository contains meta-arm-image layer for OpenEmbedded
+
+meta-arm-image:
+ This layer provides a common image shared between different Arm platforms.
+ This image is called arm-reference-image.
+ Each platform can extend arm-reference-image by including inc files to provide
+ custom image settings tailored to the selected machine.
+ This layer is intended to hold arm-reference-image, the image includes
+ and classes.
+
+Contributing
+------------
+Currently, we only accept patches from the meta-arm mailing list. For general
+information on how to submit a patch, please read
+https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
+
+E-mail meta-arm@lists.yoctoproject.org with patches created using this process
+
+Reporting bugs
+--------------
+E-mail meta-arm@lists.yoctoproject.org with the error encountered and the steps
+to reproduce the issue
+
+
+Maintainer(s)
+-------------
+* Jon Mason <jon.mason@arm.com>
diff --git a/classes/cramfs-xip.bbclass b/classes/cramfs-xip.bbclass
new file mode 100644
index 0000000..9449f34
--- /dev/null
+++ b/classes/cramfs-xip.bbclass
@@ -0,0 +1,9 @@
+# The dependency below is to make sure the mkcramfs binary is
+# available in the sysroot before building the XIP image.
+# mkcramfs is needed by IMAGE_CMD_cramfs-xip
+
+do_image_cramfs_xip[depends] += "cramfs-tools-native:do_populate_sysroot"
+
+IMAGE_TYPES += "cramfs-xip"
+
+IMAGE_CMD_cramfs-xip = "mkcramfs -n ${IMAGE_NAME} -X ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cramfs-xip ${EXTRA_IMAGECMD}"
diff --git a/classes/u-bootimg.bbclass b/classes/u-bootimg.bbclass
new file mode 100644
index 0000000..3835367
--- /dev/null
+++ b/classes/u-bootimg.bbclass
@@ -0,0 +1,11 @@
+# This class generates a ramdisk compatible with u-boot.
+# The ramdisk image can be used as a parameter to the u-boot
+# bootm command.
+
+IMAGE_TYPES += "cpio.gz.u-bootimg"
+
+CONVERSIONTYPES += "u-bootimg"
+
+CONVERSION_DEPENDS_u-bootimg = "u-boot-mkimage-native"
+
+CONVERSION_CMD_u-bootimg = "mkimage -A arm -O linux -C none -T ramdisk -n ramdisk -a ${UBOOT_IMAGE_LOADADDRESS} -e ${UBOOT_IMAGE_ENTRYPOINT} -n ${IMAGE_NAME} -d ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.u-bootimg"
diff --git a/classes/wic_nopt.bbclass b/classes/wic_nopt.bbclass
new file mode 100644
index 0000000..08aaca0
--- /dev/null
+++ b/classes/wic_nopt.bbclass
@@ -0,0 +1,9 @@
+# This class removes the empty partition table header
+# in the WIC file when --no-table WKS option is used
+
+IMAGE_TYPES += "wic.nopt"
+
+CONVERSIONTYPES += "nopt"
+
+# 1024 bytes are skipped which corresponds to the size of the partition table header to remove
+CONVERSION_CMD_nopt = "tail -c +1025 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.nopt"
diff --git a/conf/layer.conf b/conf/layer.conf
new file mode 100644
index 0000000..4a05a0a
--- /dev/null
+++ b/conf/layer.conf
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: MIT
+#
+# Copyright (c) 2020 Arm Limited
+#
+
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "meta-arm-image"
+BBFILE_PATTERN_meta-arm-image := "^${LAYERDIR}/"
+LAYERSERIES_COMPAT_meta-arm-image = "dunfell"
diff --git a/recipes-core/cramfs-tools/cramfs-tools_2.1.bb b/recipes-core/cramfs-tools/cramfs-tools_2.1.bb
new file mode 100644
index 0000000..0dd3374
--- /dev/null
+++ b/recipes-core/cramfs-tools/cramfs-tools_2.1.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Cramfs tools"
+DESCRIPTION = "Cramfs tools to create cramfs images with support to XIP"
+HOMEPAGE = "https://github.com/npitre/cramfs-tools"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRC_URI = "git://github.com/npitre/cramfs-tools;protocol=https"
+
+SRCREV = "bf888f2dd0a96cc804ec7d656ecbbe7354ac0497"
+
+DEPENDS = "zlib"
+
+BBCLASSEXTEND = "native"
+
+S = "${WORKDIR}/git"
+
+do_compile() {
+ oe_runmake all CC="${CC}" CFLAGS="${CFLAGS} ${CPPFLAGS} ${LDFLAGS}"
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install ${S}/mkcramfs ${D}${bindir}
+ install ${S}/cramfsck ${D}${bindir}
+}
diff --git a/recipes-core/images/arm-reference-image.bb b/recipes-core/images/arm-reference-image.bb
new file mode 100644
index 0000000..aaa7c53
--- /dev/null
+++ b/recipes-core/images/arm-reference-image.bb
@@ -0,0 +1,9 @@
+SUMARY = "Arm Reference Image"
+DESCRIPTION = "Common Linux image for Arm platforms"
+LICENSE = "MIT"
+
+inherit core-image
+
+MACHINE_IMAGE_REQUIRE ?= ""
+
+require ${MACHINE_IMAGE_REQUIRE}