summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
AgeCommit message (Collapse)Author
2021-09-09image.bbclass: inherit nopackagesMartin Jansa
* image recipes don't produce any packages * it might help with strange dependency like: NOTE: recipe android-kernel-bootimg-1.0-r0: task do_package: Started ERROR: android-kernel-bootimg-1.0-r0 do_package: Manifest /OE/build/luneos-hardknott/webos-ports/tmp-glibc/sstate-control/manifest-x86_64_x86_64-nativesdk-initramfs-android-image.packagedata not found in tissot aarch64-halium aarch64 allarch x86_64_x86_64-nativesdk (variant '')? NOTE: recipe android-kernel-bootimg-1.0-r0: task do_package: Failed the android-kernel-bootimg has only the dependency on virtual/kernel:do_deploy and initramfs-android-image is shown in task-depends.dot from bitbake -g android-kernel-bootimg only as expected do_image_complete: linux-xiaomi-tissot.do_deploy -> initramfs-android-image.do_image_complete how it ended looking for packagedata is still a bit unknown, but removing this task completely with nopackages.bbclass seems to prevent this issue. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2021-04-09image,populate_sdk_base: move 'func' flag setting for sdk command varsChristopher Larson
Setting the 'func' flag on the commands variables ensures that they are parsed as shell, and therefore that the referenced commands contents are included in checksums. Doing this only in image.bbclass means that this is missing in recipes that are not images, but which inherit populate_sdk or populate_sdk_base directly, so move it to the latter. [YOCTO #13998] Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit edc28907ce19a7298059dd388933c58a9c6c28b9) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-03-10bitbake.conf/image: Move image specific PSEUDO_IGNORE_PATHS to image classRichard Purdie
This path is image specific so we can move to the image class definition of PSEUDO_IGNORE_PATHS. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 66a8ca0f206434e0b301a8fdc90f062750d6d118) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-03-10image: Add directories to PSEUDO_IGNORE_PATHSRichard Purdie
Some paths used in image construction shouldn't be tracked under pseudo so list these. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9463be2292b942a1072eea88881b9644e55aadb9) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2020-10-13IMAGE_LOCALES_ARCHIVE: add option to prevent locale archive creationMichael Thalmeier
Under some circumstances it is not desirable to create a combined locale archive (/usr/lib/locale/locale-archive). The new variable IMAGE_LOCALES_ARCHIVE defaults to '1', so the default behaviour is not changed. Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-08image.bbclass: fix REPRODUCIBLE_TIMESTAMP_ROOTFS referenceMatt Madison
Commit 97b439469a45a089431ca9c31893288c855045f4 added a fallback mechanism for getting the rootfs timestamp. However, it uses curly braces around the variable name, which causes bitbake resolve the variable reference, rather than the shell, so the git timestamp never gets used. Fix the reference to restore the intent of making it a fallback for when there is no git timestamp to retrieve. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-22image.bbclass: improve wording when image size exceeds the specified limitDaniel Ammann
Signed-off-by: Daniel Ammann <daniel.ammann@bytesatwork.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-29image/packagegroup: Remove PACKAGE_GROUP_*, long since deprecatedRichard Purdie
This was deprecated in 2014 so we can safely remove the old code now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-15image.bbclass, package-index.bb: Delete do_populate_lic taskKhem Raj
These are meta packages Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-31IMAGE_LINGUAS_COMPLEMENTARY: auto-add language packages other than localesAndreas Müller
This change allows layers adding packages other than locales automatically to images based on languages selected in IMAGE_LINGUAS. E.g if a layer has recipes creating packages as: | ${PN}-foo-en / ${PN}-foo-de / ${PN}-foo-it / .. it would set | IMAGE_LINGUAS_COMPLEMENTARY_append = " *-foo-%s" in its layer.conf to enable auto-adding. Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-08-30image.bbclass: Fix debug output for rootfs sizeDaniel Klauer
The debug output showed the wrong variable. Signed-off-by: Daniel Klauer <daniel.klauer@gin.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-03classes/lib: Remove bb.build.FuncFailedRichard Purdie
Whilst seemingly a good idea, this exception doesn't really serve any purpose that bb.fatal() doesn't cover. Wrapping exceptions within exceptions isn't pythonic. Its not used in many places, lets clean up those and remove usage of it entirely. It may ultimately be dropped form bitbake entirely. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-10image.bbclass: Only append to IMAGE_LINK_NAME if it was already setMike Crowe
create_symlinks does not create any links if IMAGE_LINK_NAME is empty. Unfortunately, setup_debugfs_variables unconditionally appends '-dbg' which results in a previously-empty IMAGE_LINK_NAME containing just '-dbg'. Let's check that it's not empty before appending. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-02image.bbclass: fix systemd_preset_allChen Qi
Check the existence of systemd before using systemctl to preset units. This is because even if 'systemd' is in DISTRO_FEATURES, it's possible that systemd is not even installed. e.g. container-test-image in meta-selftest layer. As systemd DEPENDS on systemd-systemctl-native, the existence of systemd also ensures the existence of systemd-systemctl-native. This would fix the following test case when using systemd as the init manager. containerimage.ContainerImageTests.test_expected_files Also remove the IMAGE_EXTRADEPENDS setting, as nothing references this variable. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09systemd: Default to non-stateless imagesAlex Kiernan
When creating images, for anything other than the explicitly stateless case, touch /etc/machine-id so that the images can be booted without an initramfs and with `ro` set on the kernel command line, otherwise system refuses to start: [ 7.222134] systemd[1]: No hostname configured. [ 7.227266] systemd[1]: Set hostname to <localhost>. [ 7.232622] systemd[1]: System cannot boot: Missing /etc/machine-id and /etc is mounted read-only. [ 7.241750] systemd[1]: Booting up is supported only when: [ 7.247362] systemd[1]: 1) /etc/machine-id exists and is populated. [ 7.253752] systemd[1]: 2) /etc/machine-id exists and is empty. [ 7.259757] systemd[1]: 3) /etc/machine-id is missing and /etc is writable. If IMAGE_FEATURES includes `stateless-rootfs` then systemctl-native is not run on the image leaving the image for population at runtime by systemd. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-02image: call systemctl preset-all for imagesAlex Kiernan
Rather than rely on systemd's default invocation of preset-all at runtime, we pre-populate the symlink tree as part of of the image. This is done late so any overrides of presets during rootfs construction should already have happened. Whilst we don't strictly need this for the read-write root case, it avoids boot time churn; for read-only root we have to do it here. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28default-distrovars: Drop DISTRO_FEATURES_LIBCKhem Raj
After eglibc was merged into glibc, Kconfig support was also dropped so these libc features therefore are not effective anymore and can be removed Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05image.bbclass: respect PACKAGE_NO_GCONVKai Kang
It installs locale-base-* packages according to var IMAGE_LINGUAS. Packages locale-base-* are split in libc-package.bbclass if variable PACKAGE_NO_GCONV is not set. When none of ditro features libc-charsets libc-locales and libc-locale-code is set, PACKAGE_NO_GCONV is set. Then no locale-base-* is created and fails to create image. Clear IMAGE_LINGUAS in such situation. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-24image.bbclass: fix a wrong position blankMing Liu
A flaw was introduced by commit c5fa6034: [ image.bbclass: use prependVarFlag for postfuncs ] it changed to use prependVarFlag instead of appendVarFlag, then the blank also needs change to adapt it. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-16image.bbclass: add a missing blankMing Liu
When calling d.appendVarFlag, a blank is needed or else it could mess up the later appended variables. Reported-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-13rootfs: ensure that packages in IMAGE_INSTALL_DEBUGFS are existingAndrej Valek
Ensure that additional packages in IMAGE_INSTALL_DEBUGFS are available before installation. Signed-off-by: Andrej Valek <andrej.valek@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-18rootfs: possibility to add packages to debug rootfsAndrej Valek
Static libraries are not included in rootfs, it means, that sources are not going into debug rootfs. This option enables to install additional packages even if the standard package is not installed. Signed-off-by: Andrej Valek <andrej.valek@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-16image.bbclass: inherit and use image-postinst-interceptsChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15image: Use ${COREBASE}/meta for timestamp, fallback to bitbake.confAlex Kiernan
To handle the case where ${COREBASE} isn't the git directory, avoid erroring out when the git command fails. If we don't have a timestamp after this, fall back to the timestamp from conf/bitbake.conf. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15image: Add locale archive optimisationRichard Purdie
Refactor the locale archive function from the SDK to also make it work during general image creation. This reduces the size of the locales from 900MB to 220MB in core-image-lsb-sdk. The exception handling around subprocess was dropped as the standard subprocess exception printing is better handled than the catchall exception. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-25license_image: Fix raceRichard Purdie
The current code pokes into do_deploy manifests from do_image_complete when the do_image_complete task may or may not depend upon the do_deploy tasks in question. Often it gets lucky, sometimes it results in build failures. To fix this, split the functionality to its own task which can have the correct task dependencies. This means the data in BB_TASKDEPDATA is definitive, the other code can be dropped, as can the IMAGE_EXTRATYPES do_populate_lic dependencies from image.bbclass. This fixes bugs which show up as: NOTE: recipe linux-yocto-4.14.48+gitAUTOINC+d64aec9793_97c8063d2d-r0: task do_deploy: Started ERROR: core-image-minimal-1.0-r0 do_image_complete: Error executing a python function in exec_python_func() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 0001: *** 0002:write_deploy_manifest(d) 0003: File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/classes/license.bbclass', lineno: 33, function: write_deploy_manifest 0029: 'w+').write(output) 0030:} 0031: 0032:python write_deploy_manifest() { *** 0033: license_deployed_manifest(d) 0034:} 0035: 0036:python license_create_manifest() { 0037: import oe.packagedata File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/classes/license.bbclass', lineno: 191, function: license_deployed_manifest 0187: # It is necessary to mark this will be used for image manifest 0188: man_dic[dep]["IMAGE_MANIFEST"] = True 0189: man_dic[dep]["PN"] = dep 0190: man_dic[dep]["FILES"] = \ *** 0191: " ".join(get_deployed_files(dep_dic[dep])) 0192: with open(os.path.join(lic_dir, dep, "recipeinfo"), "r") as f: 0193: for line in f.readlines(): 0194: key,val = line.split(": ", 1) 0195: man_dic[dep][key] = val[:-1] File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/classes/license.bbclass', lineno: 289, function: get_deployed_files 0285: """ 0286: 0287: dep_files = [] 0288: excluded_files = [] *** 0289: with open(man_file, "r") as manifest: 0290: all_files = manifest.read() 0291: for f in all_files.splitlines(): 0292: if ((not (os.path.islink(f) or os.path.isdir(f))) and 0293: not os.path.basename(f) in excluded_files): Exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build-st-730/tmp/sstate-control/manifest-qemux86_64-linux-yocto.deploy' ERROR: core-image-minimal-1.0-r0 do_image_complete: Function failed: write_deploy_manifest ERROR: Logfile of failure stored in: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build-st-730/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_complete.50537 NOTE: recipe core-image-minimal-1.0-r0: task do_image_complete: Failed ERROR: Task (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/recipes-core/images/core-image-minimal.bb:do_image_complete) failed with exit code '1' NOTE: recipe linux-yocto-4.14.48+gitAUTOINC+d64aec9793_97c8063d2d-r0: task do_deploy: Succeeded Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-07rootfs-postcommands: split ssh_allow_empty_passwordJackie Huang
"allow root login" should not be bundled in ssh_allow_empty_password, because some distro may want only one of "allow root login" and "allow empty password", so split it out into ssh_allow_root_login and add new imagefeature allow-root-login so they can be controlled separately, debug-tweaks will still include both of them. Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28image: Set COREBASE as the git directory for timestampAlex Kiernan
When REPRODUCIBLE_TIMESTAMP_ROOTFS is unset and we want to parse one from git, use COREBASE as the base for the git command so we have a known repository which we're using. Without this the build may fail if the current directory is not part of a git repository. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21image/testimage: Rework auto image test executionRichard Purdie
The TEST_IMAGE interface has never particularly worked and image testing currently gets configured manually. This reworks the interface to better serve the needs of its users, replacing it with TESTIMAGE_AUTO. This does away with the need for the separate class due to better bitbake APIs for changing tasks. TESTIMAGE_AUTO will automatically boot under qemu any image that is built. It also adds in dependencies so that any SDK for which testing is requested will automatically be built first. The code in bitbake.conf was error prone (e.g. testsdk wasn't considered), this improves it to standardise on IMAGE_CLASSES as the standard configuration mechanism. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-20image/image-live: Improve handling of live/iso/hddimg types (drop NOISO/NOHDD)Richard Purdie
The logic can be improved and the historical NOISO/NOHDD variables moved into the class and out of common code. The variables are also then removed in favour of directly controlling the behaviour from IMAGE_FSTYPES in line with all the other image types. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-20image: Combine all the class handling code into a single sectionRichard Purdie
Right now the code handling class inherits is spread all over and its hard to get an idea of what is happening overall. Combine all the code together to make it clearer. There shoould be no functionality changes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18image.bbclass, populate_sdk_base.bbclass: make all variants of ↵Alexander Kanavin
qemuwrapper-cross available in sysroots The variants are needed in particular when executing postinst_intercepts as those may require running binaries built for different architectures and against different sets of library paths, when multilib is in use (or nativesdk host packages are installed), so a single global variant of the script was not working. I do understand expanding PATH and DEPENDS in this manner is hackish, however every other approach I could think of is worse. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-07classes: Use ${MACHINE_ARCH} instead of ${MACHINE} for stamp-extra-info task ↵Peter Kjellerstedt
flag Without this change, there will be two sstate index files in tmp/sstate-control for any machine that contains a dash in the name. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-12classes/recipes: Use expanded BUILD_REPRODUCIBLE_BINARIES valueJuro Bystricky
Replace the occurences of BUILD_REPRODUCIBLE_BINARIES with expanded values ${BUILD_REPRODUCIBLE_BINARIES} so the variable does not need to be exported. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04image: Remove the do_package_write_* tasksRichard Purdie
Now we're filtering tasks in the rpm indexing code so that tasks can only see the packages they really depend upon, having noexec package_write tasks around is causing problems since the tasks exist but don't have manifests. Removing the tasks entirely solves this problem and streamlines the task execution graph too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16classes: don't scan for CVEs in images or packagegroupsRoss Burton
There's no point even looking in the database for these, so unset CVE_PRODUCT. Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-29meta: don't use deprecated functions from utils.bbclassRoss Burton
These functions were moved to meta/lib/oe in 2010 and the base_* functions in utils.bbclass were intended to be a short-term compatibility layer. They're still used in a few places, so update the callers to use the new functions. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-10image: Expand PV to avoid AUTOREV parsing failuresRichard Purdie
Currently, setting PV to include SRCPV for build-appliance results in: bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: Fetch command export ftp_proxy="http://proxy.yocto.io:5187/"; export FTP_PROXY="http://proxy.yocto.io:5187/"; export PATH="${TMPDIR}/work/ qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/ recipe-sysroot-native/usr/bin/python3-native:${TMPDIR}/work/ qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/ recipe-sysroot-native/usr/bin/python3-native:${TMPDIR}/work/ qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/ recipe-sysroot-native/usr/bin/python3-native:/home/pokybuild/ yocto-autobuilder/yocto-worker/buildtools/build/scripts:${TMPDIR}/ work/qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/ recipe-sysroot-native/usr/bin/x86_64-poky-linux:${TMPDIR}/work/ qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/ recipe-sysroot/usr/bin/crossscripts:${TMPDIR}/work/qemux86_64-poky-linux/ build-appliance-image/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/sbin: ${TMPDIR}/work/qemux86_64-poky-linux/build-appliance-image/ fetcheravoidrecurse-r0/recipe-sysroot-native/usr/bin:${TMPDIR}/work/ qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/ recipe-sysroot-native/sbin:${TMPDIR}/work/qemux86_64-poky-linux/ build-appliance-image/fetcheravoidrecurse-r0/recipe-sysroot-native/bin:/home/ pokybuild/yocto-autobuilder/yocto-worker/buildtools/build/bitbake/bin:${TMPDIR} /hosttools"; export HOME="/home/pokybuild"; git -c core.fsyncobjectfiles=0 ls-remote git://git.yoctoproject.org/poky failed with exit code 127, output: /bin/sh: 1: git: not found This is because PV is being expanded when TMPDIR is unset. Expand PV in advance to avoid this problem. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18image.bbclass: Add additional bb.debug to help track 12304Saul Wold
We actually caught the ext4 size issue in the wild with the debug output in the oe_mkext234fs() code, but it did not help. What that showed was that the get_rootfs_size was returning a default size of 8192, where as the actual rootfs was more like 10572, thus too large to fit in the created sparse file. This additional temporary debug code should help us determine where the failure might be. More debug for [YOCTO #12304] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08image.bbclass: let do_image depend on do_populate_lic of EXTRA_IMAGEDEPENDSMing Liu
The licenses of EXTRA_IMAGEDEPENDS recipes are being referenced in image postcommand write_deploy_manifest, but a dependency is missing between do_image and do_populate_lic of EXTRA_IMAGEDEPENDS recipes, this leads some license files not present when write_deploy_manifest runs, hence will cause build errors. Fixed by letting do_image depend on do_populate_lic of EXTRA_IMAGEDEPENDS recipes. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08image.bbclass: Fix 'vardepsexclude' mechanism for image_cmd_${FSTYPE}Igor Romanov
Current mechanism doesn't allow to use any non-determenistic variable, except 'DATE' and 'DATETIME', inside IMAGE_CMD_${FSTYPE} prototype. Passing 'vardepsexclude' values from IMAGE_CMD_${FSTYPE}, so users will be able to avoid taskhash mismatch problems. Signed-off-by: Igor Romanov <i.romanov@inango-systems.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-21image.bbclass: Sorted ctypes to avoid basehash errorGerson Fernando Budke
When selected multiple subimages a similar error could happend: Variable do_image_cpio[subimages] value changed \ from 'cpio.gz.u-boot cpio.gz' to 'cpio.gz cpio.gz.u-boot' To avoid this, 'ctypes' should be sorted at 'gen_conversion_cmds'. This garantee that 'CONVERSION_CMD_xxx' are always written in tha same order and consequently 'do_image_cpio' have the same hash. Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-21classes/image: move image_qa to between rootfs and imageRoss Burton
It was noticed that do_image_qa is useless when rm_work is enabled as the rootfs directory is deleted before image_qa is called. This indicates that image_qa is incorrectly scheduled as it failing should mean images don't get generated, so move it between do_rootfs and do_image. Also, add a little bit more documentation to the comments. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-08-16image.bbclass: drop initramfs bundle related codeMing Liu
The original purpose of this code snippet was to repackage initramfs bundled kernel images before do_image_complete, to be able to be included by rootfs, but it's not going to achieve that since the initramfs bundled kernel images are not even installed to ${D}/boot after commit a49569e3a7534779bbe3f01a0647fd076c95798d: [ kernel.bbclass: do not copy bundled initramfs to /boot ] So there is not a initramfs bundled kernel package at all, we should drop the code, because it is leading kernel do_initramfs_bundle unnecessarily rerun and it's very time consuming and hence is impacting the performance a lot. Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-16image.bbclass: support binary reproducibilityJuro Bystricky
Added a new task "reproducible_final_image_task". If binary reproducibility is desired ($BUILD_REPRODUCIBLE_BINARIES" = "1"), then recursivley modify mtimes of all files to a reproducible vale. The value is obtained via REPRODUCIBLE_TIMESTAMP_ROOTFS. This task is executed as the very last step in image creation, once all the files in the image have been finalized. [YOCTO#11176] Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-16image.bbclass: delete DATE variable tooStefan Agner
When creating a custom image which uses the DATE variable the basehash seems to change every day and lead to errors such as: ERROR: console-tdx-image-2.7.6-r0 do_image_customimg: Error executing a python function in exec_python_func() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 0001: *** 0002:set_image_size(d) ... Add DATE to the variables which should not get expanded early and to the vardepsexclude list for the image task. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-31image: Make do_image_qa a dummy sstate task to match do_image_completeRichard Purdie
Similar to do_image_complete, make do_image_qa a dummy sstate task so that rm_work doesn't cause image generation to repeat on every new build command. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-31image/rm_work: Promote do_image_complete to be more sstate likeRichard Purdie
We relied on the missing do_image_complete_setscene task to ensure the dummy sstate tarball that was created would never be used. This lead to its own issues and a better fix for SSTATE_SKIP_CREATION has now been merged. We can therefore make do_image_complete look like a more standard sstate task which means image generation doesn't keep rerunning when using rm_work. We do need to turn do_image_complete's stamp into an sstate version to handle this (it otherwise matches the do_image_* glob). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-31image: Drop before do_build from do_rootfs and do_imageRichard Purdie
do_image_complete has the do_build dependency, these other two tasks don't need it. If this is present, it complicates the dependency tree and convinces rm_work that the tasks need to rerun even if they already did since the stamps are removed. Drop the unneeded dependency to help resolve this issue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-30image: Convert vmdk/vdi/qcow2 to strict CONVERSION_CMD typesTom Rini
The vmdk/vdi/qcow2 IMAGE_FSTYPEs predate wic. As such, they provide some similar underlying functionality in order to produce a "disk" image that in turn can be converted into different formats that various hypervisor types work with. They do not however provide the ability for other disk image types to be converted into these same output types. Furthermore, they are less flexible than what wic does provide. This drops the old style vmdk/vdi/qcow2 types and re-introduces them under the CONVERSION_CMD framework. The equivalent of vmdk is now wic.vmdk and so forth for the other types. Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>