Skip to contentSkip to conversation

wic populate-ext fix

PATCH In review Tom Zanussi 5 participants 6 messages Oct 16, 2013 – Oct 18, 2013

lore
Share & tools
lore
#0 lore raw

cover wic populate-ext fix

This is the pseudo version of the previously submitted fakeroot fix to the wic populate-ext bug.

The following changes since commit 68a41d2afd3392c59f78398913aa3855225cc52d:

glib-2.0: fix build on Aarch64 (2013-10-16 13:33:59 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib.git tzanussi/wic-fixes-1
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-fixes-1

Tom Zanussi (1):
wic: add pseudo to the populate-extfs step

 scripts/lib/mic/kickstart/custom_commands/partition.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.11.4
#1 lore raw

PATCH 1/1 wic: add pseudo to the populate-extfs step

Without this, files in the generated filesystem pick up the wrong ownership.

---
 scripts/lib/mic/kickstart/custom_commands/partition.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
scripts/lib/mic/kickstart/custom_commands/partition.py +8 -1
index 302cace..0eb0671 100644
@@ -216,7 +216,14 @@ class Wic_PartData(Mic_PartData):
         """
         Prepare content for an ext2/3/4 rootfs partition.
         """
-        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
+        populate_script = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot
+        populate_script += "export PSEUDO_LOCALSTATEDIR=%s/../pseudo;" % rootfs_dir
+        populate_script += "export PSEUDO_PASSWD=%s;" % rootfs_dir
+        populate_script += "export PSEUDO_NOSYMLINKEXP=1;"
+        populate_script += "export PSEUDO_DISABLED=0;"
+        populate_script += "%s/usr/bin/pseudo %s/usr/bin/populate-extfs.sh" % \
+            (native_sysroot, native_sysroot)
+
         image_extra_space = 10240
 
         image_rootfs = rootfs_dir
Signature · 1 line
1.7.11.4
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] wic: add pseudo to the populate-extfs step

Quoted 18 lines · Tom Zanussi

Without this, files in the generated filesystem pick up the wrong ownership.

---
 scripts/lib/mic/kickstart/custom_commands/partition.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
scripts/lib/mic/kickstart/custom_commands/partition.py +1 -1
index 302cace..0eb0671 100644
@@ -216,7 +216,14 @@ class Wic_PartData(Mic_PartData):
         """
         Prepare content for an ext2/3/4 rootfs partition.
         """
-        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
+        populate_script = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot

scripts/lib/mic/kickstart/custom_commands/partition.py class Wic_PartData(Mic_PartData): · line 229

Quoted 10 lines
scripts/lib/mic/kickstart/custom_commands/partition.py +7 -0
+        populate_script += "export PSEUDO_LOCALSTATEDIR=%s/../pseudo;" % rootfs_dir
+        populate_script += "export PSEUDO_PASSWD=%s;" % rootfs_dir
+        populate_script += "export PSEUDO_NOSYMLINKEXP=1;"
+        populate_script += "export PSEUDO_DISABLED=0;"
+        populate_script += "%s/usr/bin/pseudo %s/usr/bin/populate-extfs.sh" % \
+            (native_sysroot, native_sysroot)
+
         image_extra_space = 10240
 
         image_rootfs = rootfs_dir

This resolved the failure to login permissions issue.

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#3 lore raw

Re: [PATCH 1/1] wic: add pseudo to the populate-extfs step

In reply to Tom Zanussi
Quoted 18 lines · Tom Zanussi

Without this, files in the generated filesystem pick up the wrong ownership.

---
 scripts/lib/mic/kickstart/custom_commands/partition.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
scripts/lib/mic/kickstart/custom_commands/partition.py +1 -1
index 302cace..0eb0671 100644
@@ -216,7 +216,14 @@ class Wic_PartData(Mic_PartData):
         """
         Prepare content for an ext2/3/4 rootfs partition.
         """
-        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
+        populate_script = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot

scripts/lib/mic/kickstart/custom_commands/partition.py class Wic_PartData(Mic_PartData): · line 229

Quoted 10 lines
scripts/lib/mic/kickstart/custom_commands/partition.py +7 -0
+        populate_script += "export PSEUDO_LOCALSTATEDIR=%s/../pseudo;" % rootfs_dir
+        populate_script += "export PSEUDO_PASSWD=%s;" % rootfs_dir
+        populate_script += "export PSEUDO_NOSYMLINKEXP=1;"
+        populate_script += "export PSEUDO_DISABLED=0;"
+        populate_script += "%s/usr/bin/pseudo %s/usr/bin/populate-extfs.sh" % \
+            (native_sysroot, native_sysroot)
+
         image_extra_space = 10240
 
         image_rootfs = rootfs_dir

I've merged this but I would like to figure out why pseudo can't manage more sane defaults rather than needing all of those variables...

Cheers,

Richard

#4 lore raw

Re: [PATCH 1/1] wic: add pseudo to the populate-extfs step

