Skip to contentSkip to conversation

Fix packaged staging for cross packages

PATCH In review Joshua Lock 3 participants 4 messages Mar 4, 2010 – Mar 21, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix packaged staging for cross packages

Hi,

While working on packaged staging in Poky I noticed that cross packages where being incorrectly packaged.

After spending quite some time to track down the issue and fix it I committed a patch to Poky master[1] to fix it.

Attached is a copy of the patch for packages-staging.bbclass against oe.dev.

Regards,
Joshua

1.http://git.pokylinux.org/cgit.cgi/poky/commit/?id=538087d2036d9dd319e3a22aaa2f62e5a5285c55

Signature · 2 lines
Joshua Lock
        Intel Open Source Technology Centre

From 76d07ab28c304f1b827ef9b7f8adda22599c67ec Mon Sep 17 00:00:00 2001
From: Joshua Lock <[email protected]>
Date: Thu, 4 Mar 2010 17:47:33 +0000
Subject: [PATCH] packaged-staging: Fix packagaging of cross packages

packagedstaging_fastpath() was only copying the contents of CROSS_DIR to PSTAGE_TMPDIR resulting in the folders contents being packaged and then installed incorrectly at the top level of CROSS_DIR rather than in HOST_ARCH specific sub directories.

This patch fixes that issue by copying the directory and its contents rather than just the directory contents.

---
 classes/packaged-staging.bbclass |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
