Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/atari/floppies/prepare Also use kernfs to get rootde...
details: https://anonhg.NetBSD.org/src/rev/2e4da79975f7
branches: trunk
changeset: 357748:2e4da79975f7
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat Nov 25 09:41:45 2017 +0000
description:
Also use kernfs to get rootdev and disk devices for "prepare" part.
Completely untested for many years..
diffstat:
distrib/atari/floppies/prepare/install.md | 20 +++++++++++++++-----
distrib/atari/floppies/prepare/list | 3 ++-
2 files changed, 17 insertions(+), 6 deletions(-)
diffs (60 lines):
diff -r 279177d4d18f -r 2e4da79975f7 distrib/atari/floppies/prepare/install.md
--- a/distrib/atari/floppies/prepare/install.md Sat Nov 25 09:40:17 2017 +0000
+++ b/distrib/atari/floppies/prepare/install.md Sat Nov 25 09:41:45 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: install.md,v 1.3 2008/11/17 20:14:35 abs Exp $
+# $NetBSD: install.md,v 1.4 2017/11/25 09:41:45 tsutsui Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -46,19 +46,29 @@
export TERM
}
+__mount_kernfs() {
+ # Make sure kernfs is mounted.
+ if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
+ mkdir /kern > /dev/null 2>&1
+ /sbin/mount_kernfs /kern /kern
+ fi
+}
+
md_makerootwritable() {
# Mount root rw for convenience of the tester ;-)
if [ ! -e /tmp/.root_writable ]; then
- rootdev=/dev/$(sysctl -n kern.root_device)$(sysctl -n kern.root_partition | sed y/0123456789/abcdefghij/)
- mount -t ffs -u $rootdev / > /dev/null 2>&1
+ __mount_kernfs
+ mount -u /kern/rootdev /
cp /dev/null /tmp/.root_writable
fi
}
md_get_diskdevs() {
# return available disk devices
- sysctl -n hw.disknames | sed 'y/ /\n/' | sed -n '/^[sw]d[0-9]/p' \
- | sort -u
+ __mount_kernfs
+ sed -n -e '/^sd[0-9] /s/ .*//p' \
+ -e '/^wd[0-9] /s/ .*//p' \
+ < /kern/msgbuf | sort -u
}
md_prep_disklabel()
diff -r 279177d4d18f -r 2e4da79975f7 distrib/atari/floppies/prepare/list
--- a/distrib/atari/floppies/prepare/list Sat Nov 25 09:40:17 2017 +0000
+++ b/distrib/atari/floppies/prepare/list Sat Nov 25 09:41:45 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: list,v 1.11 2016/09/18 16:36:02 christos Exp $
+# $NetBSD: list,v 1.12 2017/11/25 09:41:45 tsutsui Exp $
PROG bin/cat
PROG bin/chmod
@@ -22,6 +22,7 @@
PROG sbin/mount
PROG sbin/mount_cd9660
PROG sbin/mount_ffs
+PROG sbin/mount_kernfs
PROG sbin/mount_msdos
PROG sbin/mount_nfs
PROG sbin/newfs sbin/mount_mfs
Home |
Main Index |
Thread Index |
Old Index