For small/embedded systems busybox can be used as big part of the system (USE="make-symlinks"), but sometimes its important to have regular tools (kbd/util-linux/shadow/etc). In this case updating busybox's symlinks overwrite important parts of the system. I suggest use tar "keep-old-files" mode for creating symlinks (tar -k) Reproducible: Always
Created attachment 316189 [details, diff] cp -n (--no-clobber) is not destructive This patch makes ebuild less destructive, in cases when you want use busybox for most, but not all system components.
Comment on attachment 316189 [details, diff] cp -n (--no-clobber) is not destructive i don't think that'll work as that flag isn't in POSIX :/ http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cp.html
Created attachment 612890 [details, diff] force cp to be nondestructive Posix compliant workaround for non-destructive cp
Created attachment 675667 [details, diff] Make USE=make-symlinks safer Here’s another approach: only install an applet symlink if that name cannot be found in the usual /usr/sbin:/usr/bin:/sbin:/bin . This guarantees the user can’t screw their system up, because it prevents a BB applet from both overwriting and hiding the “full” program (by installing a symlink in a different directory).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50b3efe86028e0e7d184d3a5c4a36c11f3388b6f commit 50b3efe86028e0e7d184d3a5c4a36c11f3388b6f Author: Jakov Smolic <jakov.smolic@sartura.hr> AuthorDate: 2021-08-16 16:31:47 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-08-16 16:35:39 +0000 sys-apps/busybox: Don't overwrite existing files when using make-symlinks Closes: https://bugs.gentoo.org/417263 Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr> Closes: https://github.com/gentoo/gentoo/pull/21353 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/busybox/busybox-1.33.1-r1.ebuild | 343 ++++++++++++++++++++++++++++++ sys-apps/busybox/busybox-9999.ebuild | 2 +- 2 files changed, 344 insertions(+), 1 deletion(-)