rootfs_ipk.bbclass: always specify tmp_dir in opkg-cl call with -t parameter
authorMartin Jansa <Martin.Jansa@gmail.com>
Wed, 24 Feb 2010 18:19:03 +0000 (19:19 +0100)
committerMartin Jansa <Martin.Jansa@gmail.com>
Wed, 24 Feb 2010 19:10:40 +0000 (20:10 +0100)
* 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)
* Similar patch for testlab.bbclass will follow

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
classes/rootfs_ipk.bbclass

index 16dd511..38d6121 100644 (file)
@@ -7,7 +7,8 @@
 
 do_rootfs[depends] += "opkg-native:do_populate_staging"
 
-IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} ${@base_conditional("PACKAGE_INSTALL_NO_DEPS", "1", "-nodeps", "", d)}"
+IPKG_TMP_DIR = "${IMAGE_ROOTFS}-tmp"
+IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} -t ${IPKG_TMP_DIR} ${@base_conditional("PACKAGE_INSTALL_NO_DEPS", "1", "-nodeps", "", d)}"
 
 PACKAGE_INSTALL_NO_DEPS ?= "0"
 
@@ -31,6 +32,7 @@ fakeroot rootfs_ipk_do_rootfs () {
        package_generate_ipkg_conf
 
        mkdir -p ${T}
+       mkdir -p ${IPKG_TMP_DIR}
        mkdir -p ${IMAGE_ROOTFS}${libdir}/opkg/
 
        STATUS=${IMAGE_ROOTFS}${libdir}/opkg/status
@@ -100,6 +102,7 @@ fakeroot rootfs_ipk_do_rootfs () {
        ${ROOTFS_POSTPROCESS_COMMAND}
        
        log_check rootfs        
+       rm -rf ${IPKG_TMP_DIR}
 }
 
 rootfs_ipk_log_check() {