diff --git a/meta-iota/README.md b/meta-iota/README.md new file mode 100644 index 00000000..f38979d9 --- /dev/null +++ b/meta-iota/README.md @@ -0,0 +1,60 @@ +# Iota OS + +This is meta layer dedicated to support Arm fast models. + +# Iota setup + +The way to start the setup to build the distribution is to fetch the +iota-manifest. For that, first install repo tool from google: + +``` +curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > /tmp/repo +sudo install -m 0755 /tmp/repo /usr/local/bin/repo; +``` + +and then fetch the manifest: +``` +mkdir ~/iota; cd ~/iota +repo init -u oteutoehuote -b master -m default.xml +repo sync +``` + +after setup the following environment variables to set the distribution and the +machine type of the build, for now only vexpress-a32 is totally tested, but +others will follow: + +``` +export DISTRO="iota" +export MACHINE="vexpress-a32" +``` + +Then prepare the environment to run the build, in the top directory + +``` +source setup-environment +``` + +This will create and put you ready to start the build in a topdir/build-iota +directory, to start the build just type: + +``` +bitbake iota-tiny-image +``` + +The first build is long and can take several minutes to conclude, when finished +check the resulted binaries in the deploy directory + +``` + ~/iota/build-iota/tmp-iota/deploy/images/vexpress-a32/ +``` + +To load the resulted flash img in the FVP model + +``` +YOCTO_OUTDIR=~/iota/build-iota/tmp-iota/deploy/images/vexpress-a32 + +./host/FVP_Base_Cortex-A32x1 \ + -C bp.secureflashloader.fname=${YOCTO_OUTDIR}/bl1.bin \ + -C bp.flashloader0.fname=${YOCTO_OUTDIR}/iota-tiny-image-vexpress-a32.wic + +``` diff --git a/meta-iota/conf/distro/iota-tiny.conf b/meta-iota/conf/distro/iota-tiny.conf new file mode 100644 index 00000000..00a86c7f --- /dev/null +++ b/meta-iota/conf/distro/iota-tiny.conf @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: MIT +# +# Copyright (c) 2019 Arm Limited +# + +require conf/distro/poky-tiny.conf + +DISTRO_NAME = "Iota - Tiny Linux Distribution" +DISTRO = "iota-tiny" +DISTRO_VERSION = "0.1" + +INHERIT += "image-buildinfo" + +TCLIBC = "musl" diff --git a/meta-iota/conf/layer.conf b/meta-iota/conf/layer.conf new file mode 100644 index 00000000..19721be9 --- /dev/null +++ b/meta-iota/conf/layer.conf @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: MIT +# +# Copyright (c) 2019 Arm Limited +# + +# iota has a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# iota has a packages directory, add to BBFILES +BBFILES += " \ + ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "iota" +BBFILE_PATTERN_iota := "^${LAYERDIR}/" +BBFILE_PRIORITY_iota = "14" +LAYERSERIES_COMPAT_iota = "warrior" + diff --git a/meta-iota/recipes-core/images/iota-tiny-image.bb b/meta-iota/recipes-core/images/iota-tiny-image.bb new file mode 100644 index 00000000..9ea0833b --- /dev/null +++ b/meta-iota/recipes-core/images/iota-tiny-image.bb @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (c) 2019 Linaro, LLC +# Copyright (c) 2019 Arm Limited +# +# Iota Recipe to build tiny minimal image +# + +SUMARY = "Iota Tiny Minimal Image" +DESCRIPTION = "Tiny Linux image for Iota Distribution" +LICENSE = "MIT" + +IMAGE_LINGUAS = " " +IMAGE_FEATURES += "debug-tweaks" +IMAGE_FSTYPES += " wic" +DEPENDS += "u-boot-mkimage-native" + +inherit core-image + +# Remove Partition table if wic image is generated +do_cleanup_partition_table() { + echo "check if partition table exits in wic image" + header=$(head -c 4 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.wic | md5sum -b | cut -d ' ' -f1) + + if [ ${header}=="d9a7c187f1dc40d183b645f61daa500f" ]; then + echo "remove partition table from wic image" + tail -c +1025 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.wic > ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.img + mv ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.img ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.wic + fi +} +addtask do_cleanup_partition_table after do_image_wic before do_image_complete + +do_image_make_ramfs() { + echo "adding uboot header to cpio.gz" + mkimage -A arm -O linux -C none -T ramdisk -n ramdisk -a 0x84000000 -e 0x84000000 -n "Iota Ramdisk" -d ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.cpio.gz ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.initramfs.cpio.gz + cd ${IMGDEPLOYDIR}; ln -s ${IMAGE_NAME}.rootfs.initramfs.cpio.gz ${IMAGE_LINK_NAME}.initramfs.cpio.gz +} + +do_image_make_ramfs_corstone700() { + echo "u-boot not present in corstone700" +} + +addtask do_image_make_ramfs after do_image_cpio before do_image_wic