xref: /netbsd-src/distrib/sparc64/instfs/Makefile (revision b519c70ad771d0a55b3c2277db6b97a05fa6465d)
1#	$NetBSD: Makefile,v 1.3 2001/12/28 16:34:50 mason Exp $
2#
3# instfs.tgz is the filesystem image for disk 2 of the floppy based
4# installation method.
5# It is constructed by tarring up the contents of the miniroot with
6# the exeption of the kernel and boot program.
7#
8
9TOP=		${.CURDIR}/..
10MINIROOT=	${.CURDIR}/../xminiroot
11
12.include "${TOP}/Makefile.inc"
13
14MOUNT_POINT?=	/mnt
15# DEV/RDEV file system device, CDEV/RDEV vnconfig device
16VND?=		vnd0
17VND_DEV=	/dev/${VND}a
18VND_RDEV=	/dev/r${VND}a
19VND_CDEV=	/dev/${VND}c
20VND_CRDEV=	/dev/r${VND}c
21INSTFS?=	instfs.tgz
22
23MINIROOT_DIR!=cd ${MINIROOT}; \
24		printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | \
25		${MAKE} -s -f-
26MINIROOT_IMAGE=	${MINIROOT_DIR}/miniroot.fs
27MINIROOT_KERNEL=${MINIROOT_DIR}/netbsd.INSTALL
28
29all: ${INSTFS}
30
31${INSTFS}: ${MINIROOT_IMAGE}
32	vnconfig -v -c ${VND_CRDEV} ${MINIROOT_IMAGE}
33	mount ${VND_DEV} ${MOUNT_POINT}
34	(cd ${MOUNT_POINT}; \
35		tar -z -X ${.CURDIR}/exclude -c -f ${.OBJDIR}/${.TARGET} .)
36	umount ${MOUNT_POINT}
37	vnconfig -u ${VND_CRDEV}
38
39unconfig:
40	-umount -f ${MOUNT_POINT}
41	-vnconfig -u ${VND}
42	-/bin/rm -f ${INSTFS}
43
44clean cleandir distclean:
45	/bin/rm -f *.core ${INSTFS}
46
47.ifndef RELEASEDIR
48release:
49	@echo setenv RELEASEDIR first
50	@false
51.else
52release: ${INSTFS}
53	cp ${INSTFS} $(RELEASEDIR)/installation/misc
54	gzip -9 -c ${MINIROOT_KERNEL} > $(RELEASEDIR)/binary/kernel/netbsd.INSTALL.gz
55.endif	# RELEASEDIR check
56
57.include <bsd.obj.mk>
58.include <bsd.subdir.mk>
59