diff options
author | Martin Natano <natano@cvs.openbsd.org> | 2016-12-11 10:01:02 +0000 |
---|---|---|
committer | Martin Natano <natano@cvs.openbsd.org> | 2016-12-11 10:01:02 +0000 |
commit | f6470b3c2fa527abf59d5f0165174d55e4e265aa (patch) | |
tree | 71dc457ce65c18766bd2a7b9227b07cc2f3d86bd /distrib | |
parent | 0eac77458ce9ea677b1d71063c6ccb87f1371f5a (diff) |
Use makefs to build bsd.rd; build & boot tested by visa
Diffstat (limited to 'distrib')
-rw-r--r-- | distrib/loongson/ramdisk/Makefile | 55 |
1 files changed, 14 insertions, 41 deletions
diff --git a/distrib/loongson/ramdisk/Makefile b/distrib/loongson/ramdisk/Makefile index 976b4dbeceb..c2a2b553cfe 100644 --- a/distrib/loongson/ramdisk/Makefile +++ b/distrib/loongson/ramdisk/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.11 2016/10/14 18:44:19 deraadt Exp $ +# $OpenBSD: Makefile,v 1.12 2016/12/11 10:01:01 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 - - -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}: @@ -35,11 +26,19 @@ all ${IMAGE}: # mix config is not needed. 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 .endif @@ -48,30 +47,11 @@ bsd: su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && exec ${MAKE}' cp -p ${TOP}/../../sys/arch/loongson/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 -EM -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC} @@ -81,18 +61,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: |