summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/rootfs.py
Commit message (Collapse)AuthorAgeFilesLines
* kernel, license, sstate, rootfs.py: Remove deploy directory READMEMike Crowe2017-08-291-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) (From OE-Core rev: 20c39fdbb25c1b1867709c5bfb3ae2baef249be9) 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>
* rootfs.py: Respect OPKGLIBDIR variableMartin Jansa2017-05-181-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: 0554537271f56d95cb43e09bb831f57f82e8f3ac) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: fix log_check warnings being printed twice with RPM packagingPaul Eggleton2017-01-111-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) (From OE-Core rev: 9654a6a238a44ed1025a45e4ad1cb779a8684344) 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> Signed-off-by: Armin Kuster <akuster808@gmail.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>
* rootfs.py: two changes regarding log checkingChen Qi2015-03-221-3/+2
| | | | | | | | | | | | | | | | | | | This patch involves two changes. 1. Extend the regular expression to also catch '^WARNING:' in _log_check_warn. Warnings from bb.note or bbnote begin with 'WARNING:'. So if we decide to catch warnings at rootfs time, we should not ignore those produced by the build system itself. 2. Delay _log_check in rootfs process so that more warnings are likely to be catched. Note that we should at least delay the _log_check after the execution of ROOTFS_POSTPROCESS_COMMANDS, because we want to catch warnings there. (From OE-Core rev: 4c9213dffb71510ba99a0665f620e9de4a2dfeb5) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: Create variable for install_dir_nameSaul Wold2015-03-201-1/+4
| | | | | | | | | | | | | | | | This patch creates a variable for the install_dir name so it can be something other than /install, also by doing this we can correctly clean up the empty directories (/install/tmp) during the clean-up phase. The new default is /oe_install so as to not conflict with other possible packages that might use /install to place files. [YOCTO #7353] (From OE-Core rev: 335effec42099666d0fb433b31981edcb0dae9a0) 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>
* rootfs.py: fix logic error so that warnings are checkedChen Qi2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | The following commit caused log checking for warnings not working for RPM rootfs. rootfs.py: ignore "NOTE:" when catching warnings The problem is that checking for warnings is always skipped because the following statement is always true. if 'log_check' or 'NOTE:' in line: This patch fixes the above problem so that warning checking in RPM rootfs can work again. (From OE-Core rev: 3e9e2ce380a73b50cbfc1995e361cfe879de6a8a) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: ignore "NOTE:" when catching warningsRicardo Neri2015-02-141-1/+1
| | | | | | | | | | | | | The script looks for any warn|Warn pattern in the log. However, it may happen that the warn|Warn pattern appears as part of the name of the objects described in the NOTE lines of the log. Thus, to avoid false positives, ignore the line if it contains the word "NOTE:" (From OE-Core rev: 0387d0957909a9977efd8b2008e4d1c6d81ceb2a) Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass: make kernel depmod data optionalDan McGregor2015-02-031-1/+2
| | | | | | | | | | | | | 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. (From OE-Core rev: ca641aedff5f6bd155796ead02cb2eb871f8c17a) Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/image: ensure uninstalled packages do not appear in manifestsPaul Eggleton2015-02-031-25/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]. (From OE-Core rev: b198a189228648057c3be7d068598f50841b3bf9) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: rename _uninstall_uneeded to fix spelling errorPaul Eggleton2015-02-031-2/+2
| | | | | | | | | Rename it to _uninstall_unneeded. (From OE-Core rev: cb217f442b8143d88112bebe4011051efbd905a3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>