* [Buildroot] [PATCH 1/1] package/busybox: save shell history only on exit
@ 2025-03-03 12:14 Fiona Klute via buildroot
2025-04-21 21:52 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Fiona Klute via buildroot @ 2025-03-03 12:14 UTC (permalink / raw)
To: buildroot; +Cc: Fiona Klute (WIWA)
From: "Fiona Klute (WIWA)" <fiona.klute@gmx.de>
Both busybox.config and busybox-minimal.config set
CONFIG_FEATURE_EDITING_SAVEHISTORY=y. This causes the Busybox shell to
write the history file after every command, which can be a problem on
storage with limited write cycles (e.g. eMMC).
Set CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y to change behavior to write
the history file only on exit, which reduces writes without losing the
history feature.
Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
---
Of course writes would be reduced even more by disabling history
entirely, but "save on exit" seems like a reasonable tradeoff to
me. It is also what Bash does, so it's unlikely to cause issues.
package/busybox/busybox-minimal.config | 2 +-
package/busybox/busybox.config | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/busybox/busybox-minimal.config b/package/busybox/busybox-minimal.config
index 9733dd2156..1e4b404479 100644
--- a/package/busybox/busybox-minimal.config
+++ b/package/busybox/busybox-minimal.config
@@ -105,7 +105,7 @@ CONFIG_FEATURE_EDITING_MAX_LEN=1024
CONFIG_FEATURE_EDITING_VI=y
CONFIG_FEATURE_EDITING_HISTORY=999
CONFIG_FEATURE_EDITING_SAVEHISTORY=y
-# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
+CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y
CONFIG_FEATURE_REVERSE_SEARCH=y
CONFIG_FEATURE_TAB_COMPLETION=y
# CONFIG_FEATURE_USERNAME_COMPLETION is not set
diff --git a/package/busybox/busybox.config b/package/busybox/busybox.config
index 69d896bebd..823fcd2b46 100644
--- a/package/busybox/busybox.config
+++ b/package/busybox/busybox.config
@@ -108,7 +108,7 @@ CONFIG_FEATURE_EDITING_MAX_LEN=1024
CONFIG_FEATURE_EDITING_VI=y
CONFIG_FEATURE_EDITING_HISTORY=999
CONFIG_FEATURE_EDITING_SAVEHISTORY=y
-# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
+CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y
CONFIG_FEATURE_REVERSE_SEARCH=y
CONFIG_FEATURE_TAB_COMPLETION=y
# CONFIG_FEATURE_USERNAME_COMPLETION is not set
--
2.47.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/busybox: save shell history only on exit
2025-03-03 12:14 [Buildroot] [PATCH 1/1] package/busybox: save shell history only on exit Fiona Klute via buildroot
@ 2025-04-21 21:52 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-04-21 21:52 UTC (permalink / raw)
To: Fiona Klute via buildroot; +Cc: Fiona Klute
On Mon, 3 Mar 2025 13:14:49 +0100
Fiona Klute via buildroot <buildroot@buildroot.org> wrote:
> From: "Fiona Klute (WIWA)" <fiona.klute@gmx.de>
>
> Both busybox.config and busybox-minimal.config set
> CONFIG_FEATURE_EDITING_SAVEHISTORY=y. This causes the Busybox shell to
> write the history file after every command, which can be a problem on
> storage with limited write cycles (e.g. eMMC).
>
> Set CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y to change behavior to write
> the history file only on exit, which reduces writes without losing the
> history feature.
>
> Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
> ---
> Of course writes would be reduced even more by disabling history
> entirely, but "save on exit" seems like a reasonable tradeoff to
> me. It is also what Bash does, so it's unlikely to cause issues.
Makes sense, applied!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-21 21:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 12:14 [Buildroot] [PATCH 1/1] package/busybox: save shell history only on exit Fiona Klute via buildroot
2025-04-21 21:52 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox