summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorMartin Natano <natano@cvs.openbsd.org>2017-01-27 17:59:10 +0000
committerMartin Natano <natano@cvs.openbsd.org>2017-01-27 17:59:10 +0000
commitfc80f19489346b5af0fbac80d67559591941eb7e (patch)
treed288ca9570c01789f7c5ea65a8afcb0618a7a54f /distrib
parent27eaf4fbadb2879b52b66f55d0fc43e00931fd50 (diff)
Switch alpha, luna88k and sparc64 ramdisks to makefs.
ok deraadt
Diffstat (limited to 'distrib')
-rw-r--r--distrib/alpha/Makefile4
-rw-r--r--distrib/alpha/bsd.rd/Makefile56
-rw-r--r--distrib/alpha/common/Makefile.inc36
-rw-r--r--distrib/alpha/inst-common/Makefile.inc13
-rw-r--r--distrib/luna88k/ramdisk/Makefile61
-rw-r--r--distrib/sparc64/Makefile3
-rw-r--r--distrib/sparc64/bsd.rd/Makefile91
-rw-r--r--distrib/sparc64/ramdisk/Makefile51
-rw-r--r--distrib/sparc64/ramdiskB/Makefile51
9 files changed, 87 insertions, 279 deletions
diff --git a/distrib/alpha/Makefile b/distrib/alpha/Makefile
index 86a5b0c41da..3f07ac44732 100644
--- a/distrib/alpha/Makefile
+++ b/distrib/alpha/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.10 2015/08/29 16:48:22 deraadt Exp $
+# $OpenBSD: Makefile,v 1.11 2017/01/27 17:59:09 natano Exp $
SUBDIR= bsd.rd miniroot floppy floppyB floppyC cdfs
@@ -7,11 +7,11 @@ SUBDIR+= iso
.endif
unconfig:
- cd bsd.rd; ${MAKE} unconfig
cd miniroot; ${MAKE} unconfig
cd floppy; ${MAKE} unconfig
cd floppyB; ${MAKE} unconfig
cd floppyC; ${MAKE} unconfig
cd cdfs; ${MAKE} unconfig
+ cd iso; ${MAKE} unconfig
.include <bsd.subdir.mk>
diff --git a/distrib/alpha/bsd.rd/Makefile b/distrib/alpha/bsd.rd/Makefile
index 684c7d41f61..0b1e1dd0eee 100644
--- a/distrib/alpha/bsd.rd/Makefile
+++ b/distrib/alpha/bsd.rd/Makefile
@@ -1,41 +1,24 @@
-# $OpenBSD: Makefile,v 1.22 2016/10/14 18:44:19 deraadt Exp $
+# $OpenBSD: Makefile,v 1.23 2017/01/27 17:59:09 natano Exp $
TOP= ${.CURDIR}/..
.include "${TOP}/Makefile.inc"
IMAGE= ramdisk${REV}.fs
-MOUNT_POINT= /mnt
-
-VND?= vnd0
-VND_DEV= /dev/${VND}a
-VND_RDEV= /dev/r${VND}a
-VND_CRDEV= /dev/r${VND}c
-PID!= echo $$$$
-REALIMAGE!= echo /var/tmp/image.${PID}
-
STRIP?= strip
GZIPCMD?= gzip
GZIPFLAGS?= -9fn
-INSTALLBOOT?= /usr/mdec/installboot -v
RAMDISK= RAMDISKBIG
-BOOT?= /usr/mdec/boot
-BOOTXX?= /usr/mdec/bootxx
.include "${TOP}/inst-common/Makefile.inc"
LISTS+= ${.CURDIR}/list.local
-all: ${CBIN} bsd.rd
-
-DISKTYPE= rdroot
-NBLKS= 5744
+all: bsd.rd
-# old format, minfree, opt, b/i trks, sects, cpg
-NEWFSARGS= -t ffs -m 0 -o space
-NEWFSARGS_RD= -i 8192
-NEWFSARGS_FD= -i 524288 -c ${FLOPPYBLKS}
+DISKTYPE= rdroot
+MAKEFSARGS_RD= -o disklabel=${DISKTYPE},minfree=0,density=8192
bsd.rd: bsd.rd_unz
objcopy -Sg -R .comment bsd.rd_unz bsd.strip
@@ -51,34 +34,21 @@ bsd:
su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && env COPTS=-Os ${MAKE}'
cp -p ${.CURDIR}/../../../sys/arch/alpha/compile/${RAMDISK}/obj/bsd bsd
-${IMAGE}: do_prep do_mount do_files do_umount
- mv -f ${REALIMAGE} ${IMAGE}
+${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
rdsetroot: ${TOP}/../common/elfrdsetroot.c
${HOSTCC} ${HOSTCFLAGS} -o rdsetroot \
${TOP}/../common/elfrdsetroot.c ${TOP}/../common/elf32.c \
${TOP}/../common/elf64.c
-do_prep:
- dd if=/dev/zero of=${REALIMAGE} count=${NBLKS}
- vnconfig -v -c ${VND} ${REALIMAGE}
- disklabel -w ${VND} ${DISKTYPE}
-
-do_mount:
- newfs ${NEWFSARGS} ${NEWFSARGS_RD} -s ${NBLKS} ${VND_RDEV}
- mount ${VND_DEV} ${MOUNT_POINT}
-
-do_umount:
- @echo ""
- @df -i ${MOUNT_POINT}
- @echo ""
- umount ${MOUNT_POINT}
- vnconfig -u ${VND}
-
-unconfig:
- -umount ${MOUNT_POINT}
- -vnconfig -u ${VND}
-
.ifdef RELEASEDIR
beforeinstall:
cp bsd.rd ${RELEASEDIR}
diff --git a/distrib/alpha/common/Makefile.inc b/distrib/alpha/common/Makefile.inc
index f6dbf7a7a32..2433e4fb146 100644
--- a/distrib/alpha/common/Makefile.inc
+++ b/distrib/alpha/common/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.28 2016/10/14 18:44:19 deraadt Exp $
+# $OpenBSD: Makefile.inc,v 1.29 2017/01/27 17:59:09 natano Exp $
TOP= ${.CURDIR}/..
@@ -28,14 +28,13 @@ BOOTXX?= /usr/mdec/bootxx
.include "${TOP}/inst-common/Makefile.inc"
-all: ${CBIN} ${FLOPPY}
+all: ${FLOPPY}
-DISKTYPE= rdroot
-NBLKS= 5744
+DISKTYPE= rdroot
+MAKEFSARGS_RD= -o disklabel=${DISKTYPE},minfree=0,density=8192
# old format, minfree, opt, b/i trks, sects, cpg
NEWFSARGS= -t ffs -m 0 -o space
-NEWFSARGS_RD= -i 8192
NEWFSARGS_FD= -i 524288 -c ${FLOPPYBLKS}
CLEANFILES+= bsd bsd.rd bsd.gz ${FLOPPY}
@@ -77,30 +76,21 @@ bsd:
su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && env COPTS=-Os ${MAKE}'
cp -p ${.CURDIR}/../../../sys/arch/alpha/compile/${RAMDISK}/obj/bsd bsd
-${IMAGE}: do_prep do_mount do_files do_umount
- mv -f ${REALIMAGE} ${IMAGE}
+${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
rdsetroot: ${TOP}/../common/elfrdsetroot.c
${HOSTCC} ${HOSTCFLAGS} -o rdsetroot \
${TOP}/../common/elfrdsetroot.c ${TOP}/../common/elf32.c \
${TOP}/../common/elf64.c
-do_prep:
- dd if=/dev/zero of=${REALIMAGE} count=${NBLKS}
- vnconfig -v -c ${VND} ${REALIMAGE}
- disklabel -w ${VND} ${DISKTYPE}
-
-do_mount:
- newfs ${NEWFSARGS} ${NEWFSARGS_RD} -s ${NBLKS} ${VND_RDEV}
- mount ${VND_DEV} ${MOUNT_POINT}
-
-do_umount:
- @echo ""
- @df -i ${MOUNT_POINT}
- @echo ""
- umount ${MOUNT_POINT}
- vnconfig -u ${VND}
-
unconfig:
-umount ${MOUNT_POINT}
-vnconfig -u ${VND}
diff --git a/distrib/alpha/inst-common/Makefile.inc b/distrib/alpha/inst-common/Makefile.inc
index dea53b9e2c8..8d40d96fc2e 100644
--- a/distrib/alpha/inst-common/Makefile.inc
+++ b/distrib/alpha/inst-common/Makefile.inc
@@ -1,15 +1,12 @@
#
-# $OpenBSD: Makefile.inc,v 1.12 2015/09/19 10:44:01 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.13 2017/01/27 17:59:09 natano Exp $
#
# TOP is assumed to be defined by Makefile including this one.
CBIN?= instbin
-COMMONDIR= ${TOP}/inst-common
UTILS= ${TOP}/../miniroot
-MOUNT_POINT?= ${TOP}/${BASE}/fs
-
LISTS?= ${.CURDIR}/../common/list
CRUNCHCONF?= ${CBIN}.conf
MTREE= ${UTILS}/mtree.conf
@@ -25,17 +22,11 @@ ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
${MAKE} -f ${CBIN}.mk SRCLIBDIR=${.CURDIR}/../../../lib all
${STRIP} -R .eh_frame ${CBIN}
-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 \
*.o *.lo *.c \
lib*.a lib*.olist ${CBIN}.map ${CLEANFILES}
+ /bin/rm -rf ${IMAGE}.d
.include <bsd.obj.mk>
.include <bsd.subdir.mk>
diff --git a/distrib/luna88k/ramdisk/Makefile b/distrib/luna88k/ramdisk/Makefile
index 4b15e0b95ac..bcac913eaf4 100644
--- a/distrib/luna88k/ramdisk/Makefile
+++ b/distrib/luna88k/ramdisk/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.18 2016/10/14 18:44:19 deraadt Exp $
+# $OpenBSD: Makefile,v 1.19 2017/01/27 17:59:09 natano Exp $
TOP= ${.CURDIR}/..
@@ -8,29 +8,26 @@ IMAGE= mr.fs
CBIN?= instbin
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= 4096
-# minfree, opt, b/i trks, sects, cpg
-NEWFSARGS= -t ffs -m 0 -o space
+DISKTYPE= rdroot
+MAKEFSARGS_RD= -o disklabel=${DISKTYPE},minfree=0
all: ${BSD_RD}
-${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
+ 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
bsd:
.ifndef(NOBUILD)
@@ -39,32 +36,11 @@ bsd:
.endif
cp -p ${.CURDIR}/../../../sys/arch/luna88k/compile/RAMDISK/obj/bsd bsd
-rd_test: rd_setup rd_teardown
-
-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} -o rdsetroot \
${TOP}/../common/elfrdsetroot.c ${TOP}/../common/elf32.c \
${TOP}/../common/elf64.c
-unconfig:
- -umount -f ${MOUNT_POINT}
- -vnconfig -u ${VND}
-
-.PRECIOUS: ${IMAGE}
-
.ifdef RELEASEDIR
install:
cp ${BSD_RD} ${RELEASEDIR}
@@ -79,20 +55,11 @@ ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
${MAKE} -f ${CBIN}.mk all
-#${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
-# ${MAKE} -f ${CBIN}.mk SRCLIBDIR=${.CURDIR}/../../../lib all
-
-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}.conf ${CBIN}.mk ${CBIN}.cache \
lib*.a lib*.olist ${CBIN}.map \
*.o *.lo *.c bsd ${BSD_RD} rdsetroot
+ /bin/rm -rf ${IMAGE}.d
.include <bsd.obj.mk>
.include <bsd.subdir.mk>
diff --git a/distrib/sparc64/Makefile b/distrib/sparc64/Makefile
index 7f47b9c74a4..a8764500282 100644
--- a/distrib/sparc64/Makefile
+++ b/distrib/sparc64/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.10 2012/06/22 02:56:42 deraadt Exp $
+# $OpenBSD: Makefile,v 1.11 2017/01/27 17:59:09 natano Exp $
# preserve order: 'miniroot' depends on 'bsd.rd', 'cdfs' depends on 'miniroot'
SUBDIR+= ramdisk ramdiskB bsd.rd miniroot cdfs
@@ -10,5 +10,6 @@ SUBDIR+= iso
unconfig:
cd ramdisk; ${MAKE} unconfig
cd ramdiskB; ${MAKE} unconfig
+ cd miniroot; ${MAKE} unconfig
.include <bsd.subdir.mk>
diff --git a/distrib/sparc64/bsd.rd/Makefile b/distrib/sparc64/bsd.rd/Makefile
index a0966ebc941..2a7cf7ab358 100644
--- a/distrib/sparc64/bsd.rd/Makefile
+++ b/distrib/sparc64/bsd.rd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.29 2016/10/14 18:44:20 deraadt Exp $
+# $OpenBSD: Makefile,v 1.30 2017/01/27 17:59:09 natano Exp $
TOP= ${.CURDIR}/..
@@ -8,37 +8,17 @@ CBIN?= instbin
LISTS?= ${.CURDIR}/list
UTILS?= ${TOP}/../miniroot
-MOUNT_POINT= /mnt
-
-VND?= vnd0
-VND_DEV= /dev/${VND}a
-VND_RDEV= /dev/r${VND}a
-VND_CRDEV= /dev/r${VND}c
-PID!= echo $$$$
-REALIMAGE!= echo /var/tmp/image.${PID}
-
STRIP?= strip
GZIPCMD?= gzip
GZIPFLAGS?= -9fn
MTREE= ${UTILS}/mtree.conf
RAMDISK= RAMDISK
-BOOT?= /usr/mdec/boot
-BOOTXX?= /usr/mdec/bootxx
-
-CLEANFILES+= bsd.rd_unz rdsetroot
-
-#.include "${TOP}/common/Makefile.inc"
-all: ${CBIN} bsd.rd
+all: bsd.rd
-DISKTYPE= rdroot
-NBLKS= 5744
-
-# old format, minfree, opt, b/i trks, sects, cpg
-NEWFSARGS= -t ffs -m 0 -o space
-NEWFSARGS_RD= -i 4096 -c ${NBLKS}
-NEWFSARGS_FD= -i 524288 -c 2880
+DISKTYPE= rdroot
+MAKEFSARGS_RD= -o disklabel=${DISKTYPE},minfree=0,density=4096
bsd.rd: bsd.rd_unz
objcopy -Sg -R .comment bsd.rd_unz bsd.strip
@@ -54,56 +34,21 @@ bsd:
su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && env COPTS=-Os ${MAKE}'
cp -p ${.CURDIR}/../../../sys/arch/sparc64/compile/${RAMDISK}/obj/bsd bsd
-${IMAGE}: do_prep do_mount do_files do_umount
- mv -f ${REALIMAGE} ${IMAGE}
+${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
rdsetroot: ${TOP}/../common/elfrdsetroot.c
${HOSTCC} ${HOSTCFLAGS} -o rdsetroot \
${TOP}/../common/elfrdsetroot.c ${TOP}/../common/elf32.c \
${TOP}/../common/elf64.c
-do_prep:
- dd if=/dev/zero of=${REALIMAGE} count=${NBLKS}
- vnconfig -v -c ${VND} ${REALIMAGE}
- disklabel -w ${VND} ${DISKTYPE}
-
-do_mount:
- newfs ${NEWFSARGS} ${NEWFSARGS_RD} ${VND_RDEV}
- mount ${VND_DEV} ${MOUNT_POINT}
-
-do_umount:
- @echo ""
- @df -i ${MOUNT_POINT}
- @echo ""
- umount ${MOUNT_POINT}
- vnconfig -u ${VND}
-
-unconfig:
- -umount ${MOUNT_POINT}
- -vnconfig -u ${VND}
-
-rd_setup: ${CBIN}
- dd if=/dev/zero of=${REALIMAGE} bs=512 count=${NBLKS}
- vnconfig -v -c ${VND} ${REALIMAGE}
- 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}
- cp ${REALIMAGE} ${IMAGE}
- rm ${REALIMAGE}
-
-unconfig:
- -umount -f ${MOUNT_POINT}
- -vnconfig -u ${VND}
- -/bin/rm -f ${IMAGE}
-
-.PRECIOUS: ${IMAGE}
-
.ifdef RELEASEDIR
install:
.ifndef NOBSDRD
@@ -121,17 +66,11 @@ ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
${MAKE} -f ${CBIN}.mk SRCLIBDIR=${.CURDIR}/../../../lib all
-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 bsd.gz bsd.strip floppy*.fs rdsetroot
+ *.o *.lo *.c bsd bsd.rd{,_unz} bsd.gz bsd.strip floppy*.fs rdsetroot
+ /bin/rm -rf ${IMAGE}.d
.include <bsd.obj.mk>
.include <bsd.subdir.mk>
diff --git a/distrib/sparc64/ramdisk/Makefile b/distrib/sparc64/ramdisk/Makefile
index 31418601b39..4e06bc50036 100644
--- a/distrib/sparc64/ramdisk/Makefile
+++ b/distrib/sparc64/ramdisk/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.31 2016/10/14 18:44:20 deraadt Exp $
+# $OpenBSD: Makefile,v 1.32 2017/01/27 17:59:09 natano Exp $
TOP= ${.CURDIR}/..
@@ -19,29 +19,17 @@ FLOPPYTYPE?= floppy
VND?= vnd0
VND_DEV= /dev/${VND}a
VND_RDEV= /dev/r${VND}a
-VND_CRDEV= /dev/r${VND}c
-PID!= echo $$$$
GZIPCMD?= gzip
GZIPFLAGS?= -9nv
GZIPEXT?= .gz
-MOUNT_POINT?= /mnt
-DISKTYPE= rdroot
PID!= echo $$$$
REALIMAGE!= echo /var/tmp/image.${PID}
-IMAGE?= ramdisk${REV}.fs
-IMAGESIZE?= 8192 # 4MB in 512 byte blocks
-NEWFS_WILL_FAIL?=false
-CRUNCHGENOPTS?=
KERNEL?= RAMDISKU1
-UTILS?= ${.CURDIR}/../miniroot
-STRIP?= strip
-DISKTYPE= rdroot
-NBLKS= 6144
-# 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}:
@@ -76,7 +64,15 @@ ${BSD_RD}: ${CBIN} ${IMAGE} bsd elfrdsetroot
cp bsd ${BSD_RD}
${.OBJDIR}/elfrdsetroot ${BSD_RD} < ${IMAGE}
-${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
@@ -85,19 +81,6 @@ bsd:
su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && env COPTS=-Os ${MAKE}'
cp -p ${TOP}/../../sys/arch/sparc64/compile/${KERNEL}/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}
-
elfrdsetroot: ${TOP}/../common/elfrdsetroot.c
${HOSTCC} ${HOSTCFLAGS} -o elfrdsetroot \
${TOP}/../common/elfrdsetroot.c ${TOP}/../common/elf32.c \
@@ -107,8 +90,6 @@ unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND}
-.PRECIOUS: ${IMAGE}
-
${CBIN}.conf: ${LISTS}
awk -f ${UTILS}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf
@@ -118,17 +99,11 @@ ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
${MAKE} -f ${CBIN}.mk SRCLIBDIR=${.CURDIR}/../../../lib all
-do_files:
- mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
- TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} REV=${REV} \
- ARCHDIR=${.CURDIR}/.. 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} bsd.gz ${FLOPPY} elfrdsetroot
+ /bin/rm -rf ${IMAGE}.d
.ifdef RELEASEDIR
install:
diff --git a/distrib/sparc64/ramdiskB/Makefile b/distrib/sparc64/ramdiskB/Makefile
index b342a482c6c..4dbf05cc6b7 100644
--- a/distrib/sparc64/ramdiskB/Makefile
+++ b/distrib/sparc64/ramdiskB/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.25 2016/10/14 23:52:45 deraadt Exp $
+# $OpenBSD: Makefile,v 1.26 2017/01/27 17:59:09 natano Exp $
TOP= ${.CURDIR}/..
@@ -19,29 +19,17 @@ FLOPPYTYPE?= floppy
VND?= vnd0
VND_DEV= /dev/${VND}a
VND_RDEV= /dev/r${VND}a
-VND_CRDEV= /dev/r${VND}c
-PID!= echo $$$$
GZIPCMD?= gzip
GZIPFLAGS?= -9nv
GZIPEXT?= .gz
-MOUNT_POINT?= /mnt
-DISKTYPE= rdroot
PID!= echo $$$$
REALIMAGE!= echo /var/tmp/image.${PID}
-IMAGE?= ramdisk${REV}.fs
-IMAGESIZE?= 8192 # 4MB in 512 byte blocks
-NEWFS_WILL_FAIL?=false
-CRUNCHGENOPTS?=
KERNEL?= RAMDISKU5
-UTILS?= ${.CURDIR}/../miniroot
-STRIP?= strip
-DISKTYPE= rdroot
-NBLKS= 6144
-# minfree, opt, b/i trks, sects, cpg
-NEWFSARGS= -m 0 -o space -i 8192
+DISKTYPE= rdroot
+MAKEFSARGS_RD= -o disklabel=${DISKTYPE},minfree=0,density=8192
.ifndef DESTDIR
all ${IMAGE}:
@@ -76,7 +64,15 @@ ${BSD_RD}: ${CBIN} ${IMAGE} bsd elfrdsetroot
cp bsd ${BSD_RD}
${.OBJDIR}/elfrdsetroot ${BSD_RD} < ${IMAGE}
-${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
@@ -85,19 +81,6 @@ bsd:
su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && env COPTS=-Os ${MAKE}'
cp -p ${TOP}/../../sys/arch/sparc64/compile/${KERNEL}/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}
-
elfrdsetroot: ${TOP}/../common/elfrdsetroot.c
${HOSTCC} ${HOSTCFLAGS} -o elfrdsetroot \
${TOP}/../common/elfrdsetroot.c ${TOP}/../common/elf32.c \
@@ -107,8 +90,6 @@ unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND}
-.PRECIOUS: ${IMAGE}
-
${CBIN}.conf: ${LISTS}
awk -f ${UTILS}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf
@@ -118,17 +99,11 @@ ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
${MAKE} -f ${CBIN}.mk SRCLIBDIR=${.CURDIR}/../../../lib all
-do_files:
- mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
- TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} REV=${REV} \
- ARCHDIR=${.CURDIR}/.. 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} bsd.gz ${FLOPPY} elfrdsetroot
+ /bin/rm -rf ${IMAGE}.d
.ifdef RELEASEDIR
install: