migrate to NDWO using Makefile.mdset, based on pmax/instkernel/Makefile

XXX: untested
This commit is contained in:
lukem 2002-04-12 13:54:50 +00:00
parent 58e532b9cd
commit b39fbede64
4 changed files with 45 additions and 111 deletions

View File

@ -1,91 +1,53 @@
# $NetBSD: Makefile,v 1.6 2002/02/09 13:56:51 lukem Exp $
# $NetBSD: Makefile,v 1.7 2002/04/12 13:54:50 lukem Exp $
.include "../../../Makefile.inc"
.include <bsd.kernobj.mk>
.include <bsd.own.mk>
.include "${_SRC_TOP_}/distrib/Makefile.inc"
.include <bsd.kernobj.mk>
IMAGE= diskimage
IMAGESIZE= 2m
LISTS= ${.CURDIR}/list
IMAGEENDIAN= be
IMAGEDEPENDS= ${KERNELS} ${DESTDIR}/usr/mdec/boot
RAMDISKDIR!= cd ${.CURDIR}/../ramdisk && ${PRINTOBJDIR}
RAMDISK= ${RAMDISKDIR}/ramdisk.fs
MDSETTARGETS= RAMDISK ${RAMDISK} netbsd
.if defined(ECOFF_KERNEL)
netbsd.post= ${ELF2ECOFF} netbsd.tmp netbsd.ecoff && gzip -9f netbsd.ecoff
CLEANFILES+= netbsd.ecoff netbsd.ecoff.gz
.endif # ECOFF_KERNEL
PRIMARYBOOT= ${DESTDIR}/usr/mdec/bootxx_ffs
${IMAGE}.gz: ${IMAGE} ${PRIMARYBOOT}
# XXX ${INSTALLBOOT} -m ${MACHINE} ${IMAGE} ${PRIMARYBOOT}
# XXXDISTRIB
${DESTDIR}/usr/mdec/installboot ${IMAGE} ${PRIMARYBOOT}
gzip -9f ${IMAGE}
CLEANFILES+= ${IMAGE}.gz
realall: ${KERNELS} ${IMAGE}.gz
DISKBINDIR= ${RELEASEDIR}/installation/diskimage
KERNBINDIR= ${RELEASEDIR}/binary/kernel
MDSETIMAGE?= mdsetimage
IMAGE= diskimage
IMAGESIZE= 4096 # 512 byte blocks, update disktab.diskimage if changed
DISKTAB= ${.CURDIR}/disktab.diskimage
DISKTYPE= miniroot
NEWFSOPTS?= -c 32 -B be -i 32768 # don't need many inodes!
MDEC?= ${DESTDIR}/usr/mdec
BOOT_PRIMARY= ${MDEC}/bootxx_ffs
BOOT_SECONDARY= ${MDEC}/boot
INSTALLBOOT?= ${MDEC}/installboot
KERN= ${KERNOBJDIR}/RAMDISK/netbsd
RAMDISK!= cd ${.CURDIR}/../ramdisk; ${MAKE} echoimage
CLEANFILES= netbsd netbsd.gz netbsd.ecoff netbsd.ecoff.gz ${IMAGE}.gz
# DEV/RDEV file system device, CDEV/RDEV vnconfig device
VND?= vnd0
VND_DEV= /dev/${VND}c
VND_RDEV= /dev/r${VND}c
#VND_GEOM= 512/18/2/$$((${IMAGESIZE} / (18 * 2)))
MOUNT_POINT?= /mnt
realall: ${IMAGE}.gz
netbsd.gz: ${KERN} ${RAMDISK}
cp ${KERN} netbsd
${MDSETIMAGE} -v netbsd ${RAMDISK}
.ifdef ECOFF_KERNEL
elf2ecoff netbsd netbsd.ecoff
rm -f netbsd.ecoff.gz
gzip -9 netbsd.ecoff
.endif # ECOFF_KERNEL
rm -f netbsd.gz
gzip -9 netbsd
${IMAGE}.gz: netbsd.gz ${BOOT_PRIMARY} ${BOOT_SECONDARY}
dd if=/dev/zero of=${IMAGE} count=${IMAGESIZE}
vnconfig ${DISKTYPEARG} -v -c ${VND} ${IMAGE} ${VND_GEOM}
disklabel -rw -f ${DISKTAB} ${VND} ${DISKTYPE}
newfs -B be -m 0 -o space ${NEWFSOPTS} ${VND_RDEV}
${INSTALLBOOT} ${VND_RDEV} ${BOOT_PRIMARY}
mount ${VND_DEV} ${MOUNT_POINT}
cp -p ${BOOT_SECONDARY} ${MOUNT_POINT}
cp -p netbsd.gz ${MOUNT_POINT}/netbsd
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
umount ${MOUNT_POINT}
vnconfig -u ${VND}
rm -f ${IMAGE}.gz
gzip -9 ${IMAGE}
unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND}
-/bin/rm -f ${IMAGE} ${IMAGE}.gz
.if !defined(RELEASEDIR)
release: .USE
@echo setenv RELEASEDIR first!
@false
.else
release: ${IMAGE}.gz
release: check_RELEASEDIR .WAIT ${KERNELS} ${IMAGE}.gz
-mkdir -p ${DISKBINDIR} ${KERNBINDIR}
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${NONBINMODE} \
${IMAGE}.gz ${DISKBINDIR}
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${NONBINMODE} \
netbsd.gz ${KERNBINDIR}/install.gz
${RELINSTALL} ${IMAGE}.gz ${DISKBINDIR}
${RELINSTALL} netbsd.gz ${KERNBINDIR}/install.gz
.if defined(ECOFF_KERNEL)
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${NONBINMODE} \
netbsd.ecoff.gz ${KERNBINDIR}/install.ecoff.gz
${RELINSTALL} netbsd.ecoff.gz ${KERNBINDIR}/install.ecoff.gz
.endif # ECOFF_KERNEL
.endif # RELEASEDIR
realinstall: release
clean cleandir distclean:
rm -f ${CLEANFILES}
.include "${DISTRIBDIR}/common/Makefile.image"
.include "${DISTRIBDIR}/common/Makefile.mdset"
.include <bsd.obj.mk>
.include <bsd.prog.mk>

View File

@ -1,24 +0,0 @@
# /dev/rvnd1c:
type: SCSI
disk: install diskimag
label:
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 32
sectors/cylinder: 1024
cylinders: 1648
total sectors: 1312344
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0
3 partitions:
# size offset fstype [fsize bsize cpg]
a: 4096 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 82*)
b: 4096 4096 unknown # (Cyl. 82*- 247*)
c: 4096 0 unknown # (Cyl. 0 - 82*)

View File

@ -1,8 +0,0 @@
# $NetBSD: disktab.diskimage,v 1.1 2001/02/19 07:45:39 wdk Exp $
#
miniroot:2MB Install Diskimage\
:ty=simulated:se#512:nt#2:ns#16:nc#128:\
:ta=4.4BSD:\
:pa#4096:oa#0:ba#4096:fa#512:\
:pb#0:ob#0:\
:pc#4096:oc#0:

View File

@ -0,0 +1,4 @@
# $NetBSD: list,v 1.1 2002/04/12 13:54:50 lukem Exp $
COPY ${DESTDIR}/usr/mdec/boot boot
COPY ${CURDIR}/netbsd.gz netbsd