busybox: Save shell history into /tmp
Enable the busybox feature to save shell command history. (.apk size increase 0.5 kB) To prevent flash wear, * save history only at the exit from a shell session, and * set /tmp as the default location for the history file. The history is kept on ramdisk until a reboot, when the history is then lost. If the user wants to save history onto flash, he can change the location definition in /etc/profile.d/busybox-history-file.sh Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi> Link: https://github.com/openwrt/openwrt/pull/17179 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
0826b224b5
commit
e23b37b2d9
@ -255,10 +255,10 @@ config BUSYBOX_DEFAULT_FEATURE_EDITING_HISTORY
|
|||||||
default 256
|
default 256
|
||||||
config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVEHISTORY
|
config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVEHISTORY
|
||||||
bool
|
bool
|
||||||
default n
|
default y
|
||||||
config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVE_ON_EXIT
|
config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVE_ON_EXIT
|
||||||
bool
|
bool
|
||||||
default n
|
default y
|
||||||
config BUSYBOX_DEFAULT_FEATURE_REVERSE_SEARCH
|
config BUSYBOX_DEFAULT_FEATURE_REVERSE_SEARCH
|
||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
|
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=busybox
|
PKG_NAME:=busybox
|
||||||
PKG_VERSION:=1.37.0
|
PKG_VERSION:=1.37.0
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
PKG_FLAGS:=essential
|
PKG_FLAGS:=essential
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||||
@ -143,6 +143,8 @@ define Package/busybox/install
|
|||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
|
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/profile.d
|
||||||
|
$(INSTALL_BIN) ./files/busybox-history-file.sh $(1)/etc/profile.d
|
||||||
ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOG)$(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOGD_CFG),)
|
ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOG)$(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOGD_CFG),)
|
||||||
touch $(1)/etc/syslog.conf
|
touch $(1)/etc/syslog.conf
|
||||||
endif
|
endif
|
||||||
|
2
package/utils/busybox/files/busybox-history-file.sh
Normal file
2
package/utils/busybox/files/busybox-history-file.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export HISTFILE=/tmp/.busybox_ash_history
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user