Skip to contentSkip to conversation

New: Embedded Shell Scripts in BusyBox

Buildroot bugzilla at busybox.net 1 participant 4 messages May 3, 2019

lore
Share & tools
lore
#0 lore raw

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

Bug ID: 11836
Summary: Embedded Shell Scripts in BusyBox
Product: buildroot
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: br-max at re-gister.com
CC: buildroot at uclibc.org
Target Milestone: ---

BusyBox has the feature to embed custom shell scripts into the main binary during the build process.
Details are described at the following link:
https://git.busybox.net/busybox/tree/docs/embedded-scripts.txt

If the BusyBox config FEATURE_SH_EMBEDDED_SCRIPTS is set to yes (which is the default setting), all scripts from the 'embed' directory of the BusyBox build folder are compressed and embedded in the BusyBox binary.

It would be great to be able to use this feature with buildroot, but (please correct me if I'm wrong) unfortunately there is no configuration option in buildroot to add custom scripts to the 'embed' directory of the BusyBox build folder.

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

[Buildroot] [Bug 11836] Embedded Shell Scripts in BusyBox

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

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

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

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

Quoted 1 line

It would be great to be able to use [embedded scripts]

What is the advantage over having the scripts installed in /bin or /usr/bin instead? If you are concerned about space that much that you want to take advantage of busybox' compression of the scripts, you would anyway consider a compressed filesystem like squashfs anyway, so the space gain would probably be ridiculous.

Quoted 1 line

there is no configuration option in buildroot [for that]

Indeed no, but it should not be overly complex to add. Yet, I'd like to see a good explanations why that would be better than to have the scripts in the filesystem instead.

Regards,
Yann E. MORIN.

PS. Yes, support for embedded scripts is enabled in a default build, but that's an accident: our busybox .config was created before embedded scripts were a thing, so they are not explicitly disabled in our .config, and since the default for them in busybox is 'y', we end up with a buysbox that has support for embedded script (but no such script).

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

[Buildroot] [Bug 11836] Embedded Shell Scripts in BusyBox

In reply to bugzilla at busybox.net

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

--- Comment #2 from Max <[email protected]> ---
Beside the benefit of additional free space on the target filesystem (due to the compression of the scripts), another advantage is that it is not necessary to take care about script file permissions (there is no need to set execute-permissions when the scripts are embedded into the BusyBox binary).

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

[Buildroot] [Bug 11836] Embedded Shell Scripts in BusyBox

In reply to bugzilla at busybox.net

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

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

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

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

--- Comment #3 from Yann E. MORIN <[email protected]> --- Max, All,

Quoted 2 lines

Beside the benefit of additional free space on the target filesystem (due to the compression of the scripts),

As I said: if you are really concerned about the size of the scripts that you need them to be compressed, you will probably better benefit from a compressed filesystem to begin with, like squashfs, which would compress everything, from busybox itself, to the libraries it uses like libc et al. to all the files on the systems, and not just the few scripts that are embedded in the busybox binary.

Honestly, I doubt embedding the scripts in the busybox binary wins over having a squashfs, but I'd like to see numbers.

Quoted 3 lines

another advantage is that it is not necessary to take care about script file permissions (there is no need to set execute-permissions when the scripts are embedded into the BusyBox binary).

If you can't track the executable bit on your scripts, you have a big problem in your tooling and/or process and/or build environment.

Again, I am not opposed to having support for embedded scripts, but I'd like to see a *convincing* argument...

BTW, this is not a bug, but an enhancement request. We usually take new features as patches sent to the mailing list, so I'm closing this bug.

Regards,
Yann E. MORIN.

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