tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
get rid of MEMORY_DISK_IS_ROOT?
Since md(4) is a first-class device now, it should be
possible to remove more of the special hacks to make
it the root device. After all, there is the "root on"
config(8) directive which should control this.
The "root on" doesn't issue cpp definitions afaict,
so one couldn't do compile-time decisions based on the
root-nedd of md.
For me, this looks OK, but I've only tested an INSTALL
kernel, with the appended patch. There are likely
other uses; in particular I didn't try to load a ramdisk
as module yet. I don't see why it shouldn't work.
Comments?
best regards
Matthias
-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------
#
# old_revision [7d27a0c7499d816af7fb364f08ccdb4bfe8366a6]
#
# patch "sys/arch/i386/conf/INSTALL_FLOPPY"
# from [f9ddfa6b17ecffc9d32d0544c0057d48cdaf3aa2]
# to [5556fb0702bbabf99132d1ea1d6ece953491d199]
#
# patch "sys/dev/md.h"
# from [311707c80c820ecfbc64252b9fc401ef4d731859]
# to [08a37c47e6516a3f25b5341cfe21292e5aaf4223]
#
# patch "sys/dev/md_root.c"
# from [153e2341f17c1da33cc31ea90a5a82a20b8a10be]
# to [06823f1e9cc0bb9bf4c2820cebdb3503d057e8e9]
#
============================================================
--- sys/arch/i386/conf/INSTALL_FLOPPY f9ddfa6b17ecffc9d32d0544c0057d48cdaf3aa2
+++ sys/arch/i386/conf/INSTALL_FLOPPY 5556fb0702bbabf99132d1ea1d6ece953491d199
@@ -19,7 +19,7 @@ options MEMORY_DISK_HOOKS
# Enable the hooks used for initializing the root memory-disk.
options MEMORY_DISK_HOOKS
-options MEMORY_DISK_IS_ROOT # force root on memory disk
+#options MEMORY_DISK_IS_ROOT # force root on memory disk
options MEMORY_DISK_SERVER=0 # no userspace memory disk support
options MEMORY_DISK_ROOT_SIZE=10000 # size of memory disk, in blocks
@@ -187,7 +187,7 @@ options PCDISPLAY_SOFTCURSOR
#options VGA_CONSOLE_SCREENTYPE="\"80x24\""
# Kernel root file system and dump configuration.
-config netbsd root on ? type ?
+config netbsd root on md0a type ?
#config netbsd root on sd0a type ffs
#config netbsd root on ? type nfs
============================================================
--- sys/dev/md.h 311707c80c820ecfbc64252b9fc401ef4d731859
+++ sys/dev/md.h 08a37c47e6516a3f25b5341cfe21292e5aaf4223
@@ -88,6 +88,4 @@ extern void md_root_setconf(char *, size
extern void md_attach_hook(int, struct md_conf *);
extern void md_open_hook(int, struct md_conf *);
extern void md_root_setconf(char *, size_t);
-
-extern int md_is_root;
#endif /* _KERNEL */
============================================================
--- sys/dev/md_root.c 153e2341f17c1da33cc31ea90a5a82a20b8a10be
+++ sys/dev/md_root.c 06823f1e9cc0bb9bf4c2820cebdb3503d057e8e9
@@ -83,7 +83,7 @@ md_root_setconf(char *addr, size_t size)
void
md_root_setconf(char *addr, size_t size)
{
- md_is_root = 1;
+
md_root_image = addr;
md_root_size = size;
}
@@ -97,7 +97,7 @@ md_attach_hook(int unit, struct md_conf
{
char pbuf[9];
- if (unit == 0 && md_is_root) {
+ if (unit == 0) {
/* Setup root ramdisk */
md->md_addr = (void *)md_root_image;
md->md_size = (size_t)md_root_size;
@@ -114,7 +114,7 @@ md_open_hook(int unit, struct md_conf *m
md_open_hook(int unit, struct md_conf *md)
{
- if (unit == 0 && md_is_root) {
+ if (unit == 0) {
/* The root ramdisk only works single-user. */
boothowto |= MEMORY_RBFLAGS;
}
Home |
Main Index |
Thread Index |
Old Index