summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/rootfs.py
Commit message (Collapse)AuthorAgeFilesLines
* rootfs.py: Respect OPKGLIBDIR variableMartin Jansa2017-03-241-1/+3
| | | | | | | | | | | | | * when OPKGLIBDIR doesn't have the default /var/lib value it will silently fail to copy package database from normal rootfs to debugfs rootfs and then when trying to install *-dbg complimentary packages it won't install anything, because installed_pkgs.txt file generated from debugfs is empty (From OE-Core rev: bebdb056c8bd0efc056f07b275a154e5d5a3aa2b) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs_rpm.bbclass: migrate image creation to dnfAlexander Kanavin2017-03-141-14/+4
| | | | | | | | | To properly look at this patch, you probably need a side-by-side diff viewing tool. (From OE-Core rev: 65581c68d130fa74d703f6c3c92560e053857ac7) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: improve the API for insert_feed_uris()Alexander Kanavin2017-03-141-1/+4
| | | | | | | | | | No need to store the configuration as class members, just pass it directly into the method. (From OE-Core rev: a5cc38481be3c5e6ccbecf951f9fdc049e5101d5) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel, license, sstate, rootfs.py: Remove deploy directory READMEMike Crowe2017-03-011-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | It isn't clear that the README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt file in the deploy directory warrants the complexity it brings elsewhere. Let's just remove it entirely. In particular, if two do_image_complete tasks run in parallel they risk both trying to put their image into ${DEPLOY_DIR_IMAGE} at the same time. Both will contain a README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt file. In theory this should be safe because "cp -alf" will just cause one to overwrite the other. Unfortunately, coreutils cp also has a race[1] which means that if one copy creates the file at just the wrong point the other will fail with: cp: cannot create hard link ‘..../tmp-glibc/deploy/images/pantera/README_-_DO_NOT_DELETE_FILES_IN_THIS_D.txt’ to +‘..../tmp-glibc/work/rage_against-oe-linux-gnueabi/my-own-image/1.0-r0/deploy-my-own-image-complete/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt’: File exists [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25680 (From OE-Core rev: 71e9e88847d7000781642ea6187ebd8f40dfdcfe) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/oeqa: Replace subprocess.check_call() with check_output()Richard Purdie2017-01-231-3/+3
| | | | | | | | | | If you use subprocess.check_output() the traceback will contain the output when the command fails which is very useful for debugging. There is no good reason not to use this everywhere. (From OE-Core rev: ad750dd1cc9d789abe723daddd098ce41d8547f5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: reliably handle alternative symlinksAndré Draszik2017-01-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When removing unneeded packages from a (read-only) rootfs during rootfs creation, alternative symlinks from those packages may or may not be removed. The reason is as follows: update-alternatives(-native) is used during package installation as part of the image creation. It uses a database which contains entries for all the alternative symlinks possible, and the -native version uses the target's database by means of $OPKG_OFFLINE_ROOT, i.e. the rootfs we're in the process of creating. Once the rootfs has been created, OE removes certain packages because we have a read-only rootfs - in particular ROOTFS_RO_UNNEEDED which includes VIRTUAL-RUNTIME_update-alternatives, i.e. the update-alternatives. Recently, a change was made in OE, where uninstallation of update-alternatives from the rootfs causes removal of its database, too, to save space (700KiB (uncompressed) in a busybox system) b24a63d71b517af701dfedbc7f7b541d25af708f http://git.openembedded.org/openembedded-core/commit/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb?id=b24a63d71b517af701dfedbc7f7b541d25af708f Following from that, if update-alternatives is removed from the target file system, update-alternatives-native has no database anymore, meaning it can't manage any of the alternative symlinks anymore. Because the order of packages to uninstall is non-deterministic, and update-alternatives could well be removed before any packages that use the mechanism provided, sometimes the extra symlinks are removed, sometimes not. By sorting the list of packages to be removed such that update-alternatives is removed last, we can ensure that that tings work reliably. (Certainly opkg seems to uninstall packages in the order given on the command line.) [YOCTO #10916] (From OE-Core rev: 5263dd3eac9d9fbdb7ef654d0cd532c192baed16) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs: don't put /usr/lib/ssl and /etc into debugfsRoss Burton2017-01-161-1/+1
| | | | | | | | | | | | The /etc and /usr/lib/ssl directories were only put into the opkg-generated debugfs because of a bug in opkg which means that a conffile has to exist if we're running 'opkg status'. This is now fixed, so the workaround can be reverted. (From OE-Core rev: 7267b1f6fa25e290eac070263355aa7f30b2ebcb) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-57/+57
| | | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/image: suppress log_check mechanism for warnings/errors logged ↵Paul Eggleton2016-12-141-13/+16
| | | | | | | | | | | | | | | | | | | | | | through BitBake If you printed a warning through bb.warn() / bbwarn or an error through bb.error() / bberror, this was also being picked up by our log_check mechanism that was designed to pick up warnings and errors printed by other programs used during do_rootfs. This meant you saw not only the warning or error itself, you saw it a second time through log_check, which is a bit ugly. Use the just-added BB_TASK_LOGGER to access the logger and add a handler that we can use to find out if any warning or error we find in the logs is one we should ignore as it has already been printed. Fixes [YOCTO #8223]. (From OE-Core rev: fb37304d27857df3c53c0867e81fbc8899b48089) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: fix log_check warnings being printed twice with RPM packagingPaul Eggleton2016-12-141-2/+0
| | | | | | | | | | | | | We were calling _log_check() in the RPM-specific rootfs class as well as in the base class; this is unnecessary and resulted in any errors/warnings generated during the actual package installation time triggering two warnings instead of one. Drop the call from RpmRootfs._create() to fix this. (From OE-Core rev: 541c56d755ba0354297673e857628026ad9e4df2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: Deploy images to IMGDEPLOYDIREd Bartosh2016-09-041-3/+3
| | | | | | | | | | | | | | | | | Changed deployment directory from DEPLOY_DIR_IMAGE to IMGDEPLOYDIR to make sstate machinery to do final deployment and generate manifest. Renamed variable deploy_dir to deploy_dir_image in selftest code to avoid confusion with DEPLOYDIR variable. Updated the code of rootfs.py:Rootfs class to use IMGDEPLOYDIR variable as it's now used as a new deployment destination. (From OE-Core rev: 6d969bacc718e21a5246d4da9bf9639dcae29b02) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: allow removal of unneeded packagesStephano Cetola2016-08-251-1/+3
| | | | | | | | | | | | | | | Current functionality allows for the removal of certain packages based on the read-only image feature. This patch extends this functionality by adding the FORCE_RO_REMOVE variable, which will remove these packages regardless of any image features. [ YOCTO #9491 ] (From OE-Core rev: cfb869ffd4c37c3cc8e6b3eb732c1a7b7cfc3cb0) Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/image: implement progress support for do_rootfsPaul Eggleton2016-07-081-13/+88
| | | | | | | | | | | | Use the new task progress functionality to report progress during do_rootfs. This is a little coarse and ideally we would have some progress within the installation section, but it's better than nothing. (From OE-Core rev: 370f08d434480c1790950e40db8f7687da78cb14) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Complete transition to python3Richard Purdie2016-06-021-2/+1
| | | | | | | | | This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. (From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Update to explictly create lists where neededRichard Purdie2016-06-021-2/+2
| | | | | | | | | Iterators now return views, not lists in python3. Where we need lists, handle this explicitly. (From OE-Core rev: caebd862bac7eed725e0f0321bf50793671b5312) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: Fix DEBUGFS generation, without opensslAnders Darander2016-05-201-0/+2
| | | | | | | | | | | | | | | | In commit 20ea6d274bb0a9a5addb111f32793de49b907865, debugfs generation for images using opkg, which included openssl was fixed. However, that broke the generation of the opkg-based images, that lacks openssl. The error is a python stack trace, showing that shutil.copytree tries to copy a non-existing directory. This relates to [YOCTO #9040]. (From OE-Core rev: f6b0b260ce18a30d04edfb0afb7942b9f9a5480b) Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Unify _log_check_warn() and _log_check_error()Peter Kjellerstedt2016-05-191-38/+14
| | | | | | | | | | | | | | | | | | | Use a common _log_check_common() function (based on the old _log_check_warn() function) to implement the logic for both _log_check_warn() and _log_check_error(). The main benefit of this is that now all error messages will be reported again, not just the first one found. Additionally the output will now look the same for both error and warning messages. This removes the context for the error messages. However, since there was no indication in the output that some of the lines were context, they were more confusing than helping. (From OE-Core rev: dd73dcac36b80b3b886a2e9bf575b91c4f60d039) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Reduce spam from _log_check_warn()Peter Kjellerstedt2016-05-191-2/+9
| | | | | | | | | | | | | | | | For each warning found in the log, _log_check_warn() would output a line stating that it had found a warning, then the actual warning and finally an empty line. This is quite excessive when there are many warnings in the log. With this change the output is instead a line stating how many warnings were found, followed by the warnings. This makes the output much more compact and actually much more readable. (From OE-Core rev: d6e3477749b1d09d40a773e0ac857a24d5851984) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Exclude lines in _log_check_warn() as wellPeter Kjellerstedt2016-05-191-4/+15
| | | | | | | | | | This will make _log_check_warn() exclude the same lines as _log_check_error() does. (From OE-Core rev: 85f64c68278f797c6f73f002f63d7f46fe80aef4) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Use one way to exclude lines in _log_check_error()Peter Kjellerstedt2016-05-191-13/+12
| | | | | | | | | | | | Before there were three different ways to exclude a line from being searched for error messages in _log_check_error(). Now there is only one: an array of regular expressions. This should make it easy to add more excludes if nedded. (From OE-Core rev: 321df88088fbfa657b61b2bae32751f03daec46f) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Simplify the regular expression used in _log_check_warn()Peter Kjellerstedt2016-05-191-2/+2
| | | | | | | | | | | | In commit 0387d095 lines with "NOTE:" in them were excluded from the log check for warnings. However, those lines were only there in the first place since the regular expression that is used to find warning messages explicitly included those lines... (From OE-Core rev: 865ab39f18a52ed84217df56d0e65113e2894d02) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Remove _log_check_error() from the RpmRootfs classPeter Kjellerstedt2016-05-191-26/+3
| | | | | | | | | | | | | | | | | | | | | The fact that this function was overridden in the RpmRootfs class seems to have led to a number of misstakes when changes have been made to the base function in the Rootfs class. E.g., this change will properly solve ticket 7789, which was supposedly solved in 38871dc0, but that change had no effect in practice as the log_check_regex that was modified for RpmRootfs class was not used by the RpmRootfs version of _log_check_error()... The only thing _log_check_error() in RpmRootfs did that the base function in Rootfs did not do was to skip lines in the log that begin with a + sign. This has now been moved to the base function instead. [YOCTO #7789] (From OE-Core rev: 1eb0a46502fca4b2ee30ccd2508f4e21a40c25ca) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "rootfs.py: add more info to the warning message"Peter Kjellerstedt2016-05-191-1/+0
| | | | | | | | | | | | | | | | | The reverted commit added a warning with the log line that triggered the log check for error messages before the warning that states that an error has been found in the log. However, the error line is output by the call to bb.fatal() that follows immediately after the original warning, which makes it redundant. Additionaly, having two warnings contradicts the intent of commit 8dfdd329 where the log warnings were tidied up. This reverts commit f9cf31525fc885e1a0f65bd55654631257f87078. (From OE-Core rev: e509a83c8eb5a572aad7e7451d019fa2469d70c3) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: Fix DEBUGFS generation for opkg & openssl-cnfAnders Darander2016-05-111-1/+1
| | | | | | | | | | | | | | | | | | | When enabling extra DEBUGFS image generation with opkg, the following error is seen when openssl-cnf is included in the image. Collected errors: * file_md5sum_alloc: Failed to open file /mnt/cs-builds/anders/oe-build/build-ccu/tmp/work/ccu-oe-linux-gnueabi/ccu-image/1.0-r0/rootfs/usr/lib/ssl/openssl.cnf: No such file or directory. Lots of similar issues was fixed by an earlier commit in oe-core, 5084ed9401250ed269a49d27b303806ab173c5d5, but openssl-cnf is outside of that fix. Followup to [YOCTO #9490] (From OE-Core rev: 20ea6d274bb0a9a5addb111f32793de49b907865) Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: Fix DEBUGFS generation when using opkgRichard Purdie2016-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | When enabling extra DEBUGFS image generation with opkg, errors are seen like: ERROR: core-image-minimal-1.0-r0 do_rootfs: Cannot get the installed packages list. Command '/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/bin/opkg -f /media/build1/poky/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/opkg.conf -o /media/build1/poky/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs --force_postinstall --prefer-arch-to-version status' returned 0 and stderr: Collected errors: * file_md5sum_alloc: Failed to open file /media/build1/poky/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/syslog-startup.conf.busybox: No such file or directory. * file_md5sum_alloc: Failed to open file /media/build1/poky/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/fstab: No such file or directory. basically for all CONFFILES in the image. This is due to the file rearranging the rootfs generation code does. If we preserve the /etc directory, the avoids the problem. We need to tell copyfile to preserve symlinks since some are present in /etc. [YOCTO #9490] (From OE-Core rev: 5084ed9401250ed269a49d27b303806ab173c5d5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: apply ROOTFS_POSTINSTALL_COMMAND to all package formatsBill Randle2016-04-141-2/+3
| | | | | | | | | | | | | | Previously, ROOTFS_POSTINSTALL_COMMAND was run only after the opkg rootfs install post processing phase. This patch makes it generic so it is run fter any package manager specific rootfs post processing, but before _run_intercepts(). [YOCTO #9248] (From OE-Core rev: 8f2571881cd01ace88d282a63ad802cab4ab6940) Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: Make unneeded packages for a read-only rootfs configurablePeter Kjellerstedt2016-03-311-18/+5
| | | | | | | | | | | | | | | | Previously the list of packages that are considered unneeded for a read-only rootfs was hardcoded. This made it impossible to, e.g., have shadow installed on a system with a read-only rootfs, but where /etc is mounted writable. This also lists ${VIRTUAL-RUNTIME_update-alternatives} rather than update-alternatives (as was previously the case) since this should actually remove the intended package. (From OE-Core rev: e3b881d4168e5b02ff00f5c470ba472ab8bbc747) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager: remove package feed listsStefan Agner2016-01-311-1/+1
| | | | | | | | | | | | | Remove opkg package feed lists after generating the rootfs. The lists have been generated by the local feed but are no longer necessary after image generation. This still leaves the package management fully usable (and hence is different from omitting package-management from IMAGE_FEATURES). (From OE-Core rev: 25477874ef737777cedc623a8e1c5aedf2f4bae1) Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: Use list_pkgs() instead of list()Mariano Lopez2016-01-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | This patch changes the use list_pkgs() instead of list() from class RpmPkgsList. The change is in two functions, image_list_installed_packages from rootfs.py and sdk_list_installed_packages from sdk.py. With this change the functions calling the functions listed above, must format the output as they required. The formatting can be done using format_pkg_list() from oe.utils. The classes calling the afected functions are changed too with this patch, to keep the same functionality using the new data structure. [YOCTO #7427] (From OE-Core rev: 983ea373362514e5888bd1d7d9c4f136c94b00f2) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* DpkgRootfs: Fix logcheck_error false-positive when use multilibAníbal Limón2016-01-111-0/+13
| | | | | | | | | | | | | | | | | | | | Rootfs with dpkg was failing due to false-positive in logcheck_error because current logic of DpkgPM handles missing dependencies failure using apt-get -f install [1][2]. This support was broken due to addition of logcheck and don't take into account dpkgpm cases, in order to fix add an attr for specify expected errors regex'es by package manager. [1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/lib/oe/rootfs.py#n659 [2] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/lib/oe/package_manager.py#n2038 (From OE-Core rev: fa7a5ebef87883755491b847c2f4e1a7b021d585) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Change logic to unistall packagesMariano Lopez2015-12-121-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current state some of the base utils (update-rc.d, base-passwd, shadow, and update-alternatives) are unistalled when there is no package manager in the image. Checking for previous commits, the unistall of these utils were to be done in a read-only filesystem. It is a valid option to have these utils without a package manager, and also make sense to remove them when building a read-only filesystem. This changes the check logic from having a package mananger to if is a read-only filesystem to remove the utils. Another change implemented with this patch is that delayed post installs now doesn't depend if there is a package manager. Also it is a valid option to have post install scripts without package manger. [YOCTO #8235] (From OE-Core rev: 5aae19959a443c6ac4b0feef10715c8acf3c6376) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Stop using installed_pkgs.txtMariano Lopez2015-11-241-15/+9
| | | | | | | | | | | | | | | | The method _uninstall_unneeded uses the file installed_pkgs.txt, this file is left after the build and can cause confusion. This changes allow to get the installed packages using functions of rootfs instead of the installed_pkgs.txt file. With this change now is possible to remove the file without breaking anything. [YOCTO #8444] (From OE-Core rev: bf935ac16f6175673417dda92a619946b52fac87) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: tell intercepts where the native sysroot isRoss Burton2015-10-271-0/+1
| | | | | | | | | | | | | | | | Some intercepts may want to access files in the native sysroot that are not on $PATH (such as something in $libexecdir) but any use of STAGING_DIR_NATIVE in the postinst that calls the intercept will be "baked" into the package, so if sstate is reused it will use paths that may not exist. Solve this by exporting the location of the native sysroot in the environment so the postinst and intercept can use an environment variable instead of a bitbake variable. (From OE-Core rev: 646599a1f3d39238ba8009993750a46ae220e762) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: add more info to the warning messageEd Bartosh2015-10-271-0/+1
| | | | | | | | | | | | | | | Since the log_check_regex can potentially be false positive it makes sense to print the whole line where error is found. This way user will be able to see the error and understand if it's valid or not. [YOCTO: #7789] (From OE-Core rev: f9cf31525fc885e1a0f65bd55654631257f87078) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Empty image:rootfs.py:handle empty PACKAGE_INSTALLAlex Franco2015-09-281-1/+5
| | | | | | | | | | | | | | rootfs.py: added a test in DpkgOpkgRootfs which skips the get package post installs step (get_pkgs_postinsts), when PACKAGE_INSTALL is empty. [YOCTO #7664] (From OE-Core rev: 2d5fb43ec647e8445fc8e8a5caba771c0361a539) Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs: Conditionally uninstall update-rc.dKhem Raj2015-09-111-1/+9
| | | | | | | | | | | | | update-rc.d is now needed by systemd to interact with sysv scripts, so if we have a mixed system, then we can not uninstall update-rc.d as it is going to break systemd functionality, we check for sysvinit and sytemd in distro and also ensure that its not building an image with readonly rootfs (From OE-Core rev: 5dd5b8adc225d5c703d85fc0187ae65ff6067b58) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "rootfs: Do not uninstall update-rc.d"Richard Purdie2015-09-111-1/+2
| | | | | | | | This reverts commit acf90b6c299afe9e9c8fa33c3c6992bfcf40fbbf. (Reverted to apply the better v2 of the patch) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: show intercept script output in log.do_rootfsMartin Jansa2015-09-091-1/+1
| | | | | | | | | | | * without this the output wasn't shown anywhere even when the bb.warn says: "See log for details!" (From OE-Core rev: a3c322b42c7a14584a80e04519c34689ec813210) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs: Do not uninstall update-rc.dKhem Raj2015-09-091-2/+1
| | | | | | | | | | | update-rc.d is now needed by systemd to interact with sysv scripts, so if we have a mixed system, then we can not uninstall update-rc.d as it is going to break systemd functionality (From OE-Core rev: acf90b6c299afe9e9c8fa33c3c6992bfcf40fbbf) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Allow to override postinst-intercepts locationMartin Jansa2015-09-091-2/+4
| | | | | | | | | * useful when we need to overlay/extend intercept scripts from oe-core (From OE-Core rev: 7d08d2d5c0ae686e3bb8732ea82f30fd189b1cd8) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Empty image: package list splitting and iterationAlex Franco2015-08-291-1/+1
| | | | | | | | | | | | A few short fixes to splitting/iteration done over package lists in license.bbclass, package_manager.py and rootfs.py. [YOCTO #7664] (From OE-Core rev: a902e98c5938f52ec960e0518e0ceaf8f5ee610c) Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: fix PRE/POSTPROCESS_COMMANDS for rpm and debRobert Yang2015-08-011-1/+15
| | | | | | | | | | | | | The rpm didn't run RPM_PREPROCESS_COMMANDS or RPM_POSTPROCESS_COMMANDS, the similar to deb, this patch fix the problem. And fix a typo: DEB_POSTPROCESS_COMMAND -> DEB_POSTPROCESS_COMMANDS (From OE-Core rev: aadfac366bd2cae37357e15bf4fc28c159d71b32) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Add check for kernel modules before running depmodSaul Wold2015-07-021-2/+16
| | | | | | | | | | | | | | Add a check for kernel modules so we don't un-necessarily run the depmods, this will also handle the case with linux-dummy does not place the kernel-abiversion since it also does not have kernel modules. [YOCTO #7884] (From OE-Core rev: 1b696a45ddb00fbe1d993b19339071486d0cfef2) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/rootfs.py: DpkgRootfs/OpkgRootfs add support for dependency handling in ↵Aníbal Limón2015-06-271-55/+101
| | | | | | | | | | | | | | | | | | | | | postinsts scripts. The old code don't take into account package dependencies causing undefined execution order in postinsts scripts, in order to fix: Add DpkgOpkgRootfs class for store common operations in DpkgRootfs and OpkgRootfs. Add _get_delayed_postinsts_common method that process Depends from status file in dpkg/opkg and resolve dependency order causing an execption if found circular dependencies. [YOCTO #5318] (From OE-Core rev: ed52d1040ee8be0bfa080d5679c583b1012bb575) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: tidy up log warning reportingPaul Eggleton2015-06-111-7/+6
| | | | | | | | | | | | | | | * bb.warn() should only be called once per warning - UIs such as Toaster assume that this is the case, so adjust the output accordingly. (It's tricky here because we have to include "log_check" on every line or we'll end up looping forever as the log checking code's own messages retrigger the log check, sigh...) * Iterating over a file already splits by line, there's no need to do it manually. (From OE-Core rev: 8dfdd329f0137cab8cab97e1d0c1181810fe5b32) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: Add a method for creating a companion debug filesystemMark Hatle2015-05-241-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 1a6ed48c65f922c66b005aa966d7ee4878ee95e3) 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>
* rootfs.py: Make set -x not break rootfs creationPeter Seebach2015-05-241-0/+3
| | | | | | | | | | | | | | | | The rootfs logfile check errors out if it finds an "exit 1" in a log. But consider the shell idiom: if ! $command; then exit 1; fi and consider a postinstall script with a "set -x" for debugging purposes (to get log output in /var/log/postinstall.log.) Solution: Ignore lines prefixed with a +, because those show shell code even if a specific fragment won't be executed. (From OE-Core rev: f23f129dba66144abf8fe8450320e01fa4c02f5c) Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Improve rpm log_check_regexEd Bartosh2015-05-221-1/+3
| | | | | | | | | | | | | | | | | Current regex can cause false negatives if paths in bitbake log files contain "ERR" or "Fail". do_rootfs fails with return code 1 in this case. Improved regexp is based on error messages produced by rpm. Those are found by analyzing rpm source code. [YOCTO #7789] (From OE-Core rev: 38871dc0295fb2516e1c8b1dc9948c2d2fc4d2cd) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Also uninstall update-alternatives and shadow for read-only-rootfsAndreas Oberritter2015-03-251-0/+2
| | | | | | | | | | This brings back commit d41097a970e9bfa553cd4bc3c9fad4b9073d7bd5, which got lost during transition from image.bbclass to rootfs.py. (From OE-Core rev: f4932e2e640764d16f1f6d398390ebfb376f4cf1) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: add log checking ability for deb and ipkChen Qi2015-03-221-17/+44
| | | | | | | | | | Extract the common codes of log checking and add the ability of log checking for deb and ipk package backend. (From OE-Core rev: d995871b433643958845e1d476813fa12888100e) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>