summaryrefslogtreecommitdiff
path: root/distrib/armv7/ramdisk
diff options
context:
space:
mode:
authorMartin Natano <natano@cvs.openbsd.org>2016-11-30 15:46:46 +0000
committerMartin Natano <natano@cvs.openbsd.org>2016-11-30 15:46:46 +0000
commit32527362c91b9f84cd15a1e2a4a4ffe2124c32bb (patch)
tree92483ad67590b8cc5912060c88063f5bd9e34e28 /distrib/armv7/ramdisk
parent836035a7161ff8b5e118d55718d417c2f1674ddc (diff)
Use makefs to build bsd.rd on armv7 and macppc.
ok deraadt
Diffstat (limited to 'distrib/armv7/ramdisk')
-rw-r--r--distrib/armv7/ramdisk/Makefile61
1 files changed, 17 insertions, 44 deletions
diff --git a/distrib/armv7/ramdisk/Makefile b/distrib/armv7/ramdisk/Makefile
index fae4c651ad9..5887f7dd87e 100644
--- a/distrib/armv7/ramdisk/Makefile
+++ b/distrib/armv7/ramdisk/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.15 2016/10/14 18:44:19 deraadt Exp $
+# $OpenBSD: Makefile,v 1.16 2016/11/30 15:46:45 natano Exp $
REV= ${OSrev}
@@ -12,19 +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= 15360
-# 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
DIRS=\
am335x \
@@ -50,38 +41,30 @@ bsd:
su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && exec ${MAKE}'
cp -p ${TOP}/../../sys/arch/armv7/compile/RAMDISK/obj/bsd bsd
-${BSD_RD}: ${CBIN} ${IMAGE} bsd rdsetroot
+${BSD_RD}: ${IMAGE} bsd rdsetroot
cp bsd ${BSD_RD}
${.OBJDIR}/rdsetroot ${BSD_RD} ${IMAGE}
-${IMAGE}: rd_setup do_files rd_teardown
+${IMAGE}: ${CBIN}
+ rm -rf $@.d
+ install -d -o root -g wheel $@.d
+.for DIR in ${DIRS}
+ mkdir -p $@.d/usr/mdec/${DIR}
+.endfor
+ 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 -E -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
@@ -91,22 +74,12 @@ ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
${CRUNCHCONF}: ${LISTS}
awk -f ${UTILS}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf
-do_files:
-.for DIR in ${DIRS}
- mkdir -p ${MOUNT_POINT}/usr/mdec/${DIR}
-.endfor
- cat ${MTREE} | mtree -de -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 ${ALLBSD} ${ALLBSDRD} rdsetroot
rm -f instbin.conf
- rm -rf cd-dir
+ rm -rf cd-dir ${IMAGE}.d
.ifdef RELEASEDIR
install: