diff options
| author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2013-05-21 14:17:19 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-11 15:38:04 +0100 |
| commit | b11f8183074857be5a5920f093b4298884eec805 (patch) | |
| tree | 5ebfb0091cfeeda7993b92f322978eaba5c8a01a /meta/classes/rootfs_ipk.bbclass | |
| parent | fdb5c12240ff5e8e279a088dee632a308d233838 (diff) | |
| download | poky-b11f8183074857be5a5920f093b4298884eec805.tar.gz | |
rootfs_*.bbclass: add some helper functions
This patch adds the following helper functions:
* delayed_postinsts - outputs the list of delayed postinstalls;
* save_postinsts - this will save the delayed postinstalls for ipk/deb
in /etc/(ipk|deb)_postinsts;
* rootfs_remove_packages - removes packages from an image;
Additionaly, this patch will remove a piece of code in
rootfs_ipk_do_rootfs which will be moved to image.bbclass and used for
all backends;
[YOCTO #4484]
(From OE-Core rev: 928df79cd3964f775c4c6e4283ef84b8882f9328)
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>
Diffstat (limited to 'meta/classes/rootfs_ipk.bbclass')
| -rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index 3e1f9590fc..1403422ca7 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass | |||
| @@ -91,36 +91,29 @@ fakeroot rootfs_ipk_do_rootfs () { | |||
| 91 | ${ROOTFS_POSTPROCESS_COMMAND} | 91 | ${ROOTFS_POSTPROCESS_COMMAND} |
| 92 | 92 | ||
| 93 | if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then | 93 | if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then |
| 94 | if grep Status:.install.ok.unpacked ${STATUS}; then | 94 | if [ -n "$(delayed_postinsts)" ]; then |
| 95 | bberror "Some packages could not be configured offline and rootfs is read-only." | 95 | bberror "Some packages could not be configured offline and rootfs is read-only." |
| 96 | exit 1 | 96 | exit 1 |
| 97 | fi | 97 | fi |
| 98 | fi | 98 | fi |
| 99 | 99 | ||
| 100 | rm -f ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/lists/* | 100 | rm -f ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/lists/* |
| 101 | if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then | ||
| 102 | if ! grep Status:.install.ok.unpacked ${STATUS}; then | ||
| 103 | # All packages were successfully configured. | ||
| 104 | # update-rc.d, base-passwd, run-postinsts are no further use, remove them now | ||
| 105 | remove_run_postinsts=false | ||
| 106 | if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then | ||
| 107 | remove_run_postinsts=true | ||
| 108 | fi | ||
| 109 | opkg-cl ${OPKG_ARGS} --force-depends remove update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} || true | ||
| 110 | |||
| 111 | # Need to remove rc.d files for run-postinsts by hand since opkg won't | ||
| 112 | # call postrm scripts in offline root mode. | ||
| 113 | if $remove_run_postinsts; then | ||
| 114 | update-rc.d -f -r ${IMAGE_ROOTFS} run-postinsts remove | ||
| 115 | fi | ||
| 116 | |||
| 117 | # Also delete the status files | ||
| 118 | remove_packaging_data_files | ||
| 119 | fi | ||
| 120 | fi | ||
| 121 | log_check rootfs | 101 | log_check rootfs |
| 122 | } | 102 | } |
| 123 | 103 | ||
| 104 | rootfs_ipk_do_rootfs[vardeps] += "delayed_postinsts" | ||
| 105 | |||
| 106 | delayed_postinsts () { | ||
| 107 | cat ${STATUS}|grep -e "^Package:" -e "^Status:"|sed -ne 'N;s/Package: \(.*\)\nStatus:.*unpacked/\1/p' | ||
| 108 | } | ||
| 109 | |||
| 110 | save_postinsts () { | ||
| 111 | for p in $(delayed_postinsts); do | ||
| 112 | install -d ${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts | ||
| 113 | cp ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/info/$p.postinst ${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts/$p | ||
| 114 | done | ||
| 115 | } | ||
| 116 | |||
| 124 | rootfs_ipk_write_manifest() { | 117 | rootfs_ipk_write_manifest() { |
| 125 | manifest=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest | 118 | manifest=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest |
| 126 | cp ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/status $manifest | 119 | cp ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/status $manifest |
| @@ -145,6 +138,10 @@ rootfs_install_packages() { | |||
| 145 | opkg-cl ${OPKG_ARGS} install `cat $1` | 138 | opkg-cl ${OPKG_ARGS} install `cat $1` |
| 146 | } | 139 | } |
| 147 | 140 | ||
| 141 | rootfs_remove_packages() { | ||
| 142 | opkg-cl ${OPKG_ARGS} --force-depends remove $@ | ||
| 143 | } | ||
| 144 | |||
| 148 | ipk_insert_feed_uris () { | 145 | ipk_insert_feed_uris () { |
| 149 | 146 | ||
| 150 | echo "Building from feeds activated!" | 147 | echo "Building from feeds activated!" |
