summaryrefslogtreecommitdiffstats
path: root/classes
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #796 from ricardosalveti/masterPatti Vacek2021-01-291-1/+1
|\ | | | | image_types_ota.bbclass: use standard ext4 features
| * image_types_ota.bbclass: use standard ext4 featuresRicardo Salveti2021-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid removing 64bit and metadata_csum by default and prefer the standard ext4 features instead. 64bit enables the file system to be larger than 2^32 blocks and metadata_csum enables metadata checksumming, both of which are enabled by default on recent mke2fs releases. It is unclear why 64bit was disabled by looking at the git history, but my assumption would be that either kernel or userspace was old enough for this feature to not be supported/available. Since this option is currently used by most distros by default, it should now be safe to enable it (requires kernel >= 2.6.28). metadata_csum was disabled in 4d34fa53db to make the u-boot tooling work with the ext4 file system (when saving environment), but the correct fix should instead be a fix at the userspace tooling instead, since not every target requires u-boot. Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
* | Merge pull request #797 from ↵Patti Vacek2021-01-291-0/+1
|\ \ | | | | | | | | | | | | liuming50/fix-race-problems-of-ostreecommit-ota-tasks image_types_ota.bbclass: get lock before accessing OSTREE_REPO
| * | image_types_ostree.bbclass: get lock before accessing OSTREE_REPOMing Liu2021-01-281-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit d13ec585ae677affd88b9d92c6ea135cc249b2fa: [ image_types_ostree: use OSTree repo location for lockfiles ] A lockfile ${OSTREE_REPO}/ostree.lock was added to prevent concurrent access to the repository by multiple bitbake instances, but it should not only apply to ostreecommit task, but ostreepush task also need it. This fixes a following race condition error: | | ERROR: Execution of '.../temp/run.do_image_ostreecommit.34262' failed with exit code 1: | error: Writing content object: Creating temp file: No such file or directory Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* / image_repo_manifest.bbclass: Improvement for builds outside the .repo directoryDominik Wild2021-01-191-1/+1
|/ | | | | | | The repo tool searches up the directory tree to find the .repo directory, which doesn't work in a separated build directory. Signed-off-by: Dominik Wild <dominik.wild@glutz.com>
* image_types_ota.bbclass: pass -t ext4 to mke2fsMartin Jansa2021-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * it doesn't automatically pass "-t ext4", because here we're calling mke2fs as mkfs.ota-ext4 instead of mkfs.ext4 so the resulting was now ext2 instead of ext4 $ file image-raspberrypi4.rootfs.ota-ext4 image-raspberrypi4.rootfs.ota-ext4: Linux rev 1.0 ext2 filesystem data, UUID=15862fcd-6204-486b-a4c6-fdf7b1710797, volume name "otaroot" (large files) after this fix: $ file image-raspberrypi4.rootfs.ota-ext4 image-raspberrypi4.rootfs.ota-ext4: Linux rev 1.0 ext4 filesystem data, UUID=3709e65c-1d2b-4280-85d1-638f5f9c3cc0, volume name "otaroot" (extents) (64bit) (large files) (huge files) that's why metadata_csum and other features enabled by default in ext4 were now missing after https://github.com/advancedtelematic/meta-updater/pull/787 we can drop 64bit feature as well, it's also enabled in default recipe-sysroot-native/etc/mke2fs.conf [defaults] base_features = sparse_super,large_file,filetype,resize_inode,dir_index,ext_attr default_mntopts = acl,user_xattr enable_periodic_fsck = 0 blocksize = 4096 inode_size = 256 inode_ratio = 16384 [fs_types] ext3 = { features = has_journal } ext4 = { features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize inode_size = 256 } ... Signed-off-by: Martin Jansa <martin.jansa@lge.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* image_types_ota.bbclass: add metadata_csum mkfs optionMing Liu2020-11-251-1/+1
| | | | | | | | | This fixes a following error: | Saving Environment to EXT4... Unsupported feature metadata_csum found, not writing when u-boot tries to write env to EXT4 filesystem. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* image_types_ota.bbclass: call oe_mkext234fs to make ota-ext4 imageMing Liu2020-11-251-56/+6
| | | | | | | | | | | | We dont have to maintain our own function calculate_size and use dd/mkfs.ext4 to generate ota-ext4 image, they have been done in OE by get_rootfs_size/oe_mkext234fs functions, we could just use them. The major benefit could be we can sync the future fixes/changes in these functions from OE, also avoid maintaining some duplicated code in image_types_ota.bbclass. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* ostree-kernel-initramfs: add back initramfs fit workaroundRicardo Salveti2020-10-151-2/+1
| | | | | | | | | | | Previous initramfs fit specific workaround was removed as part of commit 6eecf1593d, causing ostree to provide an init argument as part of the kernel command line arguments when it is not really needed. Bring back the workaround by simply generating an empty file in case kernel image type is fit and initramfs is also used by the target. Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
* image_types_ostree: fix chmodDominik Wild2020-09-171-4/+4
| | | | Signed-off-by: Dominik Wild <dominik.wild@glutz.com>
* sota: introduce OSTREE_MULTI_DEVICETREE_SUPPORTMing Liu2020-09-031-0/+1
| | | | | | | | | | | | | | | ostree supports multiple devicetrees provided that there is no /lib/modules/$kversion/devicetree installed on rootfs, in which case, a uboot variable 'fdtdir' would be written to /boot/loader/uEnv.txt instead of fdt_file. Introduce OSTREE_MULTI_DEVICETREE_SUPPORT to control that, when it's set to '0', there is no functional changes with current implementation, while it's set to '1', then /lib/modules/$kversion/devicetree would not be installed and the end users need set their own fdtfile/fdt_file in boot script to locate the devicetree in 'fdtdir'. Signed-off-by: Ming Liu <ming.liu@toradex.com>
* image_repo_manifest.bbclass: fix build when there is no repo on hostMartin Jansa2020-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * failing "which repo" causes the run.buildinfo_manifest task to fail before it even reaches the test for empty repotool variable: dash -x some-image/1.0-r2/temp/run.buildinfo_manifest.80233 + export systemd_system_unitdir=/usr/lib/systemd/system + export systemd_unitdir=/usr/lib/systemd + export systemd_user_unitdir=/usr/lib/systemd/user + buildinfo_manifest + which repo + repotool= + bb_sh_exit_handler + ret=1 + [ 1 != 0 ] + echo WARNING: exit code 1 from a shell command. WARNING: exit code 1 from a shell command. + exit 1 causing nasty long python exception from do_image task with this fix, it just shows an warning again: dash -x some-image/1.0-r2/temp/run.buildinfo_manifest.80233 + export systemd_user_unitdir=/usr/lib/systemd/user + buildinfo_manifest + which repo + true + repotool= + [ -n ] + bbwarn Android repo tool not found; manifest not copied. + [ -p some-image/1.0-r2/temp/fifo.80233 ] + echo WARNING: Android repo tool not found; manifest not copied. WARNING: Android repo tool not found; manifest not copied. + ret=0 + trap 0 + exit 0 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* image_repo_manifest.bbclass: explicitly call python3Ming Liu2020-08-101-2/+3
| | | | | | | | | | | | Now we have changed to inherit python3native to provide python3 binary for repo, then we need explicitly call python3 to execute repo, or else it will firstly try to locate python which will fail if python is not in HOSTTOOLS. This fixes a following warning: | Android repo tool failed to run; manifest not copied Signed-off-by: Ming Liu <ming.liu@toradex.com>
* sota_raspberrypi: Use new variable for bootfiles path.fix/master/rpi-bootfiles-appendPatrick Vacek2020-08-071-2/+3
| | | | | | | | This was changed in f046b4128c9ca3420614887006101fa2b10fc6e7 of meta-raspberrypi. This also requires e947e8590f74477505c754d016d99fc71cadf4e1 in meta-updater-raspberrypi. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* Inherit python3native instead of using HOSTTOOLS.fix/pythonnativePatrick Vacek2020-08-031-0/+2
| | | | Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* image_types_ota.bbclass: change IMAGE_BASENAME to PNMing Liu2020-07-041-1/+1
| | | | | | | | | When setting intertask dependencies, we should use PN instead of IMAGE_BASENAME to refer to a image recipe, since PN is generated from recipe file name, while IMAGE_BASENAME is a variable that could be changed, it's not guaranteed to always equal to PN. Signed-off-by: Ming Liu <ming.liu@toradex.com>
* Put aktualizr-info in a separate package and use it in Secondaries.feat/secondary-aktualizr-infoPatrick Vacek2020-06-231-2/+1
| | | | | | | | | We did the work a while ago to make aktualizr-info work for Secondaries, but until now we weren't putting the tool into the secondary-image we use for testing. Now it's there. Actually, it's in every image that inherits from sota.bbclass, which is probably a good thing. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* Merge pull request #681 from liuming50/introduce-ostree-kernel-initramfsPatrick Vacek2020-06-222-25/+7
|\ | | | | Introduce ostree kernel initramfs
| * meta: introduce ostree-kernel-initramfs recipeMing Liu2020-06-182-25/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We package kernel image, devicetrees, initramfs and install them to /usr/lib/modules/${KERNEL_VERSION}, which is the preferred location according to ostree's new implementation, this could simplify the deployment. Reference: https://github.com/ostreedev/ostree/commit/3ab0d5e6644885440bac6abd17b6d2637df5435f To let initramfs-ostree-image be able to be depended by ostree-kernel-initramfs, it must inherit nopackages to avoid a annoying QA warning like the follows: | WARNING: initramfs-ostree-image-0.0.1-r0 do_package: Manifest ...initramfs-ostree-image.packagedata | not found in colibri_imx6 armv7ahf-neon-imx armv7at2hf-neon-imx armv7at2hf-neon armv7ahf-neon armv7at2hf-vfp | armv7ahf-vfp armv6thf-vfp armv6hf-vfp armv5tehf-vfp armv5ehf-vfp armv5thf-vfp armv5hf-vfp allarch | x86_64_x86_64-nativesdk (variant '')? Also we need define OSTREE_KERNEL, OSTREE_DEPLOY_DEVICETREE and OSTREE_DEVICETREE in sota.bbclass so they could be accessed in other recipes as well as in image recipes. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Ming Liu <ming.liu@toradex.com>
* | Merge pull request #722 from liuming50/fix-network-configuration-namingPatrick Vacek2020-06-225-8/+8
|\ \ | |/ |/| meta: change virtual/network-configuration to network-configuration
| * meta: change virtual/network-configuration to network-configurationMing Liu2020-05-105-8/+8
| | | | | | | | | | | | | | | | | | | | The name 'virtual' is a recipe specific concept but not a package specific one, it's confusing that a package provides 'virtual/' names. Let's drop 'virtual/' from network-configuration, to keep consistent with yocto naming styles. Signed-off-by: Ming Liu <ming.liu@toradex.com>
* | Merge pull request #728 from antznin/allow-specifying-dtb-namePatrick Vacek2020-06-031-3/+4
|\ \ | | | | | | image_types_ostree: allow specifying a device tree to deploy
| * | image_types_ostree: allow specifying a device tree to deployantznin2020-05-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting `OSTREE_DEPLOY_DEVICETREE` to 1, it will by default deploy all the device tree blobs present in `KERNEL_DEVICETREE`. Adding `OSTREE_DEVICETREE` would allow specifying a specific device tree blob (or several dtbs), thus resulting in only the specified ones in the image. This is particularely useful because ostree selects the first device tree it finds in /boot, and discards the remaining ones. Signed-off-by: antznin <agodard@witekio.com>
* | | Update garage-push invocation for new clirls/2020.7Laurent Bonnans2020-05-291-1/+1
|/ / | | | | | | Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
* | image_types_ostree: allow to add layer specific OSTree commit argumentsStefan Agner2020-05-261-1/+2
| | | | | | | | | | | | | | | | | | | | The OSTree commit command allows to add metadata to the commit. This might be customized in a distro layer for distribution specific needs. Allow to pass extra arguments using EXTRA_OSTREE_COMMIT variable (using a variable named similar to EXTRA_OEMAKE used to pass extra make arguments). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* | Merge pull request #716 from agners/master-ostree-fix-deployment-refPatrick Vacek2020-05-122-14/+18
|\ \ | | | | | | Use checksum as deployment source and refspec in the deployment
| * | image_types_ota: use named referenceStefan Agner2020-05-071-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use named reference when deploying the device tree. This makes sure that this reference will end up in the deployments .origin file, which will be visible by the user in ostree admin status. This reference will also be used when running ostree admin upgrade. This is not really required when using aktualizr, but can be useful during test/debugging when using pure OSTree updates. Make sure to make ${OSTREE_REPO} accessible via http and add a remote on the device called ${OSTREE_OSNAME} pointing to the http exposed archive OSTree. With that ostree admin upgrade should work. Note: We could use the name reference in ostree pull-local already, but this is potentially racy if multiple builds are committing to the same branch. Use the OSTree commit hash to get the actual commit and recreate a local reference to this commit. This makes absolutely sure that we use the same OSTree commit this bitbake execution committed during the do_image_ostreecommit task. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
| * | image_types_ostree/ota: use hash from ostree commitStefan Agner2020-05-072-13/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relying on a OSTree branch reference has been problematic in the past and addressed by adding more attributes to it in commit 202a8c70ba8c ("image_types_ostree: Add a unique ref to fix simultaneous bitbaking."). However, depening on what kind of OpenEmbedded builds are running in parallel, even more attributes would need to be taken into account. Instead of relying on a reference, store the exact ostree commit hash in a manifest file and reuse it in the do_image_ota deploy task. This guarantees that the correct reference gets picked even when two builds with the exact same machine/image name run in parallel. Note: This gets rid of the second branch name again. If the branch name with image name is preferred, the variable OSTREE_BRANCHNAME can be used: OSTREE_BRANCHNAME = "${SOTA_HARDWARE_ID}-${IMAGE_BASENAME}" Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* / sota_sanity.bbclass: introduce sota_check_boolean_variableMing Liu2020-05-112-10/+17
|/ | | | | | | | | | The current sanity check are too strict for some boolean variables, introduce sota_check_boolean_variable to allow a boolean value to be set like yes/y/true/t/1 or no/n/false/f/0. Also change to use oe.types.boolean to check their values. Signed-off-by: Ming Liu <ming.liu@toradex.com>
* image_types_ostree/ota: move home physically to /var/rootdirs/homeStefan Agner2020-04-272-4/+5
| | | | | | | | | | | | | | | | | | | | | | Instead of using the double indirection mode /home -> /var/rootdirs/home -> /sysroot/home move the home directory physically into /var/rootdirs. This allows to use the --modern flag when initializing the file system. The "old" style is still supported, and does make sense in case the home directories need to be shared between multiple deployments. Since multiple deployments is not a use case in meta-updater use the /var approach. See also: https://github.com/ostreedev/ostree/issues/2085. The modern flag also gets rid of dev, proc, root, run, sys and tmp. All of them have been empty and unused. Note: This change cannot be pushed through updates as this is an initial deployment setting. Only devices provisioned with images built with this change applied will use the new layout. Updates will continue to work on both systems as the symlink from the deployment stays the same (first indirection is still /home -> /var/rootdirs/home). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* image_types_ostree/ota: do not commit homes to the OSTreeStefan Agner2020-04-272-9/+7
| | | | | | | | | | | | | | The home directory currently are commited to the OSTree, presumably to then use it for the deployment. However, we do have access to the original rootfs in the OSTree deployment tasks (do_image_ota) hence transferring the files "via OSTree" is not necessary. We do already carry over some files from the original OE rootfs to /var/sota. Follow this approach for /var/local and /home as well. The home will still be stored in the sysroot as documented in https://ostree.readthedocs.io/en/latest/manual/adapting-existing/. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* image_types_ostree: use hardlink treeStefan Agner2020-04-271-5/+15
| | | | | | | | | | | Instead of copying the files to be commited to the ostree just use a hardlink tree. This improves performance and wasts less diskspace. When using this method the root directory has already the correct permission bits set. Also get rid of the unnecessary sync. This halfs the execution time of the do_image_ostree tasks in my measurments. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* image_types_ostree: drop unnecessary tmp handlingStefan Agner2020-04-271-3/+0
| | | | | | | | | | | | | The current code clears tmp and then creates a symlink inside it to /sysroot/tmp: tmp └── tmp -> sysroot/tmp This is likely a mistake and the root tmp should have pointed to sysroot/tmp. However, since /tmp is mounted as a tmpfs anyways, we can get rid of all this logic. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* image_types_ota: export OSTREE_BOOT_PARTITION when neededStefan Agner2020-04-271-2/+5
| | | | | | | | The environment variable OSTREE_BOOT_PARTITION is only used when using GRUB. Move the export into the if statement. Also add a comment why manually adding /boot/loader{.0} directory is necessary. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* Rename defconfig and bootfilesfix/agl-renesas-buildMinori Yasumura2020-03-041-3/+4
| | | | | | The file name of sota has been changed in AGL, so change it to apply. Signed-off-by: Minori Yasumura <minori@witz-inc.co.jp>
* sota_bleeding: Also set aktualizr-native to the latest.Patrick Vacek2020-02-271-0/+1
| | | | | | I'm a bit surprised we never noticed this was missing! Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* image_types_ostree: update doc link.fix/doc-linkPatrick Vacek2020-02-181-2/+2
| | | | | | | Most of the README content has been moved to the docs portal, so provide the direct link. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* Merge pull request #669 from liuming50/fix-some-problems-in-image-recipesPatrick Vacek2020-02-103-6/+0
|\ | | | | Fix some problems in image recipes
| * meta: move HOSTTOOLS definitions to sota.conf.incMing Liu2020-01-303-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HOSTTOOLS and HOSTTOOLS_NONFATAL are global variables that being handled in base_eventhandler, so they must be defined in config files or in INHERIT classes or classes being inherited by base.bbclass, or else we might run into the following problems: ``` $ bitbake pkgname $ bitbake imgname ``` the HOSTTOOLS and HOSTTOOLS_NONFATAL in the above image recipe, for instance, 'repo python' in image_repo_manifest.bbclass, they would not be copied to HOSTTOOLS_DIR. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* | image_types_ostree: set version metadata fieldpr/670Stefan Agner2020-01-281-0/+2
|/ | | | | | | | | | | | | OSTree uses the "version" metadata field in various places, e.g. in ostree admin status. Use DISTRO_VERSION as default version number source. This gives a more human readable version number to a particular OSTree: $ ostree admin status * torizon f1825d8a8f89c48cc0915ea059bd23463a97655757a53ae0ab0fe7a97e1ebeb2.0 Version: 3.0+snapshot-20200128 origin refspec: f1825d8a8f89c48cc0915ea059bd23463a97655757a53ae0ab0fe7a97e1ebeb Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* Allow dots in ostree branch names and hw idsfix/dots-in-namesLaurent Bonnans2020-01-081-4/+4
| | | | Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
* meta: add python to HOSTTOOLS_NONFATALMing Liu2020-01-022-3/+3
| | | | | | | | | | repo is requiring python to be able to work correctly, add python to HOSTTOOLS_NONFATAL as well. image_repo_manifest is actually a image bbclass, move it to IMAGE_CLASSES instead of inheriting it in sota.bbclass. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* Merge pull request #631 from ↵Patrick Vacek2019-11-272-14/+47
|\ | | | | | | | | advancedtelematic/feat/ota-3202/Add-sanity-checks-for-SOTA-variables-in-meta-updater Add sanity checks for user-defined SOTA variables
| * keep new name suggestion remove ostree repo checkfeat/ota-3202/Add-sanity-checks-for-SOTA-variables-in-meta-updaterZee3141592019-11-271-3/+7
| | | | | | | | Signed-off-by: Zee314159 <252806294@qq.com>
| * Use regex and add some variablesZee3141592019-11-221-37/+38
| | | | | | | | Signed-off-by: Zee314159 <252806294@qq.com>
| * Add sanity checks for user-defined SOTA variablesZee3141592019-11-182-14/+42
| | | | | | | | Signed-off-by: Zee314159 <252806294@qq.com>
* | image_types_ostree.bbclass: do not inherit distro_features_checkMing Liu2019-11-241-2/+3
|/ | | | | | | Change to inherit features_check, since distro_features_check has been deprecated in OE. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* Fix uart output on raspberrypi3Laurent Bonnans2019-11-121-3/+3
| | | | | | | The broadcom firmware now needs device trees to be present in/boot to set it up. Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
* Only push repo manifest if garage-push supports itLaurent Bonnans2019-11-111-1/+2
| | | | Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
* Send a copy of repo manifest through garage-pushLaurent Bonnans2019-11-081-2/+8
| | | | Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>