From 12020f8a95d21547bd7d7fd1fef9cdecf2892803 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 3 May 2019 02:24:27 +0800 Subject: base-files: Add /etc/shinit for non-login shell init Because /etc/profile (and ~/.profile) are read by login shells only, aliases and functions defined there are not available to non-login shells, e.g. when using screen or tmux. If the ENV environment variable exists (exported by /etc/profile or ~/.profile) and references an existing file, then all interactive shells (login or non-login) will read that file as well. This sets the ENV environment variable in /etc/profile, pointing to /etc/shinit. This also adds /etc/shinit, which: * Contains alias and function definitions originally in /etc/profile * Sources /etc/mkshrc if the user is using mksh (also originally in /etc/profile), as /etc/mkshrc is meant for all interactive shells * Sources ~/.mkshrc if the user is using mksh, to compensate for the fact that mksh will not read ~/.mkshrc if ENV is set * Sources ~/.shinit if the user is not using mksh This also removes the shebang from /etc/profile, as the file is sourced, not executed. Signed-off-by: Jeffery To --- package/base-files/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'package/base-files/Makefile') diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 4f4e93361f..107d53e74f 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -72,6 +72,7 @@ define Package/base-files/conffiles /etc/services /etc/shadow /etc/shells +/etc/shinit /etc/sysctl.conf /etc/sysupgrade.conf $(call $(TARGET)/conffiles) -- cgit v1.2.3