summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Tian <kevin.tian@intel.com>2010-08-26 12:39:07 +0800
committerJoshua Lock <josh@linux.intel.com>2010-08-26 08:54:55 +0100
commit8ea7fa6d4c7734da6034d44f8b6d78d2993f1949 (patch)
treed0be459748627b653337548837be820c529a8117
parentd46c362a46f26b38d8da30f6a83e7c0fdadda348 (diff)
downloadpoky-8ea7fa6d4c7734da6034d44f8b6d78d2993f1949.tar.gz
opkg: finalize the change to var directory
commit 1d0757f16beb31551733d9d755d72337ccda9642 changes opkg run state from /usr/lib/opkg to /var/lib/opkg, which however is incomplete and still many important information is kept under old directory including postinst methods. This makes latest boot into a mess. So finalize this movement to /var here. Fix [BUGID #229] Signed-off-by: Kevin Tian <kevin.tian@intel.com>
-rw-r--r--meta/classes/rootfs_deb.bbclass12
-rw-r--r--meta/classes/rootfs_ipk.bbclass18
-rw-r--r--meta/classes/rootfs_rpm.bbclass6
-rw-r--r--meta/packages/opkg/opkg.inc6
-rw-r--r--meta/packages/opkg/opkg_0.1.8.bb2
-rw-r--r--meta/packages/opkg/opkg_svn.bb2
6 files changed, 26 insertions, 20 deletions
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 16b8a86a58..b33d153dae 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -8,6 +8,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
8do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot" 8do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
9do_rootfs[recrdeptask] += "do_package_write_deb" 9do_rootfs[recrdeptask] += "do_package_write_deb"
10 10
11opkglibdir = "${localstatedir}/lib/opkg"
12
11fakeroot rootfs_deb_do_rootfs () { 13fakeroot rootfs_deb_do_rootfs () {
12 set +e 14 set +e
13 mkdir -p ${IMAGE_ROOTFS}/var/dpkg/info 15 mkdir -p ${IMAGE_ROOTFS}/var/dpkg/info
@@ -120,13 +122,13 @@ fakeroot rootfs_deb_do_rootfs () {
120 set -e 122 set -e
121 123
122 # Hacks to allow opkg's update-alternatives and opkg to coexist for now 124 # Hacks to allow opkg's update-alternatives and opkg to coexist for now
123 mkdir -p ${IMAGE_ROOTFS}/usr/lib/opkg 125 mkdir -p ${IMAGE_ROOTFS}${opkglibdir}
124 if [ -e ${IMAGE_ROOTFS}/var/dpkg/alternatives ]; then 126 if [ -e ${IMAGE_ROOTFS}/var/dpkg/alternatives ]; then
125 rmdir ${IMAGE_ROOTFS}/var/dpkg/alternatives 127 rmdir ${IMAGE_ROOTFS}/var/dpkg/alternatives
126 fi 128 fi
127 ln -s /usr/lib/opkg/alternatives ${IMAGE_ROOTFS}/var/dpkg/alternatives 129 ln -s ${opkglibdir}/alternatives ${IMAGE_ROOTFS}/var/dpkg/alternatives
128 ln -s /var/dpkg/info ${IMAGE_ROOTFS}/usr/lib/opkg/info 130 ln -s /var/dpkg/info ${IMAGE_ROOTFS}${opkglibdir}/info
129 ln -s /var/dpkg/status ${IMAGE_ROOTFS}/usr/lib/opkg/status 131 ln -s /var/dpkg/status ${IMAGE_ROOTFS}${opkglibdir}/status
130 132
131 ${ROOTFS_POSTPROCESS_COMMAND} 133 ${ROOTFS_POSTPROCESS_COMMAND}
132 134
@@ -154,6 +156,6 @@ rootfs_deb_log_check() {
154} 156}
155 157
156remove_packaging_data_files() { 158remove_packaging_data_files() {
157 rm -rf ${IMAGE_ROOTFS}/usr/lib/opkg/ 159 rm -rf ${IMAGE_ROOTFS}${opkglibdir}
158 rm -rf ${IMAGE_ROOTFS}/usr/dpkg/ 160 rm -rf ${IMAGE_ROOTFS}/usr/dpkg/
159} 161}
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 0bfa49194d..c9edec2b52 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -18,6 +18,8 @@ OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf
18 18
19OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris" 19OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris"
20 20
21opkglibdir = "${localstatedir}/lib/opkg"
22
21fakeroot rootfs_ipk_do_rootfs () { 23fakeroot rootfs_ipk_do_rootfs () {
22 set -x 24 set -x
23 25
@@ -27,7 +29,7 @@ fakeroot rootfs_ipk_do_rootfs () {
27 ${OPKG_PREPROCESS_COMMANDS} 29 ${OPKG_PREPROCESS_COMMANDS}
28 30
29 mkdir -p ${T}/ 31 mkdir -p ${T}/
30 mkdir -p ${IMAGE_ROOTFS}/usr/lib/opkg/ 32 mkdir -p ${IMAGE_ROOTFS}${opkglibdir}
31 33
32 opkg-cl ${IPKG_ARGS} update 34 opkg-cl ${IPKG_ARGS} update
33 35
@@ -59,12 +61,12 @@ fakeroot rootfs_ipk_do_rootfs () {
59 ${OPKG_POSTPROCESS_COMMANDS} 61 ${OPKG_POSTPROCESS_COMMANDS}
60 ${ROOTFS_POSTINSTALL_COMMAND} 62 ${ROOTFS_POSTINSTALL_COMMAND}
61 63
62 for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.preinst; do 64 for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.preinst; do
63 if [ -f $i ] && ! sh $i; then 65 if [ -f $i ] && ! sh $i; then
64 opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst` 66 opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst`
65 fi 67 fi
66 done 68 done
67 for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.postinst; do 69 for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.postinst; do
68 if [ -f $i ] && ! sh $i configure; then 70 if [ -f $i ] && ! sh $i configure; then
69 opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst` 71 opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst`
70 fi 72 fi
@@ -75,7 +77,7 @@ fakeroot rootfs_ipk_do_rootfs () {
75 77
76 ${ROOTFS_POSTPROCESS_COMMAND} 78 ${ROOTFS_POSTPROCESS_COMMAND}
77 79
78 rm -f ${IMAGE_ROOTFS}${libdir}/opkg/lists/* 80 rm -f ${IMAGE_ROOTFS}${opkglibdir}/lists/*
79 81
80 log_check rootfs 82 log_check rootfs
81} 83}
@@ -102,7 +104,7 @@ rootfs_ipk_log_check() {
102 104
103rootfs_ipk_write_manifest() { 105rootfs_ipk_write_manifest() {
104 manifest=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest 106 manifest=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest
105 cp ${IMAGE_ROOTFS}/usr/lib/opkg/status $manifest 107 cp ${IMAGE_ROOTFS}${opkglibdir}/status $manifest
106 108
107 sed '/Depends/d' -i $manifest 109 sed '/Depends/d' -i $manifest
108 sed '/Status/d' -i $manifest 110 sed '/Status/d' -i $manifest
@@ -115,16 +117,16 @@ rootfs_ipk_write_manifest() {
115} 117}
116 118
117remove_packaging_data_files() { 119remove_packaging_data_files() {
118 rm -rf ${IMAGE_ROOTFS}/usr/lib/opkg/ 120 rm -rf ${IMAGE_ROOTFS}${opkglibdir}
119 # We need the directory for the package manager lock 121 # We need the directory for the package manager lock
120 mkdir ${IMAGE_ROOTFS}/usr/lib/opkg 122 mkdir ${IMAGE_ROOTFS}${opkglibdir}
121} 123}
122 124
123install_all_locales() { 125install_all_locales() {
124 126
125 PACKAGES_TO_INSTALL="" 127 PACKAGES_TO_INSTALL=""
126 128
127 INSTALLED_PACKAGES=`grep ^Package: ${IMAGE_ROOTFS}${libdir}/opkg/status |sed "s/^Package: //"|egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"` 129 INSTALLED_PACKAGES=`grep ^Package: ${IMAGE_ROOTFS}${opkglibdir}/status |sed "s/^Package: //"|egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"`
128 130
129 for pkg in $INSTALLED_PACKAGES 131 for pkg in $INSTALLED_PACKAGES
130 do 132 do
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 9c681f382b..9cbfdd3db3 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -20,6 +20,8 @@ AWKPOSTINSTSCRIPT = "${POKYBASE}/scripts/rootfs_rpm-extract-postinst.awk"
20RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf" 20RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf"
21RPM_POSTPROCESS_COMMANDS = "" 21RPM_POSTPROCESS_COMMANDS = ""
22 22
23opkglibdir = "${localstatedir}/lib/opkg"
24
23fakeroot rootfs_rpm_do_rootfs () { 25fakeroot rootfs_rpm_do_rootfs () {
24 set +x 26 set +x
25 27
@@ -164,7 +166,7 @@ rootfs_rpm_log_check() {
164 166
165remove_packaging_data_files() { 167remove_packaging_data_files() {
166 exit 1 168 exit 1
167 rm -rf ${IMAGE_ROOTFS}/usr/lib/opkg/ 169 rm -rf ${IMAGE_ROOTFS}${opkglibdir}
168} 170}
169 171
170install_all_locales() { 172install_all_locales() {
@@ -172,7 +174,7 @@ install_all_locales() {
172 174
173 PACKAGES_TO_INSTALL="" 175 PACKAGES_TO_INSTALL=""
174 176
175 INSTALLED_PACKAGES=`grep ^Package: ${IMAGE_ROOTFS}${libdir}/opkg/status |sed "s/^Package: //"|egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"` 177 INSTALLED_PACKAGES=`grep ^Package: ${IMAGE_ROOTFS}${opkglibdir}/status |sed "s/^Package: //"|egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"`
176 178
177 for pkg in $INSTALLED_PACKAGES 179 for pkg in $INSTALLED_PACKAGES
178 do 180 do
diff --git a/meta/packages/opkg/opkg.inc b/meta/packages/opkg/opkg.inc
index 667b6386e5..add1563c47 100644
--- a/meta/packages/opkg/opkg.inc
+++ b/meta/packages/opkg/opkg.inc
@@ -22,10 +22,10 @@ do_configure_prepend() {
22 22
23inherit autotools pkgconfig 23inherit autotools pkgconfig
24 24
25target_libdir := "${libdir}" 25target_localstatedir := "${localstatedir}"
26EXTRA_OECONF = "--with-opkglibdir=${localstatedir}/lib" 26EXTRA_OECONF = "--with-opkglibdir=${localstatedir}/lib"
27EXTRA_OECONF_virtclass-native = "--with-opkglibdir=${target_libdir} --disable-gpg --disable-curl --disable-openssl" 27EXTRA_OECONF_virtclass-native = "--with-opkglibdir=${target_localstatedir}/lib --disable-gpg --disable-curl --disable-openssl"
28EXTRA_OECONF_virtclass-nativesdk = "--with-opkglibdir=${target_libdir} --disable-gpg --disable-curl --disable-openssl" 28EXTRA_OECONF_virtclass-nativesdk = "--with-opkglibdir=${target_localstatedir}/lib --disable-gpg --disable-curl --disable-openssl"
29 29
30#PROVIDES_append_virtclass-native = "virtual/update-alternatives-native" 30#PROVIDES_append_virtclass-native = "virtual/update-alternatives-native"
31#RPROVIDES_${PN} += "update-alternatives-native" 31#RPROVIDES_${PN} += "update-alternatives-native"
diff --git a/meta/packages/opkg/opkg_0.1.8.bb b/meta/packages/opkg/opkg_0.1.8.bb
index 1d05ef802e..4eb3ff9a11 100644
--- a/meta/packages/opkg/opkg_0.1.8.bb
+++ b/meta/packages/opkg/opkg_0.1.8.bb
@@ -13,7 +13,7 @@ SRC_URI = "http://opkg.googlecode.com/files/opkg-${PV}.tar.gz \
13 file://headerfix.patch \ 13 file://headerfix.patch \
14" 14"
15 15
16PR = "r2" 16PR = "r3"
17 17
18PACKAGES =+ "libopkg-dev libopkg update-alternatives-cworth" 18PACKAGES =+ "libopkg-dev libopkg update-alternatives-cworth"
19 19
diff --git a/meta/packages/opkg/opkg_svn.bb b/meta/packages/opkg/opkg_svn.bb
index 1dc4c48006..518c767354 100644
--- a/meta/packages/opkg/opkg_svn.bb
+++ b/meta/packages/opkg/opkg_svn.bb
@@ -17,7 +17,7 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;proto=http \
17S = "${WORKDIR}/trunk" 17S = "${WORKDIR}/trunk"
18 18
19PV = "0.0+svnr${SRCREV}" 19PV = "0.0+svnr${SRCREV}"
20PR = "r14" 20PR = "r15"
21 21
22PACKAGES =+ "libopkg-dev libopkg update-alternatives-cworth" 22PACKAGES =+ "libopkg-dev libopkg update-alternatives-cworth"
23 23