Module Name:    src
Committed By:   uebayasi
Date:           Sat Aug 29 15:51:53 UTC 2015

Modified Files:
        src/sys/conf: Makefile.kern.inc
        src/sys/dev: md_root.c

Log Message:
According to nxr.netbsd.org, nothing uses MEMORY_DISK_IMAGE.  Retire it.
Premature design and its build rule bloats Makefile.kern.inc.  There are
other ways like MEMORY_DISK_DYNAMIC.

(When kernel will be built as relocatable, embedding binary data will be much
easier, and md(4), splash(4), and ksyms(4) will all benefit.)


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/md_root.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.206 src/sys/conf/Makefile.kern.inc:1.207
--- src/sys/conf/Makefile.kern.inc:1.206	Sat Aug 29 15:37:18 2015
+++ src/sys/conf/Makefile.kern.inc	Sat Aug 29 15:51:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.206 2015/08/29 15:37:18 uebayasi Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.207 2015/08/29 15:51:53 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -349,19 +349,6 @@ vers.o: ${SYSTEM_OBJ} Makefile $S/conf/n
 init_main.o: splash_image.o
 .endif
 
-.if defined(MEMORY_DISK_IMAGE)
-md_root_image.h: ${MEMORY_DISK_IMAGE}
-	${_MKTARGET_CREATE}
-	${TOOL_HEXDUMP} -v -e '"\t" 8/1 "0x%02x, " "\n"' ${.ALLSRC} > ${.TARGET}
-
-# XXX This is only needed when building md_root.o
-CPPFLAGS+=	-DMEMORY_DISK_IMAGE
-md_root.o: md_root_image.h
-.endif
-
-# depend on MEMORY_DISK_IMAGE configuration
-md_root.o: Makefile
-
 ##
 ## (7) misc targets: install, clean(dir), depend(all), lint, links, tags,
 ##                   cscope, mkid

Index: src/sys/dev/md_root.c
diff -u src/sys/dev/md_root.c:1.17 src/sys/dev/md_root.c:1.18
--- src/sys/dev/md_root.c:1.17	Thu Apr 16 14:46:33 2009
+++ src/sys/dev/md_root.c	Sat Aug 29 15:51:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: md_root.c,v 1.17 2009/04/16 14:46:33 tsutsui Exp $	*/
+/*	$NetBSD: md_root.c,v 1.18 2015/08/29 15:51:53 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: md_root.c,v 1.17 2009/04/16 14:46:33 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md_root.c,v 1.18 2015/08/29 15:51:53 uebayasi Exp $");
 
 #include "opt_md.h"
 
@@ -41,23 +41,10 @@ __KERNEL_RCSID(0, "$NetBSD: md_root.c,v 
 #include <dev/md.h>
 
 #ifdef MEMORY_DISK_DYNAMIC
-#ifdef MEMORY_DISK_IMAGE
-#error MEMORY_DISK_DYNAMIC is not compatible with MEMORY_DISK_IMAGE
-#endif
 size_t md_root_size;
 char *md_root_image;
 #else /* MEMORY_DISK_DYNAMIC */
 
-#ifdef MEMORY_DISK_IMAGE
-#ifdef MEMORY_DISK_ROOT_SIZE
-#error MEMORY_DISK_ROOT_SIZE is not compatible with MEMORY_DISK_IMAGE
-#endif
-char md_root_image[] = {
-#include "md_root_image.h"
-};
-uint32_t md_root_size = sizeof(md_root_image) & ~(DEV_BSIZE - 1);
-
-#else /* MEMORY_DISK_IMAGE */
 
 #ifndef MEMORY_DISK_ROOT_SIZE
 #define MEMORY_DISK_ROOT_SIZE 512
@@ -70,7 +57,6 @@ uint32_t md_root_size = sizeof(md_root_i
  */
 uint32_t md_root_size = ROOTBYTES;
 char md_root_image[ROOTBYTES] = "|This is the root ramdisk!\n";
-#endif /* MEMORY_DISK_IMAGE */
 #endif /* MEMORY_DISK_DYNAMIC */
 
 #ifndef MEMORY_DISK_RBFLAGS

Reply via email to