summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_deb.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/rootfs_deb.bbclass')
-rw-r--r--meta/classes/rootfs_deb.bbclass23
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
97rootfs_deb_do_rootfs[vardeps] += "delayed_postinsts"
98
99delayed_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
103save_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
97remove_packaging_data_files() { 110remove_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
102rootfs_install_packages() { 115rootfs_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
122rootfs_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