classes/packaged-staging.bbclass +3 -1
index 1ede25c..1cf30e2 100644
@@ -289,7 +289,9 @@ packagedstaging_fastpath () {
 		mkdir -p ${PSTAGE_TMPDIR_STAGE}/staging/
 		mkdir -p ${PSTAGE_TMPDIR_STAGE}/cross/
 		cp -fpPR ${SYSROOT_DESTDIR}${STAGING_DIR}/* ${PSTAGE_TMPDIR_STAGE}/staging/ || /bin/true
-		cp -fpPR ${SYSROOT_DESTDIR}${CROSS_DIR}/* ${PSTAGE_TMPDIR_STAGE}/cross/ || /bin/true
+                # CROSS_DIR is just the HOST_ARCH specific stuff and a sub
+                # directory of cross so copy it *and* its contents
+		cp -fpPR ${SYSROOT_DESTDIR}${CROSS_DIR} ${PSTAGE_TMPDIR_STAGE}/cross/ || /bin/true
 	fi
 }
 
Signature · 1 line
1.6.6.1
#1 lore raw

It looks like this does fix the problem, and good job in spotting the problem, but this fix assumes that the basename of CROSS_DIR is BASE_PACKAGE_ARCH. If that ever changes for whatever reason, it will break.
I'd suggest instead changing it to continue to copy the contents of the
dir, but to change the destination to match the destination used in the postamble (${PSTAGE_TMPDIR_STAGE}/cross/${BASE_PACKAGE_ARCH}).

Quoted 26 lines · Joshua Lock

Hi,

While working on packaged staging in Poky I noticed that cross packages where being incorrectly packaged.

After spending quite some time to track down the issue and fix it I committed a patch to Poky master[1] to fix it.

Attached is a copy of the patch for packages-staging.bbclass against oe.dev.

Regards,
Joshua

1.
http://git.pokylinux.org/cgit.cgi/poky/commit/?id=538087d2036d9dd319e3a22aaa2f62e5a5285c55
--
Joshua Lock
Intel Open Source Technology Centre

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#2 lore raw

Hi Chris,

Quoted 6 lines · Chris Larson

It looks like this does fix the problem, and good job in spotting the problem, but this fix assumes that the basename of CROSS_DIR is BASE_PACKAGE_ARCH. If that ever changes for whatever reason, it will break.
I'd suggest instead changing it to continue to copy the contents of the
dir, but to change the destination to match the destination used in the postamble (${PSTAGE_TMPDIR_STAGE}/cross/${BASE_PACKAGE_ARCH}).

Thanks for the quick review, I've attached a modified patch to account for potential changes in the base name of CROSS_DIR as suggested.

Regards,
Joshua

Signature · 2 lines
Joshua Lock
        Intel Open Source Technology Centre

From f40c45b8cba055d698e22c2b7444bc21c5a47eb8 Mon Sep 17 00:00:00 2001
From: Joshua Lock <[email protected]>
Date: Fri, 5 Mar 2010 08:23:39 +0000
Subject: [PATCH] packaged-staging: Fix packagaging of cross packages

packagedstaging_fastpath() was only copying the contents of CROSS_DIR to PSTAGE_TMPDIR resulting in the folders contents being packaged and then installed incorrectly at the top level of CROSS_DIR rather than in HOST_ARCH specific sub directories.

This patch fixes that issue by copying the directory and its contents rather than just the directory contents.

---
 classes/packaged-staging.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
classes/packaged-staging.bbclass +1 -1
index 1ede25c..f50ccad 100644
@@ -289,7 +289,7 @@ packagedstaging_fastpath () {
 		mkdir -p ${PSTAGE_TMPDIR_STAGE}/staging/
 		mkdir -p ${PSTAGE_TMPDIR_STAGE}/cross/
 		cp -fpPR ${SYSROOT_DESTDIR}${STAGING_DIR}/* ${PSTAGE_TMPDIR_STAGE}/staging/ || /bin/true
-		cp -fpPR ${SYSROOT_DESTDIR}${CROSS_DIR}/* ${PSTAGE_TMPDIR_STAGE}/cross/ || /bin/true
+		cp -fpPR ${SYSROOT_DESTDIR}${CROSS_DIR}/* ${PSTAGE_TMPDIR_STAGE}/cross/${BASE_PACKAGE_ARCH}/ || /bin/true
 	fi
 }
 
Signature · 1 line
1.6.6.1
Acked-by
#3 lore raw
Quoted 10 lines · Joshua Lock

Hi Chris,

Quoted 6 lines · Chris Larson

It looks like this does fix the problem, and good job in spotting the problem, but this fix assumes that the basename of CROSS_DIR is BASE_PACKAGE_ARCH. If that ever changes for whatever reason, it will break.
I'd suggest instead changing it to continue to copy the contents of the
dir, but to change the destination to match the destination used in the postamble (${PSTAGE_TMPDIR_STAGE}/cross/${BASE_PACKAGE_ARCH}).

Quoted 23 lines

Thanks for the quick review, I've attached a modified patch to account for potential changes in the base name of CROSS_DIR as suggested.

Regards,
Joshua

Signature · 17 lines
Joshua Lock
        Intel Open Source Technology Centre

From f40c45b8cba055d698e22c2b7444bc21c5a47eb8 Mon Sep 17 00:00:00 2001
From: Joshua Lock <[email protected]>
Date: Fri, 5 Mar 2010 08:23:39 +0000
Subject: [PATCH] packaged-staging: Fix packagaging of cross packages

packagedstaging_fastpath() was only copying the contents of CROSS_DIR to
PSTAGE_TMPDIR resulting in the folders contents being packaged and then
installed incorrectly at the top level of CROSS_DIR rather than in HOST_ARCH
specific sub directories.

This patch fixes that issue by copying the directory and its contents rather
than just the directory contents.

Signed-off-by: Joshua Lock <[email protected]>
Quoted 25 lines
---
 classes/packaged-staging.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
classes/packaged-staging.bbclass +1 -1
index 1ede25c..f50ccad 100644
@@ -289,7 +289,7 @@ packagedstaging_fastpath () {
 		mkdir -p ${PSTAGE_TMPDIR_STAGE}/staging/
 		mkdir -p ${PSTAGE_TMPDIR_STAGE}/cross/
 		cp -fpPR ${SYSROOT_DESTDIR}${STAGING_DIR}/* ${PSTAGE_TMPDIR_STAGE}/staging/ || /bin/true
-		cp -fpPR ${SYSROOT_DESTDIR}${CROSS_DIR}/* ${PSTAGE_TMPDIR_STAGE}/cross/ || /bin/true
+		cp -fpPR ${SYSROOT_DESTDIR}${CROSS_DIR}/* ${PSTAGE_TMPDIR_STAGE}/cross/${BASE_PACKAGE_ARCH}/ || /bin/true
 	fi
 }
 
Signature · 7 lines
1.6.6.1


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel