mkinitramfs.py: Search for busybox{.,-}static first#52
mkinitramfs.py: Search for busybox{.,-}static first#52amluto merged 1 commit intoamluto:masterfrom marcosps:mpdesouza_busybox_tumbleweed
Conversation
In currentl Tumbleweed, using busybox dynamic linked does not work. For now let's check if we have busybox static first. Fix: #51 Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
|
Funny, I was just looking at that code a few hours ago (unrelatedly to the ongoing discussion in #51) and thinking I probably should have put the static suffixes first in that list... |
|
@zevweiss so maybe this is the right/safe choice? |
|
I'd think so, yeah -- Granted, I suppose even with this patch it'd still be vulernable to misbehaving if there's, say, a dynamic for p in itertools.product(['-static', '.static', ''],
['usr/local', 'usr', ''],
['bin', 'sbin']):
path = os.path.join(root, p[1], p[2], 'busybox' + p[0])to search for an explicitly-static one everywhere before falling back to a maybe-dynamic one. |
|
Yeah, let's do @zevweiss's version. Bonus points for parsing just enough of the ELF header to confirm it's static in lieu of actually doing #13. Although I'm not entirely opposed to having a nice mechanism to pull in dynamic dependencies, but it's certainly simpler and faster to use the static binary if we can find it. |
|
I can confirm this patch fixes the problem I observed running virtme on openSUSE Leap 15.1 with |
|
Hmm, though on a related topic I notice the README says, regarding the busybox binary, "somewhere in your path"; to actually match that, perhaps ideally we'd incorporate |
|
I'm going to merge this PR and then improve it a bit on top. |
Now the algorithm prefers the 'static' versions regardless of path, and it searches PATH first (for native) as advertised. See issue #52. Signed-off-by: Andy Lutomirski <luto@kernel.org>
In currentl Tumbleweed, using busybox dynamic linked does not work. For
now let's check if we have busybox static first.
Fix: #51
Signed-off-by: Marcos Paulo de Souza mpdesouza@suse.com