summaryrefslogtreecommitdiff
path: root/distrib/sparc64/ramdisk/Makefile
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-04-30 17:46:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-04-30 17:46:07 +0000
commitd3aa0d760e1ed38557b0c9da42407fc9ad97d828 (patch)
tree2dec49beadb3ffe5f5334cd98424fbbab5ba000e /distrib/sparc64/ramdisk/Makefile
parent7f1a8bec460a41a172fb21ffab33697ce8395c12 (diff)
Every Makefile on every architecture had deviated in unique ways.
Eliminate many more differences. When it makes sense, build bsd.rd and miniroot/ramdisk.fs and cd.iso in the same directory. More steps coming after this..
Diffstat (limited to 'distrib/sparc64/ramdisk/Makefile')
-rw-r--r--distrib/sparc64/ramdisk/Makefile95
1 files changed, 45 insertions, 50 deletions
diff --git a/distrib/sparc64/ramdisk/Makefile b/distrib/sparc64/ramdisk/Makefile
index 2e8558445dd..fbfaa405c99 100644
--- a/distrib/sparc64/ramdisk/Makefile
+++ b/distrib/sparc64/ramdisk/Makefile
@@ -1,51 +1,48 @@
-# $OpenBSD: Makefile,v 1.45 2019/04/29 15:56:26 deraadt Exp $
-
-IMAGE= mr.fs
-LISTS= ${.CURDIR}/list
-UTILS?= ${.CURDIR}/../../miniroot
+# $OpenBSD: Makefile,v 1.46 2019/04/30 17:46:06 deraadt Exp $
+FS= floppy${OSrev}.fs
+FSSIZE= 2880
+FSDISKTYPE= floppy
MOUNT_POINT= /mnt
MTREE= ${UTILS}/mtree.conf
-FLOPPY= floppy${OSrev}.fs
-FLOPPYSIZE?= 2880
-FLOPPYTYPE?= floppy
-
-DISKTYPE= rdroot
-MAKEFSARGS_RD= -o disklabel=${DISKTYPE},minfree=0,density=4096
-
-.ifndef DESTDIR
-all ${IMAGE}:
- @echo setenv DESTDIR before making a ramdisk!
- @false
-.else
+LISTS= ${.CURDIR}/list
+UTILS= ${.CURDIR}/../../miniroot
-# mix config is not needed.
-all: ${FLOPPY} bsd.rd
+MRDISKTYPE= rdroot
+MRMAKEFSARGS= -o disklabel=${MRDISKTYPE},minfree=0,density=4096
-bsd.gz: bsd.rd
- gzip -9nv < bsd.rd > bsd.gz
+all: ${FS}
-${FLOPPY}: bsd.gz ${BOOT} /usr/
- dd if=/dev/zero of=${FLOPPY} count=${FLOPPYSIZE}
- vnconfig -v ${FLOPPY} > vnd
- disklabel -w `cat vnd` ${FLOPPYTYPE}
- newfs -m 0 -o space -i 524288 -c ${FLOPPYSIZE} /dev/r`cat vnd`a
+${FS}: bsd.rd
+ dd if=/dev/zero of=${FS} bs=512 count=${FSSIZE}
+ vnconfig -v ${FS} > vnd
+ disklabel -w `cat vnd` ${FSDISKTYPE}
+ newfs -m 0 -o space -i 524288 -c ${FSSIZE} /dev/r`cat vnd`a
mount /dev/`cat vnd`a ${MOUNT_POINT}
- cp ${DESTDIR}/usr/mdec/ofwbootfd ${MOUNT_POINT}/ofwboot
- cp bsd.gz ${MOUNT_POINT}/bsd
- installboot -v `cat vnd` /usr/mdec/bootblk ${MOUNT_POINT}/ofwboot
+ install -c -m 555 -o root -g wheel bsd.rd ${MOUNT_POINT}/bsd
+ install -c -m 555 -o root -g wheel \
+ ${DESTDIR}/usr/mdec/ofwbootfd ${MOUNT_POINT}/ofwboot
+ installboot -v -r ${MOUNT_POINT} `cat vnd` \
+ ${DESTDIR}/usr/mdec/bootblk ${MOUNT_POINT}/ofwboot
df -i ${MOUNT_POINT}
umount ${MOUNT_POINT}
vnconfig -u `cat vnd`
rm -f vnd
-bsd.rd: instbin ${IMAGE} bsd
- cp bsd bsd.rd
- rdsetroot bsd.rd ${IMAGE}
- strip -R .SUNW_ctf bsd.rd
+bsd.rd: mr.fs bsd
+ cp bsd bsd.rd_unz
+ rdsetroot bsd.rd_unz mr.fs
+ cp bsd.rd_unz bsd.strip
+ strip -R .SUNW_ctf bsd.strip
+ gzip -c -9nv < bsd.strip > bsd.rd
-${IMAGE}: instbin
+bsd:
+ cd ${.CURDIR}/../../../sys/arch/sparc64/compile/RAMDISKU1 && \
+ su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && exec ${MAKE}'
+ cp -p ${.CURDIR}/../../../sys/arch/sparc64/compile/RAMDISKU1/obj/bsd bsd
+
+mr.fs: instbin
rm -rf $@.d
install -d -o root -g wheel $@.d
mtree -def ${MTREE} -p $@.d -u
@@ -53,38 +50,36 @@ ${IMAGE}: instbin
TARGDIR=$@.d UTILS=${UTILS} RELEASEDIR=${RELEASEDIR} \
sh ${UTILS}/runlist.sh ${LISTS}
rm $@.d/instbin
- makefs ${MAKEFSARGS_RD} $@ $@.d
-
-.endif
+ makefs ${MRMAKEFSARGS} $@ $@.d
bsd:
cd ${.CURDIR}/../../../sys/arch/sparc64/compile/RAMDISKU1 && \
- su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && env ${MAKE}'
+ su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && exec ${MAKE}'
cp -p ${.CURDIR}/../../../sys/arch/sparc64/compile/RAMDISKU1/obj/bsd bsd
-unconfig:
- -umount -f ${MOUNT_POINT}
- -[ -f vnd ] && vnconfig -u `cat vnd` && rm -f vnd
-
instbin.conf: ${LISTS}
awk -f ${UTILS}/makeconf.awk ${LISTS} > instbin.conf
instbin.mk instbin.cache instbin.c: instbin.conf
- crunchgen -E -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
+ crunchgen -E -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib \
+ -c instbin.c -e instbin -m instbin.mk instbin.conf
instbin: instbin.mk instbin.cache instbin.c
${MAKE} -f instbin.mk SRCLIBDIR=${.CURDIR}/../../../lib all
-clean cleandir:
- /bin/rm -f *.core ${IMAGE} instbin instbin.mk instbin.cache \
- lib*.a lib*.olist instbin.map \
- *.o *.lo *.c bsd bsd.rd bsd.gz ${FLOPPY}
- /bin/rm -rf ${IMAGE}.d
+unconfig:
+ -umount -f ${MOUNT_POINT}
+ -[ -f vnd ] && vnconfig -u `cat vnd` && rm -f vnd
.ifdef RELEASEDIR
install:
- cp ${FLOPPY} ${BSD.RD} ${RELEASEDIR}
+ cp ${FS} ${RELEASEDIR}
.endif
+clean cleandir:
+ /bin/rm -f *.core mr.fs instbin instbin.mk instbin.cache \
+ lib*.a lib*.olist instbin.map \
+ *.o *.lo *.c bsd bsd.rd bsd.gz ${FLOPPY}
+ /bin/rm -rf mr.fs.d
+
.include <bsd.obj.mk>
-.include <bsd.subdir.mk>