2002-02-12 14:17:47 +03:00
|
|
|
# $NetBSD: Makefile,v 1.48 2002/02/12 11:17:47 is Exp $
|
1995-12-19 01:47:26 +03:00
|
|
|
|
2000-05-02 10:45:24 +04:00
|
|
|
.include "../../Makefile.inc"
|
1997-01-08 10:22:43 +03:00
|
|
|
.include <bsd.own.mk>
|
2000-05-02 10:45:24 +04:00
|
|
|
.include <bsd.kernobj.mk>
|
1997-01-08 10:22:43 +03:00
|
|
|
|
1995-12-19 01:47:26 +03:00
|
|
|
CBIN= instbin
|
|
|
|
ARCHDIR= ${.CURDIR}/../${MACHINE}/miniroot
|
|
|
|
|
1996-05-25 03:36:38 +04:00
|
|
|
.if exists(${ARCHDIR}/Makefile.inc)
|
|
|
|
.include "${ARCHDIR}/Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
2002-02-12 14:17:47 +03:00
|
|
|
HOST_RAWPART!= sysctl -n kern.rawpartition | tr '0-9a-f' 'a-p'
|
2001-11-27 08:05:38 +03:00
|
|
|
VND?= vnd0
|
2002-02-12 14:17:47 +03:00
|
|
|
VND_DEV= /dev/${VND}${HOST_RAWPART}
|
|
|
|
VND_RDEV= /dev/r${VND}${HOST_RAWPART}
|
1997-09-23 01:33:31 +04:00
|
|
|
VND_GEOM?=
|
2000-01-10 18:17:30 +03:00
|
|
|
IMAGE?= miniroot.fs
|
2000-03-07 11:41:35 +03:00
|
|
|
IMAGESIZE?= 14336 # 7MB in 512 byte blocks
|
1996-05-27 16:39:01 +04:00
|
|
|
NEWFSOPTS?=
|
2000-08-29 15:41:24 +04:00
|
|
|
MOUNT_POINT?= /mnt
|
1997-09-10 03:02:04 +04:00
|
|
|
BOOTINSTALL?= true
|
1998-11-17 02:43:58 +03:00
|
|
|
PRELABEL?= true
|
1995-12-19 01:47:26 +03:00
|
|
|
|
1997-07-15 12:16:36 +04:00
|
|
|
.ifdef DISKTYPE
|
|
|
|
DISKTYPEARG= -t ${DISKTYPE}
|
|
|
|
.endif
|
1997-06-24 01:29:50 +04:00
|
|
|
|
1996-05-27 16:39:01 +04:00
|
|
|
LISTS= ${.CURDIR}/list ${ARCHDIR}/list
|
1995-12-19 01:47:26 +03:00
|
|
|
CRUNCHCONF= ${CBIN}.conf
|
2001-10-10 09:13:51 +04:00
|
|
|
MTREECONF= ${.CURDIR}/mtree.conf
|
2002-02-09 16:56:48 +03:00
|
|
|
ICMD= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${NONBINMODE}
|
1995-12-19 01:47:26 +03:00
|
|
|
|
2000-11-01 10:57:55 +03:00
|
|
|
CRUNCHGEN?= crunchgen
|
2001-10-13 10:15:15 +04:00
|
|
|
MTREE?= mtree
|
2000-11-01 10:57:55 +03:00
|
|
|
|
2002-01-15 20:45:36 +03:00
|
|
|
.if !defined(DESTDIR) || ${DESTDIR} == ""
|
1996-07-04 10:53:12 +04:00
|
|
|
all:
|
1999-07-18 11:22:36 +04:00
|
|
|
@echo setenv DESTDIR before making a miniroot!
|
1996-07-04 10:53:12 +04:00
|
|
|
@false
|
|
|
|
.else
|
|
|
|
|
1995-12-19 01:47:26 +03:00
|
|
|
all: ${CBIN}
|
1996-05-27 16:39:01 +04:00
|
|
|
dd if=/dev/zero of=${IMAGE} count=${IMAGESIZE}
|
2001-11-27 08:05:38 +03:00
|
|
|
vnconfig ${DISKTYPEARG} -v -c ${VND} ${IMAGE} ${VND_GEOM}
|
1998-11-17 02:43:58 +03:00
|
|
|
${PRELABEL}
|
1997-09-10 03:02:04 +04:00
|
|
|
-newfs -m 0 -o space ${NEWFSOPTS} ${VND_RDEV} ${DISKTYPE}
|
|
|
|
${BOOTINSTALL}
|
1999-04-19 01:01:57 +04:00
|
|
|
mount -o async ${VND_DEV} ${MOUNT_POINT}
|
2001-10-13 10:15:15 +04:00
|
|
|
${MTREE} -def ${MTREECONF} -p ${MOUNT_POINT}/ -u
|
2002-02-12 04:38:17 +03:00
|
|
|
REV=${DISTRIBREV} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
|
1997-09-10 03:02:04 +04:00
|
|
|
TARGDIR=${MOUNT_POINT} VND_RDEV=${VND_RDEV} \
|
2000-05-02 10:45:24 +04:00
|
|
|
KERNOBJDIR=${KERNOBJDIR} \
|
1997-09-10 03:02:04 +04:00
|
|
|
sh ${.CURDIR}/runlist.sh ${LISTS}
|
1995-12-19 01:47:26 +03:00
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
|
|
|
umount ${MOUNT_POINT}
|
2002-01-07 15:56:42 +03:00
|
|
|
vnconfig -u ${VND}
|
1995-12-19 01:47:26 +03:00
|
|
|
|
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
2001-11-08 10:29:45 +03:00
|
|
|
-vnconfig -u ${VND_DEV}
|
1995-12-19 01:47:26 +03:00
|
|
|
-/bin/rm -f ${IMAGE}
|
|
|
|
|
|
|
|
${CBIN}.conf: ${LISTS}
|
|
|
|
awk -f ${.CURDIR}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf
|
|
|
|
|
2002-01-15 20:41:41 +03:00
|
|
|
${CBIN}.mk: .EXEC
|
|
|
|
${CBIN}.mk ${CBIN}.c: ${CRUNCHCONF}
|
2001-02-25 06:54:24 +03:00
|
|
|
${CRUNCHGEN} -f -D ${.CURDIR}/../.. -L ${DESTDIR}/usr/lib ${CRUNCHCONF}
|
1995-12-19 01:47:26 +03:00
|
|
|
|
2002-01-15 20:41:41 +03:00
|
|
|
${CBIN}: ${CBIN}.mk ${CBIN}.c
|
2000-08-31 03:51:46 +04:00
|
|
|
${MAKE} -f ${CBIN}.mk all
|
1995-12-19 01:47:26 +03:00
|
|
|
|
2002-01-15 20:45:36 +03:00
|
|
|
.if !defined(RELEASEDIR) || ${RELEASEDIR} == ""
|
1999-10-19 00:13:55 +04:00
|
|
|
release:
|
|
|
|
@echo setenv RELEASEDIR first
|
|
|
|
@false
|
|
|
|
.else
|
2000-04-17 01:27:00 +04:00
|
|
|
release: ${IMAGE}
|
|
|
|
mkdir -p ${RELEASEDIR}/installation/miniroot
|
|
|
|
gzip -c -9 < ${.OBJDIR}/miniroot.fs \
|
|
|
|
> ${RELEASEDIR}/installation/miniroot/miniroot.fs.gz
|
|
|
|
${.CURDIR}/../sets/makesums \
|
2000-05-05 15:15:45 +04:00
|
|
|
-t ${RELEASEDIR}/installation/miniroot miniroot.fs.gz
|
2000-05-02 10:45:24 +04:00
|
|
|
|
1999-10-19 00:13:55 +04:00
|
|
|
.endif # RELEASEDIR check
|
|
|
|
.endif # DESTDIR check
|
|
|
|
|
1998-09-05 18:46:13 +04:00
|
|
|
clean cleandir distclean:
|
1996-01-07 01:40:58 +03:00
|
|
|
/bin/rm -f core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \
|
1999-05-12 00:46:58 +04:00
|
|
|
${CBIN}.conf *.o *.cro *.c
|
1995-12-19 01:47:26 +03:00
|
|
|
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
.include <bsd.subdir.mk>
|