2001-12-17 23:27:39 +03:00
|
|
|
# $NetBSD: Makefile,v 1.3 2001/12/17 20:27:39 fredette Exp $
|
2001-05-18 04:16:36 +04:00
|
|
|
|
|
|
|
TOP= ${.CURDIR}/..
|
|
|
|
|
|
|
|
# This include just sets REV=XX
|
|
|
|
.include "${TOP}/Makefile.inc"
|
|
|
|
|
|
|
|
IMAGE= miniroot
|
|
|
|
|
|
|
|
TREE= ${TOP}/common/${IMAGE}.tree
|
|
|
|
|
|
|
|
LISTS= ${TOP}/common/${IMAGE}.list \
|
|
|
|
${TOP}/common/mini_sbin.list \
|
|
|
|
${TOP}/common/mini_bin.list \
|
|
|
|
${TOP}/common/mini_usr.list
|
|
|
|
|
|
|
|
KERNEL = ${KERNOBJDIR}/INSTALL/netbsd
|
|
|
|
|
|
|
|
MOUNT_POINT?= /mnt
|
2001-12-17 23:27:39 +03:00
|
|
|
RAW_PART!= sysctl -n kern.rawpartition | tr '0-7' 'a-h'
|
2001-05-18 04:16:36 +04:00
|
|
|
VND?= vnd1
|
|
|
|
VND_DEV?= /dev/${VND}a
|
|
|
|
VND_RDEV?= /dev/r${VND}a
|
2001-12-17 23:27:39 +03:00
|
|
|
VND_CRDEV?= /dev/r${VND}${RAW_PART}
|
2001-10-13 10:15:15 +04:00
|
|
|
|
2001-05-18 04:16:36 +04:00
|
|
|
# These are all the parameters for the miniroot: (12MB)
|
|
|
|
DISKTYPE= miniroot
|
|
|
|
SIZE= 12
|
|
|
|
# bigendian, old format, minfree, opt, b/i, cpg
|
|
|
|
NEWFSARGS= -B be -O -m 0 -o space -i 8192 -c 16
|
2001-12-17 23:27:39 +03:00
|
|
|
MTREE?= mtree
|
|
|
|
INSTALLBOOT?= usr/mdec/installboot
|
2001-05-18 04:16:36 +04:00
|
|
|
|
|
|
|
CLEANFILES= ${IMAGE}.gz ${IMAGE} ${IMAGE}.tmp install.sub
|
|
|
|
|
|
|
|
all: ${IMAGE}.gz
|
|
|
|
|
|
|
|
${IMAGE}.gz: ${TREE} ${LISTS} install.sub
|
|
|
|
dd if=/dev/zero of=${IMAGE} bs=1024k count=${SIZE}
|
2001-12-17 23:27:39 +03:00
|
|
|
vnconfig -f ${.CURDIR}/disktab -t ${DISKTYPE} -v -c ${VND} ${IMAGE}
|
2001-05-18 04:16:36 +04:00
|
|
|
disklabel -f ${.CURDIR}/disktab -rw ${VND} ${DISKTYPE}
|
|
|
|
newfs ${NEWFSARGS} ${VND_RDEV}
|
|
|
|
mount ${VND_DEV} ${MOUNT_POINT}
|
2001-10-13 10:15:15 +04:00
|
|
|
${MTREE} -def ${TREE} -p ${MOUNT_POINT}/ -u
|
2001-05-18 04:16:36 +04:00
|
|
|
cp ${KERNEL} ${MOUNT_POINT}/netbsd
|
|
|
|
TOPDIR=${TOP} CURDIR=${.CURDIR} DESTDIR=${DESTDIR} \
|
|
|
|
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
|
|
|
|
sh ${TOP}/common/RunList.sh ${LISTS}
|
|
|
|
sync ; sleep 1 ; sync
|
|
|
|
cd ${MOUNT_POINT} ;\
|
2001-12-17 23:27:39 +03:00
|
|
|
${INSTALLBOOT} -v ufsboot usr/mdec/bootxx ${VND_CRDEV}
|
2001-05-18 04:16:36 +04:00
|
|
|
sync
|
|
|
|
@echo ""
|
|
|
|
@df -i ${MOUNT_POINT}
|
|
|
|
@echo ""
|
|
|
|
-umount ${MOUNT_POINT}
|
2001-12-17 23:27:39 +03:00
|
|
|
dd if=${VND_DEV} of=${IMAGE}-tmp bs=1024k count=${SIZE}
|
2001-05-18 04:16:36 +04:00
|
|
|
vnconfig -u ${VND}
|
2001-12-17 23:27:39 +03:00
|
|
|
mv ${IMAGE}-tmp ${IMAGE}
|
2001-05-18 04:16:36 +04:00
|
|
|
gzip -9 -c ${IMAGE} > ${IMAGE}.tmp
|
|
|
|
-mv -f ${IMAGE}.tmp ${IMAGE}.gz
|
|
|
|
|
|
|
|
unconfig:
|
|
|
|
-umount -f ${MOUNT_POINT}
|
2001-12-17 23:27:39 +03:00
|
|
|
-vnconfig -u ${VND}
|
2001-05-18 04:16:36 +04:00
|
|
|
-/bin/rm -f ${IMAGE} ${IMAGE}.tmp
|
|
|
|
|
|
|
|
# Do not delete this if I change my mind and kill make...
|
|
|
|
.PRECIOUS: ${IMAGE}.gz
|
|
|
|
|
|
|
|
install.sub : ${TOP}/../miniroot/install.sub
|
|
|
|
sed -e "/^VERSION=/s/=.*/=${REV}/" < $? > $@
|
|
|
|
|
|
|
|
clean cleandir distclean:
|
|
|
|
-rm -f a.out core *.core *.o
|
|
|
|
-rm -f ${CLEANFILES}
|
|
|
|
|
|
|
|
.if !defined(RELEASEDIR)
|
|
|
|
release:
|
|
|
|
@echo setenv RELEASEDIR before doing that!
|
|
|
|
@false
|
|
|
|
.else # RELEASEDIR
|
|
|
|
release: ${IMAGE}.gz
|
|
|
|
-mkdir -p ${RELEASEDIR}/installation/miniroot
|
|
|
|
cp -p ${IMAGE}.gz \
|
|
|
|
${RELEASEDIR}/installation/miniroot/${IMAGE}.gz
|
|
|
|
.endif # RELEASEDIR
|
|
|
|
|
|
|
|
# Standard rules needed by the above...
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
.include <bsd.subdir.mk>
|