Module Name:    src
Committed By:   nonaka
Date:           Thu May  5 09:08:00 UTC 2011

Modified Files:
        src/distrib/zaurus/ramdisk: Makefile list
        src/sys/arch/zaurus/conf: GENERIC INSTALL Makefile.zaurus.inc
        src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c

Log Message:
Reduce kernel size.
Tested on SL-C1000.

Fix PR/44898.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/zaurus/ramdisk/Makefile
cvs rdiff -u -r1.14 -r1.15 src/distrib/zaurus/ramdisk/list
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/zaurus/conf/GENERIC
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/conf/INSTALL
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/conf/Makefile.zaurus.inc
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c

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

Modified files:

Index: src/distrib/zaurus/ramdisk/Makefile
diff -u src/distrib/zaurus/ramdisk/Makefile:1.11 src/distrib/zaurus/ramdisk/Makefile:1.12
--- src/distrib/zaurus/ramdisk/Makefile:1.11	Thu Feb 11 09:06:51 2010
+++ src/distrib/zaurus/ramdisk/Makefile	Thu May  5 09:07:59 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.11 2010/02/11 09:06:51 roy Exp $
+#	$NetBSD: Makefile,v 1.12 2011/05/05 09:07:59 nonaka Exp $
 
 .include <bsd.own.mk>
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	2560k
+IMAGESIZE=	2144k
 MAKEFS_FLAGS=	-f 14
 
 WARNS=		1

Index: src/distrib/zaurus/ramdisk/list
diff -u src/distrib/zaurus/ramdisk/list:1.14 src/distrib/zaurus/ramdisk/list:1.15
--- src/distrib/zaurus/ramdisk/list:1.14	Fri Jan 14 10:26:37 2011
+++ src/distrib/zaurus/ramdisk/list	Thu May  5 09:07:59 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.14 2011/01/14 10:26:37 tsutsui Exp $
+#	$NetBSD: list,v 1.15 2011/05/05 09:07:59 nonaka Exp $
 
 # usr.bin/less has to be first, otherwise the ramdisk.mk generation fails
 SRCDIRS usr.bin/less bin sbin usr.bin usr.sbin gnu/usr.bin
@@ -31,9 +31,7 @@
 PROG	sbin/init
 PROG	sbin/mknod
 PROG	sbin/mount
-PROG	sbin/mount_cd9660
 PROG	sbin/mount_ffs
-PROG	sbin/mount_filecore
 PROG	sbin/mount_kernfs
 PROG	sbin/mount_msdos
 PROG	sbin/mount_nfs

Index: src/sys/arch/zaurus/conf/GENERIC
diff -u src/sys/arch/zaurus/conf/GENERIC:1.34 src/sys/arch/zaurus/conf/GENERIC:1.35
--- src/sys/arch/zaurus/conf/GENERIC:1.34	Sun Mar  6 17:08:33 2011
+++ src/sys/arch/zaurus/conf/GENERIC	Thu May  5 09:07:59 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.34 2011/03/06 17:08:33 bouyer Exp $
+#	$NetBSD: GENERIC,v 1.35 2011/05/05 09:07:59 nonaka Exp $
 #
 # GENERIC machine description file
 #
@@ -50,7 +50,7 @@
 # File systems
 file-system	FFS		# UFS
 #file-system	EXT2FS		# second extended file system (linux)
-file-system	LFS		# log-structured file system
+#file-system	LFS		# log-structured file system
 file-system	MFS		# memory file system
 file-system	NFS		# Network File System client
 #file-system	NTFS		# Windows/NT file system (experimental)
@@ -103,6 +103,13 @@
 options 	COMPAT_OSSAUDIO	# OSS (Voxware) audio driver compatibility
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+#options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+# The following two options can break /etc/fstab, so handle with care
+#options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
+#options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
+
 # Shared memory options
 
 options 	SYSVMSG		# System V-like message queues

