From a3ffc9af4e3ff9d9846af4e809306c1850f0cda9 Mon Sep 17 00:00:00 2001 From: Eric Fahlgren Date: Wed, 4 Nov 2026 11:28:09 -0800 Subject: [PATCH] busybox: enable shell history size controls Enable user control of history size both in memory and file size, increasing the memory space to allow up to 2000 entries (or 256 on SMALL_FLASH and LOW_MEMORY_FOOTPRINT devices). This is a follow on to the busybox ash history series in e23b37b2d9a2 and 0ab0a1d66958. Default remains as before (256 entries, both for memory and disk), so as to avoid possible issues with increased footprint. On both x86 and ath79, busybox binary size is unchanged across several test builds. Signed-off-by: Eric Fahlgren Link: https://github.com/openwrt/openwrt/pull/26482 Signed-off-by: Robert Marko --- package/utils/busybox/Config-defaults.in | 5 +++-- package/utils/busybox/Makefile | 2 +- package/utils/busybox/files/busybox-history-file.sh | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index e7a3c38cbdf..55128906fcf 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -255,7 +255,8 @@ config BUSYBOX_DEFAULT_FEATURE_EDITING_VI default n config BUSYBOX_DEFAULT_FEATURE_EDITING_HISTORY int - default 256 + default 256 if SMALL_FLASH || LOW_MEMORY_FOOTPRINT + default 2000 config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVEHISTORY bool default y @@ -3242,7 +3243,7 @@ config BUSYBOX_DEFAULT_FEATURE_SH_READ_FRAC default n config BUSYBOX_DEFAULT_FEATURE_SH_HISTFILESIZE bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_SH_EMBEDDED_SCRIPTS bool default n diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index bb00d332d04..658d9ed057d 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.38.0 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/package/utils/busybox/files/busybox-history-file.sh b/package/utils/busybox/files/busybox-history-file.sh index f2860096272..ab1bfbbb8a8 100644 --- a/package/utils/busybox/files/busybox-history-file.sh +++ b/package/utils/busybox/files/busybox-history-file.sh @@ -1,2 +1,4 @@ export HISTFILE=/tmp/.busybox_ash_history - +# 256 is historical value; maximum is 2000 (256 on small builds). +export HISTFILESIZE=256 +export HISTSIZE=256