summaryrefslogtreecommitdiff
path: root/classes/image_type_tezi.bbclass
AgeCommit message (Collapse)Author
2019-05-22image_type_tezi: check argument to basenameStefan Agner
Check whether argument two is given before passing it to basename. This avoids build failure when building without deploying device trees in the bootfs (e.g. TorizonCore). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-05-20image_type_tezi: support dtbs in subdirectoriesStefan Agner
Aarch64 typically stores device trees in subdirectories, e.g. freescale/fsl-imx8qm-apalis.dtb. However, the kernel-devicetree.bbclass deploys those files without subdirectory. Make sure the Tezi image class behaves like the kernel-devicetree.bbclass. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-05-14image_type_tezi.bbclass: drop redundant codeMing Liu
There are quite a few common code being shared by rootfs_tezi_rawnand and rootfs_tezi_distro_rawnand, we should merge them to a same function to avoid being redundant. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2019-05-12image_type_tezi.bbclass: drop hard-coded tar.xzMing Liu
Replace hard-coded tar.xz by TEZI_ROOT_SUFFIX since the rootfs image suffix is being controlled by that variable. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2019-05-12image_type_tezi.bbclass: drop some useless codeMing Liu
We currently have some tricky code intended to get rid of the "basehash value changed" errors, but they are actually not needed. Since the references to "DATE" only exist in image tasks or their prefuncs, so they would be expanded at task executing time but not recipe parsing time, a 'vardepsexclude' flag would be enough in this case. I guess the reason we introduced this piece of code was that we found we still could see the annoying "basehash value changed" errors with 'vardepsexclude' flag set at that moment, but that's probably was not caused by our code, it's actually another issue now had been fixed in OE by e74158b6cc1d683ab14ef5d47ec531f986fc2259: [ rm_work: sort the value of do_build dependencies ] We can safely drop these useless code per my test. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2019-05-12image_type_tezi.bbclass: normalize some comment textsMing Liu
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2019-03-04apalis/colibri-t20 -t30: drop machinesMax Krummenacher
These machines use an old Nvidia provided downstream kernel 3.1.10. They no longer much the way more recent sysroot components, e.g. libc, xserver et. al. The maintance burden to keep the userspace components in their old version becomes simply to high. Keep using the rocko based 2.8 BSP for these machines. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2019-03-04image_type_tezi.bbclass: refactor image size calculating functionsMing Liu
Drop bootfs_get_size since it has a obvious flaw, it's being called in both do_image_teziimg and do_image_teziimg_distro but the boot files of these two tasks are different. Drop rootfs_get_size, it's trying to get the size of IMAGE_ROOTFS directory, but in some cases, that is not correct, for instance, when TEZI_ROOT_SUFFIX is 'ota.tar.gz', the rootfs directory should be OTA_SYSROOT rather than IMAGE_ROOTFS. Introduce get_uncompressed_size function, it reads the image size from a image-size file in ${T} directory, and that image size is written into this file by the image functions when they making the tarballs. Also split the duplicated bootfs tarball creating code to a common function create_bootfs, and it must run as a prefuncs before rootfs_tezi_run_json and rootfs_tezi_run_distro_json, this ensures the image size has been written to the file when the later functions run. Signed-off-by: Ming Liu <liu.ming50@gmail.com> [use _append for tar commands] Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04meta: drop True option to getVar callsMing Liu
Search made with the following regex: getVar ?\((.*), True\), this is to be consistent with OE. This is follows the fix upstream in oe-core commit 7c552996: [ meta: remove True option to getVar calls ] Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: add option to ignore kernel and device treeLuka Pivk
In some cases kernel and device tree may be a part of rootfs and in this case we do not want to install anything related to kernel or device tree. Use TEZI_KERNEL_IMAGETYPE = "" to exclude kernel Use TEZI_KERNEL_DEVICETREE = "" to exclude device tree Signed-off-by: Luka Pivk <luka.pivk@toradex.com>
2019-03-04image_type_tezi.bbclass: drop image_types inheritanceMing Liu
It's redundant to inherit image_types bbclass, it's already done in image.bbclass. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: make eMMC the default flash typeStefan Agner
Before the latest changes eMMC was considered the default flash type and therefor not specified for all machines. Make sure that image_type_tezi.bbclass is backward compatible by setting TORADEX_FLASH_TYPE to "emmc" by default. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: implement teziimg for distro bootStefan Agner
Implement a separate teziimg class which support distro boot. This image format uses a layout which allows distro boot on block devices as well as raw NAND devices. It also support multi flash type images by creating two image.json files for each flash type. It requires machine specific meta data e.g.: TORADEX_PRODUCT_IDS = "0032 0033 0039 0041" TORADEX_PRODUCT_IDS[0032] = "imx7s-colibri-eval-v3.dtb,rawnand" TORADEX_PRODUCT_IDS[0033] = "imx7d-colibri-eval-v3.dtb,rawnand" TORADEX_PRODUCT_IDS[0039] = "imx7d-colibri-emmc-eval-v3.dtb,emmc" TORADEX_PRODUCT_IDS[0041] = "imx7d-colibri-eval-v3.dtb,rawnand" TORADEX_FLASH_TYPE = "rawnand emmc" UBOOT_BINARY_TEZI_EMMC = "u-boot.imx-sd" UBOOT_BINARY_TEZI_RAWNAND = "u-boot.imx-nd" UBOOT_ENV_TEZI_EMMC = "uEnv-sd.txt" UBOOT_ENV_TEZI_RAWNAND = "uEnv-nd.txt" Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: use $() instead of backticksStefan Agner
Prefer the $() syntax, it is POSIX and allows nesting. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: allow per flash type U-BootStefan Agner
Allow to use a different U-Boot binary/environment file per flash type. This prepares for a multi flash type image. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: allow custom rootfs image type and labelStefan Agner
Add variables to customize which rootfs image type we use in the Toradex Easy Installer image. Also allow custom root filesystem label. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: generate image.json per flash typeStefan Agner
This prepares support for images with multiple flash types. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: improve message during Tezi image buildStefan Agner
The whole tarball is built as part of the the teziimg CMD. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: break tar commands into multiple linesStefan Agner
Break tar commands for better readability. No functional change. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: move bootfs size calculationStefan Agner
Create a separate function to calculate bootfs size. This allows to reuse bootfs size calculation for distro boot. Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-03-04image_type_tezi: use KERNEL_DEVICETREE variable directlyStefan Agner
Now that OpenEmbedded core does not prefix dtb files names with the type of the kernel image, we can get rid of our intermediate KERNEL_DEVICETREE_FILES variable. Also the tar transformation which removed kernel type prefix is no longer necessary. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2019-03-04image_type_tezi: follow dropped kernel type prefixMax Krummenacher
The following openembedded core commit dropped prefixing the dtb file names with the type of the kernel image. 1860d9d3c62e2e94cd68a809385873ffd8270b6d kernel-devicetree.bbclass: Fix and simplify instalation of DTB files Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2019-03-04image_type_tezi: address basehash/taskhash mismatchMax Krummenacher
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2018-09-27image_type_tezi: Use IMAGE_NAME_SUFFIX variableDrew Moseley
Use IMAGE_NAME_SUFFIX variable rather than hardcoded value .rootfs as suffix. Signed-off-by: Drew Moseley <drew.moseley@northern.tech> [use Python in rootfs_tezi_(emmc|rawnand) to get image suffix] Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2018-06-18image_type_tezi: remove workaround to set prefuncsMax Krummenacher
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11372 With the fix available in rocko we can now replace the workaround with the usual bitbake syntax. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2018-06-18image_type_tezi: move DATE dereferencing into IMAGE_CMD_teziimgMax Krummenacher
This works around bitbake throwing the following error: | ERROR: When reparsing ...angstrom-lxqt-image.bb.do_image, | the basehash value changed from b2871a71bd4873d31d3fe7de755c753f to 5cf887f9a6518e8cf668fd3f435d1fc1. | The metadata is not deterministic and this needs to be fixed. It looks like the vardepsexclude flag is ignored in general python functions. Compare also with openembedded-core commit ecbc1db7ed1f9848dee69507de8eb289b8ddeba0 and follow-up extensions which uses a different workaround for the do_image code. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2018-06-18image_type_tezi: set apalis t30 cbootimageMarcel Ziswiler
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2018-06-18image_type_tezi: make emmc root file system type configurableMarcel Ziswiler
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2018-06-18image_type_tezi: make device tree optionalStefan Agner
Apalis T30 does not require a device tree. Do not try to deploy device trees if none are specified. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2018-03-28image_type_tezi: write uEnv.txt as default U-Boot environmentColibri-iMX7_LXDE-Image_2.8b2.97-20180331Colibri-iMX6_LXDE-Image_2.8b2.97-20180331Colibri-iMX6ULL_LXDE-Image_2.8b2.97-20180331Colibri-VF_LXDE-Image_2.8b2.97-20180331Colibri-T30_LXDE-Image_2.8b2.97-20180331Colibri-T20_LXDE-Image_2.8b2.97-20180331Apalis-iMX6_LXDE-Image_2.8b2.97-20180331Apalis-TK1_LXDE-Image_2.8b2.97-20180331Apalis-TK1-Mainline_LXDE-Image_2.8b2.97-20180331Apalis-T30_LXDE-Image_2.8b2.97-20180331Stefan Agner
Use the "u_boot_env" property to write uEnv.txt to flash by default. With that the Toradex Easy Installer will make sure that the default environment of the shipped U-Boot is written on flash. Especially since with 2.8b2 we transition to using zImage, this change will make sure that a correct U-Boot environment is written on flash to boot the zImage. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2018-03-28image_type_tezi: deploy default U-Boot environmentStefan Agner
Deploy the default U-Boot environment alongside U-Boot itself. This is helpful along with the new u_boot_env property for Toradex Easy Installer image files. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-12-22image_type_tezi: replace depracated IMAGE_DEPENDSMax Krummenacher
with its aquivalent do_image_teziimg[depends]. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-11-27image_type_tezi: make sure Tezi image use the -Tezi suffixStefan Agner
To clearly distinguish between images for Toradex Easy Installer and legacy images we add the suffix -Tezi to the Toradex Easy Installer images. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2017-11-27image_type_tezi: make sure image.json uses RFC 3339 datesStefan Agner
Use RFC 3339 date (2017-11-15) in the release_date field. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2017-10-03image_type_tezi: uboot_binary handling cbootimage for apalis tk1Marcel Ziswiler
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2017-10-03image_type_tezi: configurable payload offsetsMarcel Ziswiler
Use configurable rather than hard-coded boot ROM and SPL payload offsets. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2017-10-03image_type_tezi: make sure UBOOT_BINARY is definedStefan Agner
UBOOT_BINARY is only available in U-Boot recipes and the Toradex image recipes. If the Toradex image recipes are not used, then UBOOT_BINARY is undefined and image.json contains "null" instead of the binary name. Define UBOOT_BINARY with a reasonable default. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03image_type_tezi: generate image.json as a image prefuncStefan Agner
Generate the image description file just before the Tezi image gets generated by attaching rootfs_tezi_json as a prefunc of do_image. It should lead to better root file system size estimation since all do_rootfs post processing functions have been processed at that time. It also allows to move the check whether an Tezi image will be built into the anonymous python function. Later we should be able to get rid of the check by just adding rootfs_tezi_json as a prefunc of do_image_tezirun. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03image_type_tezi: depend on u-bootMax Krummenacher
Without this, if nothing else makes sure that U-Boot got built then image_type_tezi fails. This can happen when one does build core-image-minimal. | NOTE: Create bootfs tarball | tar: SPL: Cannot stat: No such file or directory Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03image_type_tezi: do not discard by defaultStefan Agner
The utility to create ext4 file systems (mkfs.ext4) discards all data on the target partition before creating the file system by default. On some eMMC this operation takes a while several seconds which makes flashing images slow. Often a new image is written to a already (almost) empty eMMC, so there is not a lot of value in discarding all data before flashing. Also, the Toradex Easy Installer has its own option which uses blkdiscard to discard blocks before writing (see "erase" option). Disable discard during file system creation by default using the nodiscard option. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03image_type_tezi: support non-SPL eMMC targetsStefan Agner
Colibri iMX7 Dual 1GB uses eMMC but no SPL. Make sure that Tezi flashes the u-boot.imx binary to the location where the boot loader expects the image. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03image_type_tezi: use standard variables as much as possibleStefan Agner
Use OpenEmbedded standard variables such as PV and DATE as much as possible. This allows to reuse the Tezi image class for non- Toradex images with their own versioning scheme. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03classes/image_type_tezi.bbclass: fix for dtb filenames containing multiple dotsMax Krummenacher
In IMAGE_CMD_teziimg(), if a dtb file has more than one dot the current logic fails. e.g. device.tree.dtb will be truncated at the first dot to device. Fix by removing awk in favour of letting basename also remove the .dtb extension. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-07-27image_type_tezi: Update tezi to use ext4 by default for emmcSanchayan Maity
Update tezi to use ext4 by default for emmc. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2017-06-09image_type_tezi: make small volumes staticStefan Agner
The volumes for kernel, device tree and Cortex-M4 firmware get updated with a single binary for which a static volume is better suited. This also allows the boot code to only load the amount of written bytes and therefore speeds up boot time. Static volumes have been used already with the update.sh script based update method. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-06-09image_type_tezi: pack raw nand images without bootfsStefan Agner
Raw NAND images flash the kernel and device tree directly into UBI volumes, hence there is no need to generate a bootfs tarball. Leave the kernel and device tree unpacked so we can copy it directly into the UBI volume. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-06-09image_type_tezi: add raw nand device supportStefan Agner
Add support for raw NAND devices. Describe the layout of the MTD partitions and UBI volumes using JSON. Also split the storage description into a separate function, called depending on a machine specific variable for eMMC and raw NAND. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-04-07image_type_tezi: use the new version variablesMax Krummenacher
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-02-08image_type_tezi: do not create image.json if teziimg is not requestedStefan Agner
In case teziimg is not among the requested images (not part of IMAGE_FSTYPES) we don't need to create a Toradex Easy Installer image.json file. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2017-02-08image_type_tezi: rename image to teziimgStefan Agner
Avoid ambiguity with other uses of the string "tezi", e.g. when used as an image or distro name. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>