summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/rootfs.py
Commit message (Collapse)AuthorAgeFilesLines
* rootfs.py: change the logic in _uninstall_unneededChen Qi2014-06-171-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if we have 'package-management' and 'read-only-rootfs' both in IMAGE_FEATRUES, we would meet the following error at system start-up. rm: can't remove '/etc/rcS.d/S99run-postinsts': Read-only file system However, what's really expected is that when there's no postinstall script at system start-up, the /etc/rcS.d/S99run-postinsts should not even be there. Whether or not to remove the init script symlinks to run-postinsts should not depend on whether we have 'package-management' in IMAGE_FEATURES; rather, it should only depend on whether we have any postinstall script left to run at system start-up. This patch changes the _uninstall_unneeded function based on the logic stated above. [YOCTO #6257] (From OE-Core rev: d51b1ced88958d31a1596e37db871257fe013446) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: introduce USE_DEVFS checkMatthieu Crapet2014-04-041-1/+2
| | | | | | | | | | | | Since commit a83144bac8d67704ff66f5dc0fc56f5b63979694 (2014-02-11), USE_DEVFS is not considered anymore. For compatibility, let's restore USE_DEVFS semantic. Also add USE_DEVFS to documentation.conf. (From OE-Core rev: d12a5e38a02abe3feb3db8ae5ffd9a5005124294) Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: add new cleanup methodLaurentiu Palcu2014-03-301-0/+25
| | | | | | | | | | | | | | This commit adds a new _cleanup() internal method that will be called at the end of rootfs creation, so that each backend can delete various files that were probably generated during rootfs postprocess execution, etc. [YOCTO #6049] (From OE-Core rev: 6151d69875f3f4f097b6e2fdef2a0f3ab391e2fd) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py, sdk.py: adjust/create the wrappers for creating installed ↵Laurentiu Palcu2014-03-211-15/+4
| | | | | | | | | | | | | | | | packages list Since we created a new PkgsList object that will deal with listing the installed packages in a rootfs, use the new class both for images and SDKs in the wrapper functions. The old list_installed_packages() wrapper listed only the packages inside an image rootfs. It didn't deal with target/host SDK rootfs's. (From OE-Core rev: 8fc18e67504db5b6df3fdd239c6187a71af52656) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* do_rootfs: Added PACKAGE_FEED_URIS functionalityDavid Nyström2014-03-071-12/+4
| | | | | | | | | | | | | | | | | | | | | Adding a common interface to add predefined package manager channels to prebuilt rootfs:es. Adding PACKAGE_FEED_URIS = "http://myre.po/repo/, will assume repo directories named (rpm,ipk,deb) as subdirectories and statically add them to the rootfs, using the same PKG_ARCHs as the build which produced the images. Tested with RPM, IPK and DEB. deb feed functionality seem broken, is anyone using this ? (From OE-Core rev: 9b8811045546ad67b4695d980f09636d5506e50c) Signed-off-by: David Nyström <david.c.nystrom@gmail.com> Signed-off-by: David Nyström <david.nystrom@enea.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.py, rootfs.py, package_manager.py: redirect stderr to stdout when ↵Laurentiu Palcu2014-03-071-1/+1
| | | | | | | | | | | | | | | | | | | calling check_output() If a command executed with subprocess.check_output() fails, the subprocess.CalledProcessError.output contains only STDOUT and the user needs to check the log.do_rootfs to see any other details. This commit forwards stderr to stdout so that, in case of failure, the entire error output will be displayed in terminal. [YOCTO #5902] (From OE-Core rev: 4661f1441429952f30e19cebd93dc42ce31fd868) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs: Fix LDCONFIGDEPEND checkRichard Purdie2014-02-251-1/+1
| | | | | | | | | We shouldn't be running this if it expands to None or "" or False so update the code accordingly. (From OE-Core rev: 255079780729f0dd9df6f35302169e0c8480eced) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: tweak _multilib_sanity_test for ipk incremental image generationHongxu Jia2014-02-211-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | The _multilib_sanity_test installs multilib packages in a temporary root fs, and compare with the current image to figure out duplicated files that come from different packages. While incremental image generation enabled and the previous image was existed, there was an Multilib check error: ... ERROR: Multilib check error: duplicate files tmp/work/qemux86_64-poky- linux/core-image-minimal/1.0-r0/multilib/lib32/lib/libc.so.6 tmp/work/ qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/lib/libc.so.6 is not the same ... The reason is the file in the existing image has been prelinked by previous image generation and the file in a temporary root fs is not prelinked, even though both of them came from the same package, the Multilib check failed. [YOCTO #1894] (From OE-Core rev: 8d813f614cdfda31c85bbaf133f2822f90a4a78a) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: support BAD_RECOMMENDATIONS for ipk incremental image generationHongxu Jia2014-02-211-1/+28
| | | | | | | | | | | | | | While incremental image generation enabled and the previous image is existed, if BAD_RECOMMENDATIONS is changed, the operation on the existing image is complicated, so remove the old image in this situation. The same with PACKAGE_EXCLUDE and NO_RECOMMENDATIONS. [YOCTO #1894] (From OE-Core rev: 0566de3fa424af3bdfadcd0a08ce4c214abda083) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: support ipk incremental image generationHongxu Jia2014-02-211-3/+47
| | | | | | | | | | | | The incremental image generation is based on the previous existing image, adds new packages, upgrades existing packages, and removes unused packages. [YOCTO #1894] (From OE-Core rev: adf587e55c0f9bc74f0bef415273c937401baebb) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: Check for LDCONFIGDEPEND being empty stringKhem Raj2014-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We override LDCONFIGDEPEND to be empty string for uclibc however the current check is for it being None as a result the function is still executed but ldconfig-native is not built as dependency for rootfs when building with uclibc Fixes errors like below File: '/home/kraj/work/angstrom-repo/sources/openembedded-core/meta/lib/oe/rootfs.py', lineno: 191, function: _run_ldconfig 0187: def _run_ldconfig(self): 0188: if self.d.getVar('LDCONFIGDEPEND', True) is not None: 0189: bb.note("Executing: ldconfig -r" + self.image_rootfs + "-c new -v") 0190: self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c', *** 0191: 'new', '-v']) (From OE-Core rev: 315a71e00928fea6715087b1ce66f8a8a91d5fe0) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py, rootfs.py, sdk.py: add Indexer classLaurentiu Palcu2014-02-141-58/+0
| | | | | | | | | | | | | | | | | | | Because the package-index.bb needs to create package indexes outside do_rootfs environment, move the indexing capability out of PackageManager class to a smaller Indexer class. This commit: * simply moves the indexing functions for ipk/deb with no changes; * rewrites the RPM indexing function so that it can be easily moved out of the PackageManager class; * removes some RPM duplicate code, moves it into a method inside RpmPM class and changes the RpmPM constructor so that the new method is effective; (From OE-Core rev: d339d6f48f81330e94162f333aad76f3c65d6bfd) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: fix RPM multilib issueLaurentiu Palcu2014-02-131-4/+11
| | | | | | | | | | | | | | | | For some odd reason (at least I couldn't find an explanation to this, yet), if a multilib version of a package is installed after the main one (that is: in a different smart session), the main package binaries are not overwritten. This commit restores the functionality to the original one, before migrating to python: feed all the packages to smart, apart from attempt only ones which are installed separately. (From OE-Core rev: 1fa94697163f16cdbb1499b57f1bc018546974ee) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* (image|rootfs_ipk).bbclass, rootfs.py: ipk multilib fixesLaurentiu Palcu2014-02-131-1/+3
| | | | | | | | | | | This commit whitelists some common directories, so the multilib sanity checks pass and also fixes an issue in lib/oe/rootfs.py when the compared files do not exist. (From OE-Core rev: 4615ac771175cd413f461c081f7d3191c49ccc4b) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.py, package_manager.py, rootfs.py: dump command output on errorLaurentiu Palcu2014-02-111-1/+1
| | | | | | | | | Print the entire command output in case of errors. (From OE-Core rev: 2253c9ac2caa61dee0bd4fea04d4d77b79be7b36) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py, package_manager.py, sdk.py: Fix building from feeds feature for opkgLaurentiu Palcu2014-02-111-2/+3
| | | | | | | | | | | | | | | When using opkg as the PM backend, one has the option to provide custom feeds to create the rootfs from. This commit: * fixes this in the refactored code; * moves the custom config creation code to python; * clean up the package-ipk.bbclass; (From OE-Core rev: 19c538f57c8fa7c566e88a6dbe13ea4826d4f26c) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: OpkgRootfs, fix issue in _get_delayed_postinsts()Laurentiu Palcu2014-02-111-1/+1
| | | | | | | | | Status file path was not created correctly. (From OE-Core rev: 628c4bce36ca0bc2b316ec78cf58b02a42e7f35f) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: warn the user if intercept hooks failLaurentiu Palcu2014-02-111-2/+2
| | | | | | | | | | | | | | | The idea of postinstall intercept hooks is to run CPU intensive postinstalls (like the ones generating font/pixbuf/icon caches) on host, at rootfs generation time. So, ideally, the user would like to know if the intercepts fail on host. With this patch, the user will see warnings on console if intercept hooks fail to execute. (From OE-Core rev: 5666ce9720132a76b5ff6e99712e240b8dc8e47a) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manger.py/rootfs.py: rename save_rpmpostinist with save_rpmpostinstHongxu Jia2014-02-111-1/+1
| | | | | | | | | | The tweak made the code looks better. (From OE-Core rev: 61981755b4738ccc49be0e790de828f4166ef0e8) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: fix invoking _run_intercepts failedHongxu Jia2014-02-111-0/+1
| | | | | | | | | | - The variable D is needed by intercepts scripts; (From OE-Core rev: 3d37dcdb836b59d8a7f880ce22d06760eb8af232) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: fix invoking rpm _handle_intercept_failure failedHongxu Jia2014-02-111-1/+1
| | | | | | | | (From OE-Core rev: 7858c8ac141a7bf66c65ddc7e4b39ad937a7e084) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: strip kernel-abiversion useless readlineHongxu Jia2014-02-111-1/+1
| | | | | | | | | | | | | | | It failed to read Kernel version from kernel-abiversion file, the reason was it didn't strip the readline. ... Error: Kernel version 3.10.25-yocto-standard does not match kernel-abiversion (3.10.25-yocto-standard) ... (From OE-Core rev: 17a0a8f44fe344ab1ae49730d9f17705b43987e5) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: fix uninstall uneeded pkgs failedHongxu Jia2014-02-111-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The refactor of shell function rootfs_uninstall_unneeded is incorrect, it should check and update the installed_pkgs.txt file for the existance of the packages that were removed. ... rootfs_uninstall_unneeded () { if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then if [ -z "$(delayed_postinsts)" ]; then # All packages were successfully configured. # update-rc.d, base-passwd, run-postinsts are no further # use, remove them now remove_run_postinsts=false if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then remove_run_postinsts=true fi # Remove package only if it's installed pkgs_to_remove="update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" for pkg in $pkgs_to_remove; do # regexp for pkg, to be used in grep and sed pkg_regexp="^`echo $pkg | sed 's/\./\\\./'` " if grep -q "$pkg_regexp" ${WORKDIR}/installed_pkgs.txt; then rootfs_uninstall_packages $pkg sed -i "/$pkg_regexp/d" ${WORKDIR}/installed_pkgs.txt fi done ... (From OE-Core rev: 9cdecb3935962653733705ad6313558bfd4fda29) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: Tweak the rootfs removing operationHongxu Jia2014-02-111-3/+4
| | | | | | | | | | | | Move the bb.utils.remove(self.image_rootfs, True) from the base class constructor, to Opkg/Ipkg constructors after super's constructor is called. (From OE-Core rev: 66d86c4bbb9423c9fe0fc89005530be54068d401) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: support RpmRootfsHongxu Jia2014-02-111-6/+205
| | | | | | | | | | | - Implementation RpmRootfs class - Refactor list_installed_packages in python (From OE-Core rev: b3eeb0edf3f0296d30d7e62628bde722402bdb9d) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: use Manifest.INSTALL_ORDERLaurentiu Palcu2014-02-111-5/+1
| | | | | | | | | | Since the Manifest class has this property, use it. This contains the default package installation order. (From OE-Core rev: bb1fb4ceb544c161ed30cd102155657e3771859b) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass, lib/oe/rootfs.py: remove intercept_scripts directoryLaurentiu Palcu2014-02-111-0/+2
| | | | | | | | | Remove the directory, manually, in the Rootfs.create() function. (From OE-Core rev: 37a9dc05272e7e49c8a475ccb3d10880dcee4763) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: add support for opkg backendLaurentiu Palcu2014-02-111-9/+149
| | | | | | | (From OE-Core rev: 0650e1f2354cdb6f925040d9d07e2c785274a592) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/rootfs.py: add new library for rootfs creationLaurentiu Palcu2014-02-111-0/+328
This library will be used to generate the rootfs. Recommended usage: create_rootfs(d, manifest_file) this will determine the PM backend used, save the shell environment and will call the appropriate backend implementation (DpkgRootfs(d, manifest_file).create()). NOTE: this commit adds Dpkg support. (From OE-Core rev: 5ad8c21bc7f2213d1287cecf07d00a61d1456ff7) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>