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_rpm.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_rpm.bbclass')
-rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index d373dab408..4194c5621c 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass | |||
@@ -114,8 +114,8 @@ fakeroot rootfs_rpm_do_rootfs () { | |||
114 | ${ROOTFS_POSTPROCESS_COMMAND} | 114 | ${ROOTFS_POSTPROCESS_COMMAND} |
115 | 115 | ||
116 | if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then | 116 | if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then |
117 | if [ -d ${IMAGE_ROOTFS}/etc/rpm-postinsts ] ; then | 117 | if [ -d ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts ] ; then |
118 | if [ "`ls -A ${IMAGE_ROOTFS}/etc/rpm-postinsts`" != "" ] ; then | 118 | if [ "`ls -A ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts`" != "" ] ; then |
119 | bberror "Some packages could not be configured offline and rootfs is read-only." | 119 | bberror "Some packages could not be configured offline and rootfs is read-only." |
120 | exit 1 | 120 | exit 1 |
121 | fi | 121 | fi |
@@ -135,6 +135,20 @@ fakeroot rootfs_rpm_do_rootfs () { | |||
135 | log_check rootfs | 135 | log_check rootfs |
136 | } | 136 | } |
137 | 137 | ||
138 | rootfs_rpm_do_rootfs[vardeps] += "delayed_postinsts" | ||
139 | |||
140 | delayed_postinsts() { | ||
141 | if [ -d ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts ]; then | ||
142 | ls ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts | ||
143 | fi | ||
144 | } | ||
145 | |||
146 | save_postinsts() { | ||
147 | # this is just a stub. For RPM, the failed postinstalls are already saved in | ||
148 | # /etc/rpm-postinsts | ||
149 | true | ||
150 | } | ||
151 | |||
138 | remove_packaging_data_files() { | 152 | remove_packaging_data_files() { |
139 | # Save the rpmlib for increment rpm image generation | 153 | # Save the rpmlib for increment rpm image generation |
140 | t="${T}/saved_rpmlib/var/lib" | 154 | t="${T}/saved_rpmlib/var/lib" |
@@ -165,6 +179,15 @@ rootfs_install_packages() { | |||
165 | package_install_internal_rpm | 179 | package_install_internal_rpm |
166 | } | 180 | } |
167 | 181 | ||
182 | rootfs_remove_packages() { | ||
183 | rpm -e --nodeps --root=${IMAGE_ROOTFS} --dbpath=/var/lib/rpm\ | ||
184 | --define='_cross_scriptlet_wrapper ${WORKDIR}/scriptlet_wrapper'\ | ||
185 | --define='_tmppath /install/tmp' $@ | ||
186 | |||
187 | # remove temp directory | ||
188 | rm -rf ${IMAGE_ROOTFS}/install | ||
189 | } | ||
190 | |||
168 | python () { | 191 | python () { |
169 | if d.getVar('BUILD_IMAGES_FROM_FEEDS', True): | 192 | if d.getVar('BUILD_IMAGES_FROM_FEEDS', True): |
170 | flags = d.getVarFlag('do_rootfs', 'recrdeptask') | 193 | flags = d.getVarFlag('do_rootfs', 'recrdeptask') |