* [PATCH 0/3] mips64/openssl gcc5 fix, musl and debug file system patch
@ 2015-05-22 19:56 Khem Raj
2015-05-22 19:56 ` [PATCH 1/3] openssl: Fix build with gcc5 on mips64 Khem Raj
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Khem Raj @ 2015-05-22 19:56 UTC (permalink / raw)
To: openembedded-core
these patches have been tested fairly well for now,
creating debug file system is a forward ported from last time
and has been working quite well
Khem Raj (2):
openssl: Fix build with gcc5 on mips64
glibc: ignore for musl/uclibc but only for target recipes
Mark Hatle (1):
image.bbclass: Add a method for creating a companion debug filesystem
meta/classes/image.bbclass | 5 +-
meta/lib/oe/rootfs.py | 57 ++++++++++++++++++++++
...ine-GCC_VERSION-macro-to-cover-upto-gcc-5.patch | 53 ++++++++++++++++++++
.../recipes-connectivity/openssl/openssl_1.0.2a.bb | 1 +
meta/recipes-core/glibc/glibc-collateral.inc | 3 ++
meta/recipes-core/glibc/glibc_2.21.bb | 9 ++--
6 files changed, 121 insertions(+), 7 deletions(-)
create mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch
--
2.1.4
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] openssl: Fix build with gcc5 on mips64 2015-05-22 19:56 [PATCH 0/3] mips64/openssl gcc5 fix, musl and debug file system patch Khem Raj @ 2015-05-22 19:56 ` Khem Raj 2015-05-25 19:22 ` Bernhard Reutner-Fischer 2015-05-22 19:56 ` [PATCH 2/3] glibc: ignore for musl/uclibc but only for target recipes Khem Raj 2015-05-22 19:56 ` [PATCH 3/3] image.bbclass: Add a method for creating a companion debug filesystem Khem Raj 2 siblings, 1 reply; 7+ messages in thread From: Khem Raj @ 2015-05-22 19:56 UTC (permalink / raw) To: openembedded-core Patch is submitted upstream as well Signed-off-by: Khem Raj <raj.khem@gmail.com> --- ...ine-GCC_VERSION-macro-to-cover-upto-gcc-5.patch | 53 ++++++++++++++++++++++ .../recipes-connectivity/openssl/openssl_1.0.2a.bb | 1 + 2 files changed, 54 insertions(+) create mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch diff --git a/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch b/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch new file mode 100644 index 0000000..46d1adf --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch @@ -0,0 +1,53 @@ +From 0aa68f7681a74f6ff80a80c5843bc35e5effffb9 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 22 May 2015 12:43:39 -0700 +Subject: [PATCH] Define GCC_VERSION macro to cover upto gcc-5 + +Current check is limited to gcc 4 with minor versions +but when we use gcc 5.1, then minor version check fails +with current setup and we end up with build errors like + +| In file included from bn_div.c:62:0: +| bn_div.c: In function 'BN_div': +| bn_lcl.h:311:9: error: impossible constraint in 'asm' +| asm ("dmultu %2,%3" \ +| ^ +| bn_div.c:402:13: note: in expansion of macro 'BN_UMULT_LOHI' +| BN_UMULT_LOHI(t2l, t2h, d1, q); +| ^ +| <builtin>: recipe for target 'bn_div.o' failed +| make[2]: *** [bn_div.o] Error 1 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- +Upstream-Status: [Submitted] + crypto/bn/bn_lcl.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h +index 196df7e..e801ba7 100644 +--- a/crypto/bn/bn_lcl.h ++++ b/crypto/bn/bn_lcl.h +@@ -118,6 +118,9 @@ + extern "C" { + #endif + ++#define GCC_VERSION (__GNUC__ * 10000 \ ++ + __GNUC_MINOR__ * 100 \ ++ + __GNUC_PATCHLEVEL__) + /*- + * Bignum consistency macros + * There is one "API" macro, bn_fix_top(), for stripping leading zeroes from +@@ -443,7 +446,7 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b, + # endif + # elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)) + # if defined(__GNUC__) && __GNUC__>=2 +-# if __GNUC__>=4 && __GNUC_MINOR__>=4 ++# if GCC_VERSION > 40400 + /* "h" constraint is no more since 4.4 */ + # define BN_UMULT_HIGH(a,b) (((__uint128_t)(a)*(b))>>64) + # define BN_UMULT_LOHI(low,high,a,b) ({ \ +-- +2.1.4 + diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb index 9a218be..c05be1f 100644 --- a/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb +++ b/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb @@ -37,6 +37,7 @@ SRC_URI += "file://configure-targets.patch \ file://ptest-deps.patch \ file://run-ptest \ file://crypto_use_bigint_in_x86-64_perl.patch \ + file://0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch \ " SRC_URI[md5sum] = "a06c547dac9044161a477211049f60ef" -- 2.1.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] openssl: Fix build with gcc5 on mips64 2015-05-22 19:56 ` [PATCH 1/3] openssl: Fix build with gcc5 on mips64 Khem Raj @ 2015-05-25 19:22 ` Bernhard Reutner-Fischer 2015-05-28 4:53 ` Khem Raj 0 siblings, 1 reply; 7+ messages in thread From: Bernhard Reutner-Fischer @ 2015-05-25 19:22 UTC (permalink / raw) To: Khem Raj, openembedded-core On May 22, 2015 9:56:51 PM GMT+02:00, Khem Raj <raj.khem@gmail.com> wrote: >Patch is submitted upstream as well > >Signed-off-by: Khem Raj <raj.khem@gmail.com> >--- >...ine-GCC_VERSION-macro-to-cover-upto-gcc-5.patch | 53 >++++++++++++++++++++++ > .../recipes-connectivity/openssl/openssl_1.0.2a.bb | 1 + > 2 files changed, 54 insertions(+) >create mode 100644 >meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch > >diff --git >a/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch >b/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch >new file mode 100644 >index 0000000..46d1adf >--- /dev/null >+++ >b/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch >@@ -0,0 +1,53 @@ >+From 0aa68f7681a74f6ff80a80c5843bc35e5effffb9 Mon Sep 17 00:00:00 2001 >+From: Khem Raj <raj.khem@gmail.com> >+Date: Fri, 22 May 2015 12:43:39 -0700 >+Subject: [PATCH] Define GCC_VERSION macro to cover upto gcc-5 >+ >+Current check is limited to gcc 4 with minor versions >+but when we use gcc 5.1, then minor version check fails >+with current setup and we end up with build errors like >+ >+| In file included from bn_div.c:62:0: >+| bn_div.c: In function 'BN_div': >+| bn_lcl.h:311:9: error: impossible constraint in 'asm' >+| asm ("dmultu %2,%3" \ >+| ^ >+| bn_div.c:402:13: note: in expansion of macro 'BN_UMULT_LOHI' >+| BN_UMULT_LOHI(t2l, t2h, d1, q); >+| ^ >+| <builtin>: recipe for target 'bn_div.o' failed >+| make[2]: *** [bn_div.o] Error 1 >+ >+Signed-off-by: Khem Raj <raj.khem@gmail.com> >+ >+--- >+Upstream-Status: [Submitted] >+ crypto/bn/bn_lcl.h | 5 ++++- >+ 1 file changed, 4 insertions(+), 1 deletion(-) >+ >+diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h >+index 196df7e..e801ba7 100644 >+--- a/crypto/bn/bn_lcl.h >++++ b/crypto/bn/bn_lcl.h >+@@ -118,6 +118,9 @@ >+ extern "C" { >+ #endif >+ >++#define GCC_VERSION (__GNUC__ * 10000 \ >++ + __GNUC_MINOR__ * 100 \ >++ + __GNUC_PATCHLEVEL__) >+ /*- >+ * Bignum consistency macros >+ * There is one "API" macro, bn_fix_top(), for stripping leading >zeroes from >+@@ -443,7 +446,7 @@ unsigned __int64 _umul128(unsigned __int64 a, >unsigned __int64 b, >+ # endif >+ # elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || >defined(SIXTY_FOUR_BIT_LONG)) >+ # if defined(__GNUC__) && __GNUC__>=2 >+-# if __GNUC__>=4 && __GNUC_MINOR__>=4 >++# if GCC_VERSION > 40400 Not that it would really matter nowadays, but this should likely be >= Cheers, >+ /* "h" constraint is no more >since 4.4 */ >+ # define BN_UMULT_HIGH(a,b) (((__uint128_t)(a)*(b))>>64) >+ # define BN_UMULT_LOHI(low,high,a,b) ({ \ >+-- >+2.1.4 >+ >diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb >b/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb >index 9a218be..c05be1f 100644 >--- a/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb >+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2a.bb >@@ -37,6 +37,7 @@ SRC_URI += "file://configure-targets.patch \ > file://ptest-deps.patch \ > file://run-ptest \ > file://crypto_use_bigint_in_x86-64_perl.patch \ >+ >file://0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch \ > " > > SRC_URI[md5sum] = "a06c547dac9044161a477211049f60ef" ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] openssl: Fix build with gcc5 on mips64 2015-05-25 19:22 ` Bernhard Reutner-Fischer @ 2015-05-28 4:53 ` Khem Raj 0 siblings, 0 replies; 7+ messages in thread From: Khem Raj @ 2015-05-28 4:53 UTC (permalink / raw) To: Bernhard Reutner-Fischer; +Cc: Patches and discussions about the oe-core layer On Mon, May 25, 2015 at 12:22 PM, Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> wrote: > On May 22, 2015 9:56:51 PM GMT+02:00, Khem Raj <raj.khem@gmail.com> wrote: >>Patch is submitted upstream as well >> >>Signed-off-by: Khem Raj <raj.khem@gmail.com> >>--- >>...ine-GCC_VERSION-macro-to-cover-upto-gcc-5.patch | 53 >>++++++++++++++++++++++ >> .../recipes-connectivity/openssl/openssl_1.0.2a.bb | 1 + >> 2 files changed, 54 insertions(+) >>create mode 100644 >>meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch >> >>diff --git >>a/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch >>b/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch >>new file mode 100644 >>index 0000000..46d1adf >>--- /dev/null >>+++ >>b/meta/recipes-connectivity/openssl/openssl/0001-Define-GCC_VERSION-macro-to-cover-upto-gcc-5.patch >>@@ -0,0 +1,53 @@ >>+From 0aa68f7681a74f6ff80a80c5843bc35e5effffb9 Mon Sep 17 00:00:00 2001 >>+From: Khem Raj <raj.khem@gmail.com> >>+Date: Fri, 22 May 2015 12:43:39 -0700 >>+Subject: [PATCH] Define GCC_VERSION macro to cover upto gcc-5 >>+ >>+Current check is limited to gcc 4 with minor versions >>+but when we use gcc 5.1, then minor version check fails >>+with current setup and we end up with build errors like >>+ >>+| In file included from bn_div.c:62:0: >>+| bn_div.c: In function 'BN_div': >>+| bn_lcl.h:311:9: error: impossible constraint in 'asm' >>+| asm ("dmultu %2,%3" \ >>+| ^ >>+| bn_div.c:402:13: note: in expansion of macro 'BN_UMULT_LOHI' >>+| BN_UMULT_LOHI(t2l, t2h, d1, q); >>+| ^ >>+| <builtin>: recipe for target 'bn_div.o' failed >>+| make[2]: *** [bn_div.o] Error 1 >>+ >>+Signed-off-by: Khem Raj <raj.khem@gmail.com> >>+ >>+--- >>+Upstream-Status: [Submitted] >>+ crypto/bn/bn_lcl.h | 5 ++++- >>+ 1 file changed, 4 insertions(+), 1 deletion(-) >>+ >>+diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h >>+index 196df7e..e801ba7 100644 >>+--- a/crypto/bn/bn_lcl.h >>++++ b/crypto/bn/bn_lcl.h >>+@@ -118,6 +118,9 @@ >>+ extern "C" { >>+ #endif >>+ >>++#define GCC_VERSION (__GNUC__ * 10000 \ >>++ + __GNUC_MINOR__ * 100 \ >>++ + __GNUC_PATCHLEVEL__) >>+ /*- >>+ * Bignum consistency macros >>+ * There is one "API" macro, bn_fix_top(), for stripping leading >>zeroes from >>+@@ -443,7 +446,7 @@ unsigned __int64 _umul128(unsigned __int64 a, >>unsigned __int64 b, >>+ # endif >>+ # elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || >>defined(SIXTY_FOUR_BIT_LONG)) >>+ # if defined(__GNUC__) && __GNUC__>=2 >>+-# if __GNUC__>=4 && __GNUC_MINOR__>=4 >>++# if GCC_VERSION > 40400 > > Not that it would really matter nowadays, but this should likely be >= you are right, I have sent another patch which actually is a backport of what was applied upstream ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] glibc: ignore for musl/uclibc but only for target recipes 2015-05-22 19:56 [PATCH 0/3] mips64/openssl gcc5 fix, musl and debug file system patch Khem Raj 2015-05-22 19:56 ` [PATCH 1/3] openssl: Fix build with gcc5 on mips64 Khem Raj @ 2015-05-22 19:56 ` Khem Raj 2015-05-28 4:58 ` Khem Raj 2015-05-22 19:56 ` [PATCH 3/3] image.bbclass: Add a method for creating a companion debug filesystem Khem Raj 2 siblings, 1 reply; 7+ messages in thread From: Khem Raj @ 2015-05-22 19:56 UTC (permalink / raw) To: openembedded-core we still need nativesdk or native recipes for libc to come from glibc, but only be ignored for target recipes types Change-Id: Ibaf8114f2aef63f1eadf493b264e78cd928535a0 Signed-off-by: Khem Raj <raj.khem@gmail.com> --- meta/recipes-core/glibc/glibc-collateral.inc | 3 +++ meta/recipes-core/glibc/glibc_2.21.bb | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/meta/recipes-core/glibc/glibc-collateral.inc b/meta/recipes-core/glibc/glibc-collateral.inc index f82db06..60655eb 100644 --- a/meta/recipes-core/glibc/glibc-collateral.inc +++ b/meta/recipes-core/glibc/glibc-collateral.inc @@ -17,3 +17,6 @@ do_compile[noexec] = "1" do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot" +COMPATIBLE_HOST_libc-musl_class-target = "null" +COMPATIBLE_HOST_libc-uclibc_class-target = "null" + diff --git a/meta/recipes-core/glibc/glibc_2.21.bb b/meta/recipes-core/glibc/glibc_2.21.bb index 0c28814..4b94cba 100644 --- a/meta/recipes-core/glibc/glibc_2.21.bb +++ b/meta/recipes-core/glibc/glibc_2.21.bb @@ -69,14 +69,11 @@ TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}" GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1" # -# We will skip parsing glibc when system C library selection is not glibc +# We will skip parsing glibc when target system C library selection is not glibc # this helps in easing out parsing for non-glibc system libraries # -python __anonymous () { - if d.getVar('TCLIBC', True) != "glibc": - raise bb.parse.SkipPackage("incompatible with %s C library" % - d.getVar('TCLIBC', True)) -} +COMPATIBLE_HOST_libc-musl_class-target = "null" +COMPATIBLE_HOST_libc-uclibc_class-target = "null" EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ --without-cvs --disable-profile \ -- 2.1.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] glibc: ignore for musl/uclibc but only for target recipes 2015-05-22 19:56 ` [PATCH 2/3] glibc: ignore for musl/uclibc but only for target recipes Khem Raj @ 2015-05-28 4:58 ` Khem Raj 0 siblings, 0 replies; 7+ messages in thread From: Khem Raj @ 2015-05-28 4:58 UTC (permalink / raw) To: Patches and discussions about the oe-core layer any issues with this patch, why was it dropped from last pull request ? On Fri, May 22, 2015 at 12:56 PM, Khem Raj <raj.khem@gmail.com> wrote: > we still need nativesdk or native recipes for libc to come > from glibc, but only be ignored for target recipes types > > Change-Id: Ibaf8114f2aef63f1eadf493b264e78cd928535a0 > Signed-off-by: Khem Raj <raj.khem@gmail.com> > --- > meta/recipes-core/glibc/glibc-collateral.inc | 3 +++ > meta/recipes-core/glibc/glibc_2.21.bb | 9 +++------ > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/meta/recipes-core/glibc/glibc-collateral.inc b/meta/recipes-core/glibc/glibc-collateral.inc > index f82db06..60655eb 100644 > --- a/meta/recipes-core/glibc/glibc-collateral.inc > +++ b/meta/recipes-core/glibc/glibc-collateral.inc > @@ -17,3 +17,6 @@ do_compile[noexec] = "1" > > do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot" > > +COMPATIBLE_HOST_libc-musl_class-target = "null" > +COMPATIBLE_HOST_libc-uclibc_class-target = "null" > + > diff --git a/meta/recipes-core/glibc/glibc_2.21.bb b/meta/recipes-core/glibc/glibc_2.21.bb > index 0c28814..4b94cba 100644 > --- a/meta/recipes-core/glibc/glibc_2.21.bb > +++ b/meta/recipes-core/glibc/glibc_2.21.bb > @@ -69,14 +69,11 @@ TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}" > GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1" > > # > -# We will skip parsing glibc when system C library selection is not glibc > +# We will skip parsing glibc when target system C library selection is not glibc > # this helps in easing out parsing for non-glibc system libraries > # > -python __anonymous () { > - if d.getVar('TCLIBC', True) != "glibc": > - raise bb.parse.SkipPackage("incompatible with %s C library" % > - d.getVar('TCLIBC', True)) > -} > +COMPATIBLE_HOST_libc-musl_class-target = "null" > +COMPATIBLE_HOST_libc-uclibc_class-target = "null" > > EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ > --without-cvs --disable-profile \ > -- > 2.1.4 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] image.bbclass: Add a method for creating a companion debug filesystem 2015-05-22 19:56 [PATCH 0/3] mips64/openssl gcc5 fix, musl and debug file system patch Khem Raj 2015-05-22 19:56 ` [PATCH 1/3] openssl: Fix build with gcc5 on mips64 Khem Raj 2015-05-22 19:56 ` [PATCH 2/3] glibc: ignore for musl/uclibc but only for target recipes Khem Raj @ 2015-05-22 19:56 ` Khem Raj 2 siblings, 0 replies; 7+ messages in thread From: Khem Raj @ 2015-05-22 19:56 UTC (permalink / raw) To: openembedded-core From: Mark Hatle <mark.hatle@windriver.com> The companion debug filesystem contains only the package database and the complementary *-dbg packages for the main filesystem component. This is useful in a production environment to produce a companion filesystem capable of remote system debugging, without requiring corresponding debug symbols or source code on the device. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> If dbg pkgs have already been installed to the rootfs image, the installation to companion debug filesystem will fail, because both of image creation make use of the same pm database. In this situation, try to copy installed dbg files from rootfs image to companion debug filesystem. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Acked-by: Christopher Larson <chris_larson@mentor.com> --- meta/classes/image.bbclass | 5 +++- meta/lib/oe/rootfs.py | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 01f8b3f..58b4add 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -24,6 +24,9 @@ IMAGE_FEATURES ?= "" IMAGE_FEATURES[type] = "list" IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs empty-root-password allow-empty-password post-install-logging" +# Generate companion debugfs? +IMAGE_GEN_DEBUGFS ?= "0" + # rootfs bootstrap install ROOTFS_BOOTSTRAP_INSTALL = "${@bb.utils.contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}" @@ -108,7 +111,7 @@ def rootfs_variables(d): 'SDK_OUTPUT','SDKPATHNATIVE','SDKTARGETSYSROOT','SDK_DIR','SDK_VENDOR','SDKIMAGE_INSTALL_COMPLEMENTARY','SDK_PACKAGE_ARCHS','SDK_OUTPUT','SDKTARGETSYSROOT','MULTILIBRE_ALLOW_REP', 'MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS','PACKAGE_ARCHS', 'PACKAGE_CLASSES','TARGET_VENDOR','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS', - 'COMPRESSIONTYPES'] + 'COMPRESSIONTYPES', 'IMAGE_GEN_DEBUGFS'] variables.extend(command_variables(d)) variables.extend(variable_depends(d)) return " ".join(variables) diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index ce23b23..7d86988 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -95,6 +95,57 @@ class Rootfs(object): def _cleanup(self): pass + def _setup_dbg_rootfs(self, dirs): + gen_debugfs = self.d.getVar('IMAGE_GEN_DEBUGFS', True) or '0' + if gen_debugfs != '1': + return + + bb.note(" Renaming the original rootfs...") + try: + shutil.rmtree(self.image_rootfs + '-orig') + except: + pass + os.rename(self.image_rootfs, self.image_rootfs + '-orig') + + bb.note(" Creating debug rootfs...") + bb.utils.mkdirhier(self.image_rootfs) + + bb.note(" Copying back package database...") + for dir in dirs: + bb.utils.mkdirhier(self.image_rootfs + os.path.dirname(dir)) + shutil.copytree(self.image_rootfs + '-orig' + dir, self.image_rootfs + dir) + + cpath = oe.cachedpath.CachedPath() + # Copy files located in /usr/lib/debug or /usr/src/debug + for dir in ["/usr/lib/debug", "/usr/src/debug"]: + src = self.image_rootfs + '-orig' + dir + if cpath.exists(src): + dst = self.image_rootfs + dir + bb.utils.mkdirhier(os.path.dirname(dst)) + shutil.copytree(src, dst) + + # Copy files with suffix '.debug' or located in '.debug' dir. + for root, dirs, files in cpath.walk(self.image_rootfs + '-orig'): + relative_dir = root[len(self.image_rootfs + '-orig'):] + for f in files: + if f.endswith('.debug') or '/.debug' in relative_dir: + bb.utils.mkdirhier(self.image_rootfs + relative_dir) + shutil.copy(os.path.join(root, f), + self.image_rootfs + relative_dir) + + bb.note(" Install complementary '*-dbg' packages...") + self.pm.install_complementary('*-dbg') + + bb.note(" Rename debug rootfs...") + try: + shutil.rmtree(self.image_rootfs + '-dbg') + except: + pass + os.rename(self.image_rootfs, self.image_rootfs + '-dbg') + + bb.note(" Restoreing original rootfs...") + os.rename(self.image_rootfs + '-orig', self.image_rootfs) + def _exec_shell_cmd(self, cmd): fakerootcmd = self.d.getVar('FAKEROOT', True) if fakerootcmd is not None: @@ -369,6 +420,8 @@ class RpmRootfs(Rootfs): self.pm.install_complementary() + self._setup_dbg_rootfs(['/etc/rpm', '/var/lib/rpm', '/var/lib/smart']) + if self.inc_rpm_image_gen == "1": self.pm.backup_packaging_data() @@ -472,6 +525,8 @@ class DpkgRootfs(Rootfs): self.pm.install_complementary() + self._setup_dbg_rootfs(['/var/lib/dpkg']) + self.pm.fix_broken_dependencies() self.pm.mark_packages("installed") @@ -740,6 +795,8 @@ class OpkgRootfs(Rootfs): self.pm.install_complementary() + self._setup_dbg_rootfs(['/var/lib/opkg']) + execute_pre_post_process(self.d, opkg_post_process_cmds) execute_pre_post_process(self.d, rootfs_post_install_cmds) -- 2.1.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-05-28 4:58 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-05-22 19:56 [PATCH 0/3] mips64/openssl gcc5 fix, musl and debug file system patch Khem Raj 2015-05-22 19:56 ` [PATCH 1/3] openssl: Fix build with gcc5 on mips64 Khem Raj 2015-05-25 19:22 ` Bernhard Reutner-Fischer 2015-05-28 4:53 ` Khem Raj 2015-05-22 19:56 ` [PATCH 2/3] glibc: ignore for musl/uclibc but only for target recipes Khem Raj 2015-05-28 4:58 ` Khem Raj 2015-05-22 19:56 ` [PATCH 3/3] image.bbclass: Add a method for creating a companion debug filesystem Khem Raj
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox