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 | |
parent | 5d0f675e96eed06067e6081a4e82a07fe9dc6011 (diff) | |
download | poky-23c36b0fbf8335223b8b163e492a5a03f621780a.tar.gz |
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')
-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 | |||
69 | fakechroot yum ${YUMARGS} -y install ${PACKAGE_INSTALL} | 69 | fakechroot yum ${YUMARGS} -y install ${PACKAGE_INSTALL} |
70 | fi | 70 | fi |
71 | 71 | ||
72 | # Symlinks created under fakeroot are wrong, now we have to fix them... | ||
73 | cd ${IMAGE_ROOTFS} | ||
74 | for f in `find . -type l -print` | ||
75 | do | ||
76 | link=`readlink $f | sed -e 's#${IMAGE_ROOTFS}##'` | ||
77 | rm $f | ||
78 | ln -s $link $f | ||
79 | done | ||
80 | |||
72 | export D=${IMAGE_ROOTFS} | 81 | export D=${IMAGE_ROOTFS} |
73 | export OFFLINE_ROOT=${IMAGE_ROOTFS} | 82 | export OFFLINE_ROOT=${IMAGE_ROOTFS} |
74 | export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} | 83 | export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} |
@@ -86,10 +95,29 @@ EOF | |||
86 | 95 | ||
87 | for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*.sh; do | 96 | for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*.sh; do |
88 | if [ -f $i ] && sh $i; then | 97 | if [ -f $i ] && sh $i; then |
89 | rm $i | 98 | # rm $i |
99 | mv $i $i.done | ||
90 | fi | 100 | fi |
91 | done | 101 | done |
92 | 102 | ||
103 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d | ||
104 | # Stop $i getting expanded below... | ||
105 | i=\$i | ||
106 | cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure << EOF | ||
107 | #!/bin/sh | ||
108 | for i in /etc/rpm-postinsts/*.sh; do | ||
109 | echo "Running postinst $i..." | ||
110 | if [ -f $i ] && sh $i; then | ||
111 | # rm $i | ||
112 | mv $i $i.done | ||
113 | else | ||
114 | echo "ERROR: postinst $i failed." | ||
115 | fi | ||
116 | done | ||
117 | rm -f ${sysconfdir}/rcS.d/S98configure | ||
118 | EOF | ||
119 | chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure | ||
120 | |||
93 | install -d ${IMAGE_ROOTFS}/${sysconfdir} | 121 | install -d ${IMAGE_ROOTFS}/${sysconfdir} |
94 | echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version | 122 | echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version |
95 | 123 | ||