Sun Mar 8 06:23:18 2020 UTC ()
sun2 kernel is restricted to ~2MB due to bootloader.
It seems that working kernel should be more smaller.

Strip off most kernel options, and provide by kernel modules.
Also add GENERIC kernel for NFS root instead of FFS.


(rin)
diff -r1.7 -r1.8 src/etc/etc.sun2/Makefile.inc
diff -r1.102 -r1.103 src/sys/arch/sun2/conf/GENERIC
diff -r0 -r1.1 src/sys/arch/sun2/conf/NFS

cvs diff -r1.7 -r1.8 src/etc/etc.sun2/Makefile.inc (expand / switch to unified diff)

--- src/etc/etc.sun2/Makefile.inc 2007/07/24 10:49:28 1.7
+++ src/etc/etc.sun2/Makefile.inc 2020/03/08 06:23:18 1.8
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile.inc,v 1.7 2007/07/24 10:49:28 pavel Exp $ 1# $NetBSD: Makefile.inc,v 1.8 2020/03/08 06:23:18 rin Exp $
2# 2#
3# etc.sun2/Makefile.inc -- sun2-specific etc Makefile targets 3# etc.sun2/Makefile.inc -- sun2-specific etc Makefile targets
4# 4#
5 5
6# If you change the list of distributed kernels, don't forget 6# If you change the list of distributed kernels, don't forget
7# to update the release documentation in distrib/notes/common/contents 7# to update the release documentation in distrib/notes/common/contents
8 8
9KERNEL_SETS= GENERIC FOURMEG DISKLESS 9KERNEL_SETS= GENERIC FOURMEG DISKLESS NFS
10 10
11EXTRA_KERNELS= INSTALL 11EXTRA_KERNELS= INSTALL
12 12
13BUILD_KERNELS= RAMDISK 13BUILD_KERNELS= RAMDISK
14 14
15INSTALLATION_DIRS+= installation/miniroot \ 15INSTALLATION_DIRS+= installation/miniroot \
16 installation/netboot \ 16 installation/netboot \
17 installation/tapeimage 17 installation/tapeimage

cvs diff -r1.102 -r1.103 src/sys/arch/sun2/conf/GENERIC (expand / switch to unified diff)

--- src/sys/arch/sun2/conf/GENERIC 2019/04/26 22:46:04 1.102
+++ src/sys/arch/sun2/conf/GENERIC 2020/03/08 06:23:18 1.103
@@ -1,58 +1,63 @@ @@ -1,58 +1,63 @@
1# $NetBSD: GENERIC,v 1.102 2019/04/26 22:46:04 sevan Exp $ 1# $NetBSD: GENERIC,v 1.103 2020/03/08 06:23:18 rin Exp $
2# 2#
3# GENERIC machine description file 3# GENERIC machine description file
4#  4#
5# This machine description file is used to generate the default NetBSD 5# This machine description file is used to generate the default NetBSD
6# kernel. The generic kernel does not include all options, subsystems 6# kernel. The generic kernel does not include all options, subsystems
7# and device drivers, but should be useful for most applications. 7# and device drivers, but should be useful for most applications.
8# 8#
9# The machine description file can be customised for your specific 9# The machine description file can be customised for your specific
10# machine to reduce the kernel size and improve its performance. 10# machine to reduce the kernel size and improve its performance.
11# 11#
12# For further information on compiling NetBSD kernels, see the config(8) 12# For further information on compiling NetBSD kernels, see the config(8)
13# man page. 13# man page.
14# 14#
15# For further information on hardware support for this architecture, see 15# For further information on hardware support for this architecture, see
16# the intro(4) man page. For further information about kernel options 16# the intro(4) man page. For further information about kernel options
17# for this architecture, see the options(4) man page. For an explanation 17# for this architecture, see the options(4) man page. For an explanation
18# of each device driver in this file see the section 4 man page for the 18# of each device driver in this file see the section 4 man page for the
19# device. 19# device.
20 20
21# Supports Sun2 (2/120, 2/170, 2/50, ...) 21# Supports Sun2 (2/120, 2/170, 2/50, ...)
22# Supports root on: ie0, sd*, ... 22# Supports root on: ie0, sd*, ...
23 23
24include "arch/sun2/conf/std.sun2" 24include "arch/sun2/conf/std.sun2"
25 25
 26options MODULAR # new style module(7) framework
 27#options MODULAR_DEFAULT_AUTOLOAD
 28options INSECURE # allow modload(8) in multiuser mode
 29
26#options INCLUDE_CONFIG_FILE # embed config file in kernel binary 30#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
27 31
28#ident "GENERIC-$Revision: 1.102 $" 32#ident "GENERIC-$Revision: 1.103 $"
29 33
30makeoptions COPTS="-Os" # optimize for size 34makeoptions COPTS="-Os -fno-inline-small-functions"
 35 # bootloader has size limit (~2MB)
