Skip to content

Commit 4c60d47

Browse files
committed
ash/hush: enable full shell feature set; fix missing builtins on old busybox
Both recipes start from `make allnoconfig` and enable a curated CONFIG list. This fixes missing builtins, fills out the feature set, and fixes a reproducibility bug. Missing builtins on old versions: BusyBox renamed several symbols at 1.27.2 (ASH_BUILTIN_ECHO/PRINTF/TEST -> ASH_ECHO/PRINTF/TEST, SH_MATH_SUPPORT[_64] -> FEATURE_SH_MATH[_64]). The lists used only the modern names, so the append+oldconfig flow silently dropped them on <=1.26.2 and the 1.2.x island: ash there shipped with no echo/printf/test builtin (and, being non-standalone, no /bin/echo fallback) and no arithmetic; hush had no $(( )) on those versions. Both legacy and modern names are now listed so each applies where it exists. (Old hush echo/printf/test are unconditional, so they need no symbol.) Completed the feature set: every CONFIG-gated builtin is enabled (getopts, help, command, readonly, times, type, [[, source, let, ...), plus ASH/HUSH_BASH_COMPAT, brace expansion, $LINENO, interactive line editing (history, tab completion, reverse search, vi mode) and Unicode. hush previously had no arithmetic at all (FEATURE_SH_MATH was unset) and no aliases. Config/build fixes required by the new features, across all eras: - Pin the NEW int symbols (FEATURE_EDITING_MAX_LEN/HISTORY, SUBST_WCHAR): make oldconfig prompts for them and aborts on the build's closed stdin otherwise. - Stop sed-forcing the SH_IS "sh alias" choice: setting a choice member leaves two =y and makes oldconfig re-prompt the choice. Irrelevant for our directly-invoked binary anyway. - Drop FEATURE_USERNAME_COMPLETION: old busybox complete_username() uses getpwent_r(), a glibc extension musl lacks, breaking the static link. Reproducibility fix: ash and hush share build_srcdir (busybox/<version>), so `rm -rf "${build_srcdir}"` is now done before extraction. Without it, building both shells of one version in a single container (`shvr.sh build ash_X hush_X`, as the Dockerfile does) leaves the first shell's build tree in place; on ancient busybox `make` reuses stale objects and the second binary is non-reproducible (observed as a hush_1.2.2.1 checksum mismatch vs CI's isolated build). Verified by building real binaries across 1.37.0, 1.21.1 and 1.2.2 (echo regression fixed, hush arithmetic fixed, builtins + line editing working), a full 22-version matrix build on both arches (44 targets each, zero errors), and regenerating checksums/build/{amd64,arm64} for all 44 ash/hush targets; both arches verify clean. HUSH_ALIAS exists only in busybox 1.38.0+ (harmlessly dropped on older).
1 parent fc3eda8 commit 4c60d47

86 files changed

Lines changed: 203 additions & 97 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c46e14f553c1453473606bb2d9c708eb6698b54ddf9b9da0ab3ef3e75f4c4ca1 ash
1+
20d1ae9182433cbc0a5d07794d5e794e4c2dbc21f30ab76a95bc919f8568f848 ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3ee9062d15f3b524c4861d3652682a29e61b69fc734217ba274fd0c4b1450dcd ash
1+
a9e80b12e40b44fbead21ccaf4d5514b2b658143eff0b67b1167514b6029cfb5 ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3ee9062d15f3b524c4861d3652682a29e61b69fc734217ba274fd0c4b1450dcd ash
1+
a9e80b12e40b44fbead21ccaf4d5514b2b658143eff0b67b1167514b6029cfb5 ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8122bd7a1827079264b581df8e60ffd6b8e6aead7385e13e1ccfd7567b3fdb26 ash
1+
d87efa8d699c3e39ddf1ebe6e7f30c392d7999347eebff8903c8313e937788ee ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
95f29f5255c928676a170afbf01aacb3fa891bf462560e916d1bda52bde5fd6e ash
1+
0298974afcc5bfc19e37d8c2e4aa9e6e357d2497e504aec1ccf78102f5ccc1cf ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1c38777fc76d1e24404acdc3045aba54e0450960bf120d178e66959804d7eccd ash
1+
3acf2a1f8445dc817a2852bc36f9f637a73137f94dfd935d6c7b58d3a5482405 ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
077f8a2c2ec529f0f9a44987af78638d80dbdad7c96eb673da83ba27e7eec7e0 ash
1+
1221916b9a9bb2b5ee8d3108542a278643ab5d0849ca8856eda8941d3f3e8d72 ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0e24a55ca1b3d519df78db051c52282f1b62a3bbf1f1c3e6b84c2ebb2ead9aca ash
1+
af1950a26d94682f7e65111d0bc1493e4188abe92aaaf9d7589d49df6c341745 ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9c922d67b50799838aeb12c124ef0acbb60535e9a7c21571a8786efd48012860 ash
1+
54a92d1cd67bc50fb84f37ea388844a1d205d52716183be28f5eec0b6093693c ash
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
85e0caaf8e3e30c2c94eeee9dea6a6cb4069974457a22c36f58953c516f1ec05 ash
1+
2d1f22685eb56b1ba2e363852e6d9d1641353841e9b34abd5a0233e06b21293f ash

0 commit comments

Comments
 (0)