* Jonas Gorski <j...@openwrt.org> [19.02.2013 17:00]:
> 
> The order looks a bit random. I'd put firstboot to top, then
> mount_root (maybe separated with an extra line with "or"), then below
> that passwd and /etc/config with mentioning that these are only
> available after running mount_root. reboot -f can stay last, as it's
> usually the last thing you do ;-).
> Maybe also a short intro line, like "Some useful commands:".

thanks for feedback - amended patch attached

bye, bastian
>From 142568572a48698eb6d07affbb4cc5d6f73b00da Mon Sep 17 00:00:00 2001
From: Bastian Bittorf <bitt...@bluebottle.com>
Date: Sun, 17 Feb 2013 12:08:53 +0100
Subject: [PATCH] Failsafe-mode: print short help on commandline

Like mentioned in ticket https://dev.openwrt.org/ticket/11911
this should make the IRC much quieter. Failsafe is somehow
special and even experienced users are helpless, because they
are helpless in such a seldom situation. Also: likely you have
no internet access in this mode, so you cannot use the wiki.

Signed-off-by: Bastian Bittorf <bitt...@bluebottle.com>
---
 package/base-files/files/etc/banner.failsafe |   14 ++++++++++++++
 package/base-files/files/etc/profile         |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)
 create mode 100644 package/base-files/files/etc/banner.failsafe

diff --git a/package/base-files/files/etc/banner.failsafe b/package/base-files/files/etc/banner.failsafe
new file mode 100644
index 0000000..7804ded
--- /dev/null
+++ b/package/base-files/files/etc/banner.failsafe
@@ -0,0 +1,14 @@
+=============== FAILSAFE MODE active ================
+ some useful commands:
+ * firstboot	   reset settings to factory defaults
+ * mount_root	   mounts partition with config files
+ after mount_root:
+ * passwd			reset root's password
+ * /etc/config		  directory with config files
+ leave system with:
+ * reboot -f			       reboots router
+
+ please also respect:
+ http://wiki.openwrt.org/doc/howto/generic.failsafe
+=====================================================
+
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 171adc1..41b8e80 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -1,4 +1,5 @@
 #!/bin/sh
+[ -f /tmp/.failsafe -a -f /etc/banner.failsafe ] && cat /etc/banner.failsafe
 [ -f /etc/banner ] && cat /etc/banner
 
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-- 
1.7.2.5

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to