summaryrefslogtreecommitdiff
path: root/distrib/socppc
diff options
context:
space:
mode:
authorMartin Natano <natano@cvs.openbsd.org>2016-12-22 10:26:48 +0000
committerMartin Natano <natano@cvs.openbsd.org>2016-12-22 10:26:48 +0000
commit458d6d0543bbd443e750c9e3271f8e694228a490 (patch)
treebdedb8578699d7a1029e6bfc8b9b82c2a843ffc3 /distrib/socppc
parent4bf7b00001243fba75856378e13a1f5bf159ab58 (diff)
Use makefs to build bsd.rd; build & boot tested by mpi
Diffstat (limited to 'distrib/socppc')
-rw-r--r--distrib/socppc/ramdisk/Makefile55
1 files changed, 14 insertions, 41 deletions
diff --git a/distrib/socppc/ramdisk/Makefile b/distrib/socppc/ramdisk/Makefile
index 230bcace977..fcf8823c924 100644
--- a/distrib/socppc/ramdisk/Makefile
+++ b/distrib/socppc/ramdisk/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.15 2016/10/14 18:44:20 deraadt Exp $
+# $OpenBSD: Makefile,v 1.16 2016/12/22 10:26:47 natano Exp $
REV= ${OSrev}
@@ -13,19 +13,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
-
-
-DISKTYPE= rdroot
-NBLKS= 8192
-# 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}:
@@ -36,14 +27,22 @@ all ${IMAGE}:
# mix config is not needed.
all: ${BSD_RD} ${BSD_BIN}
-${BSD_RD}: ${CBIN} ${IMAGE} bsd rdsetroot
+${BSD_RD}: ${IMAGE} bsd rdsetroot
cp bsd ${BSD_RD}
${.OBJDIR}/rdsetroot ${BSD_RD} ${IMAGE}
${BSD_BIN}: ${BSD_RD}
objcopy -O binary ${BSD_RD} ${BSD_BIN}
-${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
@@ -52,30 +51,11 @@ bsd:
su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && env COPTS=-Os ${MAKE}'
cp -p ${TOP}/../../sys/arch/socppc/compile/RAMDISK/obj/bsd bsd
-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 -E -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
@@ -85,18 +65,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 \
*.o *.lo *.c bsd ${BSD_RD} cd${REV}.iso rdsetroot
- rm -rf cd-dir
+ rm -rf cd-dir ${IMAGE}.d
.ifdef RELEASEDIR
install: