summaryrefslogtreecommitdiffstats
path: root/classes/image_types_ostree.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* image_types_ostree: fix chmodDominik Wild2020-09-171-4/+4
| | | | Signed-off-by: Dominik Wild <dominik.wild@glutz.com>
* meta: introduce ostree-kernel-initramfs recipeMing Liu2020-06-181-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 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 #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-121-12/+6
|\ | | | | Use checksum as deployment source and refspec in the deployment
| * image_types_ostree/ota: use hash from ostree commitStefan Agner2020-05-071-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-111-2/+2
|/ | | | | | | | | | 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-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | 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-271-7/+5
| | | | | | | | | | | | | | 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_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>
* 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>
* 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>
* 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>
* meta: change OTA_IMAGE_ROOTFS to TAR_IMAGE_ROOTFSchange-OTA_IMAGE_ROOTFS-to-TAR_IMAGE_ROOTFSMing Liu2019-11-061-2/+2
| | | | | | | No functional changes, rename OTA_IMAGE_ROOTFS to TAR_IMAGE_ROOTFS since the later is a more common name. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* image_types_ostree: Fix OSTree ref-bindingsfix-ref-bindingJeremias Cordoba2019-10-151-1/+2
| | | | | | | | | | | | The command "ostree refs --create" creates a new ref that points to a pre-existing commit hash. This does not add this new ref to the ref-bindings metadata in OSTree. The missing metadata leads to OSTree verifcation failures when working with the new ref. Fix this by adding the "--bind-ref" option to "ostree commit" which adds the needed ref-binding metadata. Signed-off-by: Jeremias Cordoba <js.cordoba8321@gmail.com>
* Use a default expiry of one month if nothing is specified.Patrick Vacek2019-08-211-0/+2
| | | | | | | This mimics the intended behavior of the default in garage-sign, but doesn't rely on the date in the unsigned targets. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* aktualizr: latest garage-sign with expiration support.Patrick Vacek2019-08-201-4/+13
| | | | | | | Use GARAGE_TARGET_EXPIRES or GARAGE_TARGET_EXPIRE_AFTER (but not both!) to set the garage-sign parameters. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* Revert "Move OSTREE_BRANCHNAME to image_types_ostree.bbclass."Laurent Bonnans2019-08-151-2/+0
| | | | | | This reverts commit 8e7a0aeb3682386ed674ed0f682634d6a50983b7. Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
* Merge pull request #557 from agners/follow-fhsPatrick Vacek2019-07-241-9/+34
|\ | | | | Follow Filesystem Hierarchy Standard
| * image_types_ostree: add /usr/local supportStefan Agner2019-07-191-0/+25
| | | | | | | | | | | | | | | | | | | | Add /usr/local support as outlined in OSTree documentation. This makes sure that a writeable and persistent /usr/local directory is available. See also: https://ostree.readthedocs.io/en/latest/manual/adapting-existing/ Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
| * image_types_ostree: make root directory only readable by rootStefan Agner2019-07-191-2/+2
| | | | | | | | | | | | | | Make the root home directory only accessible by root. Use 700 as commonly used for the root home directory. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
| * image_types_ostree: add top level directories unconditionallyStefan Agner2019-07-191-7/+7
| | | | | | | | | | | | | | | | The Filesystem Hierarchy Standard defines several top-level directory to be writeable. Add those even in the absence of files installed by OpenEmbedded so a user might actually use them. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* | Merge pull request #550 from advancedtelematic/fix/branch-rebuildlbonn2019-07-191-0/+2
|\ \ | | | | | | Move OSTREE_BRANCHNAME to image_types_ostree.bbclass.
| * | Move OSTREE_BRANCHNAME to image_types_ostree.bbclass.fix/branch-rebuildPatrick Vacek2019-07-181-0/+2
| |/ | | | | | | | | | | | | | | If it is set in sota.bbclass and overwritten in local.conf, bitbake will rebuild everything. Now bitbake should only rerun the commands in image_types_ostree (and image_types_ota) as expected. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* / Allow customization of data in targets.jsonAndy Doan2019-07-171-0/+6
|/ | | | | | | This allows a user to define their own script to be executed after a target has been added to the repository but not yet signed. Signed-off-by: Andy Doan <andy@foundries.io>
* OTA-2418: Remove example.com URL from automated garage-sign usagefeat/OTA-2418/remove-example.comMykhaylo Sul2019-04-031-1/+6
| | | | Signed-off-by: Mykhaylo Sul <ext-mykhaylo.sul@here.com>
* image_types_ostree: Add a unique ref to fix simultaneous bitbaking.fix/OTA-2211/simultaneous-bitbakingPatrick Vacek2019-02-211-2/+10
| | | | | | | | | | | | To enable simultaneous bitbaking of two images with the same branch name, create a new ref in the OSTree repo using the basename of the image. As @OYTIS has pointed out, this probably won't solve every problem that might come up with simultaneous bitbaking, such as if the two images use different bootloaders. However, it does solve the immediate problem that comes up with our primary-image + secondary-image example. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* meta: drop True option to getVar callsMing Liu2019-01-141-1/+1
| | | | | | | Search made with the following regex: getVar ?\((.*), True\), this is to be consistent with OE. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* classes/image_types_ostree.bbclass: fix checksum calculationLuka Pivk2019-01-111-12/+13
| | | | | | | | | Adds initramfs and/or devicetree into checksum calculation. According to ostree documentation if devicetree and/or initramfs are included into ostree, checksum should also include them. Signed-off-by: Luka Pivk <luka.pivk@toradex.com>
* image_garagesign: Use a lock to fix concurrency problems.fix/OTA-1866/simultaneous-garage-signPatrick Vacek2019-01-071-0/+3
| | | | | | | | | | | We remove GARAGE_SIGN_REPO at the start and end of this task, which causes trouble if two images call this task at the same time. This probably could be fixed in a better fashion (like putting the repo in an image-specific subdirectory) but this is quick and easy, and the task usually doesn't take long to run, so the lack of parallelization is not a big loss. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* Merge pull request #437 from LukaPivk/masterPatrick Vacek2018-12-141-0/+9
|\ | | | | classes/image_types_ostree.bbclass: add device tree to boot/devicetree
| * classes/image_types_ostree.bbclass: add device tree to boot/devicetree-*Luka Pivk2018-12-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include device trees into boot/devicetree-*-checksum. Device trees with this name format get picked up by ostree and copied into boot/. Ostree also generates entry inside uEnv.txt called fdt_file pointing to this device tree. Normaly one would include only one device tree. If KERNEL_DEVICETREE includes more then one device tree this will add all the device trees but ostree will still pick only one device tree and include it into boot. We are working on modifications to ostree so it will pickup all the device trees. Signed-off-by: Luka Pivk <luka.pivk@toradex.com>
* | image_types_ostree: drop manual usrmove implementationStefan Agner2018-11-281-10/+0
| | | | | | | | | | | | | | | | | | OpenEmbedded's usrmerge implementation checks that nothing is installing in /bin, /sbin or /lib. Hence those directories are empty by default. There is no need for the manual usrmove anymore. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* | image_types_ostree: make usrmerge mandatoryStefan Agner2018-11-281-0/+2
| | | | | | | | | | | | | | Make usrmerge a mandatory DISTRO feature when using the ostree class. This will allow to remove the "manual" usrmerge implementation. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* | image_types_ostree: use OSTree repo location for lockfilesStefan Agner2018-11-281-1/+1
|/ | | | | | | | | | | | | OSTree does not allow concurrent access to the repository. If two bitbake instances use the same OSTree repository, then they might access it simultanously. The lockfile to prevent such simultaneous access should really be in the same location where the OSTree repository is stored. Revert back to the location inside the OSTree repository. Fixes: e97975d6113c ("image_types_ostree/ota.bbclass: refactor ostree task") Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* image_types_ostree/ota.bbclass: refactor ostree taskMing Liu2018-11-241-32/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several flaws with ostree tasks, as follows: - ${IMAGE_NAME}.rootfs.ostree.tar.bz2 is generated, but it's not being used during ostree commit, so it should be removed if it's just a intermittent artifact. Or if we intend to deploy this tar.bz2 file, it should be tracked by sstate cache, that is to day, it should be generated in ${IMGDEPLOYDIR} rather than in ${DEPLOY_DIR_IMAGE}. - There are quite a few redundant code like mktemp/cd/rm a directory, which can be replaced by setting 'dirs', 'cleandirs' varflags. - There are some redundant variable check logic in image_types_ostree and image_types_ota bbclass. To fix the above, we make the following changes: - Introduce a new conversion image type 'tar', it could convert ostree and ota to ostree.tar, ota.tar, hence we can drop the code generating ostree.tar.bz2 in image_types_ostree.bbclass, and also drop the do_image_ota-tar task. To let this conversion type take effect, the otasetup task needs to be changed to ota. - Introduce BUILD_OSTREE_TARBALL variable, when being set to 1, a ostree.tar.bz2 tarball would be built, BUILD_OSTREE_TARBALL defaults to be 1, to be consistent with original behavior. - Replace 'ota-tar ota-tar.xz' with ota.tar.xz in IMAGE_FSTYPES. - Add a sanity check bbclass sota_sanity.bbclass, to ensure ostree or ota is not in OVERRIDES, this is to prevent potential naming pollution with other meta layers, and also check the required variables are not empty. This sota_sanity.bbclass is a common class that could be extended easily in furture, and one of its most advantages is that all the check are done in bb.event.SanityCheck event handler, so the end users could get the error message at very beginning of the recipe parsing time. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* meta: drop redundant export syntaxMing Liu2018-11-241-9/+4
| | | | | | | | | | | There are quite a few 'export' syntax, they are either not necessary or being redundant. Actually only the variables being referred in ostree or aktualizr need to be exported, we can move them into sota.bbclass so they can be exported once only for all other classes referring to them. And drop all other unnecessary exports. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* image_types_ostree.bbclass: fix some dependencies issuesMing Liu2018-11-241-5/+2
| | | | | | | | | | | | | | - unzip-native:do_populate_sysroot should be depended by do_image_garagesign task instead of by do_image_ostree task. - openssl-native:do_populate_sysroot can be removed since it's being depended by aktualizr-native already. - do_image_garagesign and do_image_garagecheck does not have to depend on aktualizr-native:do_populate_sysroot, that dependency is being added by do_image_ostreepush -> aktualizr-native:do_populate_sysroot. - drop ostreepush dependency from IMAGE_TYPEDEP_garagecheck, that is redundant. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* meta: replace bberror with bbfatalMing Liu2018-11-241-8/+4
| | | | | | | | | When calling bbfatal, it reports error message and exit 1, it should be used to replace of 'bberror && exit 1' to avoid being redundant. Also fixed some incorrect bberror usages and typos. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
* Allow setup custom hardware_idfeat/hardware_idSerhiy Stetskovych2018-11-221-1/+1
| | | | Signed-off-by: Serhiy Stetskovych <patriotyk@gmail.com>
* aktualizr: Fix virtual secondary support.Patrick Vacek2018-11-131-5/+0
| | | | | | | | Use /etc/sota/ecus as using /var/sota/ecus was conflicting with the provisioning recipes that also use /var/sota. Not totally ideal, but the best compromise I could find. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
* Merge pull request #421 from agners/master-toradexPatrick Vacek2018-11-021-1/+2
|\ | | | | classes: image_types_ostree: use locking during OSTree repo update
| * classes: image_types_ostree: use locking during OSTree repo updateStefan Agner2018-11-021-0/+1
| | | | | | | | | | | | | | | | The OSTree repository might be shared accross several individual OSTree builders. Use bitbakes lockfiles mechanism to lock the OSTree for exclusive use. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
| * classes: image_types_ostree: check OSTree repo existence using ostreeStefan Agner2018-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Currently we assume if the OSTree repo exists, that there is a OSTree repo in it. This does not need to be true in general, and when using lockfiles bitbake will create the directory before the do_image_ostree task is executed the first time. Use ostree refs to detect whether the target directory contains a OSTree repo. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* | Document version overriding and add warningsAnton Gerasimov2018-10-301-0/+2
| |