31 36
32# Machines to be supported by this kernel 37# Machines to be supported by this kernel
33#options FPU_EMULATE 38#options FPU_EMULATE
34 39
35# Needs to be set per system. i.e change these as you see fit 40# Needs to be set per system. i.e change these as you see fit
36maxusers 4 41maxusers 4
37 42
38# Standard system options 43# Standard system options
39options KTRACE # system call tracing 44options KTRACE # system call tracing
40options SYSVMSG # System V message queues 45#options SYSVMSG # System V message queues
41options SYSVSEM # System V semaphores 46#options SYSVSEM # System V semaphores
42options SYSVSHM # System V shared memory 47#options SYSVSHM # System V shared memory
43#options INSECURE # disable kernel security level 48#options INSECURE # disable kernel security level
44#options USERCONF # userconf(4) support 49#options USERCONF # userconf(4) support
45#options PIPE_SOCKETPAIR # smaller, but slower pipe(2) 50options PIPE_SOCKETPAIR # smaller, but slower pipe(2)
46#options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel 51#options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel
47 52
48# Alternate buffer queue strategies for better responsiveness under high 53# Alternate buffer queue strategies for better responsiveness under high
49# disk I/O load. 54# disk I/O load.
50#options BUFQ_READPRIO 55#options BUFQ_READPRIO
51#options BUFQ_PRIOCSCAN 56#options BUFQ_PRIOCSCAN
52 57
53# Which kernel debugger? Uncomment either this: 58# Which kernel debugger? Uncomment either this:
54options DDB 59options DDB
55# ... or these for KGDB (gdb remote target) 60# ... or these for KGDB (gdb remote target)
56#makeoptions DEBUG="-g" # debugging symbols for gdb 61#makeoptions DEBUG="-g" # debugging symbols for gdb
57#options KGDB 62#options KGDB
58#options KGDB_DEV=0x0C00 # ttya=0C00 ttyb=0C01 63#options KGDB_DEV=0x0C00 # ttya=0C00 ttyb=0C01
@@ -63,35 +68,35 @@ options DDB @@ -63,35 +68,35 @@ options DDB
63#options DIAGNOSTIC # extra kernel sanity checking 68#options DIAGNOSTIC # extra kernel sanity checking
64#options PMAP_DEBUG 69#options PMAP_DEBUG
65#options SCSIDEBUG 70#options SCSIDEBUG
66#options SCSIVERBOSE # Verbose SCSI errors 71#options SCSIVERBOSE # Verbose SCSI errors
67 72
68# Compatibility options 73# Compatibility options
69include "conf/compat_netbsd16.config" 74include "conf/compat_netbsd16.config"
70#options COMPAT_SUNOS # can run SunOS 4.1.1 executables 75#options COMPAT_SUNOS # can run SunOS 4.1.1 executables
71#options COMPAT_AOUT_M68K # support for NetBSD a.out executables 76#options COMPAT_AOUT_M68K # support for NetBSD a.out executables
72#options EXEC_AOUT # support for a.out executables 77#options EXEC_AOUT # support for a.out executables
73 78
74# Filesystem options 79# Filesystem options
75file-system FFS # Berkeley Fast Filesystem 80file-system FFS # Berkeley Fast Filesystem
76file-system NFS # Sun NFS client support 81#file-system NFS # Sun NFS client support
77file-system CD9660 # ISO 9660 + Rock Ridge file system 82#file-system CD9660 # ISO 9660 + Rock Ridge file system
78#file-system FDESC # /dev/fd/* 83#file-system FDESC # /dev/fd/*
79file-system KERNFS # /kern 84#file-system KERNFS # /kern
80file-system NULLFS # loopback file system 85#file-system NULLFS # loopback file system
81#file-system OVERLAY # overlay file system 86#file-system OVERLAY # overlay file system
82#file-system PROCFS # /proc 87#file-system PROCFS # /proc
83#file-system UNION # union file system 88#file-system UNION # union file system
84file-system MFS # memory-based filesystem 89#file-system MFS # memory-based filesystem
85file-system PTYFS # /dev/pts/N support 90file-system PTYFS # /dev/pts/N support
86#file-system TMPFS # Efficient memory file-system 91#file-system TMPFS # Efficient memory file-system
87#file-system UDF # experimental - OSTA UDF CD/DVD file-system 92#file-system UDF # experimental - OSTA UDF CD/DVD file-system
88 93
89#options NFSSERVER # nfs server support 94#options NFSSERVER # nfs server support
90#options QUOTA # legacy UFS quotas 95#options QUOTA # legacy UFS quotas
91#options QUOTA2 # new, in-filesystem UFS quotas 96#options QUOTA2 # new, in-filesystem UFS quotas
92#options FFS_EI # FFS Endian Independent support 97#options FFS_EI # FFS Endian Independent support
93#options WAPBL # File system journaling support 98#options WAPBL # File system journaling support
94#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental 99#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
95#options NFS_V2_ONLY # Exclude NFS3 code to save space 100#options NFS_V2_ONLY # Exclude NFS3 code to save space
96options FFS_NO_SNAPSHOT # No FFS snapshot support 101options FFS_NO_SNAPSHOT # No FFS snapshot support
97#options UFS_EXTATTR # Extended attribute support for UFS1 102#options UFS_EXTATTR # Extended attribute support for UFS1

File Added: src/sys/arch/sun2/conf/NFS
# $NetBSD: NFS,v 1.1 2020/03/08 06:23:18 rin Exp $
#
# GENERIC machine description file for NFS root instead of FFS

# Supports Sun2 (2/120, 2/170, 2/50, ...)
# Supports root on: ie0, sd*, ...

include 	"arch/sun2/conf/GENERIC"
no file-system	FFS
file-system	NFS