Quoted 9 lines · Richard Purdie
Quoted 8 lines · Tom Zanussi

Without this, files in the generated filesystem pick up the wrong ownership.

---
  scripts/lib/mic/kickstart/custom_commands/partition.py | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
Quoted 12 lines

scripts/lib/mic/kickstart/custom_commands/partition.py class Wic_PartData(Mic_PartData): · line 221

Quoted 12 lines
scripts/lib/mic/kickstart/custom_commands/partition.py +3 -1
index 302cace..0eb0671 100644
@@ -216,7 +216,14 @@ class Wic_PartData(Mic_PartData):
          """
          Prepare content for an ext2/3/4 rootfs partition.
          """
-        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
+        populate_script = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot
+        populate_script += "export PSEUDO_LOCALSTATEDIR=%s/../pseudo;" % rootfs_dir
+        populate_script += "export PSEUDO_PASSWD=%s;" % rootfs_dir

Location of the passwd file, if we are in a chroot, it will use the chroot'd version, otherwise you need to tell pseudo where it is.

Quoted 1 line

scripts/lib/mic/kickstart/custom_commands/partition.py class Wic_PartData(Mic_PartData): · line 222

Quoted 1 line
scripts/lib/mic/kickstart/custom_commands/partition.py +1 -0
+        populate_script += "export PSEUDO_NOSYMLINKEXP=1;"

This controls how the symlinks are populated from the point of view of non-pseudo environment. If you intend to manipulate the results (and make them useful) -outside- of the pseudo environment, you need this. If you do all of your operations from within pseudo, the defaults are correct. Otherwise you can get links such as "/bin/sh -> /bin/bash" and it points to the host's bash, not the chroot's /bin/bash.

Quoted 1 line

scripts/lib/mic/kickstart/custom_commands/partition.py class Wic_PartData(Mic_PartData): · line 223

Quoted 1 line
scripts/lib/mic/kickstart/custom_commands/partition.py +1 -0
+        populate_script += "export PSEUDO_DISABLED=0;"

This shouldn't have to be set, unless the disabled has been previously set in the environment.

Quoted 20 lines

scripts/lib/mic/kickstart/custom_commands/partition.py class Wic_PartData(Mic_PartData): · line 229

Quoted 6 lines
scripts/lib/mic/kickstart/custom_commands/partition.py +3 -0
+        populate_script += "%s/usr/bin/pseudo %s/usr/bin/populate-extfs.sh" % \
+            (native_sysroot, native_sysroot)
+
          image_extra_space = 10240
 
          image_rootfs = rootfs_dir

I've merged this but I would like to figure out why pseudo can't manage more sane defaults rather than needing all of those variables...

Cheers,

Richard

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#5 lore raw

Re: [PATCH 1/1] wic: add pseudo to the populate-extfs step

In reply to Richard Purdie
Quoted 11 lines · On Fri, 18 Oct 2013 16:04:30 +0100 Richard Purdie…
Quoted 11 lines
scripts/lib/mic/kickstart/custom_commands/partition.py +8 -1
-        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
+        populate_script = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot
+        populate_script += "export PSEUDO_LOCALSTATEDIR=%s/../pseudo;" % rootfs_dir
+        populate_script += "export PSEUDO_PASSWD=%s;" % rootfs_dir
+        populate_script += "export PSEUDO_NOSYMLINKEXP=1;"
+        populate_script += "export PSEUDO_DISABLED=0;"
+        populate_script += "%s/usr/bin/pseudo %s/usr/bin/populate-extfs.sh" % \
+            (native_sysroot, native_sysroot)
+
         image_extra_space = 10240
Quoted 4 lines
Quoted 1 line

image_rootfs = rootfs_dir

I've merged this but I would like to figure out why pseudo can't manage more sane defaults rather than needing all of those variables...

Good question. Historical answer:

You need PREFIX to figure out where libpseudo.so is. LOCALSTATEDIR is there becaus one copy of libpseudo.so can correspond to several different state dirs. PASSWD is an optional feature, and not enabled by default; maybe it should be, but the question of what path to use for it is not obvious. I suppose it could be changed to default to / or the current chroot directory, but I don't know that that would help. NOSYMLINKEXP is behavior which may be desireable or undesireable, and it's really usage-specific. Not sure why DISABLED=0 is needed here.

In a lot of these cases, there's no meaningful way to make a sane default. I suppose in theory we could search through LD_LIBRARY_PATH to find a libpseudo.so and guess PREFIX from that, the other bits are pretty hard to define good defaults for. Arguably, NOSYMLINKEXP has a sane default, it's just that this is the use case for which the sane default isn't the right choice.

And I was thinking a bit about a config file, but that wouldn't really work for several of these; you don't necessarily want NOSYMLINKEXP shared between different clients running against the same tree.

-s

Signature · 1 line
Listen, get this.  Nobody with a good compiler needs to be justified.