diff mbox

[OpenWrt-Devel,base-files] show hint when JFFS2-partition is full and overlayfs mounted read-only

Message ID 20150603192627.GA17345@medion.lan
State Rejected
Headers show

Commit Message

Bastian Bittorf June 3, 2015, 7:26 p.m. UTC
since r45833 and r45848 the overlayfs is automatically mounted read-only
(and blocks remounts as r/w) when JFFS2 is full. see ticket #19564

because of this normal file deletion is not possible anymore.
if a user logins interactively (e.g. SSH) show a hint for this,
that files must be removed in /overlay/upper/...

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
---
 package/base-files/files/etc/profile |    4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 3dd58e1..007baf0 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -1,6 +1,10 @@ 
 #!/bin/sh
 [ -f /etc/banner ] && cat /etc/banner
 [ -e /tmp/.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!'
+}
 
 export PATH=/usr/bin:/usr/sbin:/bin:/sbin
 export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)