aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/profile
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2017-12-29 14:34:03 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2017-12-29 14:34:03 +0100
commit8170f280c4c8e45a50e9d4942e7358e1271e697f (patch)
tree4f13d1f98a9f7abd79ebbfd31efaa1fc4378eb47 /package/base-files/files/etc/profile
parent20c349f68ca108d8b20363efbf5fa698e8446009 (diff)
downloadupstream-8170f280c4c8e45a50e9d4942e7358e1271e697f.tar.gz
upstream-8170f280c4c8e45a50e9d4942e7358e1271e697f.tar.bz2
upstream-8170f280c4c8e45a50e9d4942e7358e1271e697f.zip
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@universe-factory.net>
Diffstat (limited to 'package/base-files/files/etc/profile')
-rw-r--r--package/base-files/files/etc/profile5
1 files changed, 4 insertions, 1 deletions
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 3eda09b456..8ac9d6dbb5 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!'