summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Natano <natano@cvs.openbsd.org>2016-12-06 19:46:12 +0000
committerMartin Natano <natano@cvs.openbsd.org>2016-12-06 19:46:12 +0000
commitdaad54a1e46f7cd844dbe60344527bd578aa8112 (patch)
tree841ce21b271ee9b0d354a214c79e3f43bf186730
parent4c29feb768e41cdcfe53166ba6d08cbc52a0a96c (diff)
Use makefs to build bsd.rd; build & boot tested by visa
-rw-r--r--distrib/sgi/ramdisk/Makefile55
1 files changed, 14 insertions, 41 deletions
diff --git a/distrib/sgi/ramdisk/Makefile b/distrib/sgi/ramdisk/Makefile
index ac3c9c8cd67..25b4c4f6440 100644
--- a/distrib/sgi/ramdisk/Makefile
+++ b/distrib/sgi/ramdisk/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.22 2016/10/14 18:44:20 deraadt Exp $
+# $OpenBSD: Makefile,v 1.23 2016/12/06 19:46:11 natano Exp $
REV= ${OSrev}
@@ -12,20 +12,10 @@ CRUNCHCONFS?= ${.CURDIR}/../common/crunch.conf
LISTS= ${.CURDIR}/list
UTILS?= ${.CURDIR}/../../miniroot
-MOUNT_POINT= /mnt
MTREE= ${UTILS}/mtree.conf
-VND?= vnd0
-VND_DEV= /dev/${VND}a
-VND_RDEV= /dev/r${VND}a
-VND_CRDEV= /dev/r${VND}c
-PID!= echo $$$$
-
-
-DISKTYPE= rdroot
-NBLKS= 10240
-# minfree, opt, b/i trks, sects, cpg
-NEWFSARGS= -m 0 -o space -i 4096
+DISKTYPE= rdroot
+MAKEFSARGS_RD= -o disklabel=${DISKTYPE},minfree=0,density=4096
.ifndef DESTDIR
all ${IMAGE}:
@@ -50,39 +40,28 @@ bsd.IP${IP}:
.endif
cp -p ${.TOP}/../../sys/arch/sgi/compile/RAMDISK-IP${IP}/obj/bsd bsd.IP${IP}
-${BSD_RD}.IP${IP}: ${CBIN} ${IMAGE} bsd.IP${IP} rdsetroot
+${BSD_RD}.IP${IP}: ${IMAGE} bsd.IP${IP} rdsetroot
cp bsd.IP${IP} ${BSD_RD}.IP${IP}
${.OBJDIR}/rdsetroot ${BSD_RD}.IP${IP} ${IMAGE}
.endfor
-${IMAGE}: rd_setup do_files rd_teardown
+${IMAGE}: ${CBIN}
+ rm -rf $@.d
+ install -d -o root -g wheel $@.d
+ mtree -def ${MTREE} -p $@.d -u
+ TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} REV=${REV} \
+ TARGDIR=$@.d UTILS=${UTILS} RELEASEDIR=${RELEASEDIR} \
+ sh ${UTILS}/runlist.sh ${LISTS}
+ rm $@.d/${CBIN}
+ makefs ${MAKEFSARGS_RD} $@ $@.d
.endif
-rd_setup:
- dd if=/dev/zero of=${IMAGE} bs=512 count=${NBLKS}
- vnconfig -v -c ${VND} ${IMAGE}
- disklabel -w ${VND} ${DISKTYPE}
- newfs ${NEWFSARGS} ${VND_RDEV}
- fsck ${VND_RDEV}
- mount ${VND_DEV} ${MOUNT_POINT}
-
-rd_teardown:
- @df -i ${MOUNT_POINT}
- -umount ${MOUNT_POINT}
- -vnconfig -u ${VND}
-
rdsetroot: ${TOP}/../common/elfrdsetroot.c
${HOSTCC} ${HOSTCFLAGS} -o rdsetroot \
${TOP}/../common/elfrdsetroot.c ${TOP}/../common/elf32.c \
${TOP}/../common/elf64.c
-unconfig:
- -umount -f ${MOUNT_POINT}
- -vnconfig -u ${VND}
-
-.PRECIOUS: ${IMAGE}
-
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
crunchgen -M -E -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
@@ -92,17 +71,11 @@ ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
${CRUNCHCONF}: ${LISTS}
awk -f ${UTILS}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf
-do_files:
- mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
- TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
- REV=${REV} TARGDIR=${MOUNT_POINT} UTILS=${UTILS} \
- RELEASEDIR=${RELEASEDIR} sh ${UTILS}/runlist.sh ${LISTS}
- rm ${MOUNT_POINT}/${CBIN}
-
clean cleandir:
/bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \
lib*.a lib*.olist ${CBIN}.map \
${ALLBSD} ${ALLBSDRD} *.o *.lo *.c rdsetroot
+ /bin/rm -rf ${IMAGE}.d
.ifdef RELEASEDIR
install: