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_deb.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_deb.bbclass')
-rw-r--r-- | meta/classes/rootfs_deb.bbclass | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass index e642cf3852..edd1037f87 100644 --- a/meta/classes/rootfs_deb.bbclass +++ b/meta/classes/rootfs_deb.bbclass | |||
@@ -85,7 +85,7 @@ fakeroot rootfs_deb_do_rootfs () { | |||
85 | ${ROOTFS_POSTPROCESS_COMMAND} | 85 | ${ROOTFS_POSTPROCESS_COMMAND} |
86 | 86 | ||
87 | if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then | 87 | if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then |
88 | if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}/var/lib/dpkg/status; then | 88 | if [ -n "$(delayed_postinsts)" ]; then |
89 | bberror "Some packages could not be configured offline and rootfs is read-only." | 89 | bberror "Some packages could not be configured offline and rootfs is read-only." |
90 | exit 1 | 90 | exit 1 |
91 | fi | 91 | fi |
@@ -94,9 +94,22 @@ fakeroot rootfs_deb_do_rootfs () { | |||
94 | log_check rootfs | 94 | log_check rootfs |
95 | } | 95 | } |
96 | 96 | ||
97 | rootfs_deb_do_rootfs[vardeps] += "delayed_postinsts" | ||
98 | |||
99 | delayed_postinsts () { | ||
100 | cat ${IMAGE_ROOTFS}/var/lib/dpkg/status|grep -e "^Package:" -e "^Status:"|sed -ne 'N;s/Package: \(.*\)\nStatus:.*unpacked/\1/p' | ||
101 | } | ||
102 | |||
103 | save_postinsts () { | ||
104 | for p in $(delayed_postinsts); do | ||
105 | install -d ${IMAGE_ROOTFS}${sysconfdir}/deb-postinsts | ||
106 | cp ${IMAGE_ROOTFS}/var/lib/dpkg/info/$p.postinst ${IMAGE_ROOTFS}${sysconfdir}/deb-postinsts/$p | ||
107 | done | ||
108 | } | ||
109 | |||
97 | remove_packaging_data_files() { | 110 | remove_packaging_data_files() { |
98 | rm -rf ${IMAGE_ROOTFS}${opkglibdir} | 111 | rm -rf ${IMAGE_ROOTFS}${opkglibdir} |
99 | rm -rf ${IMAGE_ROOTFS}/usr/dpkg/ | 112 | rm -rf ${IMAGE_ROOTFS}/var/lib/dpkg/ |
100 | } | 113 | } |
101 | 114 | ||
102 | rootfs_install_packages() { | 115 | rootfs_install_packages() { |
@@ -105,3 +118,9 @@ rootfs_install_packages() { | |||
105 | # Mark all packages installed | 118 | # Mark all packages installed |
106 | sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" $INSTALL_ROOTFS_DEB/var/lib/dpkg/status | 119 | sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" $INSTALL_ROOTFS_DEB/var/lib/dpkg/status |
107 | } | 120 | } |
121 | |||
122 | rootfs_remove_packages() { | ||
123 | # for some reason, --root doesn't really work here... We use --admindir&--instdir instead. | ||
124 | ${STAGING_BINDIR_NATIVE}/dpkg --admindir=${IMAGE_ROOTFS}/var/lib/dpkg --instdir=${IMAGE_ROOTFS} -r --force-depends $@ | ||
125 | } | ||
126 | |||