summaryrefslogtreecommitdiff
path: root/distrib/sparc/floppies/kernel/Makefile
blob: 5f6cb36b8b059d11215d0d3c19105bb0223ea850 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#	$Id: Makefile,v 1.4 1996/10/18 23:35:36 deraadt Exp $

.include "../Makefile.inc"

MOUNT_POINT?=	/mnt
VND?=		vnd0
VND_DEV=	/dev/${VND}a
VND_RDEV=	/dev/r${VND}a
IMAGE=		kc${REV}.fs
PID!=		echo $$$$
REALIMAGE!=	echo /tmp/image.${PID}
MDEC=		${DESTDIR}/usr/mdec

LISTS=		${.CURDIR}/list

bsd:
	cd ${.CURDIR}/../../../../sys/arch/sparc/conf && config FLOPPY
	cd ${.CURDIR}/../../../../sys/arch/sparc/compile/FLOPPY && \
	    make clean && make depend && make
	cp ${.CURDIR}/../../../../sys/arch/sparc/compile/FLOPPY/bsd bsd

all:	bsd
.if ${VND} == vnd0
	dd if=/dev/zero of=${REALIMAGE} bs=10k count=144
	vnconfig -v -c ${VND_DEV} ${REALIMAGE}
	# fuck, disklabeling completely fails
.else
	disklabel -w ${VND_RDEV} floppy
.endif
	newfs -O -m 0 -o space -i 8192 -c 80 ${VND_RDEV} floppy
	mount ${VND_DEV} ${MOUNT_POINT}
	sync; /usr/mdec/binstall -v ffs ${MOUNT_POINT}
	TOPDIR=${.CURDIR}/.. CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
	    TARGDIR=${MOUNT_POINT} sh ${.CURDIR}/../runlist.sh ${LISTS}
	mtree -def ${.CURDIR}/mtree.conf -p ${MOUNT_POINT}/ -u
	df -i ${MOUNT_POINT}
	umount ${MOUNT_POINT}
.if ${VND} == vnd0
	vnconfig -u ${VND_DEV}
	cat /bin/* > /dev/null		# flush buffer cache (yuck)
	cp ${REALIMAGE} ${IMAGE}
	rm ${REALIMAGE}
	echo you have just produced a perfectly wonderful disfunctional floppy
.else
	dd if=${VND_RDEV} of=${IMAGE} bs=10k
.endif


unconfig:
	-umount -f ${MOUNT_POINT}
	-vnconfig -u ${VND_DEV}
	-/bin/rm -f ${IMAGE}

clean cleandir:
	/bin/rm -f ${IMAGE} bsd

.include <bsd.obj.mk>
.include <bsd.subdir.mk>