Skip to contentSkip to conversation

New: post-build scritp - symlinks created in post-build script are overwritten after exit of the script

Buildroot bugzilla at busybox.net 1 participant 3 messages Apr 20, 2017

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=9826

Bug ID: 9826
Summary: post-build scritp - symlinks created in post-build
script are overwritten after exit of the script
Product: buildroot
Version: 2017.02
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: timo.valimaki at sensoan.com
CC: buildroot at uclibc.org
Target Milestone: ---

I'm trying to symlink /etc/group, /etc/passwd and /etc/shadow to RW partition, in my case to /data/etc (rootfs-overlay).

I created a post-build that moves above files to /data/etc/ directory and creates symlinks pointing to the moved files. When I'm pausing my post-build script just before the exit everything is looking fine.

/output/target:

lrwxrwxrwx  1 timo timo    17 huhti 20 12:24 group -> ../data/etc/group
lrwxrwxrwx  1 timo timo    18 huhti 20 12:24 passwd -> ../data/etc/passwd
lrwxrwxrwx  1 timo timo    18 huhti 20 12:24 shadow -> ../data/etc/shadow

But when the Buildroot build is finished the above symlinks are overwritten

-rw-r--r--  1 timo timo   320 huhti 20 12:29 group
-rw-r--r--  1 timo timo   389 huhti 20 12:29 passwd
-rw-------  1 timo timo   291 huhti 20 12:29 shadow

Q: Is this as specified or a bug?
Q: If as specified, what is correct way to symlink above files?

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 9826] post-build scritp - symlinks created in post-build script are overwritten after exit of the script

https://bugs.busybox.net/show_bug.cgi?id=9826

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |yann.morin.1998 at free.fr

--- Comment #1 from Yann E. MORIN <[email protected]> --- Timo,

This is (somewhat) expected. When creating the filsystem images, there is a part creating the passwd, groups and shadow (and possibly, gshadow) files from the setting in Buildroot.

This will forcibly create files (AFAIR).

So, what you want to provide is probably a "fakeroot" script. This will be called after the passwd, group and shadow files are created, but before the images are assembled.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 9826] post-build scritp - symlinks created in post-build script are overwritten after exit of the script

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=9826

Timo V?lim?ki <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #2 from Timo V?lim?ki <[email protected]> --- Thanks.

I have totally missed the fakeroot script - perhaps I have just skipped it as didn't understood when to use it.

I moved /etc/group, /etc/passwd and /etc/shadow handling from post-build script to fakeroot script. Result: works as it should be.

I mark bug resolved as invalid.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.