summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-03-22 19:53:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-23 11:41:13 +0000
commit59e48153877269d5eea393ad2f6d1827f74720ac (patch)
tree1fc56600125082af451cf86c0c1347804bad36e7
parent9e366e153234114ab3c51e4bb8e3452593f64070 (diff)
downloadpoky-59e48153877269d5eea393ad2f6d1827f74720ac.tar.gz
classes/buildhistory: implement history collection for SDKs
SDKs are constructed in a similar manner to images, and the contents can be influenced by a number of different factors, thus tracking the contents of produced SDKs when buildhistory is enabled can help detect the same kinds of issues as with images. This required adding POPULATE_SDK_POST_HOST_COMMAND and SDK_POSTPROCESS_COMMAND variables so that data collection functions can be injected at the appropriate points in the SDK construction process, as well as moving the list_installed_packages and rootfs_list_installed_depends functions from the rootfs_{rpm,ipk,deb} to the package_{rpm,ipk,deb} classes so they can also be called during do_populate_sdk as well as do_rootfs. Implements [YOCTO #3964]. (From OE-Core rev: c3736064483d4840e38cb1b8c13d2dd3a26b36aa) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/buildhistory.bbclass130
-rw-r--r--meta/classes/package_deb.bbclass28
-rw-r--r--meta/classes/package_ipk.bbclass24
-rw-r--r--meta/classes/package_rpm.bbclass17
-rw-r--r--meta/classes/populate_sdk_base.bbclass2
-rw-r--r--meta/classes/populate_sdk_deb.bbclass1
-rw-r--r--meta/classes/populate_sdk_ipk.bbclass2
-rw-r--r--meta/classes/populate_sdk_rpm.bbclass1
-rw-r--r--meta/classes/rootfs_deb.bbclass27
-rw-r--r--meta/classes/rootfs_ipk.bbclass22
-rw-r--r--meta/classes/rootfs_rpm.bbclass16
11 files changed, 165 insertions, 105 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 07b3c1edaf..b559ebf8ac 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -3,14 +3,15 @@
3# 3#
4# Based in part on testlab.bbclass and packagehistory.bbclass 4# Based in part on testlab.bbclass and packagehistory.bbclass
5# 5#
6# Copyright (C) 2011 Intel Corporation 6# Copyright (C) 2013 Intel Corporation
7# Copyright (C) 2007-2011 Koen Kooi <koen@openembedded.org> 7# Copyright (C) 2007-2011 Koen Kooi <koen@openembedded.org>
8# 8#
9 9
10BUILDHISTORY_FEATURES ?= "image package" 10BUILDHISTORY_FEATURES ?= "image package sdk"
11BUILDHISTORY_DIR ?= "${TMPDIR}/buildhistory" 11BUILDHISTORY_DIR ?= "${TMPDIR}/buildhistory"
12BUILDHISTORY_DIR_IMAGE = "${BUILDHISTORY_DIR}/images/${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}" 12BUILDHISTORY_DIR_IMAGE = "${BUILDHISTORY_DIR}/images/${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}"
13BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS}/${PN}" 13BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS}/${PN}"
14BUILDHISTORY_DIR_SDK = "${BUILDHISTORY_DIR}/sdk/${SDK_NAME}"
14BUILDHISTORY_COMMIT ?= "0" 15BUILDHISTORY_COMMIT ?= "0"
15BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>" 16BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>"
16BUILDHISTORY_PUSH_REPO ?= "" 17BUILDHISTORY_PUSH_REPO ?= ""
@@ -315,69 +316,91 @@ def write_pkghistory(pkginfo, d):
315 os.unlink(filevarpath) 316 os.unlink(filevarpath)
316 317
317 318
318buildhistory_get_image_installed() { 319buildhistory_get_installed() {
319 # Anything requiring the use of the packaging system should be done in here 320 mkdir -p $1
320 # in case the packaging files are going to be removed for this image
321
322 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
323 return
324 fi
325
326 mkdir -p ${BUILDHISTORY_DIR_IMAGE}
327 321
328 # Get list of installed packages 322 # Get list of installed packages
329 pkgcache="${BUILDHISTORY_DIR_IMAGE}/installed-packages.tmp" 323 pkgcache="$1/installed-packages.tmp"
330 list_installed_packages file | sort > $pkgcache 324 list_installed_packages file | sort > $pkgcache
331 325
332 cat $pkgcache | awk '{ print $1 }' > ${BUILDHISTORY_DIR_IMAGE}/installed-package-names.txt 326 cat $pkgcache | awk '{ print $1 }' > $1/installed-package-names.txt
333 cat $pkgcache | awk '{ print $2 }' | xargs -n1 basename > ${BUILDHISTORY_DIR_IMAGE}/installed-packages.txt 327 cat $pkgcache | awk '{ print $2 }' | xargs -n1 basename > $1/installed-packages.txt
334 328
335 # Produce dependency graph 329 # Produce dependency graph
336 # First, filter out characters that cause issues for dot 330 # First, filter out characters that cause issues for dot
337 rootfs_list_installed_depends | sed -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' > ${BUILDHISTORY_DIR_IMAGE}/depends.tmp 331 rootfs_list_installed_depends | sed -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' > $1/depends.tmp
338 # Change delimiter from pipe to -> and set style for recommend lines 332 # Change delimiter from pipe to -> and set style for recommend lines
339 sed -i -e 's:|: -> :' -e 's:\[REC\]:[style=dotted]:' -e 's:$:;:' ${BUILDHISTORY_DIR_IMAGE}/depends.tmp 333 sed -i -e 's:|: -> :' -e 's:\[REC\]:[style=dotted]:' -e 's:$:;:' $1/depends.tmp
340 # Add header, sorted and de-duped contents and footer and then delete the temp file 334 # Add header, sorted and de-duped contents and footer and then delete the temp file
341 printf "digraph depends {\n node [shape=plaintext]\n" > ${BUILDHISTORY_DIR_IMAGE}/depends.dot 335 printf "digraph depends {\n node [shape=plaintext]\n" > $1/depends.dot
342 cat ${BUILDHISTORY_DIR_IMAGE}/depends.tmp | sort | uniq >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot 336 cat $1/depends.tmp | sort | uniq >> $1/depends.dot
343 echo "}" >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot 337 echo "}" >> $1/depends.dot
344 rm ${BUILDHISTORY_DIR_IMAGE}/depends.tmp 338 rm $1/depends.tmp
345 339
346 # Produce installed package sizes list 340 # Produce installed package sizes list
347 printf "" > ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp 341 printf "" > $1/installed-package-sizes.tmp
348 cat $pkgcache | while read pkg pkgfile 342 cat $pkgcache | while read pkg pkgfile
349 do 343 do
350 if [ -f $pkgfile ] ; then 344 if [ -f $pkgfile ] ; then
351 pkgsize=`du -k $pkgfile | head -n1 | awk '{ print $1 }'` 345 pkgsize=`du -k $pkgfile | head -n1 | awk '{ print $1 }'`
352 echo $pkgsize $pkg >> ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp 346 echo $pkgsize $pkg >> $1/installed-package-sizes.tmp
353 fi 347 fi
354 done 348 done
355 cat ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp | sort -n -r | awk '{print $1 "\tKiB " $2}' > ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.txt 349 cat $1/installed-package-sizes.tmp | sort -n -r | awk '{print $1 "\tKiB " $2}' > $1/installed-package-sizes.txt
356 rm ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp 350 rm $1/installed-package-sizes.tmp
357 351
358 # We're now done with the cache, delete it 352 # We're now done with the cache, delete it
359 rm $pkgcache 353 rm $pkgcache
360 354
361 # Produce some cut-down graphs (for readability) 355 if [ "$2" != "sdk" ] ; then
362 grep -v kernel_image ${BUILDHISTORY_DIR_IMAGE}/depends.dot | grep -v kernel_2 | grep -v kernel_3 > ${BUILDHISTORY_DIR_IMAGE}/depends-nokernel.dot 356 # Produce some cut-down graphs (for readability)
363 grep -v libc6 ${BUILDHISTORY_DIR_IMAGE}/depends-nokernel.dot | grep -v libgcc > ${BUILDHISTORY_DIR_IMAGE}/depends-nokernel-nolibc.dot 357 grep -v kernel_image $1/depends.dot | grep -v kernel_2 | grep -v kernel_3 > $1/depends-nokernel.dot
364 grep -v update_ ${BUILDHISTORY_DIR_IMAGE}/depends-nokernel-nolibc.dot > ${BUILDHISTORY_DIR_IMAGE}/depends-nokernel-nolibc-noupdate.dot 358 grep -v libc6 $1/depends-nokernel.dot | grep -v libgcc > $1/depends-nokernel-nolibc.dot
365 grep -v kernel_module ${BUILDHISTORY_DIR_IMAGE}/depends-nokernel-nolibc-noupdate.dot > ${BUILDHISTORY_DIR_IMAGE}/depends-nokernel-nolibc-noupdate-nomodules.dot 359 grep -v update_ $1/depends-nokernel-nolibc.dot > $1/depends-nokernel-nolibc-noupdate.dot
360 grep -v kernel_module $1/depends-nokernel-nolibc-noupdate.dot > $1/depends-nokernel-nolibc-noupdate-nomodules.dot
361 fi
366 362
367 # add complementary package information 363 # add complementary package information
368 if [ -e ${WORKDIR}/complementary_pkgs.txt ]; then 364 if [ -e ${WORKDIR}/complementary_pkgs.txt ]; then
369 cp ${WORKDIR}/complementary_pkgs.txt ${BUILDHISTORY_DIR_IMAGE} 365 cp ${WORKDIR}/complementary_pkgs.txt $1
370 fi 366 fi
371} 367}
372 368
373buildhistory_get_imageinfo() { 369buildhistory_get_image_installed() {
370 # Anything requiring the use of the packaging system should be done in here
371 # in case the packaging files are going to be removed for this image
372
374 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then 373 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
375 return 374 return
376 fi 375 fi
377 376
378 # List the files in the image, but exclude date/time etc. 377 buildhistory_get_installed ${BUILDHISTORY_DIR_IMAGE}
378}
379
380buildhistory_get_sdk_installed() {
381 # Anything requiring the use of the packaging system should be done in here
382 # in case the packaging files are going to be removed for this SDK
383
384 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then
385 return
386 fi
387
388 buildhistory_get_installed ${BUILDHISTORY_DIR_SDK}/$1 sdk
389}
390
391buildhistory_list_files() {
392 # List the files in the specified directory, but exclude date/time etc.
379 # This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo 393 # This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo
380 ( cd ${IMAGE_ROOTFS} && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' | sort -k5 > ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt ) 394 ( cd $1 && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' | sort -k5 > $2 )
395}
396
397
398buildhistory_get_imageinfo() {
399 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
400 return
401 fi
402
403 buildhistory_list_files ${IMAGE_ROOTFS} ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt
381 404
382 # Record some machine-readable meta-information about the image 405 # Record some machine-readable meta-information about the image
383 printf "" > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt 406 printf "" > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
@@ -395,11 +418,32 @@ ${@buildhistory_get_layers(d)}
395END 418END
396} 419}
397 420
421buildhistory_get_sdkinfo() {
422 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then
423 return
424 fi
425
426 buildhistory_list_files ${SDK_OUTPUT} ${BUILDHISTORY_DIR_SDK}/files-in-sdk.txt
427
428 # Record some machine-readable meta-information about the SDK
429 printf "" > ${BUILDHISTORY_DIR_SDK}/sdk-info.txt
430 cat >> ${BUILDHISTORY_DIR_SDK}/sdk-info.txt <<END
431${@buildhistory_get_sdkvars(d)}
432END
433 sdksize=`du -ks ${SDK_OUTPUT} | awk '{ print $1 }'`
434 echo "SDKSIZE = $sdksize" >> ${BUILDHISTORY_DIR_SDK}/sdk-info.txt
435}
436
398# By prepending we get in before the removal of packaging files 437# By prepending we get in before the removal of packaging files
399ROOTFS_POSTPROCESS_COMMAND =+ "buildhistory_get_image_installed ; " 438ROOTFS_POSTPROCESS_COMMAND =+ "buildhistory_get_image_installed ; "
400 439
401IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; " 440IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; "
402 441
442POPULATE_SDK_POST_TARGET_COMMAND += "buildhistory_get_sdk_installed target ; "
443POPULATE_SDK_POST_HOST_COMMAND += "buildhistory_get_sdk_installed host ; "
444
445SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "
446
403def buildhistory_get_layers(d): 447def buildhistory_get_layers(d):
404 layertext = "Configured metadata layers:\n%s\n" % '\n'.join(get_layers_branch_rev(d)) 448 layertext = "Configured metadata layers:\n%s\n" % '\n'.join(get_layers_branch_rev(d))
405 return layertext 449 return layertext
@@ -418,15 +462,11 @@ def squashspaces(string):
418 import re 462 import re
419 return re.sub("\s+", " ", string).strip() 463 return re.sub("\s+", " ", string).strip()
420 464
421 465def outputvars(vars, listvars, d):
422def buildhistory_get_imagevars(d): 466 vars = vars.split()
423 imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND"
424 listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS"
425
426 imagevars = imagevars.split()
427 listvars = listvars.split() 467 listvars = listvars.split()
428 ret = "" 468 ret = ""
429 for var in imagevars: 469 for var in vars:
430 value = d.getVar(var, True) or "" 470 value = d.getVar(var, True) or ""
431 if var in listvars: 471 if var in listvars:
432 # Squash out spaces 472 # Squash out spaces
@@ -434,6 +474,16 @@ def buildhistory_get_imagevars(d):
434 ret += "%s = %s\n" % (var, value) 474 ret += "%s = %s\n" % (var, value)
435 return ret.rstrip('\n') 475 return ret.rstrip('\n')
436 476
477def buildhistory_get_imagevars(d):
478 imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND"
479 listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS"
480 return outputvars(imagevars, listvars, d)
481
482def buildhistory_get_sdkvars(d):
483 sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES BAD_RECOMMENDATIONS"
484 listvars = "SDKIMAGE_FEATURES BAD_RECOMMENDATIONS"
485 return outputvars(sdkvars, listvars, d)
486
437 487
438buildhistory_commit() { 488buildhistory_commit() {
439 if [ ! -d ${BUILDHISTORY_DIR} ] ; then 489 if [ ! -d ${BUILDHISTORY_DIR} ] ; then
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 455919913b..a937b85a61 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -423,3 +423,31 @@ addtask package_write_deb before do_package_write after do_packagedata do_packag
423PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_DEB} ] || package_update_index_deb;" 423PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_DEB} ] || package_update_index_deb;"
424PACKAGEINDEXDEPS += "dpkg-native:do_populate_sysroot" 424PACKAGEINDEXDEPS += "dpkg-native:do_populate_sysroot"
425PACKAGEINDEXDEPS += "apt-native:do_populate_sysroot" 425PACKAGEINDEXDEPS += "apt-native:do_populate_sysroot"
426
427
428# This will of course only work after rootfs_deb_do_rootfs or populate_sdk_deb has been called
429DPKG_QUERY_COMMAND = "${STAGING_BINDIR_NATIVE}/dpkg-query --admindir=$INSTALL_ROOTFS_DEB/var/lib/dpkg"
430
431list_installed_packages() {
432 if [ "$1" = "arch" ] ; then
433 # Here we want the PACKAGE_ARCH not the deb architecture
434 ${DPKG_QUERY_COMMAND} -W -f='${Package} ${PackageArch}\n'
435 elif [ "$1" = "file" ] ; then
436 ${DPKG_QUERY_COMMAND} -W -f='${Package} ${Package}_${Version}_${Architecture}.deb\n' | while read pkg pkgfile
437 do
438 fullpath=`find ${DEPLOY_DIR_DEB} -name "$pkgfile" || true`
439 if [ "$fullpath" = "" ] ; then
440 echo "$pkg $pkgfile"
441 else
442 echo "$pkg $fullpath"
443 fi
444 done
445 else
446 ${DPKG_QUERY_COMMAND} -W -f='${Package}\n'
447 fi
448}
449
450rootfs_list_installed_depends() {
451 # Cheat here a little bit by using the opkg query helper util
452 ${DPKG_QUERY_COMMAND} -W -f='Package: ${Package}\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n' | opkg-query-helper.py
453}
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index d003ae7e81..cec2f17334 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -430,3 +430,27 @@ addtask package_write_ipk before do_package_write after do_packagedata do_packag
430PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_IPK} ] || package_update_index_ipk;" 430PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_IPK} ] || package_update_index_ipk;"
431PACKAGEINDEXDEPS += "opkg-utils-native:do_populate_sysroot" 431PACKAGEINDEXDEPS += "opkg-utils-native:do_populate_sysroot"
432PACKAGEINDEXDEPS += "opkg-native:do_populate_sysroot" 432PACKAGEINDEXDEPS += "opkg-native:do_populate_sysroot"
433
434
435list_installed_packages() {
436 if [ "$1" = "arch" ] ; then
437 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -a
438 elif [ "$1" = "file" ] ; then
439 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -f | while read pkg pkgfile
440 do
441 fullpath=`find ${DEPLOY_DIR_IPK} -name "$pkgfile" || true`
442 if [ "$fullpath" = "" ] ; then
443 echo "$pkg $pkgfile"
444 else
445 echo "$pkg $fullpath"
446 fi
447 done
448 else
449 opkg-cl ${OPKG_ARGS} list_installed | awk '{ print $1 }'
450 fi
451}
452
453rootfs_list_installed_depends() {
454 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py
455}
456
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 12b4bfa536..7d67b9685c 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -1155,3 +1155,20 @@ addtask package_write_rpm before do_package_write after do_packagedata do_packag
1155PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_RPM} ] || package_update_index_rpm;" 1155PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_RPM} ] || package_update_index_rpm;"
1156PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot" 1156PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot"
1157PACKAGEINDEXDEPS += "createrepo-native:do_populate_sysroot" 1157PACKAGEINDEXDEPS += "createrepo-native:do_populate_sysroot"
1158
1159
1160RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"'
1161
1162list_installed_packages() {
1163 if [ "$1" = "arch" ]; then
1164 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe arch
1165 elif [ "$1" = "file" ]; then
1166 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN}\n]" | translate_smart_to_oe
1167 else
1168 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe
1169 fi
1170}
1171
1172rootfs_list_installed_depends() {
1173 rpmresolve -t $INSTALL_ROOTFS_RPM/${rpmlibdir}
1174}
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 4015030914..6280705236 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -86,6 +86,8 @@ fakeroot populate_sdk_image() {
86 86
87 # Link the ld.so.cache file into the hosts filesystem 87 # Link the ld.so.cache file into the hosts filesystem
88 ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache 88 ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
89
90 ${SDK_POSTPROCESS_COMMAND}
89} 91}
90 92
91fakeroot create_sdk_files() { 93fakeroot create_sdk_files() {
diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
index e1705e7bfb..0361a13bbf 100644
--- a/meta/classes/populate_sdk_deb.bbclass
+++ b/meta/classes/populate_sdk_deb.bbclass
@@ -56,6 +56,7 @@ populate_sdk_deb () {
56 export INSTALL_TASK_DEB="populate_sdk-nativesdk" 56 export INSTALL_TASK_DEB="populate_sdk-nativesdk"
57 57
58 package_install_internal_deb 58 package_install_internal_deb
59 ${POPULATE_SDK_POST_HOST_COMMAND}
59 populate_sdk_post_deb ${SDK_OUTPUT}/${SDKPATHNATIVE} 60 populate_sdk_post_deb ${SDK_OUTPUT}/${SDKPATHNATIVE}
60 61
61 #move remainings 62 #move remainings
diff --git a/meta/classes/populate_sdk_ipk.bbclass b/meta/classes/populate_sdk_ipk.bbclass
index 3a5ecda268..becaf96dcf 100644
--- a/meta/classes/populate_sdk_ipk.bbclass
+++ b/meta/classes/populate_sdk_ipk.bbclass
@@ -41,6 +41,8 @@ populate_sdk_ipk() {
41 41
42 package_install_internal_ipk 42 package_install_internal_ipk
43 43
44 ${POPULATE_SDK_POST_HOST_COMMAND}
45
44 #post clean up 46 #post clean up
45 install -d ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir} 47 install -d ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir}
46 install -m 0644 ${IPKGCONF_TARGET} ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir}/ 48 install -m 0644 ${IPKGCONF_TARGET} ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir}/
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass
index 2dfb80c592..bbee35eab5 100644
--- a/meta/classes/populate_sdk_rpm.bbclass
+++ b/meta/classes/populate_sdk_rpm.bbclass
@@ -113,6 +113,7 @@ populate_sdk_rpm () {
113 export INSTALL_PLATFORM_EXTRA_RPM 113 export INSTALL_PLATFORM_EXTRA_RPM
114 114
115 package_install_internal_rpm --sdk 115 package_install_internal_rpm --sdk
116 ${POPULATE_SDK_POST_HOST_COMMAND}
116 populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM} 117 populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM}
117 118
118 # move host RPM library data 119 # move host RPM library data
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index abc9f3bbf5..e642cf3852 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -99,33 +99,6 @@ remove_packaging_data_files() {
99 rm -rf ${IMAGE_ROOTFS}/usr/dpkg/ 99 rm -rf ${IMAGE_ROOTFS}/usr/dpkg/
100} 100}
101 101
102# This will of course only work after rootfs_deb_do_rootfs has been called
103DPKG_QUERY_COMMAND = "${STAGING_BINDIR_NATIVE}/dpkg-query --admindir=$INSTALL_ROOTFS_DEB/var/lib/dpkg"
104
105list_installed_packages() {
106 if [ "$1" = "arch" ] ; then
107 # Here we want the PACKAGE_ARCH not the deb architecture
108 ${DPKG_QUERY_COMMAND} -W -f='${Package} ${PackageArch}\n'
109 elif [ "$1" = "file" ] ; then
110 ${DPKG_QUERY_COMMAND} -W -f='${Package} ${Package}_${Version}_${Architecture}.deb\n' | while read pkg pkgfile
111 do
112 fullpath=`find ${DEPLOY_DIR_DEB} -name "$pkgfile" || true`
113 if [ "$fullpath" = "" ] ; then
114 echo "$pkg $pkgfile"
115 else
116 echo "$pkg $fullpath"
117 fi
118 done
119 else
120 ${DPKG_QUERY_COMMAND} -W -f='${Package}\n'
121 fi
122}
123
124rootfs_list_installed_depends() {
125 # Cheat here a little bit by using the opkg query helper util
126 ${DPKG_QUERY_COMMAND} -W -f='Package: ${Package}\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n' | opkg-query-helper.py
127}
128
129rootfs_install_packages() { 102rootfs_install_packages() {
130 ${STAGING_BINDIR_NATIVE}/apt-get install `cat $1` --force-yes --allow-unauthenticated 103 ${STAGING_BINDIR_NATIVE}/apt-get install `cat $1` --force-yes --allow-unauthenticated
131 104
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index e38ba8689f..3e1f9590fc 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -141,28 +141,6 @@ remove_packaging_data_files() {
141 mkdir ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg 141 mkdir ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg
142} 142}
143 143
144list_installed_packages() {
145 if [ "$1" = "arch" ] ; then
146 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -a
147 elif [ "$1" = "file" ] ; then
148 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -f | while read pkg pkgfile
149 do
150 fullpath=`find ${DEPLOY_DIR_IPK} -name "$pkgfile" || true`
151 if [ "$fullpath" = "" ] ; then
152 echo "$pkg $pkgfile"
153 else
154 echo "$pkg $fullpath"
155 fi
156 done
157 else
158 opkg-cl ${OPKG_ARGS} list_installed | awk '{ print $1 }'
159 fi
160}
161
162rootfs_list_installed_depends() {
163 opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py
164}
165
166rootfs_install_packages() { 144rootfs_install_packages() {
167 opkg-cl ${OPKG_ARGS} install `cat $1` 145 opkg-cl ${OPKG_ARGS} install `cat $1`
168} 146}
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 8392a1e53f..1d3ea641f0 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -156,22 +156,6 @@ rpm_setup_smart_target_config() {
156 rm -f ${IMAGE_ROOTFS}/var/lib/smart/config.old 156 rm -f ${IMAGE_ROOTFS}/var/lib/smart/config.old
157} 157}
158 158
159RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"'
160
161list_installed_packages() {
162 if [ "$1" = "arch" ]; then
163 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe arch
164 elif [ "$1" = "file" ]; then
165 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN}\n]" | translate_smart_to_oe
166 else
167 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe
168 fi
169}
170
171rootfs_list_installed_depends() {
172 rpmresolve -t $INSTALL_ROOTFS_RPM/${rpmlibdir}
173}
174
175rootfs_install_packages() { 159rootfs_install_packages() {
176 # Note - we expect the variables not set here to already have been set 160 # Note - we expect the variables not set here to already have been set
177 export INSTALL_PACKAGES_RPM="" 161 export INSTALL_PACKAGES_RPM=""