Source-Changes-HG archive

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

[src/trunk]: src/sys According to nxr.netbsd.org, nothing uses MEMORY_DISK_IM...



details:   https://anonhg.NetBSD.org/src/rev/4b9726a0b39c
branches:  trunk
changeset: 810404:4b9726a0b39c
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sat Aug 29 15:51:53 2015 +0000

description:
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.)

diffstat:

 sys/conf/Makefile.kern.inc |  15 +--------------
 sys/dev/md_root.c          |  18 ++----------------
 2 files changed, 3 insertions(+), 30 deletions(-)

diffs (79 lines):

diff -r 87c060eb2bd1 -r 4b9726a0b39c sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Sat Aug 29 15:37:18 2015 +0000
+++ b/sys/conf/Makefile.kern.inc        Sat Aug 29 15:51:53 2015 +0000
@@ -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 @@
 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
diff -r 87c060eb2bd1 -r 4b9726a0b39c sys/dev/md_root.c
--- a/sys/dev/md_root.c Sat Aug 29 15:37:18 2015 +0000
+++ b/sys/dev/md_root.c Sat Aug 29 15:51:53 2015 +0000
@@ -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 @@
 #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 = ROOTBYTES;
 char md_root_image[ROOTBYTES] = "|This is the root ramdisk!\n";
-#endif /* MEMORY_DISK_IMAGE */
 #endif /* MEMORY_DISK_DYNAMIC */
 
 #ifndef MEMORY_DISK_RBFLAGS



Home | Main Index | Thread Index | Old Index