Convert from vnd and installboot.old to Makefile.tarfloppy and MI installboot.

Allow various parameters to be tweaked via external make(1) or
environment variables, to allow for easy creation of floppy sets
containing arbitrary kernels.

XXX: GENERIC still doesn't fit on a single floppy, so this won't build as-is
and is still not enabled by default.  (Per discussion with Ross & Jason.)
This commit is contained in:
lukem 2002-05-04 01:40:06 +00:00
parent 897d27df90
commit 0540a3d579

View File

@ -1,68 +1,53 @@
# $NetBSD: Makefile,v 1.15 2002/05/02 18:02:18 lukem Exp $ # $NetBSD: Makefile,v 1.16 2002/05/04 01:40:06 lukem Exp $
.include <bsd.own.mk> .include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
.include <bsd.kernobj.mk> .include <bsd.kernobj.mk>
MOUNT_POINT?= /mnt # Stuff an arbitrary kernel onto a ustarfs boot floppy set.
VND?= vnd0
VND_DEV= /dev/${VND}a
VND_RDEV= /dev/r${VND}a
VND_CDEV= /dev/${VND}c
VND_CRDEV= /dev/r${VND}c
MDEC?= ${DESTDIR}/usr/mdec
KERNEL?= ${KERNOBJDIR}/GENERIC/netbsd
STRIP?= strip
GZKERNEL= netbsd
IMAGE= GENERIC.fs
DISKTYPE= floppy
# Some reasonable values for the -i parameter to newfs are:
# #
# 6144 1147k, 189 inodes free # Optional variables available:
# 16384 1159k, 93 inodes free # FLOPPYKERNEL Path to kernel to stuff onto the floppy.
# 204800 1167k, 29 inodes free # [ ${KERNOBJDIR}/GENERIC/netbsd ]
INO_BYTES?= 6144 #
# FLOPPYBASE Basename of floppies (written as "${FLOPPYBASE}N.fs")
# [ "generic" ]
#
# FLOPPYSIZE Size of a floppy. [ 2880 ]
#
# FLOPPYMAX Maximum number of floppies allowed in the set. [1]
#
FLOPPYKERNEL?= ${KERNOBJDIR}/GENERIC/netbsd
FLOPPYBASE?= generic
FLOPPYMAX?= 1
CLEANFILES+= ${IMAGE} ${GZKERNEL} FLOPPY_RELEASEDIR?= installation/misc
all: GENERIC.fs .if defined(FLOPPYSIZE) && (${FLOPPYSIZE} != 2880)
FLOPPYMETAFILE!=printf "tapelabel USTAR.volsize.%o" ${FLOPPYSIZE}
.else
FLOPPYSIZE= 2880
.endif
GENERIC.fs: ${GZKERNEL} ${MDEC}/boot ${MDEC}/bootxx.old FLOPPYFILES= boot ${FLOPPYMETAFILE} netbsd
@echo Creating tar image
${PAX} -wvf ustar.tmp ${MDEC}/boot ${GZKERNEL}
@echo Creating vn image
dd if=/dev/zero of=${.TARGET}.tmp count=2880
vnconfig -t ${DISKTYPE} -v -c ${VND} ${.TARGET}.tmp
dd bs=8k seek=1 if=ustar.tmp of=${VND_CDEV}
disklabel -rw ${VND} ${DISKTYPE}
${MDEC}/installboot.old -b 17 -v \
${MDEC}/boot ${MDEC}/bootxx.old ${VND_CRDEV}
vnconfig -u ${VND}
mv ${.TARGET}.tmp ${.TARGET}
${GZKERNEL}: ${KERNEL} MDEC= ${DESTDIR}/usr/mdec
cp ${KERNEL} ${.TARGET} KERNOBJ!= cd ${.CURDIR}/../instkernel && ${PRINTOBJDIR}
${STRIP} ${.TARGET} FLOPPY_BOOT= ${MDEC}/ustarboot
gzip -9f ${.TARGET} FLOPPYINSTBOOT=\
mv ${.TARGET}.gz ${.TARGET} "${INSTALLBOOT} -m ${MACHINE} -t raw -v -b 17 @IMAGE@ ${FLOPPY_BOOT}"
unconfig: netbsd: ${FLOPPYKERNEL}
-vnconfig -u ${VND} @echo "Copying stripped and gzipped ${.ALLSRC} to ${.TARGET}"
@rm -f ${.TARGET} ${.TARGET}.tmp
cp ${.ALLSRC} ${.TARGET}.tmp
${STRIP} ${.TARGET}.tmp
gzip -9f ${.TARGET}.tmp
mv ${.TARGET}.tmp.gz ${.TARGET}
disk: all CLEANFILES+= netbsd netbsd.tmp netbsd.tmp.gz
dd if=GENERIC.fs bs=18k of=/dev/rfd0a
clean cleandir distclean: .include "${DISTRIBDIR}/common/Makefile.tarfloppy"
/bin/rm -f *.core ${CLEANFILES} ${GZKERNEL} ${GZKERNEL}.gz *.tmp
# nothing to do here
depend includes lint regress tags:
release: check_RELEASEDIR .WAIT GENERIC.fs
${RELEASE_INSTALL} GENERIC.fs ${RELEASEDIR}/installation/misc
.include <bsd.prog.mk> .include <bsd.prog.mk>