[oe] [PATCH] testlab.bbclass: use opkg.conf from staging, always specify tmp_dir in opkg-cl call with -t parameter

Martin Jansa martin.jansa at gmail.com
Wed Feb 24 19:22:47 UTC 2010


* Use opkg.conf from staging in the same way as do_rootfs does
* When option tmp_dir is used in opkg.conf installed on rootfs then it's
  used also in do_rootfs call and points to probably non-existent directory
  on buildhost like /var/lib/opkg/tmp.
* The value of tmp_dir from rootfs is used even with another config file
  specified with -c parameter
* Before this, it was using default value (/tmp) on buildhost, now it will use
  own "${IMAGE_ROOTFS}-tmp" and remove it after do_rootfs finish
  (usually already empty inside, cleaned by opkg itself)

Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 classes/testlab.bbclass |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/classes/testlab.bbclass b/classes/testlab.bbclass
index fc923c5..e6c9c8e 100644
--- a/classes/testlab.bbclass
+++ b/classes/testlab.bbclass
@@ -24,26 +24,31 @@
 do_testlab() {
 if [ -e  ${IMAGE_ROOTFS}/etc/opkg ] && [ "${ONLINE_PACKAGE_MANAGEMENT}" = "full" ] ; then
 
+	IPKG_TMP_DIR="${IMAGE_ROOTFS}-tmp"
+	IPKG_ARGS="-f ${STAGING_ETCDIR_NATIVE}/opkg.conf -o ${IMAGE_ROOTFS} -t ${IPKG_TMP_DIR}"
+
 	TESTLAB_DIR="${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-testlab"
         mkdir -p ${TESTLAB_DIR}/
+        mkdir -p ${IPKG_TMP_DIR}/
 	ls -laR ${IMAGE_ROOTFS} > ${TESTLAB_DIR}/files-in-image.txt 	
      
 	echo > ${TESTLAB_DIR}/installed-packages.txt
 	echo -e "digraph depends {\n    node [shape=plaintext]" > ${TESTLAB_DIR}/depends.dot
 
-	for pkg in $(opkg-cl -f ${IMAGE_ROOTFS}/etc/opkg -o ${IMAGE_ROOTFS} list_installed | awk '{print $1}') ; do 
-		opkg-cl -f ${IMAGE_ROOTFS}/etc/opkg -o ${IMAGE_ROOTFS} info $pkg | awk '/Package/ {printf $2"_"} /Version/ {printf $2"_"} /Archi/ {print $2".ipk"}'  >> ${TESTLAB_DIR}/installed-packages.txt
+	for pkg in $(opkg-cl ${IPKG_ARGS} list_installed | awk '{print $1}') ; do 
+		opkg-cl ${IPKG_ARGS} info $pkg | awk '/Package/ {printf $2"_"} /Version/ {printf $2"_"} /Archi/ {print $2".ipk"}'  >> ${TESTLAB_DIR}/installed-packages.txt
 
-    		for depends in $(opkg-cl -f ${IMAGE_ROOTFS}/etc/opkg -o  ${IMAGE_ROOTFS} info $pkg | grep Depends) ; do 
+    		for depends in $(opkg-cl ${IPKG_ARGS} info $pkg | grep Depends) ; do 
         		echo "$pkg OPP $depends;" | grep -v "(" | grep -v ")" | grep -v Depends | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot
     		done
     		
-		for recommends in $(opkg-cl -f ${IMAGE_ROOTFS}/etc/opkg -o ${IMAGE_ROOTFS} info $pkg | grep Recom) ; do
+		for recommends in $(opkg-cl ${IPKG_ARGS} info $pkg | grep Recom) ; do
         		echo "$pkg OPP $recommends [style=dotted];" | grep -v "(" | grep -v ")" | grep -v Recom | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot
     		done
 	done
 
 	echo "}" >>  ${TESTLAB_DIR}/depends.dot
+	rm -rf ${IPKG_TMP_DIR}
 	
 	grep -v kernel_2 ${TESTLAB_DIR}/depends.dot | grep -v kernel_image > ${TESTLAB_DIR}/depends-nokernel.dot
 	grep -v libc6 ${TESTLAB_DIR}/depends-nokernel.dot | grep -v libgcc > ${TESTLAB_DIR}/depends-nokernel-nolibc.dot
-- 
1.7.0





More information about the Openembedded-devel mailing list