* [RFC, PATCH] Make packaged-staging use more correct PSTAGE_PKGARCH
@ 2010-06-21 21:54 Tom Rini
2010-06-22 14:47 ` Khem Raj
0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2010-06-21 21:54 UTC (permalink / raw
To: openembedded-devel
packaged-staging.bbclass: Change PSTAGE_PKGARCH to something dynamic
Currently, we make all pstage packages be locked to BUILD_SYS which
causes annoying warnings in some cases and doesn't allow for sharing
between say 32 and 64bit (which is valid for target bits).
This changes to ${PACKAGE_ARCH}-${HOST_SYS} for everything and reworks
the opkg.conf we generate to add entries as needed.
There is an alternative, suggested by Chris Larson, that we modify
PSTAGE_PKGARCH in an anon python function so that we can avoid things
like 'x86_64-x86_64-linux' in native packages and similar duplication in
sdk packages, or otherwise be more dynamic (use HOST_OS instead of SYS
and then catch the cross case, etc).
Signed-off-by: Tom Rini <tom_rini@mentor.com>
diff --git a/classes/packaged-staging.bbclass
b/classes/packaged-staging.bbclass
index 8a98940..d6ac67b 100644
--- a/classes/packaged-staging.bbclass
+++ b/classes/packaged-staging.bbclass
-12,7 +12,7 @@
# bitbake.conf set PSTAGING_ACTIVE = "0", this class sets to "1" if
we're active
#
PSTAGE_PKGVERSION = "${PV}-${PR}"
-PSTAGE_PKGARCH = "${BUILD_SYS}"
+PSTAGE_PKGARCH = "${PACKAGE_ARCH}-${HOST_SYS}"
PSTAGE_EXTRAPATH ?= "/${OELAYOUT_ABI}/${DISTRO_PR}/"
PSTAGE_PKGPATH = "${DISTRO}${PSTAGE_EXTRAPATH}"
PSTAGE_PKGPN =
"${@bb.data.expand('staging-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}',
d).replace('_', '-')}"
-148,15 +148,15 @@ staging_helper () {
# Assemble appropriate opkg.conf
conffile=${PSTAGE_MACHCONFIG}
mkdir -p ${PSTAGE_WORKDIR}/pstaging_lists
+ arch="${PSTAGE_PKGARCH}"
if [ ! -e $conffile ]; then
- ipkgarchs="${BUILD_SYS}"
- priority=1
- for arch in $ipkgarchs; do
- echo "arch $arch $priority" >> $conffile
- priority=$(expr $priority + 5)
- done
+ echo "arch $arch 1" > $conffile
echo "dest root /" >> $conffile
fi
+ if [ -f $conffile -a `grep -q $arch $conffile;echo $?` -ne 0 ]; then
+ priority=$(expr `grep -cE "^arch" $conffile` + 1)
+ sed -i -e "/dest/iarch $arch $priority" $conffile
+ fi
if [ ! -e ${TMPDIR}${libdir_native}/opkg/info/ ]; then
mkdir -p ${TMPDIR}${libdir_native}/opkg/info/
fi
--
Tom Rini
Mentor Graphics Corporation
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC, PATCH] Make packaged-staging use more correct PSTAGE_PKGARCH
2010-06-21 21:54 [RFC, PATCH] Make packaged-staging use more correct PSTAGE_PKGARCH Tom Rini
@ 2010-06-22 14:47 ` Khem Raj
2010-06-22 18:55 ` Tom Rini
0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2010-06-22 14:47 UTC (permalink / raw
To: openembedded-devel
On (21/06/10 14:54), Tom Rini wrote:
> packaged-staging.bbclass: Change PSTAGE_PKGARCH to something dynamic
>
> Currently, we make all pstage packages be locked to BUILD_SYS which
> causes annoying warnings in some cases and doesn't allow for sharing
> between say 32 and 64bit (which is valid for target bits).
>
> This changes to ${PACKAGE_ARCH}-${HOST_SYS} for everything and
> reworks the opkg.conf we generate to add entries as needed.
>
> There is an alternative, suggested by Chris Larson, that we modify
> PSTAGE_PKGARCH in an anon python function so that we can avoid
> things like 'x86_64-x86_64-linux' in native packages and similar
> duplication in sdk packages, or otherwise be more dynamic (use
> HOST_OS instead of SYS and then catch the cross case, etc).
I think this approach sounds better having same arch repeated twice
would be confusing
>
> Signed-off-by: Tom Rini <tom_rini@mentor.com>
>
> diff --git a/classes/packaged-staging.bbclass
> b/classes/packaged-staging.bbclass
> index 8a98940..d6ac67b 100644
> --- a/classes/packaged-staging.bbclass
> +++ b/classes/packaged-staging.bbclass
> -12,7 +12,7 @@
> # bitbake.conf set PSTAGING_ACTIVE = "0", this class sets to "1" if
> we're active
> #
> PSTAGE_PKGVERSION = "${PV}-${PR}"
> -PSTAGE_PKGARCH = "${BUILD_SYS}"
> +PSTAGE_PKGARCH = "${PACKAGE_ARCH}-${HOST_SYS}"
> PSTAGE_EXTRAPATH ?= "/${OELAYOUT_ABI}/${DISTRO_PR}/"
> PSTAGE_PKGPATH = "${DISTRO}${PSTAGE_EXTRAPATH}"
> PSTAGE_PKGPN = "${@bb.data.expand('staging-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}',
> d).replace('_', '-')}"
> -148,15 +148,15 @@ staging_helper () {
> # Assemble appropriate opkg.conf
> conffile=${PSTAGE_MACHCONFIG}
> mkdir -p ${PSTAGE_WORKDIR}/pstaging_lists
> + arch="${PSTAGE_PKGARCH}"
> if [ ! -e $conffile ]; then
> - ipkgarchs="${BUILD_SYS}"
> - priority=1
> - for arch in $ipkgarchs; do
> - echo "arch $arch $priority" >> $conffile
> - priority=$(expr $priority + 5)
> - done
> + echo "arch $arch 1" > $conffile
> echo "dest root /" >> $conffile
> fi
> + if [ -f $conffile -a `grep -q $arch $conffile;echo $?` -ne 0 ]; then
> + priority=$(expr `grep -cE "^arch" $conffile` + 1)
> + sed -i -e "/dest/iarch $arch $priority" $conffile
> + fi
> if [ ! -e ${TMPDIR}${libdir_native}/opkg/info/ ]; then
> mkdir -p ${TMPDIR}${libdir_native}/opkg/info/
> fi
>
> --
> Tom Rini
> Mentor Graphics Corporation
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC, PATCH] Make packaged-staging use more correct PSTAGE_PKGARCH
2010-06-22 14:47 ` Khem Raj
@ 2010-06-22 18:55 ` Tom Rini
2010-06-23 17:24 ` Khem Raj
0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2010-06-22 18:55 UTC (permalink / raw
To: openembedded-devel
Khem Raj wrote:
> On (21/06/10 14:54), Tom Rini wrote:
>> packaged-staging.bbclass: Change PSTAGE_PKGARCH to something dynamic
>>
>> Currently, we make all pstage packages be locked to BUILD_SYS which
>> causes annoying warnings in some cases and doesn't allow for sharing
>> between say 32 and 64bit (which is valid for target bits).
>>
>> This changes to ${PACKAGE_ARCH}-${HOST_SYS} for everything and
>> reworks the opkg.conf we generate to add entries as needed.
>>
>> There is an alternative, suggested by Chris Larson, that we modify
>> PSTAGE_PKGARCH in an anon python function so that we can avoid
>> things like 'x86_64-x86_64-linux' in native packages and similar
>> duplication in sdk packages, or otherwise be more dynamic (use
>> HOST_OS instead of SYS and then catch the cross case, etc).
>
> I think this approach sounds better having same arch repeated twice
> would be confusing
Here we go. This also reworks generating opkg.conf a little bit (it had
multiple entries before due to a lazy grep).
Signed-off-by: Tom Rini <tom_rini@mentor.com>
diff --git a/classes/packaged-staging.bbclass
b/classes/packaged-staging.bbclass
index 8a98940..19a6a6d 100644
--- a/classes/packaged-staging.bbclass
+++ b/classes/packaged-staging.bbclass
@@ -12,7 +12,7 @@
# bitbake.conf set PSTAGING_ACTIVE = "0", this class sets to "1" if
we're active
#
PSTAGE_PKGVERSION = "${PV}-${PR}"
-PSTAGE_PKGARCH = "${BUILD_SYS}"
+PSTAGE_PKGARCH = "${PACKAGE_ARCH}-${HOST_OS}"
PSTAGE_EXTRAPATH ?= "/${OELAYOUT_ABI}/${DISTRO_PR}/"
PSTAGE_PKGPATH = "${DISTRO}${PSTAGE_EXTRAPATH}"
PSTAGE_PKGPN =
"${@bb.data.expand('staging-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}',
d).replace('_', '-')}"
@@ -28,6 +28,12 @@ PSTAGE_NATIVEDEPENDS = "\
BB_STAMP_WHITELIST = "${PSTAGE_NATIVEDEPENDS}"
+python __anonymous() {
+ # We need PSTAGE_PKGARCH to contain information about the target.
+ if bb.data.inherits_class('cross', d):
+ bb.data.setVar('PSTAGE_PKGARCH',
"${HOST_SYS}-${PACKAGE_ARCH}-${TARGET_OS}", d)
+}
+
python () {
pstage_allowed = True
@@ -148,14 +154,13 @@ staging_helper () {
# Assemble appropriate opkg.conf
conffile=${PSTAGE_MACHCONFIG}
mkdir -p ${PSTAGE_WORKDIR}/pstaging_lists
+ arch="${PSTAGE_PKGARCH}"
if [ ! -e $conffile ]; then
- ipkgarchs="${BUILD_SYS}"
- priority=1
- for arch in $ipkgarchs; do
- echo "arch $arch $priority" >> $conffile
- priority=$(expr $priority + 5)
- done
+ echo "arch $arch 1" > $conffile
echo "dest root /" >> $conffile
+ elif [ `grep -c " $arch " $conffile` -eq 0 ]; then
+ priority=$(expr `grep -cE "^arch" $conffile` + 1)
+ sed -i -e "/dest/iarch $arch $priority" $conffile
fi
if [ ! -e ${TMPDIR}${libdir_native}/opkg/info/ ]; then
mkdir -p ${TMPDIR}${libdir_native}/opkg/info/
--
Tom Rini
Mentor Graphics Corporation
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC, PATCH] Make packaged-staging use more correct PSTAGE_PKGARCH
2010-06-22 18:55 ` Tom Rini
@ 2010-06-23 17:24 ` Khem Raj
2010-06-23 18:59 ` Chris Larson
0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2010-06-23 17:24 UTC (permalink / raw
To: openembedded-devel
On (22/06/10 11:55), Tom Rini wrote:
> Khem Raj wrote:
> >On (21/06/10 14:54), Tom Rini wrote:
> >>packaged-staging.bbclass: Change PSTAGE_PKGARCH to something dynamic
> >>
> >>Currently, we make all pstage packages be locked to BUILD_SYS which
> >>causes annoying warnings in some cases and doesn't allow for sharing
> >>between say 32 and 64bit (which is valid for target bits).
> >>
> >>This changes to ${PACKAGE_ARCH}-${HOST_SYS} for everything and
> >>reworks the opkg.conf we generate to add entries as needed.
> >>
> >>There is an alternative, suggested by Chris Larson, that we modify
> >>PSTAGE_PKGARCH in an anon python function so that we can avoid
> >>things like 'x86_64-x86_64-linux' in native packages and similar
> >>duplication in sdk packages, or otherwise be more dynamic (use
> >>HOST_OS instead of SYS and then catch the cross case, etc).
> >
> >I think this approach sounds better having same arch repeated twice
> >would be confusing
>
> Here we go. This also reworks generating opkg.conf a little bit (it
> had multiple entries before due to a lazy grep).
>
> Signed-off-by: Tom Rini <tom_rini@mentor.com>
very nice
Acked-by: Khem Raj <raj.khem@gmail.com>
>
> diff --git a/classes/packaged-staging.bbclass
> b/classes/packaged-staging.bbclass
> index 8a98940..19a6a6d 100644
> --- a/classes/packaged-staging.bbclass
> +++ b/classes/packaged-staging.bbclass
> @@ -12,7 +12,7 @@
> # bitbake.conf set PSTAGING_ACTIVE = "0", this class sets to "1" if
> we're active
> #
> PSTAGE_PKGVERSION = "${PV}-${PR}"
> -PSTAGE_PKGARCH = "${BUILD_SYS}"
> +PSTAGE_PKGARCH = "${PACKAGE_ARCH}-${HOST_OS}"
> PSTAGE_EXTRAPATH ?= "/${OELAYOUT_ABI}/${DISTRO_PR}/"
> PSTAGE_PKGPATH = "${DISTRO}${PSTAGE_EXTRAPATH}"
> PSTAGE_PKGPN = "${@bb.data.expand('staging-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}',
> d).replace('_', '-')}"
> @@ -28,6 +28,12 @@ PSTAGE_NATIVEDEPENDS = "\
>
> BB_STAMP_WHITELIST = "${PSTAGE_NATIVEDEPENDS}"
>
> +python __anonymous() {
> + # We need PSTAGE_PKGARCH to contain information about the target.
> + if bb.data.inherits_class('cross', d):
> + bb.data.setVar('PSTAGE_PKGARCH',
> "${HOST_SYS}-${PACKAGE_ARCH}-${TARGET_OS}", d)
> +}
> +
> python () {
> pstage_allowed = True
>
> @@ -148,14 +154,13 @@ staging_helper () {
> # Assemble appropriate opkg.conf
> conffile=${PSTAGE_MACHCONFIG}
> mkdir -p ${PSTAGE_WORKDIR}/pstaging_lists
> + arch="${PSTAGE_PKGARCH}"
> if [ ! -e $conffile ]; then
> - ipkgarchs="${BUILD_SYS}"
> - priority=1
> - for arch in $ipkgarchs; do
> - echo "arch $arch $priority" >> $conffile
> - priority=$(expr $priority + 5)
> - done
> + echo "arch $arch 1" > $conffile
> echo "dest root /" >> $conffile
> + elif [ `grep -c " $arch " $conffile` -eq 0 ]; then
> + priority=$(expr `grep -cE "^arch" $conffile` + 1)
> + sed -i -e "/dest/iarch $arch $priority" $conffile
> fi
> if [ ! -e ${TMPDIR}${libdir_native}/opkg/info/ ]; then
> mkdir -p ${TMPDIR}${libdir_native}/opkg/info/
>
> --
> Tom Rini
> Mentor Graphics Corporation
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC, PATCH] Make packaged-staging use more correct PSTAGE_PKGARCH
2010-06-23 17:24 ` Khem Raj
@ 2010-06-23 18:59 ` Chris Larson
0 siblings, 0 replies; 5+ messages in thread
From: Chris Larson @ 2010-06-23 18:59 UTC (permalink / raw
To: openembedded-devel
On Wed, Jun 23, 2010 at 10:24 AM, Khem Raj <raj.khem@gmail.com> wrote:
> On (22/06/10 11:55), Tom Rini wrote:
> > Khem Raj wrote:
> > >On (21/06/10 14:54), Tom Rini wrote:
> > >>packaged-staging.bbclass: Change PSTAGE_PKGARCH to something dynamic
> > >>
> > >>Currently, we make all pstage packages be locked to BUILD_SYS which
> > >>causes annoying warnings in some cases and doesn't allow for sharing
> > >>between say 32 and 64bit (which is valid for target bits).
> > >>
> > >>This changes to ${PACKAGE_ARCH}-${HOST_SYS} for everything and
> > >>reworks the opkg.conf we generate to add entries as needed.
> > >>
> > >>There is an alternative, suggested by Chris Larson, that we modify
> > >>PSTAGE_PKGARCH in an anon python function so that we can avoid
> > >>things like 'x86_64-x86_64-linux' in native packages and similar
> > >>duplication in sdk packages, or otherwise be more dynamic (use
> > >>HOST_OS instead of SYS and then catch the cross case, etc).
> > >
> > >I think this approach sounds better having same arch repeated twice
> > >would be confusing
> >
> > Here we go. This also reworks generating opkg.conf a little bit (it
> > had multiple entries before due to a lazy grep).
> >
> > Signed-off-by: Tom Rini <tom_rini@mentor.com>
>
> very nice
>
> Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Chris Larson <chris_larson@mentor.com>
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-06-23 19:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-21 21:54 [RFC, PATCH] Make packaged-staging use more correct PSTAGE_PKGARCH Tom Rini
2010-06-22 14:47 ` Khem Raj
2010-06-22 18:55 ` Tom Rini
2010-06-23 17:24 ` Khem Raj
2010-06-23 18:59 ` Chris Larson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.