From 53edda1e3668752d18b2bbf4c3d6edc7e3ab1b6e Mon Sep 17 00:00:00 2001 From: mirko Date: Wed, 19 Dec 2012 16:07:46 +0000 Subject: Do not overload mount-call - trying to reduce confusion The behaviour of calling 'mount' differed depending on whether it called the busybox-mount, the mount of util-linux, the mount defined in /lib/functions.sh and /lib/functions/boot.sh /etc/preinit even included /lib/functions.sh and /lib/functions/boot.sh, both re-defining 'mount'. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34792 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/sbin/firstboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/base-files/files/sbin/firstboot') diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot index 4da299189..8fbd49990 100755 --- a/package/base-files/files/sbin/firstboot +++ b/package/base-files/files/sbin/firstboot @@ -27,7 +27,7 @@ if [ "${0##*/}" = "firstboot" ]; then boot_run_hook jffs2reset else mtd erase "$partname" - mount "$mtdpart" /overlay -t jffs2 + mount -o noatime "$mtdpart" /overlay -t jffs2 fopivot /overlay /rom 1 fi fi -- cgit v1.2.3 From c8e772f18ff31566e342cd44fbd7a6b2bc11efb2 Mon Sep 17 00:00:00 2001 From: mirko Date: Wed, 19 Dec 2012 16:07:53 +0000 Subject: merge /lib/functions/boot.sh and /lib/functions.sh git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34794 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/sbin/firstboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/base-files/files/sbin/firstboot') diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot index 8fbd49990..7e9731b00 100755 --- a/package/base-files/files/sbin/firstboot +++ b/package/base-files/files/sbin/firstboot @@ -4,7 +4,7 @@ switch2jffs_hook= jffs2reset_hook= no_fo_hook= -. /lib/functions/boot.sh +. /lib/functions.sh firstboot_skip_next=false -- cgit v1.2.3 From f53fd06253bb96bc4d4044dbaa8836836cd735cb Mon Sep 17 00:00:00 2001 From: jogo Date: Thu, 21 Feb 2013 11:45:14 +0000 Subject: base-files: make firstboot ask for confirmation To prevent accidential resets ask for confirmation (and default to n). Signed-off-by: Jonas Gorski git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35712 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/sbin/firstboot | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'package/base-files/files/sbin/firstboot') diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot index 7e9731b00..e7c0851ad 100755 --- a/package/base-files/files/sbin/firstboot +++ b/package/base-files/files/sbin/firstboot @@ -20,15 +20,23 @@ set_jffs_part if [ "${0##*/}" = "firstboot" ]; then if [ "$1" = "switch2jffs" ]; then boot_run_hook switch2jffs - elif [ -n "$jffs" ]; then - reset_has_fo=true - echo "firstboot has already been run" - echo "jffs2 partition is mounted, only resetting files" - boot_run_hook jffs2reset else - mtd erase "$partname" - mount -o noatime "$mtdpart" /overlay -t jffs2 - fopivot /overlay /rom 1 + local input + + echo -n "firstboot will erase all settings and remove any installed packages. Are you sure? [N/y]" + read input + [ "$input" = "y" ] || [ "$input" = "Y" ] || return 0 + + if [ -n "$jffs" ]; then + reset_has_fo=true + echo "firstboot has already been run" + echo "jffs2 partition is mounted, only resetting files" + boot_run_hook jffs2reset + else + mtd erase "$partname" + mount -o noatime "$mtdpart" /overlay -t jffs2 + fopivot /overlay /rom 1 + fi fi fi -- cgit v1.2.3 From 7cfbb153cd8b407bb7da221569390ee41d218acf Mon Sep 17 00:00:00 2001 From: jogo Date: Wed, 27 Mar 2013 12:39:42 +0000 Subject: base-files: firstboot: only ask for confirmation on TTY Also allow '-y' to force the reset. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36133 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/sbin/firstboot | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'package/base-files/files/sbin/firstboot') diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot index e7c0851ad..06b64c313 100755 --- a/package/base-files/files/sbin/firstboot +++ b/package/base-files/files/sbin/firstboot @@ -21,11 +21,13 @@ if [ "${0##*/}" = "firstboot" ]; then if [ "$1" = "switch2jffs" ]; then boot_run_hook switch2jffs else - local input + if [ -t 0 ] && [ "$1" != "-y" ]; then + local input - echo -n "firstboot will erase all settings and remove any installed packages. Are you sure? [N/y]" - read input - [ "$input" = "y" ] || [ "$input" = "Y" ] || return 0 + echo -n "firstboot will erase all settings and remove any installed packages. Are you sure? [N/y]" + read input + [ "$input" = "y" ] || [ "$input" = "Y" ] || return 0 + fi if [ -n "$jffs" ]; then reset_has_fo=true -- cgit v1.2.3 From b5367474cba180d7b2555e4e30421a7340f63264 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 25 Apr 2013 19:02:32 +0000 Subject: mount_root: prepare base-files Signed-off-by: John Crispin git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36429 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/sbin/firstboot | 43 +-------------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) (limited to 'package/base-files/files/sbin/firstboot') diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot index 06b64c313..081febb7b 100755 --- a/package/base-files/files/sbin/firstboot +++ b/package/base-files/files/sbin/firstboot @@ -1,44 +1,3 @@ #!/bin/sh -switch2jffs_hook= -jffs2reset_hook= -no_fo_hook= - -. /lib/functions.sh - -firstboot_skip_next=false - -for fb_source_file in /lib/firstboot/*; do - . $fb_source_file -done - -set_mtd_part -set_rom_part -set_jffs_part - -# invoked as an executable -if [ "${0##*/}" = "firstboot" ]; then - if [ "$1" = "switch2jffs" ]; then - boot_run_hook switch2jffs - else - if [ -t 0 ] && [ "$1" != "-y" ]; then - local input - - echo -n "firstboot will erase all settings and remove any installed packages. Are you sure? [N/y]" - read input - [ "$input" = "y" ] || [ "$input" = "Y" ] || return 0 - fi - - if [ -n "$jffs" ]; then - reset_has_fo=true - echo "firstboot has already been run" - echo "jffs2 partition is mounted, only resetting files" - boot_run_hook jffs2reset - else - mtd erase "$partname" - mount -o noatime "$mtdpart" /overlay -t jffs2 - fopivot /overlay /rom 1 - fi - fi -fi - +/sbin/jffs2reset -- cgit v1.2.3