diff options
author | Richard Purdie <richard@openedhand.com> | 2008-09-04 21:52:34 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-09-04 21:52:34 +0000 |
commit | 23c36b0fbf8335223b8b163e492a5a03f621780a (patch) | |
tree | 537a5fd4cfb74d28fd3aebcc4258d5dcc3dbbb58 /meta/classes/rootfs_rpm.bbclass | |
parent | 5d0f675e96eed06067e6081a4e82a07fe9dc6011 (diff) | |
download | openembedded-core-23c36b0fbf8335223b8b163e492a5a03f621780a.tar.gz openembedded-core-23c36b0fbf8335223b8b163e492a5a03f621780a.tar.bz2 openembedded-core-23c36b0fbf8335223b8b163e492a5a03f621780a.zip |
rootfs_rpm.bbclass: Fixup broken symlinks due to fakechroot and run any leftover postinstalls on real hardware at first boot
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5143 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index 6339a21476..4059a43af8 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass @@ -69,6 +69,15 @@ EOF fakechroot yum ${YUMARGS} -y install ${PACKAGE_INSTALL} fi + # Symlinks created under fakeroot are wrong, now we have to fix them... + cd ${IMAGE_ROOTFS} + for f in `find . -type l -print` + do + link=`readlink $f | sed -e 's#${IMAGE_ROOTFS}##'` + rm $f + ln -s $link $f + done + export D=${IMAGE_ROOTFS} export OFFLINE_ROOT=${IMAGE_ROOTFS} export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} @@ -86,10 +95,29 @@ EOF for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*.sh; do if [ -f $i ] && sh $i; then - rm $i + # rm $i + mv $i $i.done fi done + install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d + # Stop $i getting expanded below... + i=\$i + cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure << EOF +#!/bin/sh +for i in /etc/rpm-postinsts/*.sh; do + echo "Running postinst $i..." + if [ -f $i ] && sh $i; then + # rm $i + mv $i $i.done + else + echo "ERROR: postinst $i failed." + fi +done +rm -f ${sysconfdir}/rcS.d/S98configure +EOF + chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure + install -d ${IMAGE_ROOTFS}/${sysconfdir} echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version |