#!/bin/sed -f
#
# 5799-WZQ (C) COPYRIGHT IBM CORPORATION 1987,1988
# LICENSED MATERIALS - PROPERTY OF IBM
# REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
#
# This sed script converts a GENERIC kernel config file into
# a MINIROOT kernel config file

# set comments up right
/^#.*[$]Header/s:#: #:
/^#.*[$]Source/s:#: #:
/^#/s:.*::
/^ #/s: #:#:
1i\
\# This is a MINIROOT kernel config file.\
\# It was created from a GENERIC kernel config file by mkMINIROOT.\
\# $Header:mkMINIROOT 12.1$\
\# $ACIS:mkMINIROOT 12.1$\
\# $Source: /ibm/acis/usr/sys/dist/RCS/mkMINIROOT,v $

# delete blank lines
/^[ 	]*$/d

# change ident to MINIROOT, maxusers to 1
s:^\(ident[ 	]*\)GENERIC:\1MINIROOT:
s:^\(maxusers[ 	]*\)[0-9]*:\11:

# insert ROROOT and MINIDISKSIZE options, specify swap on hd0
s:^\(config[ 	]*vmunix[ 	]*\)swap .*:options	"ROROOT=0x0300"\
options NOFPA\
options "NOMC881"\
options NOTCP_DEBUG\
options	"MINIROOTSIZE=2400"\
\1root on fd0 swap on hd0:

# delete unnecessary options, devices, pseudo-devices
/^options[ 	]*VICE[ 	]*/d
/^options[ 	]*DEBUG[ 	]*/d
/^options[ 	]*RDB[ 	]*/d
/^options[ 	]*XWM[ 	]*/d
/^options[ 	]*SECURE[ 	]*/d
/^options[ 	]*GENERIC[ 	]*/d
/^options[ 	]*RVD[ 	]*/d
/^options[ 	]*AFS[ 	]*/d
/^options[ 	]*NFS[ 	]*/d
/^options[ 	]*VFS[ 	]*/d
/^options[ 	]*DFS[ 	]*/d
/^options[ 	]*UCBFIX[ 	]*/d

/^device[ 	]*asy[014][ 	]*/d
/^device[ 	]*lp0[ 	]*/d
/^device[ 	]*psp0[	 ]*/d
/^device[ 	]*ps0[	 ]*/d
/^device[ 	]*mc0[	 ]*/d

/^pseudo-device[ 	]*ms$/d
/^pseudo-device[ 	]*pty$/d
/^pseudo-device[ 	]*tb$/d
/^pseudo-device[ 	]*ap$/d
/^pseudo-device[ 	]*xemul[ 	]*/d
/^pseudo-device[ 	]*vd[ 	]*/d
/^pseudo-device[ 	]*rfs[ 	]*/d
/^pseudo-device[ 	]*sl$/d
/^pseudo-device[ 	]*xtenemul$/d
