* [PATCH 0/2] Fix nativesdk-intercepts for chown/chgrp
@ 2023-09-07 11:38 Eilís 'pidge' Ní Fhlannagáin
2023-09-07 11:38 ` [PATCH 1/2] populate_sdk_base.bbclass: PATH to nativesdk-intercept chown/chgrp Eilís 'pidge' Ní Fhlannagáin
2023-09-07 11:38 ` [PATCH 2/2] nativesdk-intercept: Fix bad intercept chgrp/chown logic Eilís 'pidge' Ní Fhlannagáin
0 siblings, 2 replies; 4+ messages in thread
From: Eilís 'pidge' Ní Fhlannagáin @ 2023-09-07 11:38 UTC (permalink / raw)
To: openembedded-core
This set of patches started out with fixing #15023 where building the sdk with
api-documentation set would fail out. This patch series fixes both of the main
underlying issues.
First, populate_sdk did not the nativesdk chown/chgrp intercepts in $PATH.
The second issue was within the chown/chgrp intercepts which were causing them
to fail badly. I'm not entirely sure these ever worked as prior to my fix the
args for os.execv were:
./scripts/nativesdk-intercept/chown -R pidge:pidge README.md
['root:root', '-R', 'pidge:pidge', 'README.md']
after (which is correct):
./scripts/nativesdk-intercept/chown -R pidge:pidge README.md
['/usr/bin/chown', '-R', 'root:root', 'README.md']
Eilís 'pidge' Ní Fhlannagáin (2):
populate_sdk_base.bbclass: PATH to nativesdk-intercept chown/chgrp
nativesdk-intercept: Fix bad intercept chgrp/chown logic
meta/classes-recipe/populate_sdk_base.bbclass | 1 +
scripts/nativesdk-intercept/chgrp | 5 ++++-
scripts/nativesdk-intercept/chown | 5 ++++-
3 files changed, 9 insertions(+), 2 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] populate_sdk_base.bbclass: PATH to nativesdk-intercept chown/chgrp
2023-09-07 11:38 [PATCH 0/2] Fix nativesdk-intercepts for chown/chgrp Eilís 'pidge' Ní Fhlannagáin
@ 2023-09-07 11:38 ` Eilís 'pidge' Ní Fhlannagáin
2023-09-07 13:49 ` [OE-core] " Richard Purdie
2023-09-07 11:38 ` [PATCH 2/2] nativesdk-intercept: Fix bad intercept chgrp/chown logic Eilís 'pidge' Ní Fhlannagáin
1 sibling, 1 reply; 4+ messages in thread
From: Eilís 'pidge' Ní Fhlannagáin @ 2023-09-07 11:38 UTC (permalink / raw)
To: openembedded-core
[YOCTO #15023]
This patch fixes building the sdk with api-documentation enabled by
appending PATH with the nativesdk-intercept directory which contains a
special version of chown and chgrp.
Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
---
meta/classes-recipe/populate_sdk_base.bbclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
index b23ea26d409..632266cc162 100644
--- a/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/meta/classes-recipe/populate_sdk_base.bbclass
@@ -17,6 +17,7 @@ COMPLEMENTARY_GLOB[dbg-pkgs] = '*-dbg'
COMPLEMENTARY_GLOB[src-pkgs] = '*-src'
COMPLEMENTARY_GLOB[ptest-pkgs] = '*-ptest ${MLPREFIX}ptest-runner'
COMPLEMENTARY_GLOB[bash-completion-pkgs] = '*-bash-completion'
+PATH:prepend = "${COREBASE}/scripts/nativesdk-intercept:"
def complementary_globs(featurevar, d):
all_globs = d.getVarFlags('COMPLEMENTARY_GLOB')
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [OE-core] [PATCH 1/2] populate_sdk_base.bbclass: PATH to nativesdk-intercept chown/chgrp
2023-09-07 11:38 ` [PATCH 1/2] populate_sdk_base.bbclass: PATH to nativesdk-intercept chown/chgrp Eilís 'pidge' Ní Fhlannagáin
@ 2023-09-07 13:49 ` Richard Purdie
0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2023-09-07 13:49 UTC (permalink / raw)
To: Eilís 'pidge' Ní Fhlannagáin,
openembedded-core
On Thu, 2023-09-07 at 11:38 +0000, Eilís 'pidge' Ní Fhlannagáin wrote:
> [YOCTO #15023]
>
> This patch fixes building the sdk with api-documentation enabled by
> appending PATH with the nativesdk-intercept directory which contains a
> special version of chown and chgrp.
>
> Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
> ---
> meta/classes-recipe/populate_sdk_base.bbclass | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
> index b23ea26d409..632266cc162 100644
> --- a/meta/classes-recipe/populate_sdk_base.bbclass
> +++ b/meta/classes-recipe/populate_sdk_base.bbclass
> @@ -17,6 +17,7 @@ COMPLEMENTARY_GLOB[dbg-pkgs] = '*-dbg'
> COMPLEMENTARY_GLOB[src-pkgs] = '*-src'
> COMPLEMENTARY_GLOB[ptest-pkgs] = '*-ptest ${MLPREFIX}ptest-runner'
> COMPLEMENTARY_GLOB[bash-completion-pkgs] = '*-bash-completion'
> +PATH:prepend = "${COREBASE}/scripts/nativesdk-intercept:"
>
> def complementary_globs(featurevar, d):
> all_globs = d.getVarFlags('COMPLEMENTARY_GLOB')
Sorry to be the bearer of bad news but that won't work. The class is
included for normal rootfs generation as well as sdk generation and so
it would add the intercepts for normal rootfs too :(
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] nativesdk-intercept: Fix bad intercept chgrp/chown logic
2023-09-07 11:38 [PATCH 0/2] Fix nativesdk-intercepts for chown/chgrp Eilís 'pidge' Ní Fhlannagáin
2023-09-07 11:38 ` [PATCH 1/2] populate_sdk_base.bbclass: PATH to nativesdk-intercept chown/chgrp Eilís 'pidge' Ní Fhlannagáin
@ 2023-09-07 11:38 ` Eilís 'pidge' Ní Fhlannagáin
1 sibling, 0 replies; 4+ messages in thread
From: Eilís 'pidge' Ní Fhlannagáin @ 2023-09-07 11:38 UTC (permalink / raw)
To: openembedded-core
Running either of these ends up corrupting the os.execv args.
If we run:
./scripts/nativesdk-intercept/chown -R foo:foo bar
The loop here ends up missing the conversion of foo:foo to root:root because
it sees sys.argv[0] and assumes that it's the user:group argument and that we
should convert that. We end up a os.execv(path, args) that have the following
args:
['root:root', '-R', 'foo:foo', 'bar']
As os.execv ignores args[0], we can just populate it with sys.argv[0] and then
loop through sys.argv[1:]. As both chgrp and chown would have either flags and
USER[:GROUP] next, this fixes the issue.
Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
---
scripts/nativesdk-intercept/chgrp | 5 ++++-
scripts/nativesdk-intercept/chown | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/scripts/nativesdk-intercept/chgrp b/scripts/nativesdk-intercept/chgrp
index 30cc417d3ac..f8ae84b8b3f 100755
--- a/scripts/nativesdk-intercept/chgrp
+++ b/scripts/nativesdk-intercept/chgrp
@@ -14,7 +14,10 @@ real_chgrp = shutil.which('chgrp', path=path)
args = list()
found = False
-for i in sys.argv:
+
+args.append(real_chgrp)
+
+for i in sys.argv[1:]:
if i.startswith("-"):
args.append(i)
continue
diff --git a/scripts/nativesdk-intercept/chown b/scripts/nativesdk-intercept/chown
index 3914b3e3841..0805ceb70a8 100755
--- a/scripts/nativesdk-intercept/chown
+++ b/scripts/nativesdk-intercept/chown
@@ -14,7 +14,10 @@ real_chown = shutil.which('chown', path=path)
args = list()
found = False
-for i in sys.argv:
+
+args.append(real_chown)
+
+for i in sys.argv[1:]:
if i.startswith("-"):
args.append(i)
continue
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-07 13:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-07 11:38 [PATCH 0/2] Fix nativesdk-intercepts for chown/chgrp Eilís 'pidge' Ní Fhlannagáin
2023-09-07 11:38 ` [PATCH 1/2] populate_sdk_base.bbclass: PATH to nativesdk-intercept chown/chgrp Eilís 'pidge' Ní Fhlannagáin
2023-09-07 13:49 ` [OE-core] " Richard Purdie
2023-09-07 11:38 ` [PATCH 2/2] nativesdk-intercept: Fix bad intercept chgrp/chown logic Eilís 'pidge' Ní Fhlannagáin
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.