* [PATCH 1/5] cross-canadian.bbclass: Correct deb package arch.
2011-01-28 10:01 [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Lianhao Lu
@ 2011-01-28 10:01 ` Lianhao Lu
2011-01-28 17:01 ` Richard Purdie
2011-01-28 10:01 ` [PATCH 4/5] classes/populate_sdk_xxx.bbclass: pkg format support for populate_sdk task Lianhao Lu
` (4 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Lianhao Lu @ 2011-01-28 10:01 UTC (permalink / raw)
To: poky
From: Lianhao Lu <lianhao.lu@intel.com>
Set DPKG_ARCH to make debian package to be generated with correct
architecture.
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
meta/classes/cross-canadian.bbclass | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index 993f831..1a045ba 100644
--- a/meta/classes/cross-canadian.bbclass
+++ b/meta/classes/cross-canadian.bbclass
@@ -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}"
--
1.7.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 1/5] cross-canadian.bbclass: Correct deb package arch.
2011-01-28 10:01 ` [PATCH 1/5] cross-canadian.bbclass: Correct deb package arch Lianhao Lu
@ 2011-01-28 17:01 ` Richard Purdie
0 siblings, 0 replies; 10+ messages in thread
From: Richard Purdie @ 2011-01-28 17:01 UTC (permalink / raw)
To: Lianhao Lu; +Cc: poky
On Fri, 2011-01-28 at 18:01 +0800, Lianhao Lu wrote:
> From: Lianhao Lu <lianhao.lu@intel.com>
>
> Set DPKG_ARCH to make debian package to be generated with correct
> architecture.
>
> Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
> ---
> meta/classes/cross-canadian.bbclass | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
> index 993f831..1a045ba 100644
> --- a/meta/classes/cross-canadian.bbclass
> +++ b/meta/classes/cross-canadian.bbclass
> @@ -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}"
Merged into master, thanks.
Richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/5] classes/populate_sdk_xxx.bbclass: pkg format support for populate_sdk task
2011-01-28 10:01 [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Lianhao Lu
2011-01-28 10:01 ` [PATCH 1/5] cross-canadian.bbclass: Correct deb package arch Lianhao Lu
@ 2011-01-28 10:01 ` Lianhao Lu
2011-01-28 10:01 ` [PATCH 2/5] apt-native: Added licence checksum Lianhao Lu
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Lianhao Lu @ 2011-01-28 10:01 UTC (permalink / raw)
To: poky
From: Lianhao Lu <lianhao.lu@intel.com>
This commit added various populate_sdk_xxx.bbclass to support the
populate_sdk task based on different package format(rpm, ipk, deb).
It is based on the commit c66b12f138b6e709f9b14cbff9b579634f15cc96.
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
meta/classes/populate_sdk_deb.bbclass | 60 +++++++++++++++++++++++++++++
meta/classes/populate_sdk_ipk.bbclass | 44 +++++++++++++++++++++
meta/classes/populate_sdk_rpm.bbclass | 67 +++++++++++++++++++++++++++++++++
3 files changed, 171 insertions(+), 0 deletions(-)
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
diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
new file mode 100644
index 0000000..d563c28
--- /dev/null
+++ b/meta/classes/populate_sdk_deb.bbclass
@@ -0,0 +1,60 @@
+do_populate_sdk[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot bzip2-native:do_populate_sysroot"
+do_populate_sdk[recrdeptask] += "do_package_write_deb"
+
+
+populate_sdk_post_deb () {
+
+ local target_rootfs=$1
+
+ cp -r ${STAGING_ETCDIR_NATIVE}/apt ${target_rootfs}/etc
+}
+
+fakeroot populate_sdk_deb () {
+
+ package_update_index_deb
+
+ export INSTALL_TASK_DEB="populate_sdk"
+ export INSTALL_PACKAGES_LINGUAS_DEB=""
+ export INSTALL_PACKAGES_ATTEMPTONLY_DEB=""
+
+ #install target
+ echo "Installing TARGET packages"
+ export INSTALL_ROOTFS_DEB="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
+ export INSTALL_BASEARCH_DEB="${DPKG_ARCH}"
+ export INSTALL_ARCHS_DEB="${PACKAGE_ARCHS}"
+ export INSTALL_PACKAGES_NORMAL_DEB="${TOOLCHAIN_TARGET_TASK}"
+
+ package_install_internal_deb
+ populate_sdk_post_deb ${INSTALL_ROOTFS_DEB}
+
+ populate_sdk_log_check populate_sdk
+
+ #install host
+ echo "Installing HOST packages"
+ export INSTALL_ROOTFS_DEB="${SDK_OUTPUT}"
+ export INSTALL_BASEARCH_DEB="${SDK_ARCH}"
+ export INSTALL_PACKAGES_NORMAL_DEB="${TOOLCHAIN_HOST_TASK}"
+ INSTALL_ARCHS_DEB=""
+ for arch in ${PACKAGE_ARCHS}; 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
+ if [ -e ${DEPLOY_DIR_DEB}/$sdkarch$extension ]; then
+ INSTALL_ARCHS_DEB="$INSTALL_ARCHS_DEB $sdkarch$extension"
+ fi
+ done
+ export INSTALL_ARCHS_DEB
+
+ package_install_internal_deb
+ populate_sdk_post_deb ${SDK_OUTPUT}/${SDKPATHNATIVE}
+
+ #move remainings
+ 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 populate_sdk
+}
+
diff --git a/meta/classes/populate_sdk_ipk.bbclass b/meta/classes/populate_sdk_ipk.bbclass
new file mode 100644
index 0000000..79259f8
--- /dev/null
+++ b/meta/classes/populate_sdk_ipk.bbclass
@@ -0,0 +1,44 @@
+do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
+do_populate_sdk[recrdeptask] += "do_package_write_ipk"
+
+fakeroot populate_sdk_ipk() {
+
+ rm -f ${IPKGCONF_TARGET}
+ touch ${IPKGCONF_TARGET}
+ rm -f ${IPKGCONF_SDK}
+ touch ${IPKGCONF_SDK}
+
+ package_update_index_ipk
+ package_generate_ipkg_conf
+
+ export INSTALL_PACKAGES_ATTEMPTONLY_IPK=""
+ export INSTALL_PACKAGES_LINGUAS_IPK=""
+ export INSTALL_TASK_IPK="populate_sdk"
+
+ #install target
+ export INSTALL_ROOTFS_IPK="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
+ export INSTALL_CONF_IPK="${IPKGCONF_TARGET}"
+ export INSTALL_PACKAGES_NORMAL_IPK="${TOOLCHAIN_TARGET_TASK}"
+
+ package_install_internal_ipk
+
+ #install host
+ export INSTALL_ROOTFS_IPK="${SDK_OUTPUT}"
+ export INSTALL_CONF_IPK="${IPKGCONF_SDK}"
+ export INSTALL_PACKAGES_NORMAL_IPK="${TOOLCHAIN_HOST_TASK}"
+
+ package_install_internal_ipk
+
+ #post clean up
+ 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}/
+
+ 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
+
+ populate_sdk_log_check populate_sdk
+}
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass
new file mode 100644
index 0000000..b7be2a2
--- /dev/null
+++ b/meta/classes/populate_sdk_rpm.bbclass
@@ -0,0 +1,67 @@
+do_populate_sdk[depends] += "rpm-native:do_populate_sysroot"
+do_populate_sdk[recrdeptask] += "do_package_write_rpm"
+
+rpmlibdir = "/var/lib/rpm"
+RPMOPTS="--dbpath ${rpmlibdir} --define='_openall_before_chroot 1'"
+RPM="rpm ${RPMOPTS}"
+
+
+populate_sdk_post_rpm () {
+
+ local target_rootfs=$1
+
+ # 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
+
+ export INSTALL_PACKAGES_ATTEMPTONLY_RPM=""
+ export INSTALL_PACKAGES_LINGUAS_RPM=""
+ export INSTALL_PROVIDENAME_RPM="/bin/sh"
+ export INSTALL_TASK_RPM="populate_sdk"
+
+
+ #install target
+ export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
+ export INSTALL_PALTFOM_RPM="${TARGET_ARCH}-linux"
+ export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}"
+ export INSTALL_PACKAGES_NORMAL_RPM="${TOOLCHAIN_TARGET_TASK}"
+
+ package_install_internal_rpm
+ populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM}
+
+ #install host
+ export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}"
+ export INSTALL_PALTFOM_RPM="${SDK_ARCH}-nativesdk-linux"
+ export INSTALL_CONFBASE_RPM="${RPMCONF_HOST_BASE}"
+ export INSTALL_PACKAGES_NORMAL_RPM="${TOOLCHAIN_HOST_TASK}"
+
+ package_install_internal_rpm
+ populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM}
+
+ # 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
+
+ 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
+
+ # Workaround so the parser knows we need the resolve_package function!
+ if false ; then
+ resolve_package_rpm foo ${RPMCONF_TARGET_BASE}.conf || true
+ fi
+}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 2/5] apt-native: Added licence checksum.
2011-01-28 10:01 [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Lianhao Lu
2011-01-28 10:01 ` [PATCH 1/5] cross-canadian.bbclass: Correct deb package arch Lianhao Lu
2011-01-28 10:01 ` [PATCH 4/5] classes/populate_sdk_xxx.bbclass: pkg format support for populate_sdk task Lianhao Lu
@ 2011-01-28 10:01 ` Lianhao Lu
2011-01-28 17:01 ` Richard Purdie
2011-01-28 10:01 ` [PATCH 3/5] image/rootfs_xx/package_xx.bbclass: prepare to add populate_sdk task Lianhao Lu
` (2 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Lianhao Lu @ 2011-01-28 10:01 UTC (permalink / raw)
To: poky
From: Lianhao Lu <lianhao.lu@intel.com>
Added licence checksum for apt-native.
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
meta/recipes-devtools/apt/apt-native_0.7.14.bb | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/meta/recipes-devtools/apt/apt-native_0.7.14.bb b/meta/recipes-devtools/apt/apt-native_0.7.14.bb
index f77f817..b1bd55b 100644
--- a/meta/recipes-devtools/apt/apt-native_0.7.14.bb
+++ b/meta/recipes-devtools/apt/apt-native_0.7.14.bb
@@ -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"
--
1.7.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 2/5] apt-native: Added licence checksum.
2011-01-28 10:01 ` [PATCH 2/5] apt-native: Added licence checksum Lianhao Lu
@ 2011-01-28 17:01 ` Richard Purdie
0 siblings, 0 replies; 10+ messages in thread
From: Richard Purdie @ 2011-01-28 17:01 UTC (permalink / raw)
To: Lianhao Lu; +Cc: poky
On Fri, 2011-01-28 at 18:01 +0800, Lianhao Lu wrote:
> From: Lianhao Lu <lianhao.lu@intel.com>
>
> Added licence checksum for apt-native.
>
> Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
> ---
> meta/recipes-devtools/apt/apt-native_0.7.14.bb | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-devtools/apt/apt-native_0.7.14.bb b/meta/recipes-devtools/apt/apt-native_0.7.14.bb
> index f77f817..b1bd55b 100644
> --- a/meta/recipes-devtools/apt/apt-native_0.7.14.bb
> +++ b/meta/recipes-devtools/apt/apt-native_0.7.14.bb
> @@ -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"
Merged into master, thanks.
Richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/5] image/rootfs_xx/package_xx.bbclass: prepare to add populate_sdk task.
2011-01-28 10:01 [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Lianhao Lu
` (2 preceding siblings ...)
2011-01-28 10:01 ` [PATCH 2/5] apt-native: Added licence checksum Lianhao Lu
@ 2011-01-28 10:01 ` Lianhao Lu
2011-01-28 10:01 ` [PATCH 5/5] meta-toolchain: pkg format independant " Lianhao Lu
2011-01-29 13:28 ` [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Richard Purdie
5 siblings, 0 replies; 10+ messages in thread
From: Lianhao Lu @ 2011-01-28 10:01 UTC (permalink / raw)
To: poky
From: Lianhao Lu <lianhao.lu@intel.com>
This commit is a preparation work to add a new task populate_sdk.
It moves those common code between both the rootfs task and the
populate_sdk task in the relevant package_xx bbclass.
Added the new function package_install_internal_xxx() for each kind of
package format we support(rpm, ipk, deb). This function installed a
bunch of packages using the into a specific root dir. All the
informatino needed for the installation process, i.e. root dir, packages
to be installed, architecture information is passed by various shell
environment variables. See the comment of different
package_install_internal_xxx() function for a descriptioin of those
shell environment variables.
For package_rpm.bbclass, this commit modified the
package_generate_rpm_conf() and package_update_index_rpm to generate
seperate configuration files and index for target architecture and
"-nativesdk" architecture.
For package_deb.bbclass, this commit added a new function
package_update_index_deb to generate index for debian package format.
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
meta/classes/image.bbclass | 5 +-
meta/classes/package_deb.bbclass | 145 +++++++++++++++++++++++
meta/classes/package_ipk.bbclass | 63 ++++++++++
meta/classes/package_rpm.bbclass | 243 ++++++++++++++++++++++++++++++++++++--
meta/classes/rootfs_deb.bbclass | 111 +++---------------
meta/classes/rootfs_ipk.bbclass | 45 ++------
meta/classes/rootfs_rpm.bbclass | 157 ++-----------------------
7 files changed, 479 insertions(+), 290 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 8e8d92b..14de3e1 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -155,7 +155,6 @@ insert_feed_uris () {
}
log_check() {
- set +x
for target in $*
do
lf_path="${WORKDIR}/temp/log.do_$target.${PID}"
@@ -164,14 +163,12 @@ log_check() {
if test -e "$lf_path"
then
- rootfs_${IMAGE_PKGTYPE}_log_check $target $lf_path
+ ${IMAGE_PKGTYPE}_log_check $target $lf_path
else
echo "Cannot find logfile [$lf_path]"
fi
echo "Logfile is clean"
done
-
- set -x
}
# set '*' as the rootpassword so the images
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 29dcc5c..52bd264 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -67,6 +67,151 @@ python do_package_deb_install () {
os.putenv('PATH', path)
}
+#
+# Update the Packages index files in ${DEPLOY_DIR_DEB}
+#
+package_update_index_deb () {
+
+ local 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
+}
+
+#
+# install a bunch of packages using apt
+# the following shell variables needs to be set before calling this func:
+# INSTALL_ROOTFS_DEB - install root dir
+# INSTALL_BASEARCH_DEB - install base architecutre
+# INSTALL_ARCHS_DEB - list of available archs
+# INSTALL_PACKAGES_NORMAL_DEB - packages to be installed
+# INSTALL_PACKAGES_ATTEMPTONLY_DEB - packages attemped to be installed only
+# INSTALL_PACKAGES_LINGUAS_DEB - additional packages for uclibc
+# INSTALL_TASK_DEB - task name
+
+package_install_internal_deb () {
+
+ local target_rootfs="${INSTALL_ROOTFS_DEB}"
+ local dpkg_arch="${INSTALL_BASEARCH_DEB}"
+ local archs="${INSTALL_ARCHS_DEB}"
+ local package_to_install="${INSTALL_PACKAGES_NORMAL_DEB}"
+ local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_DEB}"
+ local package_lingusa="${INSTALL_PACKAGES_LINGUAS_DEB}"
+ local task="${INSTALL_TASK_DEB}"
+
+ rm -f ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev
+ rm -f ${STAGING_ETCDIR_NATIVE}/apt/preferences
+
+ priority=1
+ for arch in $archs; do
+ 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"
+ echo "Pin-Priority: $(expr 800 + $priority)"
+ echo) >> ${STAGING_ETCDIR_NATIVE}/apt/preferences
+ priority=$(expr $priority + 5)
+ done
+
+ tac ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev > ${STAGING_ETCDIR_NATIVE}/apt/sources.list
+
+ cat "${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample" \
+ | sed -e "s#Architecture \".*\";#Architecture \"${dpkg_arch}\";#" \
+ | sed -e "s:#ROOTFS#:${target_rootfs}:g" \
+ > "${STAGING_ETCDIR_NATIVE}/apt/apt-${task}.conf"
+
+ export APT_CONFIG="${STAGING_ETCDIR_NATIVE}/apt/apt-${task}.conf"
+
+ mkdir -p ${target_rootfs}/var/dpkg/info
+ mkdir -p ${target_rootfs}/var/dpkg/updates
+
+ > ${target_rootfs}/var/dpkg/status
+ > ${target_rootfs}/var/dpkg/available
+
+ apt-get update
+
+ # Uclibc builds don't provide this stuff..
+ if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
+ if [ ! -z "${package_lingusa}" ]; then
+ apt-get install glibc-localedata-i18n --force-yes --allow-unauthenticated
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ for i in ${package_lingusa}; do
+ apt-get install $i --force-yes --allow-unauthenticated
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ done
+ fi
+ fi
+
+ # normal install
+ for i in ${package_to_install}; do
+ apt-get install $i --force-yes --allow-unauthenticated
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ done
+
+ rm -f ${WORKDIR}/temp/log.do_${task}-attemptonly.${PID}
+ if [ ! -z "${package_attemptonly}" ]; then
+ for i in ${package_attemptonly}; do
+ apt-get install $i --force-yes --allow-unauthenticated >> ${WORKDIR}/temp/log.do_${task}-attemptonly.${PID} || true
+ done
+ fi
+
+ find ${target_rootfs} -name \*.dpkg-new | for i in `cat`; do
+ mv $i `echo $i | sed -e's,\.dpkg-new$,,'`
+ done
+
+ # Mark all packages installed
+ sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" ${target_rootfs}/var/dpkg/status
+}
+
+deb_log_check() {
+ target="$1"
+ lf_path="$2"
+
+ lf_txt="`cat $lf_path`"
+ for keyword_die in "E:"
+ 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
+}
+
python do_package_deb () {
import re, copy
import textwrap
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index fdf3262..3c2472b 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -62,6 +62,69 @@ python package_ipk_install () {
}
#
+# install a bunch of packages using opkg
+# the following shell variables needs to be set before calling this func:
+# INSTALL_ROOTFS_IPK - install root dir
+# INSTALL_CONF_IPK - configuration file
+# INSTALL_PACKAGES_NORMAL_IPK - packages to be installed
+# INSTALL_PACKAGES_ATTEMPTONLY_IPK - packages attemped to be installed only
+# INSTALL_PACKAGES_LINGUAS_IPK - additional packages for uclibc
+# INSTALL_TASK_IPK - task name
+
+package_install_internal_ipk() {
+
+ local target_rootfs="${INSTALL_ROOTFS_IPK}"
+ local conffile="${INSTALL_CONF_IPK}"
+ local package_to_install="${INSTALL_PACKAGES_NORMAL_IPK}"
+ local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_IPK}"
+ local package_lingusa="${INSTALL_PACKAGES_LINGUAS_IPK}"
+ local task="${INSTALL_TASK_IPK}"
+
+ mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/
+
+ local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite"
+
+ opkg-cl ${ipkg_args} update
+
+ # Uclibc builds don't provide this stuff...
+ if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
+ if [ ! -z "${package_lingusa}" ]; then
+ for i in ${package_lingusa}; do
+ opkg-cl ${ipkg_args} install $i
+ done
+ fi
+ fi
+
+ if [ ! -z "${package_to_install}" ]; then
+ opkg-cl ${ipkg_args} install ${package_to_install}
+ fi
+
+ if [ ! -z "${package_attemptonly}" ]; then
+ opkg-cl ${ipkg_args} install ${package_attemptonly} > "${WORKDIR}/temp/log.do_${task}_attemptonly.${PID}" || true
+ fi
+}
+
+ipk_log_check() {
+ target="$1"
+ lf_path="$2"
+
+ 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
+}
+
+#
# Update the Packages index files in ${DEPLOY_DIR_IPK}
#
package_update_index_ipk () {
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index fbe0626..a8d1ce4 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -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,18 @@ 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 +54,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 +83,215 @@ 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
+}
+
+rpm_log_check() {
+ target="$1"
+ lf_path="$2"
+
+ 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
+ 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
+}
+
+
+#
+# Resolve package names to filepaths
+# resolve_pacakge <pkgname> <solvdb conffile>
+#
+resolve_package_rpm () {
+ local pkg="$1"
+ local conffile="$2"
+ local 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
+}
+
+#
+# install a bunch of packages using rpm
+# the following shell variables needs to be set before calling this func:
+# INSTALL_ROOTFS_RPM - install root dir
+# INSTALL_PALTFOM_RPM - platform file content
+# INSTALL_CONFBASE_RPM - configuration file base name
+# INSTALL_PACKAGES_NORMAL_RPM - packages to be installed
+# INSTALL_PACKAGES_ATTEMPTONLY_RPM - packages attemped to be installed only
+# INSTALL_PACKAGES_LINGUAS_RPM - additional packages for uclibc
+# INSTALL_PROVIDENAME_RPM - content for provide name
+# INSTALL_TASK_RPM - task name
+
+package_install_internal_rpm() {
+
+ local target_rootfs="${INSTALL_ROOTFS_RPM}"
+ local platform="${INSTALL_PALTFOM_RPM}"
+ local confbase="${INSTALL_CONFBASE_RPM}"
+ local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM}"
+ local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}"
+ local package_lingusa="${INSTALL_PACKAGES_LINGUAS_RPM}"
+ local providename="${INSTALL_PROVIDENAME_RPM}"
+ local task="${INSTALL_TASK_RPM}"
+
+ # 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
+ if [ ! -z $providename ]; then
+ >>${target_rootfs}/etc/rpm/sysinfo/Providename
+ for provide in $providename ; do
+ echo $provide >> ${target_rootfs}/etc/rpm/sysinfo/Providename
+ done
+ fi
+
+ # Setup manifest of packages to install...
+ mkdir -p ${target_rootfs}/install
+ echo "# Install manifest" > ${target_rootfs}/install/install.manifest
+
+ # Uclibc builds don't provide this stuff...
+ if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
+ if [ ! -z "${package_lingusa}" ]; then
+ for pkg in ${package_lingusa}; do
+ echo "Processing $pkg..."
+ pkg_name=$(resolve_package_rpm $pkg ${confbase}.conf)
+ if [ -z "$pkg_name" ]; then
+ echo "Unable to find package $pkg!"
+ exit 1
+ fi
+ echo $pkg_name >> ${IMAGE_ROOTFS}/install/install.manifest
+ done
+ fi
+ fi
+
+ if [ ! -z "${package_to_install}" ]; then
+ for pkg in ${package_to_install} ; do
+ echo "Processing $pkg..."
+ pkg_name=$(resolve_package_rpm $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!
+ ${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
+
+ if [ ! -z "${package_attemptonly}" ]; then
+ echo "Adding attempt only packages..."
+ for pkg in ${package_attemptonly} ; do
+ echo "Processing $pkg..."
+ pkg_name=$(resolve_package_rpm $pkg ${confbase}.conf)
+ if [ -z "$pkg_name" ]; then
+ echo "Unable to find package $pkg!"
+ exit 1
+ fi
+ echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_${task}_attemptonly.${PID}"
+ ${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 private" \
+ -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
+ $pkg_name >> "${WORKDIR}/temp/log.do_${task}_attemptonly.${PID}" || true
+ done
+ fi
+
+ #### Note: 'Recommends' is an arbitrary tag that means _SUGGESTS_ in Poky..
+ # Add any recommended packages to the image
+ # RPM does not solve for recommended packages because they are optional...
+ # So we query them and tree them like the ATTEMPTONLY packages above...
+ # Change the loop to "1" to run this code...
+ loop=0
+ if [ $loop -eq 1 ]; then
+ echo "Processing recommended packages..."
+ cat /dev/null > ${target_rootfs}/install/recommend.list
+ while [ $loop -eq 1 ]; do
+ # Dump the full set of recommends...
+ ${RPM} -D "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
+ -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${confbase}.macro`" \
+ -qa --qf "[%{RECOMMENDS}\n]" | sort -u > ${target_rootfs}/install/recommend
+ # Did we add more to the list?
+ grep -v -x -F -f ${target_rootfs}/install/recommend.list ${target_rootfs}/install/recommend > ${target_rootfs}/install/recommend.new || true
+ # We don't want to loop unless there is a change to the list!
+ loop=0
+ cat ${target_rootfs}/install/recommend.new | \
+ while read pkg ; do
+ # Ohh there was a new one, we'll need to loop again...
+ loop=1
+ echo "Processing $pkg..."
+ pkg_name=$(resolve_package $pkg ${confbase}.conf)
+ if [ -z "$pkg_name" ]; then
+ echo "Unable to find package $pkg." >> "${WORKDIR}/temp/log.do_${task}_recommend.${PID}"
+ continue
+ fi
+ echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_{task}_recommend.${PID}"
+ ${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 private" \
+ -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
+ $pkg_name >> "${WORKDIR}/temp/log.do_${task}_recommend.${PID}" 2>&1 || true
+ done
+ cat ${target_rootfs}/install/recommend.list ${target_rootfs}/install/recommend.new | sort -u > ${target_rootfs}/install/recommend.new.list
+ mv -f ${target_rootfs}/install/recommend.new.list ${target_rootfs}/install/recommend.list
+ rm ${target_rootfs}/install/recommend ${target_rootfs}/install/recommend.new
+ done
+ fi
+
+ # Now that we have a solution, pull out a list of what to install...
+ echo "Manifest: ${target_rootfs}/install/install.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
}
python write_specfile () {
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index f579b53..e03e80b 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -12,50 +12,29 @@ opkglibdir = "${localstatedir}/lib/opkg"
fakeroot rootfs_deb_do_rootfs () {
set +e
- mkdir -p ${IMAGE_ROOTFS}/var/dpkg/info
- mkdir -p ${IMAGE_ROOTFS}/var/dpkg/updates
- rm -f ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev
- rm -f ${STAGING_ETCDIR_NATIVE}/apt/preferences
- > ${IMAGE_ROOTFS}/var/dpkg/status
- > ${IMAGE_ROOTFS}/var/dpkg/available
mkdir -p ${IMAGE_ROOTFS}/var/dpkg/alternatives
- priority=1
- for arch in ${PACKAGE_ARCHS}; do
- if [ ! -d ${DEPLOY_DIR_DEB}/$arch ]; then
- continue;
- fi
- cd ${DEPLOY_DIR_DEB}/$arch
- # if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
- rm -f Packages.gz Packages Packages.bz2
- # fi
- dpkg-scanpackages . | bzip2 > Packages.bz2
- echo "Label: $arch" > Release
-
- echo "deb file:${DEPLOY_DIR_DEB}/$arch/ ./" >> ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev
- (echo "Package: *"
- echo "Pin: release l=$arch"
- echo "Pin-Priority: $(expr 800 + $priority)"
- echo) >> ${STAGING_ETCDIR_NATIVE}/apt/preferences
- priority=$(expr $priority + 5)
- done
+ # update index
+ package_update_index_deb
+
+ #install packages
+ export INSTALL_ROOTFS_DEB="${IMAGE_ROOTFS}"
+ export INSTALL_BASEARCH_DEB="${DPKG_ARCH}"
+ export INSTALL_ARCHS_DEB="${PACKAGE_ARCHS}"
+ export INSTALL_PACKAGES_NORMAL_DEB="${PACKAGE_INSTALL}"
+ export INSTALL_PACKAGES_ATTEMPTONLY_DEB="${PACKAGE_INSTALL_ATTEMPTONLY}"
+ export INSTALL_PACKAGES_LINGUAS_DEB="${LINGUAS_INSTALL}"
+ export INSTALL_TASK_DEB="rootfs"
- tac ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev > ${STAGING_ETCDIR_NATIVE}/apt/sources.list
+ package_install_internal_deb
- cat "${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample" \
- | sed -e 's#Architecture ".*";#Architecture "${DPKG_ARCH}";#' \
- | sed -e 's:#ROOTFS#:${IMAGE_ROOTFS}:g' \
- > "${STAGING_ETCDIR_NATIVE}/apt/apt-rootfs.conf"
- export APT_CONFIG="${STAGING_ETCDIR_NATIVE}/apt/apt-rootfs.conf"
export D=${IMAGE_ROOTFS}
export OFFLINE_ROOT=${IMAGE_ROOTFS}
export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
- apt-get update
-
_flag () {
sed -i -e "/^Package: $2\$/{n; s/Status: install ok .*/Status: install ok $1/;}" ${IMAGE_ROOTFS}/var/dpkg/status
}
@@ -63,47 +42,6 @@ fakeroot rootfs_deb_do_rootfs () {
cat ${IMAGE_ROOTFS}/var/dpkg/status | sed -n -e "/^Package: $2\$/{n; s/Status: install ok .*/$1/; p}"
}
- if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
- if [ ! -z "${LINGUAS_INSTALL}" ]; then
- apt-get install glibc-localedata-i18n --force-yes --allow-unauthenticated
- if [ $? -ne 0 ]; then
- exit 1
- fi
- for i in ${LINGUAS_INSTALL}; do
- apt-get install $i --force-yes --allow-unauthenticated
- if [ $? -ne 0 ]; then
- exit 1
- fi
- done
- fi
- fi
-
- if [ ! -z "${PACKAGE_INSTALL}" ]; then
- for i in ${PACKAGE_INSTALL}; do
- apt-get install $i --force-yes --allow-unauthenticated
- if [ $? -ne 0 ]; then
- exit 1
- fi
- done
- fi
-
- rm ${WORKDIR}/temp/log.do_$target-attemptonly.${PID}
- if [ ! -z "${PACKAGE_INSTALL_ATTEMPTONLY}" ]; then
- for i in ${PACKAGE_INSTALL_ATTEMPTONLY}; do
- apt-get install $i --force-yes --allow-unauthenticated >> ${WORKDIR}/temp/log.do_rootfs-attemptonly.${PID} || true
- done
- fi
-
- find ${IMAGE_ROOTFS} -name \*.dpkg-new | for i in `cat`; do
- mv $i `echo $i | sed -e's,\.dpkg-new$,,'`
- done
-
- install -d ${IMAGE_ROOTFS}/${sysconfdir}
- echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
-
- # Mark all packages installed
- sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" ${IMAGE_ROOTFS}/var/dpkg/status
-
# Attempt to run preinsts
# Mark packages with preinst failures as unpacked
for i in ${IMAGE_ROOTFS}/var/dpkg/info/*.preinst; do
@@ -122,6 +60,9 @@ fakeroot rootfs_deb_do_rootfs () {
set -e
+ install -d ${IMAGE_ROOTFS}/${sysconfdir}
+ echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
+
# Hacks to allow opkg's update-alternatives and opkg to coexist for now
mkdir -p ${IMAGE_ROOTFS}${opkglibdir}
if [ -e ${IMAGE_ROOTFS}/var/dpkg/alternatives ]; then
@@ -133,27 +74,7 @@ fakeroot rootfs_deb_do_rootfs () {
${ROOTFS_POSTPROCESS_COMMAND}
- log_check rootfs
-}
-
-rootfs_deb_log_check() {
- target="$1"
- lf_path="$2"
-
- lf_txt="`cat $lf_path`"
- for keyword_die in "E:"
- 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
+ log_check rootfs
}
remove_packaging_data_files() {
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 593a403..5727d15 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -29,26 +29,19 @@ fakeroot rootfs_ipk_do_rootfs () {
${OPKG_PREPROCESS_COMMANDS}
mkdir -p ${T}/
- mkdir -p ${IMAGE_ROOTFS}${opkglibdir}
- opkg-cl ${IPKG_ARGS} update
+ #install
+ export INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}"
+ export INSTALL_PACKAGES_LINGUAS_IPK="${LINGUAS_INSTALL}"
+ export INSTALL_TASK_IPK="rootfs"
- # Uclibc builds don't provide this stuff...
- if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
- if [ ! -z "${LINGUAS_INSTALL}" ]; then
- for i in ${LINGUAS_INSTALL}; do
- opkg-cl ${IPKG_ARGS} install $i
- done
- fi
- fi
- if [ ! -z "${PACKAGE_INSTALL}" ]; then
- opkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL}
- fi
+ export INSTALL_ROOTFS_IPK="${IMAGE_ROOTFS}"
+ export INSTALL_CONF_IPK="${IPKGCONF_TARGET}"
+ export INSTALL_PACKAGES_NORMAL_IPK="${PACKAGE_INSTALL}"
- if [ ! -z "${PACKAGE_INSTALL_ATTEMPTONLY}" ]; then
- opkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL_ATTEMPTONLY} > "${WORKDIR}/temp/log.do_rootfs_attemptonly.${PID}" || true
- fi
+ package_install_internal_ipk
+ #post install
export D=${IMAGE_ROOTFS}
export OFFLINE_ROOT=${IMAGE_ROOTFS}
export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
@@ -82,26 +75,6 @@ fakeroot rootfs_ipk_do_rootfs () {
log_check rootfs
}
-rootfs_ipk_log_check() {
- target="$1"
- lf_path="$2"
-
- 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
-}
-
rootfs_ipk_write_manifest() {
manifest=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest
cp ${IMAGE_ROOTFS}${opkglibdir}/status $manifest
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 8646eec..485b9c4 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -37,118 +37,17 @@ fakeroot rootfs_rpm_do_rootfs () {
${RPM_PREPROCESS_COMMANDS}
- # Setup base system configuration
- mkdir -p ${IMAGE_ROOTFS}/etc/rpm/
- echo "${TARGET_ARCH}-linux" >${IMAGE_ROOTFS}/etc/rpm/platform
-
- # Tell RPM that the "/" directory exist and is available
- mkdir -p ${IMAGE_ROOTFS}/etc/rpm/sysinfo
- echo "/" >${IMAGE_ROOTFS}/etc/rpm/sysinfo/Dirnames
-
- # Setup manifest of packages to install...
- mkdir -p ${IMAGE_ROOTFS}/install
- echo "# Install manifest" > ${IMAGE_ROOTFS}/install/install.manifest
-
- # Uclibc builds don't provide this stuff...
- if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
- if [ ! -z "${LINGUAS_INSTALL}" ]; then
- for pkg in ${LINGUAS_INSTALL}; do
- echo "Processing $pkg..."
- pkg_name=$(resolve_package $pkg)
- if [ -z "$pkg_name" ]; then
- echo "Unable to find package $pkg!"
- exit 1
- fi
- echo $pkg_name >> ${IMAGE_ROOTFS}/install/install.manifest
- done
- fi
- fi
-
- if [ ! -z "${PACKAGE_INSTALL}" ]; then
- for pkg in ${PACKAGE_INSTALL} ; do
- echo "Processing $pkg..."
- pkg_name=$(resolve_package $pkg)
- if [ -z "$pkg_name" ]; then
- echo "Unable to find package $pkg!"
- exit 1
- fi
- echo $pkg_name >> ${IMAGE_ROOTFS}/install/install.manifest
- done
- fi
-
- # Generate an install solution by doing a --justdb install, then recreate it with
- # an actual package install!
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
- -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" \
- -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- ${IMAGE_ROOTFS}/install/install.manifest
-
- if [ ! -z "${PACKAGE_INSTALL_ATTEMPTONLY}" ]; then
- echo "Adding attempt only packages..."
- for pkg in ${PACKAGE_INSTALL_ATTEMPTONLY} ; do
- echo "Processing $pkg..."
- pkg_name=$(resolve_package $pkg)
- if [ -z "$pkg_name" ]; then
- echo "Unable to find package $pkg!"
- exit 1
- fi
- echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_rootfs_attemptonly.${PID}"
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
- -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
- -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- $pkg_name >> "${WORKDIR}/temp/log.do_rootfs_attemptonly.${PID}" || true
- done
- fi
-
-#### Note: 'Recommends' is an arbitrary tag that means _SUGGESTS_ in Poky..
- # Add any recommended packages to the image
- # RPM does not solve for recommended packages because they are optional...
- # So we query them and tree them like the ATTEMPTONLY packages above...
- # Change the loop to "1" to run this code...
- loop=0
- if [ $loop -eq 1 ]; then
- echo "Processing recommended packages..."
- cat /dev/null > ${IMAGE_ROOTFS}/install/recommend.list
- while [ $loop -eq 1 ]; do
- # Dump the full set of recommends...
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
- -qa --qf "[%{RECOMMENDS}\n]" | sort -u > ${IMAGE_ROOTFS}/install/recommend
- # Did we add more to the list?
- grep -v -x -F -f ${IMAGE_ROOTFS}/install/recommend.list ${IMAGE_ROOTFS}/install/recommend > ${IMAGE_ROOTFS}/install/recommend.new || true
- # We don't want to loop unless there is a change to the list!
- loop=0
- cat ${IMAGE_ROOTFS}/install/recommend.new | \
- while read pkg ; do
- # Ohh there was a new one, we'll need to loop again...
- loop=1
- echo "Processing $pkg..."
- pkg_name=$(resolve_package $pkg)
- if [ -z "$pkg_name" ]; then
- echo "Unable to find package $pkg." >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}"
- continue
- fi
- echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}"
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
- -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
- -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- $pkg_name >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}" 2>&1 || true
- done
- cat ${IMAGE_ROOTFS}/install/recommend.list ${IMAGE_ROOTFS}/install/recommend.new | sort -u > ${IMAGE_ROOTFS}/install/recommend.new.list
- mv ${IMAGE_ROOTFS}/install/recommend.new.list ${IMAGE_ROOTFS}/install/recommend.list
- rm ${IMAGE_ROOTFS}/install/recommend ${IMAGE_ROOTFS}/install/recommend.new
- done
- fi
-
- # Now that we have a solution, pull out a list of what to install...
- echo "Manifest: ${IMAGE_ROOTFS}/install/install.manifest"
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -qa --yaml \
- | grep -i 'Packageorigin' | cut -d : -f 2 > ${IMAGE_ROOTFS}/install/install_solution.manifest
-
- # Attempt install
- ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
- --noscripts --notriggers --noparentdirs --nolinktos \
- -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
- -Uhv ${IMAGE_ROOTFS}/install/install_solution.manifest
+ #install pacakges
+ export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}"
+ export INSTALL_PALTFOM_RPM="${TARGET_ARCH}-linux"
+ export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}"
+ export INSTALL_PACKAGES_NORMAL_RPM="${PACKAGE_INSTALL}"
+ export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}"
+ export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}"
+ export INSTALL_PROVIDENAME_RPM=""
+ export INSTALL_TASK_RPM="populate_sdk"
+
+ package_install_internal_rpm
export D=${IMAGE_ROOTFS}
export OFFLINE_ROOT=${IMAGE_ROOTFS}
@@ -212,47 +111,15 @@ EOF
# Workaround so the parser knows we need the resolve_package function!
if false ; then
- resolve_package foo || true
+ resolve_package_rpm foo ${RPMCONF_TARGET_BASE}.conf || true
fi
}
-rootfs_rpm_log_check() {
- target="$1"
- lf_path="$2"
-
- 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
- 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
-}
-
remove_packaging_data_files() {
rm -rf ${IMAGE_ROOTFS}${rpmlibdir}
rm -rf ${IMAGE_ROOTFS}${opkglibdir}
}
-# Resolve package names to filepaths
-resolve_package() {
- pkg="$1"
- pkg_name=""
- for solve in `cat ${DEPLOY_DIR_RPM}/solvedb.conf`; 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
-}
install_all_locales() {
PACKAGES_TO_INSTALL=""
--
1.7.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 5/5] meta-toolchain: pkg format independant populate_sdk task.
2011-01-28 10:01 [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Lianhao Lu
` (3 preceding siblings ...)
2011-01-28 10:01 ` [PATCH 3/5] image/rootfs_xx/package_xx.bbclass: prepare to add populate_sdk task Lianhao Lu
@ 2011-01-28 10:01 ` Lianhao Lu
2011-01-29 13:28 ` [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Richard Purdie
5 siblings, 0 replies; 10+ messages in thread
From: Lianhao Lu @ 2011-01-28 10:01 UTC (permalink / raw)
To: poky
From: Lianhao Lu <lianhao.lu@intel.com>
[BUGID# 227] fixing bug #227 by make the populate_sdk task independant
of ipk, and generic to all package formats supported(rpm, ipk, deb).
This commit is based on the following 2 commits:
c66b12f138b6e709f9b14cbff9b579634f15cc96
1daf63ead393f7ae2fddc778bdd377c1dd58f6ca
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
meta/classes/populate_sdk.bbclass | 82 ++++++++++++++++++++++++
meta/recipes-core/meta/meta-toolchain.bb | 103 +-----------------------------
2 files changed, 85 insertions(+), 100 deletions(-)
create mode 100644 meta/classes/populate_sdk.bbclass
diff --git a/meta/classes/populate_sdk.bbclass b/meta/classes/populate_sdk.bbclass
new file mode 100644
index 0000000..82386b7
--- /dev/null
+++ b/meta/classes/populate_sdk.bbclass
@@ -0,0 +1,82 @@
+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
+ #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() {
+ for target in $*
+ do
+ lf_path="${WORKDIR}/temp/log.do_$target.${PID}"
+
+ echo "log_check: Using $lf_path as logfile"
+
+ if test -e "$lf_path"
+ then
+ ${IMAGE_PKGTYPE}_log_check $target $lf_path
+ else
+ echo "Cannot find logfile [$lf_path]"
+ fi
+ echo "Logfile is clean"
+ done
+}
+
+do_populate_sdk[nostamp] = "1"
+do_populate_sdk[recrdeptask] = "do_package_write"
+addtask populate_sdk before do_build after do_install
diff --git a/meta/recipes-core/meta/meta-toolchain.bb b/meta/recipes-core/meta/meta-toolchain.bb
index 4aed9c2..feff9ac 100644
--- a/meta/recipes-core/meta/meta-toolchain.bb
+++ b/meta/recipes-core/meta/meta-toolchain.bb
@@ -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
-
- # 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
--
1.7.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain.
2011-01-28 10:01 [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Lianhao Lu
` (4 preceding siblings ...)
2011-01-28 10:01 ` [PATCH 5/5] meta-toolchain: pkg format independant " Lianhao Lu
@ 2011-01-29 13:28 ` Richard Purdie
2011-01-30 8:23 ` Lu, Lianhao
5 siblings, 1 reply; 10+ messages in thread
From: Richard Purdie @ 2011-01-29 13:28 UTC (permalink / raw)
To: Lianhao Lu; +Cc: poky
On Fri, 2011-01-28 at 18:01 +0800, Lianhao Lu wrote:
> From: Lianhao Lu <lianhao.lu@intel.com>
>
> The purpose of this series of patches is to add rpm/deb 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.
>
> Since there are quite many code duplication between relevant popuplage_sdk_xxx and rootfs_xxx
> bbclasses, it also moved the common code into the package_xxx.bbclass, based on RP's suggestion.
> The generic function package_install_internal_xxx() may installs a list of packages, based on the
> information specified by various shell environment variables about where the target directory to
> be installed to, package architecture information, etc.
>
> It also fixed a bug in cross-canadian.bbclass to enable the package_deb.bbclass generate correct
> deb package files for cross-canadian recipies.
These patches are good, if you have time could you:
a) rebase these patches against the merged rpm changes from Mark Hatle
from the rpm update to 5.4
b) Try hard to split out any logical changes you can from the bigger
patches into specific steps. For example, enhancing the log_check
function and moving those around could be a separate commit.
The idea is to make changes in clear logical steps where at all possible
so anyone reviewing the changes (such as Saul, Mark and myself) can then
more quickly "see" the changes are correct and also, if there are
problems, we can bisect the commits to track down which change the
problem is from.
Cheers,
Richard
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain.
2011-01-29 13:28 ` [PATCH 0/5] [BUG# 227] rpm/deb support for meta-toolchain Richard Purdie
@ 2011-01-30 8:23 ` Lu, Lianhao
0 siblings, 0 replies; 10+ messages in thread
From: Lu, Lianhao @ 2011-01-30 8:23 UTC (permalink / raw)
To: Richard Purdie; +Cc: poky@yoctoproject.org
Richard Purdie wrote on 2011-01-29:
> On Fri, 2011-01-28 at 18:01 +0800, Lianhao Lu wrote:
>> From: Lianhao Lu <lianhao.lu@intel.com>
>>
>> The purpose of this series of patches is to add rpm/deb 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.
>>
>> Since there are quite many code duplication between relevant
>> popuplage_sdk_xxx and rootfs_xxx bbclasses, it also moved the common
>> code into the package_xxx.bbclass, based on RP's suggestion. The
>> generic function package_install_internal_xxx() may installs a list of
>> packages, based on the information specified by various shell
>> environment variables about where the target directory to be installed
>> to, package architecture information, etc.
>>
>> It also fixed a bug in cross-canadian.bbclass to enable the
>> package_deb.bbclass generate correct deb package files for
>> cross-canadian
> recipies.
>
> These patches are good, if you have time could you:
>
> a) rebase these patches against the merged rpm changes from Mark Hatle
> from the rpm update to 5.4
> b) Try hard to split out any logical changes you can from the bigger
> patches into specific steps. For example, enhancing the log_check
> function and moving those around could be a separate commit.
>
> The idea is to make changes in clear logical steps where at all
> possible so anyone reviewing the changes (such as Saul, Mark and
> myself) can then more quickly "see" the changes are correct and also,
> if there are problems, we can bisect the commits to track down which change the problem is from.
Hi RP,
Please use my latest branch at
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: llu/bug227
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/bug227
It's based to Mark's RPM 5.4 upgrade and split the big patches into smaller ones.
- Best Regards,
Lianhao
^ permalink raw reply [flat|nested] 10+ messages in thread