2000-10-20 15:56:55 +04:00
|
|
|
# $NetBSD: Makefile,v 1.25 2000/10/20 11:56:57 pk Exp $
|
|
|
|
#
|
|
|
|
# boot.fs is the image for disk 1 of the two-set floppy based installation
|
|
|
|
# method.
|
|
|
|
#
|
|
|
|
# It is constructed by injecting the microroot filesystem `ramdisk.fs'
|
|
|
|
# into the md based kernel built from the INSTALL kernel configuration file.
|
|
|
|
#
|
1998-06-06 09:29:50 +04:00
|
|
|
|
|
|
|
TOP= ${.CURDIR}/..
|
1999-01-10 16:21:27 +03:00
|
|
|
MINIROOT= ${.CURDIR}/../../miniroot
|
1998-06-06 09:29:50 +04:00
|
|
|
|
|
|
|
.include "${TOP}/Makefile.inc"
|
|
|
|
|
2000-03-09 00:58:10 +03:00
|
|
|
.include <bsd.own.mk> # So we use /etc/mk.conf.
|
2000-05-02 11:10:19 +04:00
|
|
|
.include <bsd.kernobj.mk>
|
2000-05-02 20:06:45 +04:00
|
|
|
|
2000-05-02 11:10:19 +04:00
|
|
|
KERN?= ${KERNOBJDIR}/INSTALL/netbsd
|
1998-06-06 09:29:50 +04:00
|
|
|
|
|
|
|
MOUNT_POINT?= /mnt
|
|
|
|
VND?= vnd0
|
|
|
|
VND_DEV= /dev/${VND}a
|
|
|
|
VND_RDEV= /dev/r${VND}a
|
|
|
|
VND_CDEV= /dev/${VND}c
|
|
|
|
VND_CRDEV= /dev/r${VND}c
|
|
|
|
FD?= fd0
|
|
|
|
FD_RDEV= /dev/r${FD}a
|
2000-01-10 18:17:30 +03:00
|
|
|
IMAGE?= boot.fs
|
1998-06-06 09:29:50 +04:00
|
|
|
MDEC= ${DESTDIR}/usr/mdec
|
|
|
|
|
|
|
|
LISTS= ${.CURDIR}/list
|
1998-08-28 06:01:28 +04:00
|
|
|
RAMDISK!= cd ${TOP}/ramdisk/; \
|
2000-01-10 18:17:30 +03:00
|
|
|
printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/ramdisk.fs\n" |\
|
1999-04-09 01:17:14 +04:00
|
|
|
${MAKE} -s -f-
|
1998-06-06 09:29:50 +04:00
|
|
|
|
|
|
|
# Some reasonable values for the -i parameter to newfs are:
|
|
|
|
#
|
|
|
|
# 6144 1147k, 189 inodes free
|
|
|
|
# 16384 1159k, 93 inodes free
|
|
|
|
# 204800 1167k, 29 inodes free
|
1999-04-09 01:17:14 +04:00
|
|
|
INO_BYTES= 204800
|
1998-06-06 09:29:50 +04:00
|
|
|
|
2000-05-06 18:18:53 +04:00
|
|
|
BLOCKSIZE=512
|
2000-10-20 15:56:55 +04:00
|
|
|
FSSIZE!= expr ${BLOCKSIZE} \* 18 \* 2 \* 80
|
|
|
|
|
|
|
|
GEOM=${BLOCKSIZE}/18/2/80
|
1998-06-06 09:29:50 +04:00
|
|
|
|
2000-05-06 18:18:53 +04:00
|
|
|
CLEANFILES+= netbsd.ram.gz netbsd.tmp disktab.tmp
|
|
|
|
|
2000-10-20 15:56:55 +04:00
|
|
|
.MAIN: all
|
|
|
|
|
|
|
|
all: netbsd.ram.gz
|
|
|
|
dd if=/dev/zero of=${IMAGE} bs=${FSSIZE} count=1
|
|
|
|
vnconfig -v -c ${VND_CDEV} ${IMAGE} ${GEOM}
|
|
|
|
#newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV}
|
1999-03-04 23:32:18 +03:00
|
|
|
newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV}
|
1998-06-06 09:29:50 +04:00
|
|
|
mount ${VND_DEV} ${MOUNT_POINT}
|
1999-01-10 16:21:27 +03:00
|
|
|
TOPDIR=${TOP} CURDIR=${MINIROOT} OBJDIR=${.OBJDIR} \
|
2000-05-02 20:06:45 +04:00
|
|
|
KERNOBJDIR=${KERNOBJDIR} \
|
1999-01-10 16:21:27 +03:00
|
|
|
TARGDIR=${MOUNT_POINT} sh ${MINIROOT}/runlist.sh ${LISTS}
|
1998-06-06 09:29:50 +04:00
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
|
|
|
@echo "installing new bootblocks"
|
|
|
|
-rm -f ${MOUNT_POINT}/boot
|
2000-10-20 15:56:55 +04:00
|
|
|
${MDEC}/binstall -m ${MDEC} -v ffs ${MOUNT_POINT}
|
1998-06-06 09:29:50 +04:00
|
|
|
umount ${MOUNT_POINT}
|
|
|
|
vnconfig -u ${VND_CDEV}
|
|
|
|
|
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
|
|
|
-vnconfig -u ${VND_DEV}
|
|
|
|
|
|
|
|
netbsd.ram.gz: ${KERN} ${RAMDISK}
|
|
|
|
cp ${KERN} netbsd.tmp
|
|
|
|
mdsetimage -v netbsd.tmp ${RAMDISK}
|
2000-10-20 15:56:55 +04:00
|
|
|
strip netbsd.tmp
|
2000-01-14 16:47:27 +03:00
|
|
|
gzip -9 netbsd.tmp
|
1998-06-06 09:29:50 +04:00
|
|
|
mv netbsd.tmp.gz ${.TARGET}
|
|
|
|
|
1998-09-05 18:46:13 +04:00
|
|
|
clean cleandir distclean:
|
1998-06-06 09:29:50 +04:00
|
|
|
/bin/rm -f *.core ${IMAGE} ${CLEANFILES}
|
|
|
|
|
1998-08-28 06:01:28 +04:00
|
|
|
depend install:
|
|
|
|
|
1998-06-06 09:29:50 +04:00
|
|
|
real-floppy:
|
|
|
|
dd if=${IMAGE} of=${FD_RDEV} bs=32k
|
|
|
|
|
1999-10-19 00:13:55 +04:00
|
|
|
.ifndef RELEASEDIR
|
|
|
|
release:
|
|
|
|
@echo setenv RELEASEDIR first
|
|
|
|
@false
|
|
|
|
.else
|
|
|
|
release: $(IMAGE)
|
2000-10-20 15:56:55 +04:00
|
|
|
gzip -c -9 < $(.OBJDIR)/boot.fs \
|
|
|
|
> $(RELEASEDIR)/installation/bootfs/boot.fs.gz
|
1999-10-19 00:13:55 +04:00
|
|
|
.endif # RELEASEDIR check
|
|
|
|
|
1998-06-06 09:29:50 +04:00
|
|
|
.include <bsd.obj.mk>
|