Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib Check if /tmp is writable to see whether the rootdev...



details:   https://anonhg.NetBSD.org/src/rev/5d50b643cb38
branches:  trunk
changeset: 984179:5d50b643cb38
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Jun 26 00:38:16 2021 +0000

description:
Check if /tmp is writable to see whether the rootdev is already mounted.

Creating a dummy /tmp/root_writable file and after mountroot and
checking it on the second installation could be problematic if
users retry to installation after reboot without reinstalling miniroot.
Taken from amiga.

diffstat:

 distrib/sun2/miniroot/install.md |  5 ++---
 distrib/sun3/miniroot/install.md |  5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r e9afc667c2d5 -r 5d50b643cb38 distrib/sun2/miniroot/install.md
--- a/distrib/sun2/miniroot/install.md  Sat Jun 26 00:28:19 2021 +0000
+++ b/distrib/sun2/miniroot/install.md  Sat Jun 26 00:38:16 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: install.md,v 1.8 2021/06/26 00:25:41 tsutsui Exp $
+#      $NetBSD: install.md,v 1.9 2021/06/26 00:38:16 tsutsui Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,11 +49,10 @@
 
 md_makerootwritable() {
        # Just remount the root device read-write.
-       if [ ! -e /tmp/root_writable ]; then
+       if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then
                echo "Remounting root read-write..."
                mi_mount_kernfs
                mount -u -t ffs /kern/rootdev /
-               cp /dev/null /tmp/root_writable
        fi
 }
 
diff -r e9afc667c2d5 -r 5d50b643cb38 distrib/sun3/miniroot/install.md
--- a/distrib/sun3/miniroot/install.md  Sat Jun 26 00:28:19 2021 +0000
+++ b/distrib/sun3/miniroot/install.md  Sat Jun 26 00:38:16 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: install.md,v 1.8 2021/06/26 00:25:41 tsutsui Exp $
+#      $NetBSD: install.md,v 1.9 2021/06/26 00:38:16 tsutsui Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,11 +49,10 @@
 
 md_makerootwritable() {
        # Just remount the root device read-write.
-       if [ ! -e /tmp/root_writable ]; then
+       if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then
                echo "Remounting root read-write..."
                mi_mount_kernfs
                mount -u /kern/rootdev /
-               cp /dev/null /tmp/root_writable
        fi
 }
 



Home | Main Index | Thread Index | Old Index