modules/bash: Disable readline, enable -Os

Disable readline features for interactive shell.  This significantly
reduces the size of bash and doesn't affect scripting features.  The
interactive shell still functions, but there is no history or command
line editing (backspace works, but arrows do not move cursor).

Enable -Os on bash for more size reduction.

This saves about 180KiB from the compressed initrd for
qemu-coreboot-fbwhiptail-tpm2-hotp, almost half the cost of adding
bash.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
Jonathon Hall 2023-02-28 15:36:50 -05:00
parent c98ae5b53d
commit d59ffe07b8
No known key found for this signature in database
GPG Key ID: 1E9C3CA91AE25114

View File

@ -7,7 +7,7 @@ bash_tar := bash-$(bash_version).tar.gz
bash_url := https://ftpmirror.gnu.org/bash/$(bash_tar) bash_url := https://ftpmirror.gnu.org/bash/$(bash_tar)
bash_hash := 5bac17218d3911834520dad13cd1f85ab944e1c09ae1aba55906be1f8192f558 bash_hash := 5bac17218d3911834520dad13cd1f85ab944e1c09ae1aba55906be1f8192f558
bash_configure := ./configure \ bash_configure := CFLAGS=-Os ./configure \
$(CROSS_TOOLS) \ $(CROSS_TOOLS) \
--host $(target) \ --host $(target) \
--prefix="/usr" \ --prefix="/usr" \
@ -20,6 +20,7 @@ bash_configure := ./configure \
--disable-net-redirections \ --disable-net-redirections \
--enable-single-help-strings \ --enable-single-help-strings \
--disable-nls \ --disable-nls \
--disable-readline \
bash_target := $(MAKE_JOBS) \ bash_target := $(MAKE_JOBS) \
&& $(MAKE) -C $(build)/$(bash_dir) \ && $(MAKE) -C $(build)/$(bash_dir) \