[source] base-files: set FAILSAFE in /etc/profile when /tmp/.failsafe exists

LEDE Commits lede-commits at lists.infradead.org
Fri Dec 29 05:35:46 PST 2017


neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/8170f280c4c8e45a50e9d4942e7358e1271e697f

commit 8170f280c4c8e45a50e9d4942e7358e1271e697f
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Fri Dec 29 14:34:03 2017 +0100

    base-files: set FAILSAFE in /etc/profile when /tmp/.failsafe exists
    
    Since dropbear clears the environment, FAILSAFE was not set as intended in
    failsafe mode. This also broke sysupgrade from failsafe mode over SSH.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/base-files/Makefile          | 2 +-
 package/base-files/files/etc/profile | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 728d787..d0c9d6b 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=179
+PKG_RELEASE:=180
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 3eda09b..8ac9d6d 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -1,6 +1,9 @@
 #!/bin/sh
+[ -e /tmp/.failsafe ] && export FAILSAFE=1
+
 [ -f /etc/banner ] && cat /etc/banner
-[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
+[ -n "$FAILSAFE" ] || cat /etc/banner.failsafe
+
 fgrep -sq '/ overlay ro,' /proc/mounts && {
 	echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
 	echo 'Please try to remove files from /overlay/upper/... and reboot!'



More information about the lede-commits mailing list