path: root/meta/classes/image.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* image/populate_sdk: seprate variables to fix dependencyChenQi/YP8670Chen Qi2016-02-171-9/+7
| | | | | | | | | | | | | Previously, do_rootfs depends on variables like SDK_OS, SDK_OUTPUT, etc. And changing variables like POPULATE_SDK_POST_HOST_COMMAND doesn't cause do_populate_sdk to rerun. This patch separates variables so that do_rootfs and do_populate_sdk could correctly depend on their related variables. [YOCTO #8670] Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
* image.bbclass: check INITRAMFS_MAXSIZERobert Yang2016-01-261-1/+13
| | | | | | | | | | | | | | | | | | | | Usually, the initramfs' maxsize can be 1/2 of ram size since modern kernel uses tmpfs as initramfs by dafault, and tmpfs allocates 1/2 of ram by default at boot time, which will be used to locate the initramfs. Set INITRAMFS_MAXSIZE to 131072K (128M) by default (ram 256M), the initramfs is small usually, for example, core-image-minimal-initramfs is about 21M (uncompressed, 17M * 1.3) by default, but if the user add a lot pkgs to initramfs, we can error and stop to let the user know ealier rather than fail to boot (e.g., OOM-killer) at boot time. Please see the bug for more info: https://bugzilla.yoctoproject.org/show_bug.cgi?id=5963 [YOCTO #5963] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
* image: Don't create tasks with '.' in the nameRichard Purdie2016-01-261-2/+2
| | | | | | | | | | | Similarly to "-", "." doesn't work well in task names but is used in some real world image classes. Work around this with some replacements for now to unbreak layers. (Issues don't show themselves until runtime, e.g. with --dry-run) Tested-By: Otavio Salvador <otavio.salvador@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Handle image types containing '-' correctlyRichard Purdie2016-01-191-4/+6
| | | | | | | | Shell function names can't contain '-' characters, which means our image task names also can't. Add some mapping to use '_' instead of the '-' so images like "rpi-sdimg" work again. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Always run do_rootfs_wicenvRichard Purdie2016-01-191-1/+1
| | | | | | | | | The wic command can be used externally but for this to work, the wic environment file needs to be present. Therefore write this out universally, it runs in parallel with other image construction so any performance implications are negligible. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg/image: Enhance bootimg to respect RM_OLD_IMAGERichard Purdie2016-01-191-4/+5
| | | | | | | | Currently, iso and hddimg links don't respect RM_OLD_IMAGE. This updates them to use the common symlinks code so that they behave like the rest of the system. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Ensure we don't expand TMPDIR in image commandsRichard Purdie2016-01-191-0/+2
| | | | | | | | Similarly to DATETIME, don't expand TMPDIR in image commands. This ensures some of the stamp comparisons we make in the QA tests work correctly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Fix instability of do_image_* checksumsRichard Purdie2016-01-191-0/+5
| | | | | | | | | | | | | | | | | | | | The do_image_* tasks contained the expanded version of DATETIME. Due to the expansion, we couldn't exclude the value from the task checksum which meant the task would rerun. We fix this by deleting the DATETIME value during expansion so we don't expand any references to at that time. This means the task's hash can be stable rather than having hardcoded date/time values. It will get expanded at execution time. This also fixes errors shown by -S: NOTE: Reparsing files to collect dependency data Writing locked sigs to /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/locked-sigs.inc ERROR: Bitbake's cached basehash does not match the one we just generated (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/recipes-sato/images/core-image-sato.bb.do_image_tar)! ERROR: The mismatched hashes were 77872792556367f1dde49a1425caf1a0 and 9bb0aca6286ab7dd22d3c69964beb665 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Fix wic environment issuesRichard Purdie2016-01-191-3/+5
| | | | | | | | | | | | | | | | | | | The wic environment function needs to run after the rootfs size is setup. We move this code to a specific task, and depend on that task from the wic images and other places its needed. This fixes: ====================================================================== FAIL: test_image_env (oeqa.selftest.wic.Wic) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f return func(*args, **kwargs) File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/wic.py", line 218, in test_image_env self.assertTrue(var in content, "%s is not in .env file" % var) AssertionError: False is not true : ROOTFS_SIZE is not in .env file Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image/image-live: Add back IMAGE_TYPES_MASKED supportRichard Purdie2016-01-151-2/+5
| | | | | | | | | | | IMAGE_TYPES_MASKED support was accidentally removed. The original idea behind it was to remove some of the hardcoding in the core image code, so do that for image-live and ensure the dependency and masked variables correctly reflect the needs of the class. This means we can remove all the hardcoded special cases since image-vm already has the needed markup. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: Handle image base type dependency properlyOtavio Salvador2016-01-151-0/+3
| | | | | | | | | | | | | | When a base image type has an implicit dependency (from IMAGE_TYPEDEP) this has to be taken into account. This is a regression introduced by OE-Core:c2dab18 (image: Create separate tasks for rootfs construction). The issue has been found when building meta-fsl-arm based images which does not include the rootfs image type explicitly in IMAGE_FSTYPES but instead is added, using IMAGE_TYPEDEP, for the 'sdcard.gz' image. Reported-by: Fabio Berton <fabio.berton@ossystems.com.br> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: Unconditional includes of populate_sdk_ext failsMark Hatle2016-01-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | populate_sdk_ext requires uninative support, which is only available on glibc based SDKMACHINES. For instance, when using mingw32 a dependency error will occur: NOTE: Runtime target 'nativesdk-glibc' is unbuildable, removing... ERROR: Required build target 'core-image-minimal' has no buildable providers. Missing or unbuildable dependency chain was: ['core-image-minimal', 'uninative-tarball', 'nativesdk-glibc'] This is dues to populate_sdk_ext.bbclass having: do_populate_sdk_ext[depends] += "buildtools-tarball:do_populate_sdk uninative-tarball:do_populate_sdk" addtask populate_sdk_ext Since bitbake can't determine for dependency resolution if the task is going to be run yet, it blows up and says it simply can't be resolved. Workaround this problem by making the inherit conditional on the SDK_OS containing 'linux'. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Fix do_rootfs referencesRichard Purdie2016-01-111-2/+2
| | | | | | | After the separation of do_rootfs, some rootfs references need changing to image_complete. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Create separate tasks for rootfs constructionRichard Purdie2016-01-111-23/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch splits the code in lib/oe/image into separate tasks, one per image type. This removes the need for the simple task graph code and defers to the bitbake task management code to handle this instead. This is a good step forward in splitting up the monolithic code and starting to make it more accessible to people. It should also make it easier for people to hook in other tasks and processes into the rootfs code. Incidentally, the reason this code was all combined originally was due to limitations of fakeroot where if you exited the session, you lost permissions data. With pseudo this constraint was removed. We did start to rework the rootfs/image code previously and got so far with untangling it however we did prioritise some performance tweaks over splitting into separate tasks and in hindsight, this was a mistake and should have been done the other way around. That work was suspended due to changes in the people working on the project but this split has always been intended, now is the time to finish it IMO. There were some side effects of doing this: * The symlink for the manifest moves to the rootfs-postcommands class and into the manifest function. * There is no seperate "symlink removal" and "symlink creation", they are merged * The date/time stamps of the manifest and the built images can now be different since the tasks can be run separately and the datetime stamp will then be different between do_rootfs and the do_image_* tasks. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Move pre/post process commands to bbclassRichard Purdie2016-01-111-2/+23
| | | | | | | | As the next step in splitting up do_image, move the pre and post processing commands to separate tasks. This also creates the do_image_complete task which acts as the end marker task for image generation. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: Separate out image generation into a new task, do_imageRichard Purdie2016-01-111-4/+10
| | | | | | | | | | | | | | | | I've heard complaints from people trying to create more interesting image types about how hard it is to understand the rootfs/image generation code and that its a pain to develop/test/debug. Having looked at it myself, the internal construction of shell functions which then gets passed into a multiprocessing pool is rather convoluted and it places rather odd constraints on when variables are expanded. Its therefore no wonder people find it confusing/complex. This patch starts the process of splitting this up by separating out image generation from the do_rootfs task into a new do_image task. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Really remove lockfiles flagRichard Purdie2016-01-071-1/+0
| | | | | | | This was supposed to be removed by a previous patch but was readded. Really remove it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Condense do_rootfs function/flagsRichard Purdie2016-01-051-27/+17
| | | | | | | Various prefuncs and flags and addtask statements make sense to belong together in one clearer function now, this patch cleans things up a bit. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image/rootfs-postcommands: Separate out post rootfs commands to separate classRichard Purdie2016-01-051-239/+1
| | | | | | | | | | | | Reading image.bbclass is a little difficult as it has many post rootfs helper functions and its hard to separate those from the core contents of the rootfs/image code. Moving it to a separate class would be one way of making it clearer what these functions are. There are some comment layout improvements but no code changes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Remove pointless rootfs lockRichard Purdie2016-01-051-1/+0
| | | | | | | It was added in aa3141e979326a9d931ff03bad75923faa1d9dc6 back in 2008 but I don't see why multiple images would need this now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: tweak the key location for dropbear when rootfs is readonlyAlexander Kanavin2015-10-011-0/+11
| | | | | | | In the same way it's done for openssh. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: when building a readonly rootfs, tweak ssh settings ↵Alexander Kanavin2015-10-011-12/+12
| | | | | | | | | regardless of init system in use Previously it was done only if sysvinit was in DISTRO_FEATURES. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image types: add hdddirectPatrick Ohly2015-09-281-1/+1
| | | | | | | | | | | | | | | When image-vm.bbclass was introduced, it indirectly also introduced a ".hdddirect" image type based on boot-directdisk.bbclass. However, one could only get that image when also enabling at least one of the virtual machine images. The .hdddirect images are useful by themselves. By registering image-vm.bbclass as implementation of it, it becomes possible to select them with: IMAGE_FSTYPES = "hdddirect" Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
* image.bbclass: add do_rootfs vardeps for {COMPRESS, IMAGE}_CMD_*Christopher Larson2015-09-161-1/+17
| | | | | | | | | | | | We want do_rootfs to rerun if the fstype or compression commands or dependencies change for any of our configured fstypes (IMAGE_FSTYPES). IMAGE_TYPEDEP isn't explicitly handled, as it's traversed already, so the end result will change if it does, and we only really care about the results, not how we got there. This uses oe.image.Image()._get_image_types() to get the info about the image and compression types in use. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
* image.bbclass: add rootfs_check_host_user_contaminatedChristopher Larson2015-09-031-0/+14
| | | | | | | | This function is intended to be used in ROOTFS_POSTPROCESS_COMMAND, and checks for any paths outside of /home which are owned by the user running bitbake. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: re-run do_rootfs when feature packages changeChristopher Larson2015-08-301-0/+2
| | | | | | | | | | | | | Currently, FEATURE_PACKAGE_<feature> isn't in any vardeps, so changing the packages for a feature won't change the checksum for do_rootfs. Rather than explicitly adding those to vardeps, just use the expanded form of FEATURE_INSTALL and FEATURE_INSTALL_OPTIONAL, so the actual list of packages from the features goes into the checksum. (From OE-Core rev: fdd1669e04bd8219344b1896b9d9c6a187e4f84e) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Support for qcow2Christian Ziethén2015-07-241-1/+1
| | | | | | | | Add support for qcow2 image format. Implemented in the same way as the previously existing vmdk and vdi solutions. Signed-off-by: Christian Ziethén <christian.ziethen@linaro.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
* *image.bbclass: Consolidate ROOTFS_POSTPROCESS_COMMANDsGary Thomas2015-07-221-0/+6
| | | | | | | | | | | Move ROOTFS_POSTPROCESS_COMMANDs from core-image.bbclass to image.bbclass so that images built using just image.bbclass will benefit from them. Without this change, an image built using image.bbclass did not honor read-only-rootfs image feature. Signed-off-by: Gary Thomas <gary@mlbassoc.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Add explict getVar param for (non) expansionRichard Purdie2015-06-231-1/+1
| | | | | | | | | | | | Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Support for VDIJuro Bystricky2015-06-111-3/+3
| | | | | | | | | | Added support for VirtualBox VDI format. The support was implemented by merging with the already existing VMDK support for VM player by creating a new class image-vm.bbclass. This class replaces the previous VMDK only image-vmdk.class. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
* image.bbclass: Add a method for creating a companion debug filesystemMark Hatle2015-05-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The companion debug filesystem contains only the package database and the complementary *-dbg packages for the main filesystem component. This is useful in a production environment to produce a companion filesystem capable of remote system debugging, without requiring corresponding debug symbols or source code on the device. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> If dbg pkgs have already been installed to the rootfs image, the installation to companion debug filesystem will fail, because both of image creation make use of the same pm database. In this situation, try to copy installed dbg files from rootfs image to companion debug filesystem. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Acked-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: zap_empty_root_password doesn't handle passwd file in shadow casetprrt2015-04-241-1/+2
| | | | | | | | /etc/passwd isn't editted if /etc/shadow exists and should be else it can cause problems with some login providers such as toybox. Signed-off-by: tprrt <tprrt@tupi.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: Allow to remove do_rootfs -> virtual/kernel:do_packagedata ↵Martin Jansa2015-04-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dependency * this is causing dependency loops in some cases e.g. linux-hp-tenderloin depends on initramfs-android-image, but commit 41f0f86ec0a3e0b6f6c9bb4ef71a4215c00bf66c Author: Richard Purdie <richard.purdie@linuxfoundation.org> Date: Tue Jan 27 15:24:52 2015 +0000 Subject: image: Add missing depends on virtual/kernel for depmod data adds also dependency between <image>.do_rootfs and virtual/kernel:do_packagedata causing this dependency loop: Dependency loop #1 found: Task 78 (meta-smartphone/meta-hp/recipes-kernel/linux/linux-hp-tenderloin_git.bb, do_install) (dependent Tasks ['linux-hp-tenderloin, do_compile', 'pseudo, do_populate_sysroot']) Task 88 (meta-smartphone/meta-hp/recipes-kernel/linux/linux-hp-tenderloin_git.bb, do_package) (dependent Tasks ['rpm, do_populate_sysroot', 'pseudo, do_populate_sysroot', 'linux-hp-tenderloin, do_install', 'initramfs-android-image.bb, do_packagedata', 'glibc, do_packagedata', 'file, do_populate_sysroot', 'gcc-runtime, do_packagedata']) Task 89 (meta-smartphone/meta-hp/recipes-kernel/linux/linux-hp-tenderloin_git.bb, do_package_write_ipk) (dependent Tasks ['linux-hp-tenderloin, do_package', 'opkg-utils, do_populate_sysroot', 'linux-hp-tenderloin, do_packagedata', 'pseudo, do_populate_sysroot']) Task 560 (meta-smartphone/meta-android/recipes-core/images/initramfs-android-image.bb, do_rootfs) (dependent Tasks ['bash, do_package_write_ipk', 'run-postinsts, do_package_write_ipk', 'db, do_package_write_ipk', 'update-rc.d, do_populate_sysroot', 'android-tools-conf, do_package_write_ipk', 'base-passwd, do_package_write_ipk', 'initramfs-boot-android, do_package_write_ipk', 'expat, do_package_write_ipk', 'bzip2, do_packagedata', 'glibc-initial, do_packagedata', 'openssl, do_package_write_ipk', 'bzip2, do_package_write_ipk', 'busybox, do_packagedata', 'zlib, do_packagedata', 'qemuwrapper-cross, do_packagedata', 'base-passwd, do_packagedata', 'busybox, do_package_write_ipk', 'zlib, do_package_write_ipk', 'qemuwrapper-cross, do_package_write_ipk', 'gcc-runtime, do_package_write_ipk', 'gettext, do_packagedata', 'initramfs-boot-android, do_packagedata', 'gettext, do_package_write_ipk', 'libgcc-initial, do_packagedata', 'expat, do_packagedata', 'gdbm, do_packagedata', 'depmodwrapper-cross, do_package_write_ipk', 'libgcc-initial, do_package_write_ipk', 'glibc-initial, do_package_write_ipk', 'linux-libc-headers, do_packagedata', 'glibc, do_packagedata', 'initramfs-android-image.bb, do_packagedata', 'glibc, do_package_write_ipk', 'sqlite3, do_packagedata', 'initramfs-android-image.bb, do_package_write_ipk', 'sqlite3, do_package_write_ipk', 'android-tools-conf, do_packagedata', 'ncurses, do_packagedata', 'openssl, do_packagedata', 'android-tools, do_packagedata', 'ncurses, do_package_write_ipk', 'cryptodev-linux, do_packagedata', 'android-tools, do_package_write_ipk', 'pseudo, do_populate_sysroot', 'cryptodev-linux, do_package_write_ipk', 'linux-libc-headers, do_package_write_ipk', 'depmodwrapper-cross, do_packagedata', 'linux-hp-tenderloin, do_packagedata', 'readline, do_package_write_ipk', 'opkg-utils, do_packagedata', 'linux-hp-tenderloin, do_package_write_ipk', 'python, do_packagedata', 'gdbm, do_package_write_ipk', 'opkg, do_populate_sysroot', 'python, do_package_write_ipk', 'libtool-cross, do_packagedata', 'db, do_packagedata', 'libgcc, do_packagedata', 'libtool-cross, do_package_write_ipk', 'update-rc.d, do_packagedata', 'update-rc.d, do_package_write_ipk', 'libgcc, do_package_write_ipk', 'opkg-utils, do_populate_sysroot', 'makedevs, do_populate_sysroot', 'readline, do_packagedata', 'base-files, do_packagedata', 'gcc-runtime, do_packagedata', 'opkg-utils, do_package_write_ipk', 'base-files, do_package_write_ipk', 'ldconfig-native, do_populate_sysroot', 'bash, do_packagedata', 'run-postinsts, do_packagedata']) Task 82 (meta-smartphone/meta-hp/recipes-kernel/linux/linux-hp-tenderloin_git.bb, do_compile) (dependent Tasks ['initramfs-android-image.bb, do_rootfs', 'linux-hp-tenderloin, do_configure']) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: Empty /var/volatile if it is a mount pointRandy Witt2015-03-241-0/+18
| | | | | | | | | | | | | | | | | | | If /var/volatile is a mount point it shouldn't contain any files before mount time. If files are there, they will no longer be able to be accessed once the tmpfs gets mounted at /var/volatile. This problem can be seen for instance when systemd creates /var/volatile/log/journal as part of its package installation. It then assumes the journal is persistent even though /var/volatile/log/journal goes away shortly thereafter. This change makes sure that there are no files in /var/volatile if it is to be used as a mount point. [Yocto #7388] Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Ensure manifests end with a newlineRichard Purdie2015-03-241-0/+1
| | | | | | | | | | Manifests should end with a newline character but don't currently. This is the easiest fix for now, the alternative would be a rewrite of the internal code which is something to consider in due course. [YOCTO #7427] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_ext: add extensible SDKRandy Witt2015-02-231-1/+1
| | | | | | | | | | | | | | | | | | This bbclass will create an SDK with a copy of bitbake and the metadata and sstate for the target specified for the task. The idea is to let "system" developers both work on applications and then test adding them to an image without having to switch between workspaces or having to download separate items. Rather than running bitbake directly however, the primary way of running builds within the extensible SDK is to use the "devtool" command. The rest of the build system is fixed via locked shared state signatures, and thus only the recipes you have added get built. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: add new items to IMAGE_FEATURES[validitems] listSaul Wold2015-02-141-1/+1
| | | | | | | | | | Add the new items to the validitems list, this is fully tested, initial testing had been done with a local change that did not make the original commit request [YOCTO #7308] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
* image.bbclass: don't let do_rootfs depend on BUILDNAMEChen Qi2015-02-071-1/+1
| | | | | | | | | | | BUILDNAME is set by cooker as a string of current time. Letting do_rootfs task depend on this variable gets us no benefit. Besides, letting do_rootfs task depend on this variable will cause us trouble when executing `bitbake -S none core-image-minimal'. With current code, this command gives us error complaining about the different bashhash of do_rootfs task. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
* core-image: split debug-tweaks into individual featuresSaul Wold2015-02-071-2/+8
| | | | | | | | | | | | Split the debug-tweaks into a more fine tunable set of IMAGE_FEATURES which activate the component functions. Clean-up image-core and image bbclass by having the ROOTFS_POSTPROCESS_COMMANDs in in one place for the debug-tweaks related functions [YOCTO #5344] Signed-off-by: Saul Wold <sgw@linux.intel.com>
* image.bbclass: make kernel depmod data optionalDan McGregor2015-02-031-0/+1
| | | | | | | | | | This allows an image to skip the creation of kernel depmod data. It is useful for creating an image that will run as a container image inside a host with no knowledge of the parent's kernel. Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca> Signed-off-by: Ross Burton <ross.burton@intel.com>
* classes/image: ensure uninstalled packages do not appear in manifestsPaul Eggleton2015-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Since the rewrite of the image construction code in python a few releases ago, we remove a couple of packages from the image as one of the final steps when constructing the image (notably update-rc.d and run-postinsts). However, because of the order of operations, these packages are still listed both in the buildhistory installed_package*.txt files and in the manifest file created next to the image, which is wrong. There were two possible solutions to this: (1) change the order such that the uninstallation occurs before calling ROOTFS_POSTPROCESS_COMMAND or (2) add another hook variable in such that we can have the package list collection code run at the right time. Because it's currently possible (but very much not recommended) to install additional packages within ROOTFS_POSTPROCESS_COMMAND, which may have postinstall scripts and thus require the packages we would otherwise uninstall if we were to take option 1, option 2 is really the least likely to cause problems. Therefore, add ROOTFS_POSTUNINSTALL_COMMAND and make the image and buildhistory classes use it. Fixes [YOCTO #6479]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
* classes/image: skip recipe on invalid IMAGE_FEATURES itemPaul Eggleton2015-02-031-1/+4
| | | | | | | | | | | | | | | If you add an item to EXTRA_IMAGE_FEATURES in your local.conf that is not supported by image.bbclass itself (such as "tools-sdk" which is implemented in core-image.bbclass), it can be somewhat annoying to have the parse fall over if you have a recipe that inherits image.bbclass only. Change the error from bb.fatal to skip the recipe instead so that you only see the error when attempting to build the recipe, plus add a bit of logic to report if the feature is coming in via EXTRA_IMAGE_FEATURES. Fixes [YOCTO #5023]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
* classes/image: drop unused default of MACHINE_POSTPROCESS_COMMANDPaul Eggleton2015-02-031-1/+0
| | | | | | | | | | | | | | In the daisy (1.6) timeframe, when we rewrote the image construction in Python, we neglected to reimplement the support for the little used and undocumented variable MACHINE_POSTPROCESS_COMMAND, and apparently nobody noticed. We have a better method for implementing machine-specific image formats that is in wider use (i.e. add a custom class which implements the new image type, add the class to IMAGE_CLASSES and the type to IMAGE_FSTYPES), and we now also have wic. Thus it makes more sense to just call this variable unsupported now and drop the sole remaining reference to it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
* image: Add missing depends on virtual/kernel for depmod dataRichard Purdie2015-01-291-2/+4
| | | | | | | | | | | | | | | We need the depmod data so that the kernel depmod command works successfully at rootfs time. The fact this was working inconsistently is now highlighted after the command was made to error out. A simple test case is: bitbake virtual/kernel image bitbake vrituak/kernel -c clean bitbake image -c rootfs -f We fix it by adding the missing dependency, the data is in PKGDATA_DIR and hence we use packagedata. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel/image/depmodwrapper: Fixups for depmodRichard Purdie2015-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | With the rpm package backend enabled, running: bitbake <image> bitbake virtual/kernel -c clean bitbake <image> -c rootfs -f results in an image with incorrect kernel module dependency information. The problem is that the System.map and kernel-abiversion files are needed for depmod and after the recent kernel changes, these are no longer in sstate. Its reasonable to require the kernel to unpack/build if you're about to build a module against it. It is not reasonable to require this just to build a rootfs. Therefore stash the needed files specifically for depmod. Also fix some STAGING_KERNEL_DIR references which were incorrect, found whilst sorting through his change. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: Remove 'set_image_autologin' functionOtavio Salvador2014-12-311-6/+0
| | | | | | | | | | The set_image_autologin function is GPE Login specific and the package is not available in OE-Core so the function should be added in the meta-gpe layer, if necessary. Drop this from the OE-Core as it is unused. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: avoid boot error on read-only systemd imageChen Qi2014-12-241-0/+21
| | | | | | | | | | | | | | | | | | | | | New version of systemd implements a new feature of updating /etc or /var when needed at boot. For details, please see link below. Opointer.de/blog/projects/stateless.html For now, at boot time, the systemd-sysusers.service would update user database files (/etc/passwd, /etc/group, etc.) according to the configuration files under /usr/lib/sysusers.d. This step is necessary for other systemd services to work correctly. Examples of such services are systemd-resolved and systemd-tmpfiles-setup. The problem is that on a read-only file system, that is, if /etc is read-only, the user database files could not be updated, causing failures of services. This patch fixes this problem by adding users/groups at rootfs time. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Avoid race over directory creationRichard Purdie2014-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | There is a race over the do_package_qa task and the do_rootfs task since rootfs recreates a directory. This patch disables the task (which isn't used for images) to avoid the race: NOTE: recipe core-image-minimal-1.0-r0: task do_package_qa: Started NOTE: recipe core-image-minimal-1.0-r0: task do_rootfs: Started ERROR: Build of do_package_qa failed ERROR: Traceback (most recent call last): File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/bitbake/lib/bb/build.py", line 497, in exec_task return _exec_task(fn, task, d, quieterr) File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/bitbake/lib/bb/build.py", line 440, in _exec_task exec_func(func, localdata) File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/bitbake/lib/bb/build.py", line 212, in exec_func exec_func_python(func, d, runfile, cwd=adir) File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/bitbake/lib/bb/build.py", line 237, in exec_func_python os.chdir(cwd) OSError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/build/tmp/work/qemumips-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0' Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: whitespaceMichael Jones2014-12-051-3/+3
| | | | | | Don't mix tabs and spaces Signed-off-by: Ross Burton <ross.burton@intel.com>
* image.bbclass: remove comment that readonly only works for sysvinitMichael Jones2014-12-051-1/+0
| | | | | | | Should have been removed with 92f956d tweak read_only_rootfs_hook to also support systemd based systems Signed-off-by: Ross Burton <ross.burton@intel.com>