From e65d97d62fc5f42f4dccc7aa2e3900a70a4a599e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 27 Nov 2006 22:57:27 +0000 Subject: rootfs_deb.bbclass: Mark packages as installed/unpacked correctly. Add in hacks to work around /var being tmpfs and to enable ipkg to handle the postinsts on device (for now) git-svn-id: https://svn.o-hand.com/repos/poky/trunk@966 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/classes/rootfs_deb.bbclass | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass index 19e8b4420..87a2bd642 100644 --- a/meta/classes/rootfs_deb.bbclass +++ b/meta/classes/rootfs_deb.bbclass @@ -29,7 +29,9 @@ fakeroot rootfs_deb_do_rootfs () { priority=$(expr $priority + 5) done - cat "${STAGING_DIR}/etc/apt/apt.conf.sample" | sed -e 's#Architecture ".*";#Architecture "${TARGET_ARCH}";#' > "${STAGING_DIR}/etc/apt/apt-rootfs.conf" + cat "${STAGING_DIR}/etc/apt/apt.conf.sample" \ + | sed -e 's#Architecture ".*";#Architecture "${TARGET_ARCH}";#' \ + > "${STAGING_DIR}/etc/apt/apt-rootfs.conf" export APT_CONFIG="${STAGING_DIR}/etc/apt/apt-rootfs.conf" export D=${IMAGE_ROOTFS} @@ -73,12 +75,19 @@ fakeroot rootfs_deb_do_rootfs () { install -d ${IMAGE_ROOTFS}/${sysconfdir} echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version + # Mark all packages installed + sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" ${IMAGE_ROOTFS}/var/dpkg/status + + # Attempt to run preinsts + # Mark packages with preinst failures as unpacked for i in ${IMAGE_ROOTFS}/var/dpkg/info/*.preinst; do if [ -f $i ] && ! sh $i; then _flag unpacked `basename $i .preinst` fi done + # Attempt to run postinsts + # Mark packages with postinst failures as unpacked for i in ${IMAGE_ROOTFS}/var/dpkg/info/*.postinst; do if [ -f $i ] && ! sh $i configure; then _flag unpacked `basename $i .postinst` @@ -87,6 +96,13 @@ fakeroot rootfs_deb_do_rootfs () { set -e + # Hacks to make dpkg/ipkg coexist for now + mv ${IMAGE_ROOTFS}/var/dpkg ${IMAGE_ROOTFS}/usr/ + rmdir ${IMAGE_ROOTFS}/usr/dpkg/alternatives + ln -s /usr/lib/ipkg/alternatives ${IMAGE_ROOTFS}/usr/dpkg/alternatives + ln -s /usr/dpkg/info ${IMAGE_ROOTFS}/usr/lib/ipkg/info + ln -s /usr/dpkg/status ${IMAGE_ROOTFS}/usr/lib/ipkg/status + ${ROOTFS_POSTPROCESS_COMMAND} log_check rootfs -- cgit v1.2.3