1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 12:29:55 +00:00

opkg: Update svn 625 -> 633 and fix preinst issues

There is a major issue with opkg images at the moment as preinst
functions are not being executed before their dependencies are installed
and this is leading to corruption of images containing avahi/dbus in
particular.

There are various changes in upstream opkg in the last 8 revisions which
make changes in this area but sadly these aren't enough to get things
working for us. I've updated to the latest svn revision with this patch
since it makes sense to pull in those changes first and then supplement
them with the attached patches.

There is a full description of the patches in the patch headers but in
summary they:

a) Ensure preinst functions execute with their dependencies installed.
   This is a pretty invasive change as it changes the package install
   ordering in general.
b) Ensure opkg sets $D, not $PKG_ROOT which we don't use
c) Change opkg to allow execution of postinstall functions which fail
   resulting in execution on the target device as rootfs_ipk.bbclass
   currently does manually.

The remaining changes interface this with the rest of the OE build
infrastructure, adding in the option to tell opkg to run the preinst and
postinst functions, ensure the correct environment is present for the
postinst scripts and removing the now unneeded rootfs_ipk class code
which opkg now does itself.

[YOCTO #1711]

(From OE-Core rev: 2feba313c991170747381c7cf821a45c2cd04632)

(From OE-Core rev: b7e2eff8c18bc59605fb711ac4540985c71f155a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2011-12-15 21:08:49 +00:00
parent 5db4eaac2d
commit c1c6613ddd
6 changed files with 260 additions and 26 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ package_install_internal_ipk() {
mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/
local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite"
local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite --force_postinstall"
opkg-cl ${ipkg_args} update
+3 -23
View File
@@ -60,14 +60,14 @@ fakeroot rootfs_ipk_do_rootfs () {
export INSTALL_CONF_IPK="${IPKGCONF_TARGET}"
export INSTALL_PACKAGES_IPK="${PACKAGE_INSTALL}"
package_install_internal_ipk
#post install
export D=${IMAGE_ROOTFS}
export OFFLINE_ROOT=${IMAGE_ROOTFS}
export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT}
package_install_internal_ipk
# Distro specific packages should create this
#mkdir -p ${IMAGE_ROOTFS}/etc/opkg/
#grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/opkg/arch.conf
@@ -75,28 +75,8 @@ fakeroot rootfs_ipk_do_rootfs () {
${OPKG_POSTPROCESS_COMMANDS}
${ROOTFS_POSTINSTALL_COMMAND}
runtime_script_required=0
# Base-passwd needs to run first to install /etc/passwd and friends
if [ -e ${IMAGE_ROOTFS}${opkglibdir}/info/base-passwd.preinst ] ; then
sh ${IMAGE_ROOTFS}${opkglibdir}/info/base-passwd.preinst
fi
for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.preinst; do
if [ -f $i ] && ! sh $i; then
runtime_script_required=1
opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst`
fi
done
for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.postinst; do
if [ -f $i ] && ! sh $i configure; then
runtime_script_required=1
opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst`
fi
done
if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
if [ $runtime_script_required -eq 1 ]; then
if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}${opkglibdir}status; then
echo "Some packages could not be configured offline and rootfs is read-only."
exit 1
fi