NetBSD/distrib/i386/floppies/bootfloppy-common/Makefile.inc

75 lines
1.9 KiB
Makefile

# $NetBSD: Makefile.inc,v 1.23 2000/02/18 02:50:17 enami Exp $
# TOP is assumed to be defined by Makefile including this one.
COMMONDIR= ${TOP}/bootfloppy-common
MOUNT_POINT?= /mnt
VND?= vnd0
VND_DEV= /dev/${VND}a
VND_RDEV= /dev/r${VND}a
VND_CDEV= /dev/${VND}d
VND_CRDEV= /dev/r${VND}d
IMAGE?= xxx.fs
KERN?= netbsd-xxx
MDEC= ${DESTDIR}/usr/mdec
STRIP?= strip
LISTS= ${COMMONDIR}/list
RAMDISK !=cd $(.CURDIR)/../ramdisk/; \
printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/ramdisk.fs\n" | \
${MAKE} -s -f-
DISKTYPE?= floppy3
DISKSIZE?= 2880
# Some reasonable values for the -i parameter to newfs are:
#
# 6144 1147k, 189 inodes free
# 16384 1159k, 93 inodes free
# on 1.44M:
# 204800 1407k, 27 inodes free
# (with a 4k blocksize, one cannot get fewer than ~32 inodes allocated)
INO_BYTES?= 204800
CLEANFILES+= netbsd.ram.gz
realall: netbsd.ram.gz
dd if=/dev/zero of=${IMAGE} count=${DISKSIZE}
vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
disklabel -rw ${VND_CDEV} ${DISKTYPE}
newfs -B le -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV} ${DISKTYPE}
${MDEC}/installboot -v -f ${MDEC}/biosboot.sym ${VND_RDEV}
mount ${VND_DEV} ${MOUNT_POINT}
TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
@echo ""
@df -i ${MOUNT_POINT}
umount ${MOUNT_POINT}
vnconfig -u ${VND_CDEV}
unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND_DEV}
-/bin/rm -f ${IMAGE}
netbsd.ram.gz: ${KERN} ${RAMDISK}
cp ${KERN} netbsd.tmp
${DESTDIR}/usr/sbin/mdsetimage -v netbsd.tmp ${RAMDISK}
${STRIP} netbsd.tmp
gzip -9 netbsd.tmp
mv netbsd.tmp.gz ${.TARGET}
release:
-mkdir -p ${RELEASEDIR}/installation/floppies
cp -p ${IMAGE} ${RELEASEDIR}/installation/floppies
gzip <${IMAGE} >${RELEASEDIR}/installation/floppies/${IMAGE}.gz
clean cleandir distclean:
/bin/rm -f *.core ${IMAGE} ${CLEANFILES}
.include <bsd.own.mk>
.include <bsd.obj.mk>
.include <bsd.subdir.mk>