Index: src/sys/arch/zaurus/conf/INSTALL
diff -u src/sys/arch/zaurus/conf/INSTALL:1.6 src/sys/arch/zaurus/conf/INSTALL:1.7
--- src/sys/arch/zaurus/conf/INSTALL:1.6	Mon Dec 21 11:20:07 2009
+++ src/sys/arch/zaurus/conf/INSTALL	Thu May  5 09:07:59 2011
@@ -1,15 +1,50 @@
-# $NetBSD: INSTALL,v 1.6 2009/12/21 11:20:07 nonaka Exp $
+# $NetBSD: INSTALL,v 1.7 2011/05/05 09:07:59 nonaka Exp $
 #
 # INSTALL config file (GENERIC with memory disk root)
 #
 
 include 	"arch/zaurus/conf/GENERIC"
 
-#no options 	KLOADER
-
 # 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_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=5120	# size of memory disk, in blocks
+options 	MEMORY_DISK_ROOT_SIZE=4288	# size of memory disk, in blocks
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
+
+# for reduce kernel size.
+# kernei size must be less than 5MB.
+# - see src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:bsdimage[]
+
+makeoptions		COPTS="-Os"
+
+no options 		INSECURE
+
+no file-system		NULLFS
+no file-system		PROCFS
+no file-system		PTYFS
+no file-system		TMPFS
+
+no options 		COMPAT_OSSAUDIO
+
+no options 		SYSVMSG
+no options 		SYSVSEM
+no options 		SYSVSHM
+no options 		P1003_1B_SEMAPHORE
+
+options 		PIPE_SOCKETPAIR
+
+no options 		WSDISPLAY_COMPAT_PCVT
+no options 		WSDISPLAY_COMPAT_USL
+no options 		WSDISPLAY_COMPAT_RAWKBD
+
+no options 		DIAGNOSTIC
+no options 		DDB
+no options 		DDB_HISTORY_SIZE
+no options 		SYMTAB_SPACE
+
+no pseudo-device	vnd
+no options 		VND_COMPRESSION
+no pseudo-device	accf_data
+no pseudo-device	accf_http
+no pseudo-device	ksyms

Index: src/sys/arch/zaurus/conf/Makefile.zaurus.inc
diff -u src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.2 src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.3
--- src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.2	Sun Dec 17 16:07:11 2006
+++ src/sys/arch/zaurus/conf/Makefile.zaurus.inc	Thu May  5 09:07:59 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.zaurus.inc,v 1.2 2006/12/17 16:07:11 peter Exp $
+#	$NetBSD: Makefile.zaurus.inc,v 1.3 2011/05/05 09:07:59 nonaka Exp $
 
 MACHINE_ARCH=		arm
 CPPFLAGS+=		-D${MACHINE}
@@ -9,3 +9,14 @@
 LINKFLAGS=		-T ${THISARM}/conf/ldscript
 
 EXTRA_CLEAN+= netbsd.map assym.d
+
+SYSTEM_LD_TAIL_EXTRA+=; \
+	echo "Checking kernel size..."; \
+	size=`wc -c "$@" | ${TOOL_AWK} '{ print $$1 }'`; \
+	maxsize=5242880; \
+	if [ $$size -gt $$maxsize ]; \
+	then \
+		echo "Fatal: kernel size must be less than 5MB."; \
+		echo "Fatal: kernel size: $$size, max kernel size: $$maxsize"; \
+		false; \
+	fi

Index: src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c
diff -u src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.5 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.6
--- src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.5	Sun Dec 26 09:03:56 2010
+++ src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c	Thu May  5 09:07:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zbsdmod.c,v 1.5 2010/12/26 09:03:56 nonaka Exp $	*/
+/*	$NetBSD: zbsdmod.c,v 1.6 2011/05/05 09:07:59 nonaka Exp $	*/
 /*	$OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $	*/
 
 /*
@@ -74,8 +74,8 @@
 static Elf_Off off;
 static int havesyms;
 
-/* The maximum size of a kernel image is restricted to 10MB. */
-static u_int bsdimage[10485760/sizeof(u_int)];	/* XXX use kmalloc() */
+/* The maximum size of a kernel image is restricted to 5MB. */
+static u_int bsdimage[5242880/sizeof(u_int)];	/* XXX use kmalloc() */
 static char bootargs[BOOTARGS_BUFSIZ];
 
 /*

Reply via email to