Added rpm support in meta-toolchain
cover Added rpm support in meta-toolchain
From: Lianhao Lu <[email protected]>
The purpose of this series of patches is to add rpm support in meta-toolchain creation, and also to fix bug #227.
It makes the task populate_sdk in meta/recipes-core/meta/meta-toolchain.bb more generic to support installing packages from ipk, rpm, and deb files in creating meta-toolchain tarball, and move the populate_sdk task out of meta-toolchain.bb recipe into a bbclass.
It added populate_sdk_xxx.bbclass for different package file format.
The meta-toolchain installing process involes 2 set of packages, one is the host sdk set which contains packages of applications(e.g. cross-canadian compilers, qemu, etc.) and relevant run-time libraries, the other is the target sdk set which contains packages of target arch's libraries and header files to create a target rootfs for cross compiling purpose.So the patches also modifes and/or adds functions in package_deb.bbclass & package_rpm.bbclass to update the package index and to generate different installing configuration files for the tow different sets.
It also fixed a bug in cross-canadian.bbclass to enable the package_deb.bbclass generate correct deb package files for cross-canadian recipies.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: llu/rpm_meta-toolchain
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/rpm_meta-toolchain
Thanks,
Lianhao Lu <[email protected]>
---
Lianhao Lu (6):
cross-canadian/apt-native: support for debian package. classes/populate_sdk_ipk.bbclass: newly created. populate_sdk_deb/package_deb: Added deb support for populate_sdk. classes/populate_sdk_*: remove blanks. package_rpm/populate_sdk_rpm: Added rpm support for populate_sdk
task.
meta_toolchain/populate_sdk: Made task populate_sdk more generic.
meta/classes/cross-canadian.bbclass | 3 + meta/classes/package_deb.bbclass | 31 ++++++ meta/classes/package_rpm.bbclass | 53 ++++++++-- meta/classes/populate_sdk.bbclass | 88 +++++++++++++++ meta/classes/populate_sdk_deb.bbclass | 129 ++++++++++++++++++++++ meta/classes/populate_sdk_ipk.bbclass | 57 ++++++++++ meta/classes/populate_sdk_rpm.bbclass | 138 ++++++++++++++++++++++++ meta/recipes-core/meta/meta-toolchain.bb | 103 +----------------- meta/recipes-devtools/apt/apt-native_0.7.14.bb | 2 + 9 files changed, 496 insertions(+), 108 deletions(-) create mode 100644 meta/classes/populate_sdk.bbclass create mode 100644 meta/classes/populate_sdk_deb.bbclass create mode 100644 meta/classes/populate_sdk_ipk.bbclass create mode 100644 meta/classes/populate_sdk_rpm.bbclass
PATCH 1/6 cross-canadian/apt-native: support for debian package.
From: Lianhao Lu <[email protected]>
1. Set DPKG_ARCH in cross-canadian.bbclass to make debian package to be generated with correct architecture.
2. Added licence checksum for apt-native.
--- meta/classes/cross-canadian.bbclass | 3 +++ meta/recipes-devtools/apt/apt-native_0.7.14.bb | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-)
meta/classes/cross-canadian.bbclass +3 -0
@@ -43,6 +43,9 @@ HOST_OS = "${SDK_OS}" HOST_PREFIX = "${SDK_PREFIX}" HOST_CC_ARCH = "${SDK_CC_ARCH}" +#assign DPKG_ARCH +DPKG_ARCH = "${SDK_ARCH}" + CPPFLAGS = "${BUILDSDK_CPPFLAGS}" CFLAGS = "${BUILDSDK_CFLAGS}" CXXFLAGS = "${BUILDSDK_CFLAGS}"
meta/recipes-devtools/apt/apt-native_0.7.14.bb +2 -0
@@ -9,3 +9,5 @@ SRC_URI += "file://nodoc.patch \ SRC_URI[md5sum] = "19efa18fb1ef20c58b9b44e94258b814" SRC_URI[sha256sum] = "8fc06effaf8a4e4333308eedcdc6840f1c8056f2e924210f151dfc076bcd4045" + +LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
Signature · 1 line
1.7.0.4
Re: [PATCH 1/6] cross-canadian/apt-native: support for debian package.
Quoted 6 lines · Lianhao Lu
From: Lianhao Lu <[email protected]>
1. Set
DPKG_ARCHin cross-canadian.bbclass to make debian package to be generated with correct architecture.2. Added licence checksum for apt-native.
This should be two patches please as it's two unrelated changed.
Cheers,
Joshua
Signature · 2 lines
Joshua Lock
Intel Open Source Technology CentrePATCH 2/6 classes/populate_sdk_ipk.bbclass: newly created.
In reply to Lianhao LuFrom: Lianhao Lu <[email protected]>
Added ipk support for populate_sdk task.
--- meta/classes/populate_sdk_ipk.bbclass | 57 +++++++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+), 0 deletions(-) create mode 100644 meta/classes/populate_sdk_ipk.bbclass
meta/classes/populate_sdk_ipk.bbclass new file +57 -0
@@ -0,0 +1,57 @@ +do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot" +do_populate_sdk[recrdeptask] += "do_package_write_ipk" + +IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT} --force-overwrite" +IPKG_TARGET = "opkg-cl -f ${IPKGCONF_TARGET} -o ${SDK_OUTPUT}/${SDKTARGETSYSROOT} --force-overwrite" + +fakeroot populate_sdk_ipk() { + + mkdir -p ${SDK_OUTPUT}${localstatedir}/lib/opkg/ + mkdir -p ${SDK_OUTPUT}/${SDKTARGETSYSROOT}${localstatedir}/lib/opkg/ + + rm -f ${IPKGCONF_TARGET} + touch ${IPKGCONF_TARGET} + rm -f ${IPKGCONF_SDK} + touch ${IPKGCONF_SDK} + + package_update_index_ipk + package_generate_ipkg_conf + + ${IPKG_HOST} update + ${IPKG_HOST} install ${TOOLCHAIN_HOST_TASK} + + ${IPKG_TARGET} update + ${IPKG_TARGET} install ${TOOLCHAIN_TARGET_TASK} + + install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg + mv ${SDK_OUTPUT}/var/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg/ + rm -Rf ${SDK_OUTPUT}/var + + install -d ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir} + install -m 0644 ${IPKGCONF_TARGET} ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir}/ + + install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} + install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ + + populate_sdk_log_check +} + +populate_sdk_ipk_log_check() { + + lf_path="$1" + + lf_txt="`cat $lf_path`" + for keyword_die in "exit 1" "Collected errors" ERR Fail + do + if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 + then + echo "log_check: There were error messages in the logfile" + echo -e "log_check: Matched keyword: [$keyword_die]\n" + echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" + echo "" + do_exit=1 + fi + done + test "$do_exit" = 1 && exit 1 + true +}
Signature · 1 line
1.7.0.4
PATCH 3/6 populate_sdk_deb/package_deb: Added deb support for populate_sdk.
In reply to Lianhao LuFrom: Lianhao Lu <[email protected]>
Added populate_sdk_deb.bbclass for populate_sdk task.
Added function package_update_index_deb in package_deb.bbclass to generate deb index.
--- meta/classes/package_deb.bbclass | 31 ++++++++ meta/classes/populate_sdk_deb.bbclass | 129 +++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+), 0 deletions(-) create mode 100644 meta/classes/populate_sdk_deb.bbclass
meta/classes/package_deb.bbclass +31 -0
@@ -67,6 +67,37 @@ python do_package_deb_install () { os.putenv('PATH', path) } +# +# Update the Packages index files in ${DEPLOY_DIR_DEB} +# +package_update_index_deb () { + + debarchs="" + + if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then + return + fi + + for arch in ${PACKAGE_ARCHS}; do + sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` + if [ -e ${DEPLOY_DIR_DEB}/$arch ]; then + debarchs="$debarchs $arch" + fi + if [ -e ${DEPLOY_DIR_DEB}/$sdkarch-nativesdk ]; then + debarchs="$debarchs $sdkarch-nativesdk" + fi + done + + for arch in $debarchs; do + if [ ! -d ${DEPLOY_DIR_DEB}/$arch ]; then + continue; + fi + cd ${DEPLOY_DIR_DEB}/$arch + dpkg-scanpackages . | bzip2 > Packages.bz2 + echo "Label: $arch" > Release + done +} + python do_package_deb () { import re, copy import textwrap
meta/classes/populate_sdk_deb.bbclass new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 4/6 classes/populate_sdk_*: remove blanks.
In reply to Lianhao LuFrom: Lianhao Lu <[email protected]>
Remove unnecessary blanks introduced in commit2fc923582dbf15d1a694c0f7764f48e97b30116a and6af64af67102945a08e640e1100ea14831c6d794.
--- meta/classes/populate_sdk_deb.bbclass | 22 +++++++++++----------- meta/classes/populate_sdk_ipk.bbclass | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-)
meta/classes/populate_sdk_deb.bbclass +11 -11
@@ -2,7 +2,7 @@ do_populate_sdk[depends] += "dpkg-native:do_populate_sysroot apt-native:do_popul do_populate_sdk[recrdeptask] += "do_package_write_deb" generate_generate_deb_conf () { - + rootfs=$1 dpkg_arch=$2 shift
@@ -22,7 +22,7 @@ generate_generate_deb_conf () { if [ ! -d ${DEPLOY_DIR_DEB}/$arch ]; then continue; fi - + echo "deb file:${DEPLOY_DIR_DEB}/$arch/ ./" >> ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev (echo "Package: *" echo "Pin: release l=$arch"
@@ -79,9 +79,9 @@ populate_sdk_post_deb () { } fakeroot populate_sdk_deb () { - + package_update_index_deb - + set -x #install target generate_generate_deb_conf ${SDK_OUTPUT}/${SDKTARGETSYSROOT} ${DPKG_ARCH} ${PACKAGE_ARCHS}
@@ -100,13 +100,13 @@ fakeroot populate_sdk_deb () { generate_generate_deb_conf ${SDK_OUTPUT} ${SDK_ARCH} ${sdkarchs} populate_sdk_deb_internal ${SDK_OUTPUT} ${TOOLCHAIN_HOST_TASK} populate_sdk_post_deb ${SDK_OUTPUT}/${SDKPATHNATIVE} - + #move remainings - install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/var/dpkg + install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/var/dpkg mv ${SDK_OUTPUT}/var/dpkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/var/dpkg - rm -rf ${SDK_OUTPUT}/var - - populate_sdk_log_check + rm -rf ${SDK_OUTPUT}/var + + populate_sdk_log_check } populate_sdk_deb_log_check() {
@@ -114,7 +114,7 @@ populate_sdk_deb_log_check() { lf_txt="`cat $lf_path`" for keyword_die in "E:" - do + do if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 then echo "log_check: There were error messages in the logfile"
@@ -124,6 +124,6 @@ populate_sdk_deb_log_check() { do_exit=1 fi done - test "$do_exit" = 1 && exit 1 + test "$do_exit" = 1 && exit 1 true }
meta/classes/populate_sdk_ipk.bbclass +3 -3
@@ -33,7 +33,7 @@ fakeroot populate_sdk_ipk() { install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ - populate_sdk_log_check + populate_sdk_log_check } populate_sdk_ipk_log_check() {
@@ -42,14 +42,14 @@ populate_sdk_ipk_log_check() { lf_txt="`cat $lf_path`" for keyword_die in "exit 1" "Collected errors" ERR Fail - do + do if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 then echo "log_check: There were error messages in the logfile" echo -e "log_check: Matched keyword: [$keyword_die]\n" echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" echo "" - do_exit=1 + do_exit=1 fi done test "$do_exit" = 1 && exit 1
Signature · 1 line
1.7.0.4
Re: [PATCH 4/6] classes/populate_sdk_*: remove blanks.
Quoted 5 lines · Lianhao Lu
From: Lianhao Lu <[email protected]>
Remove unnecessary blanks introduced in commit
2fc923582dbf15d1a694c0f7764f48e97b30116aand6af64af67102945a08e640e1100ea14831c6d794.
These changes should be squashed into the patches which introduce the whitespace, this sort of thing is only necessary as a separate commit once the changes are in master.
git rebase (and its interactive mode) are useful for tidying up a branch before submitting a pull request.
http://book.git-scm.com/4_interactive_rebasing.html
Cheers,
Joshua
Signature · 2 lines
Joshua Lock
Intel Open Source Technology CentrePATCH 5/6 package_rpm/populate_sdk_rpm: Added rpm support for populate_sdk task.
In reply to Lianhao LuFrom: Lianhao Lu <[email protected]>
1. Added popluate_sdk_rpm.bbclass to add rpm support for populate_sdk task.
2. Modified the function package_update_index_rpm() & package_generate_rpm_conf in package_rpm.bbclass to generate 2 different configurations for sdk host and sdk target.
--- meta/classes/package_rpm.bbclass | 53 +++++++++++-- meta/classes/populate_sdk_rpm.bbclass | 138 +++++++++++++++++++++++++++++++++ 2 files changed, 183 insertions(+), 8 deletions(-) create mode 100644 meta/classes/populate_sdk_rpm.bbclass
meta/classes/package_rpm.bbclass +45 -8
@@ -15,6 +15,8 @@ python package_rpm_install () { bb.fatal("package_rpm_install not implemented!") } +RPMCONF_TARGET_BASE = "${DEPLOY_DIR_RPM}/solvedb" +RPMCONF_HOST_BASE = "${DEPLOY_DIR_RPM}/solvedb-sdk" # # Update the Packages depsolver db in ${DEPLOY_DIR_RPM} #
@@ -26,15 +28,20 @@ package_update_index_rpm () { fi packagedirs="" + packagedirs_sdk="" for arch in $rpmarchs ; do sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` + extension="-nativesdk" + if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then + extension="" + fi packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/$arch" - #packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/$sdkarch-nativesdk" + packagedirs_sdk="$packagedirs_sdk ${DEPLOY_DIR_RPM}/$sdkarch$extension" done #packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/${SDK_ARCH}-${TARGET_ARCH}-canadian" - cat /dev/null > ${DEPLOY_DIR_RPM}/solvedb.conf + cat /dev/null > ${RPMCONF_TARGET_BASE}.conf for pkgdir in $packagedirs; do if [ -e $pkgdir/ ]; then echo "Generating solve db for $pkgdir..."
@@ -49,7 +56,26 @@ package_update_index_rpm () { -D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" \ -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" \ $pkgdir/solvedb/manifest - echo $pkgdir/solvedb >> ${DEPLOY_DIR_RPM}/solvedb.conf + echo $pkgdir/solvedb >> ${RPMCONF_TARGET_BASE}.conf + fi + done + + cat /dev/null > ${RPMCONF_HOST_BASE}.conf + for pkgdir in $packagedirs_sdk; do + if [ -e $pkgdir/ ]; then + echo "Generating solve db for $pkgdir..." + rm -rf $pkgdir/solvedb + mkdir -p $pkgdir/solvedb + echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest + find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest + ${RPM} -i --replacepkgs --replacefiles --oldpackage \ + -D "_dbpath $pkgdir/solvedb" --justdb \ + --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \ + --ignoresize --nosignature --nodigest \ + -D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" \ + -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" \ + $pkgdir/solvedb/manifest + echo $pkgdir/solvedb >> ${RPMCONF_HOST_BASE}.conf fi done }
@@ -59,16 +85,27 @@ package_update_index_rpm () { # generated depsolver db's... # package_generate_rpm_conf () { - printf "_solve_dbpath " > ${DEPLOY_DIR_RPM}/solvedb.macro + printf "_solve_dbpath " > ${RPMCONF_TARGET_BASE}.macro + colon=false + for each in `cat ${RPMCONF_TARGET_BASE}.conf` ; do + if [ "$colon" == true ]; then + printf ":" >> ${RPMCONF_TARGET_BASE}.macro + fi + printf "%s" $each >> ${RPMCONF_TARGET_BASE}.macro + colon=true + done + printf "\n" >> ${RPMCONF_TARGET_BASE}.macro + + printf "_solve_dbpath " > ${RPMCONF_HOST_BASE}.macro colon=false - for each in `cat ${DEPLOY_DIR_RPM}/solvedb.conf` ; do + for each in `cat ${RPMCONF_HOST_BASE}.conf` ; do if [ "$colon" == true ]; then - printf ":" >> ${DEPLOY_DIR_RPM}/solvedb.macro + printf ":" >> ${RPMCONF_HOST_BASE}.macro fi - printf "%s" $each >> ${DEPLOY_DIR_RPM}/solvedb.macro + printf "%s" $each >> ${RPMCONF_HOST_BASE}.macro colon=true done - printf "\n" >> ${DEPLOY_DIR_RPM}/solvedb.macro + printf "\n" >> ${RPMCONF_HOST_BASE}.macro } python write_specfile () {
meta/classes/populate_sdk_rpm.bbclass new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Re: [PATCH 5/6] package_rpm/populate_sdk_rpm: Added rpm support for populate_sdk task.
Quoted 119 lines · Lianhao Lu
From: Lianhao Lu <[email protected]>
1. Added popluate_sdk_rpm.bbclass to add rpm support for
populate_sdktask.2. Modified the function
package_update_index_rpm()&package_generate_rpm_confin package_rpm.bbclass to generate 2 different configurations for sdk host and sdk target.Signed-off-by Lianhao Lu <[email protected]>--- meta/classes/package_rpm.bbclass | 53 +++++++++++-- meta/classes/populate_sdk_rpm.bbclass | 138 +++++++++++++++++++++++++++++++++ 2 files changed, 183 insertions(+), 8 deletions(-) create mode 100644 meta/classes/populate_sdk_rpm.bbclassmeta/classes/package_rpm.bbclass +45
-8@@ -15,6 +15,8 @@ python package_rpm_install () { bb.fatal("package_rpm_install not implemented!") } +RPMCONF_TARGET_BASE = "${DEPLOY_DIR_RPM}/solvedb" +RPMCONF_HOST_BASE = "${DEPLOY_DIR_RPM}/solvedb-sdk" # # Update the Packages depsolver db in ${DEPLOY_DIR_RPM} #@@ -26,15 +28,20 @@ package_update_index_rpm () { fi packagedirs="" + packagedirs_sdk="" for arch in $rpmarchs ; do sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` + extension="-nativesdk" + if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then + extension="" + fi packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/$arch" - #packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/$sdkarch-nativesdk" + packagedirs_sdk="$packagedirs_sdk ${DEPLOY_DIR_RPM}/$sdkarch$extension" done #packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/${SDK_ARCH}-${TARGET_ARCH}-canadian" - cat /dev/null > ${DEPLOY_DIR_RPM}/solvedb.conf + cat /dev/null > ${RPMCONF_TARGET_BASE}.conf for pkgdir in $packagedirs; do if [ -e $pkgdir/ ]; then echo "Generating solve db for $pkgdir..."@@ -49,7 +56,26 @@ package_update_index_rpm () { -D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" \ -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" \ $pkgdir/solvedb/manifest - echo $pkgdir/solvedb >> ${DEPLOY_DIR_RPM}/solvedb.conf + echo $pkgdir/solvedb >> ${RPMCONF_TARGET_BASE}.conf + fi + done + + cat /dev/null > ${RPMCONF_HOST_BASE}.conf + for pkgdir in $packagedirs_sdk; do + if [ -e $pkgdir/ ]; then + echo "Generating solve db for $pkgdir..." + rm -rf $pkgdir/solvedb + mkdir -p $pkgdir/solvedb + echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest + find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest + ${RPM} -i --replacepkgs --replacefiles --oldpackage \ + -D "_dbpath $pkgdir/solvedb" --justdb \ + --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \ + --ignoresize --nosignature --nodigest \ + -D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" \ + -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" \ + $pkgdir/solvedb/manifest + echo $pkgdir/solvedb >> ${RPMCONF_HOST_BASE}.conf fi done }@@ -59,16 +85,27 @@ package_update_index_rpm () { # generated depsolver db's... # package_generate_rpm_conf () { - printf "_solve_dbpath " > ${DEPLOY_DIR_RPM}/solvedb.macro + printf "_solve_dbpath " > ${RPMCONF_TARGET_BASE}.macro + colon=false + for each in `cat ${RPMCONF_TARGET_BASE}.conf` ; do + if [ "$colon" == true ]; then + printf ":" >> ${RPMCONF_TARGET_BASE}.macro + fi + printf "%s" $each >> ${RPMCONF_TARGET_BASE}.macro + colon=true + done + printf "\n" >> ${RPMCONF_TARGET_BASE}.macro + + printf "_solve_dbpath " > ${RPMCONF_HOST_BASE}.macro colon=false - for each in `cat ${DEPLOY_DIR_RPM}/solvedb.conf` ; do + for each in `cat ${RPMCONF_HOST_BASE}.conf` ; do if [ "$colon" == true ]; then - printf ":" >> ${DEPLOY_DIR_RPM}/solvedb.macro + printf ":" >> ${RPMCONF_HOST_BASE}.macro fi - printf "%s" $each >> ${DEPLOY_DIR_RPM}/solvedb.macro + printf "%s" $each >> ${RPMCONF_HOST_BASE}.macro colon=true done - printf "\n" >> ${DEPLOY_DIR_RPM}/solvedb.macro + printf "\n" >> ${RPMCONF_HOST_BASE}.macro } python write_specfile () {meta/classes/populate_sdk_rpm.bbclass new file +0
-0
meta/classes/populate_sdk_rpm.bbclass line 4
Quoted 4 lines
meta/classes/populate_sdk_rpm.bbclass new file +4
-0@@ -0,0 +1,138 @@ +do_populate_sdk[depends] += "rpm-native:do_populate_sysroot" +do_populate_sdk[recrdeptask] += "do_package_write_rpm" + +rpmlibdir = "/var/lib/rpm"
Bonus points if you change this for a layout variable:
${localstatedir}/lib/rpm ?
Quoted 26 lines
meta/classes/populate_sdk_rpm.bbclass new file +26
-0+RPMOPTS="--dbpath ${rpmlibdir} --define='_openall_before_chroot 1'" +RPM="rpm ${RPMOPTS}" + +# Resolve package names to filepaths +resolve_package() { + pkg="$1" + conffile="$2" + pkg_name="" + for solve in `cat ${conffile}`; do + pkg_name=$(${RPM} -D "_dbpath $solve" -D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" -q --yaml $pkg | grep -i 'Packageorigin' | cut -d : -f 2) + if [ -n "$pkg_name" ]; then + break; + fi + done + echo $pkg_name +} + +# populate_sdk_rpm_internal <rootfs> <platform> <confbase> <packages_to_install> +populate_sdk_rpm_internal() { + + target_rootfs=$1 + shift + platform=$1 + shift + confbase=$1 + shift
meta/classes/populate_sdk_rpm.bbclass line 40
Quoted 10 lines
meta/classes/populate_sdk_rpm.bbclass new file +10
-0+ package_to_install=$@ + + # Setup base system configuration + mkdir -p ${target_rootfs}/etc/rpm/ + echo "${platform}" >${target_rootfs}/etc/rpm/platform + + # Tell RPM that the "/" directory exist and is available + mkdir -p ${target_rootfs}/etc/rpm/sysinfo + echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames + echo "/bin/sh" >${target_rootfs}/etc/rpm/sysinfo/Providename
${sysconfdir} in here?
Quoted 72 lines
meta/classes/populate_sdk_rpm.bbclass new file +72
-0+ + # Setup manifest of packages to install... + mkdir -p ${target_rootfs}/install + echo "# Install manifest" > ${target_rootfs}/install/install.manifest + + if [ ! -z "${package_to_install}" ]; then + for pkg in ${package_to_install} ; do + echo "Processing $pkg..." + pkg_name=$(resolve_package $pkg ${confbase}.conf) + if [ -z "$pkg_name" ]; then + echo "Unable to find package $pkg!" + exit 1 + fi + echo $pkg_name >> ${target_rootfs}/install/install.manifest + done + fi + + # Generate an install solution by doing a --justdb install, then recreate it with + # an actual package install! + set -e + ${RPM} -D "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \ + -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \ + -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" \ + -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \ + ${target_rootfs}/install/install.manifest + + # Now that we have a solution, pull out a list of what to install... + echo "Manifest: ${target_rootfs}/install/install-target.manifest" + ${RPM} -D "_dbpath ${target_rootfs}/install" \ + -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" -qa --yaml \ + | grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_solution.manifest + + # Attempt install + ${RPM} --root ${target_rootfs} \ + -D "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \ + -D "_dbpath ${rpmlibdir}" \ + --noscripts --notriggers --noparentdirs --nolinktos \ + -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \ + -Uhv ${target_rootfs}/install/install_solution.manifest + set +e + + # remove lock files + rm -f ${target_rootfs}/__db.* + + # Move manifests into the directory with the logs + mv ${target_rootfs}/install/*.manifest ${T}/ + + # Remove all remaining resolver files + rm -rf ${target_rootfs}/install +} + +fakeroot populate_sdk_rpm () { + + package_update_index_rpm + package_generate_rpm_conf + + #install target + populate_sdk_rpm_internal ${SDK_OUTPUT}/${SDKTARGETSYSROOT} \ + ${TARGET_ARCH}-linux \ + ${RPMCONF_TARGET_BASE} \ + ${TOOLCHAIN_TARGET_TASK} + #install host + populate_sdk_rpm_internal ${SDK_OUTPUT} \ + "${SDK_ARCH}-nativesdk-linux" \ + ${RPMCONF_HOST_BASE} \ + ${TOOLCHAIN_HOST_TASK} + + # move host RPM library data + install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm + mv ${SDK_OUTPUT}${rpmlibdir}/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm/ + rm -Rf ${SDK_OUTPUT}/var +
meta/classes/populate_sdk_rpm.bbclass line 122
Quoted 10 lines
meta/classes/populate_sdk_rpm.bbclass new file +10
-0+ install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} + mv ${SDK_OUTPUT}/etc/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ + rm -rf ${SDK_OUTPUT}/etc + + populate_sdk_log_check +} + +populate_sdk_rpm_log_check() { + + lf_path="$1"
Inconsistent indentation here.
Quoted 6 lines
meta/classes/populate_sdk_rpm.bbclass new file +6
-0+ + lf_txt="`cat $lf_path`" + for keyword_die in "Cannot find package" "exit 1" ERR Fail + do + if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 + then
meta/classes/populate_sdk_rpm.bbclass line 138
Quoted 10 lines
meta/classes/populate_sdk_rpm.bbclass new file +10
-0+ echo "log_check: There were error messages in the logfile" + echo -e "log_check: Matched keyword: [$keyword_die]\n" + echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" + echo "" + do_exit=1 + fi + done + test "$do_exit" = 1 && exit 1 + true +}
Cheers,
Joshua
Signature · 2 lines
Joshua Lock
Intel Open Source Technology CentrePATCH 6/6 meta_toolchain/populate_sdk: Made task populate_sdk more generic.
In reply to Lianhao LuFrom: Lianhao Lu <[email protected]>
Make the task populate_sdk more generic to support installing from all ipk, rpm, and deb package format.
Also remove the .la files fixing in task populate_sdk code because the libtool 2.4 now supports sysroot.
--- meta/classes/populate_sdk.bbclass | 88 +++++++++++++++++++++++++ meta/classes/populate_sdk_rpm.bbclass | 6 +- meta/recipes-core/meta/meta-toolchain.bb | 103 +----------------------------- 3 files changed, 94 insertions(+), 103 deletions(-) create mode 100644 meta/classes/populate_sdk.bbclass
meta/classes/populate_sdk.bbclass new file +88 -0
@@ -0,0 +1,88 @@ +inherit meta toolchain-scripts +inherit populate_sdk_${IMAGE_PKGTYPE} + +SDK_DIR = "${WORKDIR}/sdk" +SDK_OUTPUT = "${SDK_DIR}/image" +SDK_DEPLOY = "${TMPDIR}/deploy/sdk" + +SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}" + +TOOLCHAIN_HOST_TASK ?= "task-sdk-host task-cross-canadian-${TRANSLATED_TARGET_ARCH}" +TOOLCHAIN_TARGET_TASK ?= "task-poky-standalone-sdk-target task-poky-standalone-sdk-target-dbg" +TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}" + +RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" +DEPENDS = "virtual/fakeroot-native sed-native" + +PID = "${@os.getpid()}" + +EXCLUDE_FROM_WORLD = "1" + +fakeroot do_populate_sdk() { + rm -rf ${SDK_OUTPUT} + mkdir -p ${SDK_OUTPUT} + + populate_sdk_${IMAGE_PKGTYPE} + + # Don't ship any libGL in the SDK + rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/libGL* + + # Can copy pstage files here + # target_pkgs=`cat ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/var/lib/opkg/status | grep Package: | cut -f 2 -d ' '` + + # Fix or remove broken .la files + # no longer needed since libtool now support sysroot + #for i in `find ${SDK_OUTPUT}/${SDKTARGETSYSROOT} -name \*.la`; do + # sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1${SDKTARGETSYSROOT}${base_libdir},g" \ + # -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${SDKTARGETSYSROOT}${libdir},g" \ + # -e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1${SDKTARGETSYSROOT}${base_libdir},g" \ + # -e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1${SDKTARGETSYSROOT}${libdir},g" \ + # -e 's/^installed=yes$/installed=no/' $i + #done + #rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la + rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la + + # Link the ld.so.cache file into the hosts filesystem + ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache + + # Setup site file for external use + siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS} + touch $siteconfig + for sitefile in ${CONFIG_SITE} ; do + cat $sitefile >> $siteconfig + done + + toolchain_create_sdk_env_script + + # Add version information + versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} + touch $versionfile + echo 'Distro: ${DISTRO}' >> $versionfile + echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile + echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile + echo 'Timestamp: ${DATETIME}' >> $versionfile + + # Package it up + mkdir -p ${SDK_DEPLOY} + cd ${SDK_OUTPUT} + tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . +} + +populate_sdk_log_check() { + + lf_path="${WORKDIR}/temp/log.do_populate_sdk.${PID}" + + echo "log_check: Using $lf_path as logfile" + + if test -e "$lf_path" + then + populate_sdk_${IMAGE_PKGTYPE}_log_check $lf_path + else + echo "Cannot find logfile [$lf_path]" + fi + echo "Logfile is clean" +} + +do_populate_sdk[nostamp] = "1" +do_populate_sdk[recrdeptask] = "do_package_write" +addtask populate_sdk before do_build after do_install
meta/classes/populate_sdk_rpm.bbclass +3 -3
@@ -29,7 +29,7 @@ populate_sdk_rpm_internal() { confbase=$1 shift package_to_install=$@ - + # Setup base system configuration mkdir -p ${target_rootfs}/etc/rpm/ echo "${platform}" >${target_rootfs}/etc/rpm/platform
@@ -109,12 +109,12 @@ fakeroot populate_sdk_rpm () { install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm mv ${SDK_OUTPUT}${rpmlibdir}/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm/ rm -Rf ${SDK_OUTPUT}/var - + install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} mv ${SDK_OUTPUT}/etc/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ rm -rf ${SDK_OUTPUT}/etc - populate_sdk_log_check + populate_sdk_log_check } populate_sdk_rpm_log_check() {
meta/recipes-core/meta/meta-toolchain.bb +3 -100
109 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Re: [PATCH 6/6] meta_toolchain/populate_sdk: Made task populate_sdk more generic.
Quoted 7 lines · Lianhao Lu
From: Lianhao Lu <[email protected]>
Make the task
populate_sdkmore generic to support installing from all ipk, rpm, and deb package format.Also remove the .la files fixing in task
populate_sdkcode because the libtool 2.4 now supports sysroot.
Could you do this as a separate commit and actually remove the lines of code, rather than commenting them out?
Quoted 119 lines
Signed-off-by Lianhao Lu <[email protected]>--- meta/classes/populate_sdk.bbclass | 88 +++++++++++++++++++++++++ meta/classes/populate_sdk_rpm.bbclass | 6 +- meta/recipes-core/meta/meta-toolchain.bb | 103 +----------------------------- 3 files changed, 94 insertions(+), 103 deletions(-) create mode 100644 meta/classes/populate_sdk.bbclassmeta/classes/populate_sdk.bbclass new file +88
-0@@ -0,0 +1,88 @@ +inherit meta toolchain-scripts +inherit populate_sdk_${IMAGE_PKGTYPE} + +SDK_DIR = "${WORKDIR}/sdk" +SDK_OUTPUT = "${SDK_DIR}/image" +SDK_DEPLOY = "${TMPDIR}/deploy/sdk" + +SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}" + +TOOLCHAIN_HOST_TASK ?= "task-sdk-host task-cross-canadian-${TRANSLATED_TARGET_ARCH}" +TOOLCHAIN_TARGET_TASK ?= "task-poky-standalone-sdk-target task-poky-standalone-sdk-target-dbg" +TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}" + +RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" +DEPENDS = "virtual/fakeroot-native sed-native" + +PID = "${@os.getpid()}" + +EXCLUDE_FROM_WORLD = "1" + +fakeroot do_populate_sdk() { + rm -rf ${SDK_OUTPUT} + mkdir -p ${SDK_OUTPUT} + + populate_sdk_${IMAGE_PKGTYPE} + + # Don't ship any libGL in the SDK + rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/libGL* + + # Can copy pstage files here + # target_pkgs=`cat ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/var/lib/opkg/status | grep Package: | cut -f 2 -d ' '` + + # Fix or remove broken .la files + # no longer needed since libtool now support sysroot + #for i in `find ${SDK_OUTPUT}/${SDKTARGETSYSROOT} -name \*.la`; do + # sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1${SDKTARGETSYSROOT}${base_libdir},g" \ + # -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${SDKTARGETSYSROOT}${libdir},g" \ + # -e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1${SDKTARGETSYSROOT}${base_libdir},g" \ + # -e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1${SDKTARGETSYSROOT}${libdir},g" \ + # -e 's/^installed=yes$/installed=no/' $i + #done + #rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la + rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la + + # Link the ld.so.cache file into the hosts filesystem + ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache + + # Setup site file for external use + siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS} + touch $siteconfig + for sitefile in ${CONFIG_SITE} ; do + cat $sitefile >> $siteconfig + done + + toolchain_create_sdk_env_script + + # Add version information + versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} + touch $versionfile + echo 'Distro: ${DISTRO}' >> $versionfile + echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile + echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile + echo 'Timestamp: ${DATETIME}' >> $versionfile + + # Package it up + mkdir -p ${SDK_DEPLOY} + cd ${SDK_OUTPUT} + tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . +} + +populate_sdk_log_check() { + + lf_path="${WORKDIR}/temp/log.do_populate_sdk.${PID}" + + echo "log_check: Using $lf_path as logfile" + + if test -e "$lf_path" + then + populate_sdk_${IMAGE_PKGTYPE}_log_check $lf_path + else + echo "Cannot find logfile [$lf_path]" + fi + echo "Logfile is clean" +} + +do_populate_sdk[nostamp] = "1" +do_populate_sdk[recrdeptask] = "do_package_write" +addtask populate_sdk before do_build after do_installmeta/classes/populate_sdk_rpm.bbclass +1
-1@@ -29,7 +29,7 @@ populate_sdk_rpm_internal() { confbase=$1 shift package_to_install=$@ - + # Setup base system configuration mkdir -p ${target_rootfs}/etc/rpm/ echo "${platform}" >${target_rootfs}/etc/rpm/platform@@ -109,12 +109,12 @@ fakeroot populate_sdk_rpm () { install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm mv ${SDK_OUTPUT}${rpmlibdir}/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/rpm/
meta/classes/populate_sdk_rpm.bbclass fakeroot populate_sdk_rpm () { · line 118
Quoted 10 lines
meta/classes/populate_sdk_rpm.bbclass +2
-2rm -Rf ${SDK_OUTPUT}/var - + install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} mv ${SDK_OUTPUT}/etc/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ rm -rf ${SDK_OUTPUT}/etc - populate_sdk_log_check + populate_sdk_log_check }
Whitespace changes here can be squashed into the original patch adding this file.
Quoted 106 lines
meta/classes/populate_sdk_rpm.bbclass +0
-0populate_sdk_rpm_log_check() {meta/recipes-core/meta/meta-toolchain.bb +2
-91@@ -1,106 +1,9 @@ DESCRIPTION = "Meta package for building a installable toolchain" LICENSE = "MIT" -DEPENDS = "opkg-native opkg-utils-native virtual/fakeroot-native sed-native" + +PR = "r1" LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ file://${POKYBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -inherit meta toolchain-scripts - -SDK_DIR = "${WORKDIR}/sdk" -SDK_OUTPUT = "${SDK_DIR}/image" -SDK_DEPLOY = "${TMPDIR}/deploy/sdk" - -SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}" - -IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT} --force-overwrite" -IPKG_TARGET = "opkg-cl -f ${IPKGCONF_TARGET} -o ${SDK_OUTPUT}/${SDKTARGETSYSROOT} --force-overwrite" - -TOOLCHAIN_HOST_TASK ?= "task-sdk-host task-cross-canadian-${TRANSLATED_TARGET_ARCH}" -TOOLCHAIN_TARGET_TASK ?= "task-poky-standalone-sdk-target task-poky-standalone-sdk-target-dbg" -TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}" - -RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" - -EXCLUDE_FROM_WORLD = "1" - -do_populate_sdk() { - rm -rf ${SDK_OUTPUT} - mkdir -p ${SDK_OUTPUT} - mkdir -p ${SDK_OUTPUT}${localstatedir}/lib/opkg/ - mkdir -p ${SDK_OUTPUT}/${SDKTARGETSYSROOT}${localstatedir}/lib/opkg/ - - rm -f ${IPKGCONF_TARGET} - touch ${IPKGCONF_TARGET} - rm -f ${IPKGCONF_SDK} - touch ${IPKGCONF_SDK} - - package_update_index_ipk - package_generate_ipkg_conf - - for arch in ${PACKAGE_ARCHS}; do - revipkgarchs="$arch $revipkgarchs" - done - - ${IPKG_HOST} update - ${IPKG_HOST} install ${TOOLCHAIN_HOST_TASK} - - ${IPKG_TARGET} update - ${IPKG_TARGET} install ${TOOLCHAIN_TARGET_TASK} - - install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg - mv ${SDK_OUTPUT}/var/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg/ - rm -Rf ${SDK_OUTPUT}/var - - # Don't ship any libGL in the SDK - rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/libGL* - - install -d ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir} - install -m 0644 ${IPKGCONF_TARGET} ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir}/ - - install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} - install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ - - # Can copy pstage files here - # target_pkgs=`cat ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/var/lib/opkg/status | grep Package: | cut -f 2 -d ' '` - - # Fix or remove broken .la files - for i in `find ${SDK_OUTPUT}/${SDKTARGETSYSROOT} -name \*.la`; do - sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1${SDKTARGETSYSROOT}${base_libdir},g" \ - -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${SDKTARGETSYSROOT}${libdir},g" \ - -e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1${SDKTARGETSYSROOT}${base_libdir},g" \ - -e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1${SDKTARGETSYSROOT}${libdir},g" \ - -e 's/^installed=yes$/installed=no/' $i - done - #rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la - rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la - - # Link the ld.so.cache file into the hosts filesystem - ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache - - # Setup site file for external use - siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS} - touch $siteconfig - for sitefile in ${CONFIG_SITE} ; do - cat $sitefile >> $siteconfig - done - - toolchain_create_sdk_env_script - - # Add version information - versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} - touch $versionfile - echo 'Distro: ${DISTRO}' >> $versionfile - echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile - echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile - echo 'Timestamp: ${DATETIME}' >> $versionfile -
meta/recipes-core/meta/meta-toolchain.bb line 9
Quoted 10 lines
meta/recipes-core/meta/meta-toolchain.bb +1
-9- # Package it up - mkdir -p ${SDK_DEPLOY} - cd ${SDK_OUTPUT} - tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . -} - -do_populate_sdk[nostamp] = "1" -do_populate_sdk[recrdeptask] = "do_package_write" -addtask populate_sdk before do_build after do_install +inherit populate_sdk
Cheers,
Joshua
Signature · 2 lines
Joshua Lock
Intel Open Source Technology CentreHi Lianhao,
Quoted 19 lines · Lianhao Lu
From: Lianhao Lu <[email protected]>
The purpose of this series of patches is to add rpm support in meta-toolchain creation, and also to fix bug #227.
It makes the task
populate_sdkin meta/recipes-core/meta/meta-toolchain.bb more generic to support installing packages from ipk, rpm, and deb files in creating meta-toolchain tarball, and move thepopulate_sdktask out of meta-toolchain.bb recipe into a bbclass.It added populate_sdk_xxx.bbclass for different package file format.
The meta-toolchain installing process involes 2 set of packages, one is the host sdk set which contains packages of applications(e.g. cross-canadian compilers, qemu, etc.) and relevant run-time libraries, the other is the target sdk set which contains packages of target arch's libraries and header files to create a target rootfs for cross compiling purpose.So the patches also modifes and/or adds functions in package_deb.bbclass & package_rpm.bbclass to update the package index and to generate different installing configuration files for the tow different sets.
Quoted 2 lines
It also fixed a bug in cross-canadian.bbclass to enable the package_deb.bbclass generate correct deb package files for cross-canadian recipies.
Its great to see this but I think we need to restructure the code a little more aggressively and create some general functions to complete this properly.
What I mean is that both rootfs_ipk and populate_sdk_ipk share code, rootfs_deb and populate_sdk_deb share code and likewise for rpm.
What we need is a generic function where we specify where the target directory is and a list of packages we want to install along with some architecture information and it then goes and does it. Those functions would like in package_xxx.bbclass. We should do similar things well in one place rather than in two with slightly different implementations.
Do you agree?
Cheers,
Richard
Hi Richard,
Richard Purdie wrote on 2011-01-28:
Quoted 39 lines
Hi Lianhao,
Quoted 9 lines · Lianhao Lu
From: Lianhao Lu <[email protected]>
The purpose of this series of patches is to add rpm support in meta-toolchain creation, and also to fix bug #227.
It makes the task
populate_sdkin meta/recipes-core/meta/meta-toolchain.bb more generic to support installing packages from ipk, rpm, and deb files in creating meta-toolchaintarball, and move the
populate_sdktask out of meta-toolchain.bb recipe into a bbclass.Quoted 11 lines
It added populate_sdk_xxx.bbclass for different package file format.
The meta-toolchain installing process involes 2 set of packages, one is the host sdk set which contains packages of applications(e.g. cross-canadian compilers, qemu, etc.) and relevant run-time libraries, the other is the target sdk set which contains packages of target arch's libraries and header files to create a target rootfs for cross compiling purpose.So the patches also modifes and/or adds functions in package_deb.bbclass & package_rpm.bbclass to update the package index
and to generate different installing configuration files for the tow different sets.
Quoted 4 lines
It also fixed a bug in cross-canadian.bbclass to enable the package_deb.bbclass generate correct deb package files for cross-canadian
recipies.
Its great to see this but I think we need to restructure the code a little more aggressively and create some general functions to complete this properly.
What I mean is that both
rootfs_ipkandpopulate_sdk_ipkshare code,rootfs_debandpopulate_sdk_debshare code and likewise for rpm.
Quoted 8 lines
What we need is a generic function where we specify where the target directory is and a list of packages we want to install along with some architecture information and it then goes and does it. Those functions would like in package_xxx.bbclass. We should do similar things well in one place rather than in two with slightly different implementations.
Do you agree?
Ok, I'll merge the common part between rootfs_XXX and populate_sdk_XXX into package_XXX.
Best Regards,
Lianhao