2002-02-09 16:56:48 +03:00
|
|
|
# $NetBSD: Makefile,v 1.18 2002/02/09 13:56:53 lukem Exp $
|
1999-04-27 16:03:39 +04:00
|
|
|
|
|
|
|
BINDIR= /installation/netboot
|
1998-11-28 02:10:28 +03:00
|
|
|
|
|
|
|
TOP?= ${.CURDIR}/..
|
2000-01-06 06:47:55 +03:00
|
|
|
ARCHDIR?= ${.CURDIR}/../miniroot
|
1998-11-28 02:10:28 +03:00
|
|
|
|
|
|
|
.include "${TOP}/Makefile.inc"
|
|
|
|
IMAGE= ramdisk.fs
|
1999-04-16 18:12:14 +04:00
|
|
|
DISKIMAGE= diskimage.tgz
|
1998-11-28 02:10:28 +03:00
|
|
|
|
|
|
|
CBIN= ramdiskbin
|
2000-01-06 06:47:55 +03:00
|
|
|
CSIZE= 6144 # 512 byte blocks, update disktab.ramdisk if changed
|
|
|
|
DISKTAB= ${.CURDIR}/disktab.ramdisk
|
|
|
|
DISKTYPE= install-ramdisk
|
1998-11-28 02:10:28 +03:00
|
|
|
MOUNT_POINT?= /mnt
|
2000-01-06 06:47:55 +03:00
|
|
|
|
1998-11-28 02:10:28 +03:00
|
|
|
VND?= vnd0
|
2000-01-06 06:47:55 +03:00
|
|
|
VND_DEV= /dev/${VND}c
|
|
|
|
VND_RDEV= /dev/r${VND}c
|
1998-11-28 02:10:28 +03:00
|
|
|
|
1999-05-07 00:51:22 +04:00
|
|
|
CLEANFILES= ${IMAGE} ${DISKIMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache
|
|
|
|
|
2000-01-06 06:47:55 +03:00
|
|
|
LISTS= ${.CURDIR}/list
|
|
|
|
CRUNCHCONF= ${.CURDIR}/${CBIN}.conf
|
2001-10-10 09:13:51 +04:00
|
|
|
MTREECONF= ${.CURDIR}/mtree.conf
|
1998-11-28 02:10:28 +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
|
|
|
|
1999-04-27 05:37:13 +04:00
|
|
|
all: ${IMAGE}
|
|
|
|
|
|
|
|
${IMAGE}: ${CBIN}
|
1998-11-28 02:10:28 +03:00
|
|
|
dd if=/dev/zero of=${IMAGE} count=${CSIZE}
|
2000-01-06 06:47:55 +03:00
|
|
|
vnconfig -v -c ${VND} ${IMAGE}
|
|
|
|
disklabel -rw -f ${DISKTAB} ${VND} ${DISKTYPE}
|
1999-12-28 13:54:20 +03:00
|
|
|
newfs -B le -m 0 -o space -i 5120 ${VND_RDEV}
|
1998-11-28 02:10:28 +03:00
|
|
|
mount ${VND_DEV} ${MOUNT_POINT}
|
2001-10-13 10:15:15 +04:00
|
|
|
${MTREE} -def ${MTREECONF} -p ${MOUNT_POINT}/ -u
|
1998-11-28 02:10:28 +03:00
|
|
|
TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
|
2000-05-02 20:06:45 +04:00
|
|
|
KERNOBJDIR=${KERNOBJDIR} \
|
2000-01-06 06:47:55 +03:00
|
|
|
TARGDIR=${MOUNT_POINT} sh ${TOP}/src/runlist.sh ${LISTS}
|
1998-11-28 02:10:28 +03:00
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
1999-04-16 18:12:14 +04:00
|
|
|
@echo Building diskimage tar file...
|
|
|
|
tar cf - -C ${MOUNT_POINT} . | gzip -9 > ${DISKIMAGE}
|
|
|
|
@echo ""
|
1998-11-28 02:10:28 +03:00
|
|
|
umount ${MOUNT_POINT}
|
2000-01-06 06:47:55 +03:00
|
|
|
vnconfig -u ${VND}
|
1998-11-28 02:10:28 +03:00
|
|
|
|
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
2000-01-06 06:47:55 +03:00
|
|
|
-vnconfig -u ${VND}
|
1998-11-28 02:10:28 +03:00
|
|
|
-/bin/rm -f ${IMAGE}
|
|
|
|
|
|
|
|
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
|
2000-11-01 10:57:55 +03:00
|
|
|
${CRUNCHGEN} -D ${TOP}/../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
|
1998-11-28 02:10:28 +03:00
|
|
|
|
|
|
|
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
|
2000-08-31 03:51:46 +04:00
|
|
|
${MAKE} -f ${CBIN}.mk all
|
1998-11-28 02:10:28 +03:00
|
|
|
|
1999-12-28 13:54:20 +03:00
|
|
|
echoimage:
|
|
|
|
@echo ${.OBJDIR}/${IMAGE}
|
|
|
|
|
1999-04-27 16:03:39 +04:00
|
|
|
realinstall:
|
2002-02-09 16:56:48 +03:00
|
|
|
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${NONBINMODE} \
|
|
|
|
${DISKIMAGE} ${RELEASEDIR}${BINDIR}
|
1999-04-27 16:03:39 +04:00
|
|
|
|
1998-11-28 02:10:28 +03:00
|
|
|
clean cleandir distclean:
|
1999-05-12 00:46:58 +04:00
|
|
|
/bin/rm -f *.core ${CLEANFILES} *.o *.cro *.c
|
1998-11-28 02:10:28 +03:00
|
|
|
|
1999-05-04 06:44:22 +04:00
|
|
|
# XXX!
|
|
|
|
depend:
|
2001-03-24 18:30:44 +03:00
|
|
|
dependall: depend all
|
1999-05-04 06:44:22 +04:00
|
|
|
|
1998-11-28 02:10:28 +03:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
.include <bsd.obj.mk>
|
1999-04-27 16:03:39 +04:00
|
|
|
.include "../Makefile.inc"
|