Skip to contentSkip to conversation

archiver.bbclass: Improve work-shared checking

PATCH In review [email protected] 2 participants 5 messages Dec 11, 2023 – Jun 6, 2024 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

cover archiver.bbclass: Improve work-shared checking

From: Robert Yang <[email protected]>

The following changes since commit 564339afb73fc52a66c1a08437587cad1c4d46e7:

useradd: Fix useradd do_populate_sysroot dependency bug (2023-12-10 09:23:58 +0000)

are available in the Git repository at:

https://github.com/robertlinux/yocto rbt/archiver
https://github.com/robertlinux/yocto/tree/rbt/archiver

Robert Yang (1):
archiver.bbclass: Improve work-shared checking

 meta/classes/archiver.bbclass | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.42.0
#1 lore raw

PATCH 1/1 archiver.bbclass: Improve work-shared checking

From: Robert Yang <[email protected]>

There are other recipes except the listed ones which use work-shared, improve the checking to make other recipes such as llvm-project-source work with do_ar_patched.

---
 meta/classes/archiver.bbclass | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta/classes/archiver.bbclass +2 -4
index 0eee1abefab..80a69cf31db 100644
@@ -468,10 +468,8 @@ def create_diff_gz(d, src_orig, src, ar_outdir):
         os.chdir(cwd)
 
 def is_work_shared(d):
-    pn = d.getVar('PN')
-    return pn.startswith('gcc-source') or \
-        bb.data.inherits_class('kernel', d) or \
-        (bb.data.inherits_class('kernelsrc', d) and d.expand("${TMPDIR}/work-shared") in d.getVar('S'))
+    sharedworkdir = os.path.join(d.getVar('TMPDIR'), 'work-shared')
+    return d.getVar('S').startswith(sharedworkdir)
 
 # Run do_unpack and do_patch
 python do_unpack_and_patch() {
Signature · 1 line
2.42.0
#2 lore raw

Hi,

https://github.com/openembedded/openembedded-core/commit/5fbb4ca8da4f4f1ea426275c45634802dcb5a575

This patch caused something terrible wrong behavior, because ".../work-shared/<MACHINE>/kernel-source/" directory is totally empty and the complete Linux kernel source is missing if INHERIT += "archiver" is used in local.conf file. Please fix it and if there any workaround please send it because at the moment without usage of INHERIT += "archiver" Yocto scarthgap build is working but with use it, all the time it failed to compile Linux kernel because git symbolic folder which linked to kernel-source is totally empty in this case in linux working directory.

I use the following settings when i try to making archives but it is failed to build/fetch kernel source to kernel-source directory (it was fine to use in nanbield release before).

INHERIT += "archiver"
ARCHIVER_MODE[src] = "patched"
ARCHIVER_MODE[compression] = "bz2"
ARCHIVER_MODE[mirror] = "combined"
COPYLEFT_RECIPE_TYPES = "target"
COPYLEFT_AVAILABLE_RECIPE_TYPES = "target"

# Don't filter the license
COPYLEFT_LICENSE_INCLUDE = ""
COPYLEFT_LICENSE_EXCLUDE = ""

# Deploy licenses
COPY_LIC_MANIFEST = "1"
COPY_LIC_DIRS = "1"
LICENSE_CREATE_PACKAGE = "1"

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi Livius,

Quoted 17 lines · Livius

[Edited Message Follows]

Hi,

https://github.com/openembedded/openembedded-core/commit/5fbb4ca8da4f4f1ea426275c45634802dcb5a575

This patch caused something terrible wrong behavior, because ".../work-shared/<MACHINE>/kernel-source/" directory is totally empty and the complete Linux kernel source is missing if INHERIT += "archiver" is used in local.conf file. Please fix it and if there any workaround please send it because at the moment without usage of INHERIT += "archiver" Yocto scarthgap build is working but with use it, all the time it failed to compile Linux kernel because git symbolic folder which linked to kernel-source is totally empty in this case in linux working directory.

I use the following settings when i try to making archives but it is failed to fetch kernel source to kernel-source directory (it was fine to use in nanbield release before).

INHERIT += "archiver"
ARCHIVER_MODE[src] = "patched"
ARCHIVER_MODE[compression] = "bz2"
ARCHIVER_MODE[mirror] = "combined"
COPYLEFT_RECIPE_TYPES = "target"
COPYLEFT_AVAILABLE_RECIPE_TYPES = "target"

Quoted 8 lines

# Don't filter the license
COPYLEFT_LICENSE_INCLUDE = ""
COPYLEFT_LICENSE_EXCLUDE = ""

# Deploy licenses
COPY_LIC_MANIFEST = "1"
COPY_LIC_DIRS = "1"
LICENSE_CREATE_PACKAGE = "1"

I added the above settings to conf/layer.conf, and started a fresh build on scarthgap branch, it works well for me:

commit ae6cebca5bac9521230c69fed23b375d0de7f5f6 (HEAD -> scarthgap, origin/scarthgap)

$ bitbake linux-yocto
$ ls tmp/deploy/images/qemux86-64/* -1
tmp/deploy/images/qemux86-64/bzImage
tmp/deploy/images/qemux86-64/bzImage--6.6.23+git0+f7f00b22ef_2d01bc1d4e-r0-qemux86-64-20240606092927.bin
tmp/deploy/images/qemux86-64/bzImage-qemux86-64.bin
tmp/deploy/images/qemux86-64/modules--6.6.23+git0+f7f00b22ef_2d01bc1d4e-r0-qemux86-64-20240606092927.tgz
tmp/deploy/images/qemux86-64/modules-qemux86-64.tgz
$ du -sh tmp/deploy/sources/x86_64-poky-linux/linux-yocto-6.6.23+git-r0/linux-yocto-6.6.23+
git-r0-patched.tar.bz2
168M tmp/deploy/sources/x86_64-poky-linux/linux-yocto-6.6.23+git-r0/linux-yocto-6.6.23+git-r0-patched.tar.bz2

// Robert

Quoted 11 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200381): https://lists.openembedded.org/g/openembedded-core/message/200381
Mute This Topic: https://lists.openembedded.org/mt/103110276/7304958
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw

It seems to me i found, when it can not work well.
I use linux-fslc recipe from meta-freescale which redefining somewhy source directory in linux-imx.inc file.

https://github.com/Freescale/meta-freescale/blob/master/recipes-kernel/linux/linux-imx.inc#L22
S = "${WORKDIR}/git"

In kernel.bbclass it is the default S = "${STAGING_KERNEL_DIR}" value. This patch should work well only if the linux-kernel recipe use the default source dir as STAGING_KERNEL_DIR. If any other BSP provider company uses for example S = "${WORKDIR}/git", their linux-kernel recipe build/compiling will be failed in case of use archiver class.