diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-05-03 20:04:00 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-05-03 20:04:00 +0000 |
commit | f4d1d40f84c06cfca32e8a6713275b7561d2c0d4 (patch) | |
tree | 3554042028da01bab315c7e330c123ff1f6c1b44 /distrib/armv7 | |
parent | 5dea246e02f9e7cb55b01c138de3fbe57bb27664 (diff) |
Further removal of differences (using install instead of cp, sorting
chunks in a specified order, using a few variables, performing bsd.rd
to bsd.gz conversion as similar as possible)
Diffstat (limited to 'distrib/armv7')
-rw-r--r-- | distrib/armv7/miniroot/Makefile.inc | 67 | ||||
-rw-r--r-- | distrib/armv7/ramdisk/Makefile | 8 |
2 files changed, 30 insertions, 45 deletions
diff --git a/distrib/armv7/miniroot/Makefile.inc b/distrib/armv7/miniroot/Makefile.inc index efb49489804..9f1b86f52ba 100644 --- a/distrib/armv7/miniroot/Makefile.inc +++ b/distrib/armv7/miniroot/Makefile.inc @@ -1,44 +1,30 @@ +# $OpenBSD: Makefile.inc,v 1.23 2019/05/03 20:03:58 deraadt Exp $ -IMAGE= miniroot-${BOARD}-${OSrev}.fs -MKUBOOT?= mkuboot - +FS= miniroot-${BOARD}-${OSrev}.fs +FSSIZE= 36864 # ffs+msdos, actually MOUNT_POINT= /mnt +MKUBOOT?= mkuboot + DISKTYPE= miniroot -NBLKS= 36864 MSDOSSTART= 2048 MSDOSSIZE= 4096 FFSSTART!= expr ${MSDOSSTART} + ${MSDOSSIZE} -FS?= msdos -PART_ID?=C - -NEWFS_ARGS_msdos=-L boot -MOUNT_ARGS_msdos=-o-l - PDTB= /usr/local/share/dtb/arm PUBOOT= /usr/local/share/u-boot -cleandir: clean -clean: - rm -f ${IMAGE} - -.ifndef DESTDIR -all ${IMAGE}: - @echo setenv DESTDIR before making a ramdisk! - @false -.else -all: ${IMAGE} - -${IMAGE}: rd_setup do_files rd_teardown +all: ${FS} -.endif +${FS}: bsd.rd + dd if=/dev/zero of=${FS} bs=512 count=${FSSIZE} + vnconfig -v -t ${DISKTYPE} ${FS} > vnd + echo 'u\ne 0\nC\nn\n${MSDOSSTART}\n${MSDOSSIZE}\ne 3\nA6\nn\n${FFSSTART}\n*\nf 0\nw\nq\n' \ + | fdisk -e `cat vnd` >/dev/null + echo 'a a\n\n\n\nw\nq\n' | disklabel -E `cat vnd` >/dev/null + newfs -t msdos -L boot /dev/r`cat vnd`i + mount -o-l /dev/`cat vnd`i ${MOUNT_POINT} -do_files: - cp ${.OBJDIR}/../../ramdisk/bsd.rd ${MOUNT_POINT}/bsd.rd - ln ${MOUNT_POINT}/bsd.rd ${MOUNT_POINT}/bsd - -umount ${MOUNT_POINT} - mount ${MOUNT_ARGS_msdos} /dev/`cat vnd`i ${MOUNT_POINT} .for DTB in ${DTBS} cp ${PDTB}/${DTB} ${MOUNT_POINT}/ .endfor @@ -57,34 +43,33 @@ do_files: dd if=${PUBOOT}/${UBOOT}/u-boot-sunxi-with-spl.bin \ of=/dev/r`cat vnd`c bs=1024 seek=8 .endif + mkdir -p ${MOUNT_POINT}/efi/boot cp /usr/mdec/BOOTARM.EFI ${MOUNT_POINT}/efi/boot/bootarm.efi + umount ${MOUNT_POINT} -rd_setup: - dd if=/dev/zero of=${IMAGE} bs=512 count=${NBLKS} - vnconfig -v -t ${DISKTYPE} ${IMAGE} > vnd - echo 'u\ne 0\n${PART_ID}\nn\n${MSDOSSTART}\n${MSDOSSIZE}\ne 3\nA6\nn\n${FFSSTART}\n*\nf 0\nw\nq\n' \ - | fdisk -e `cat vnd` >/dev/null - echo 'a a\n\n\n\nw\nq\n' | disklabel -E `cat vnd` >/dev/null - newfs -t msdos ${NEWFS_ARGS_msdos} /dev/r`cat vnd`i - newfs -m 0 -o space -i 4096 /dev/r`cat vnd`a + newfs -m 0 -o space -i 524288 -c ${FSSIZE} /dev/r`cat vnd`a mount /dev/`cat vnd`a ${MOUNT_POINT} - -rd_teardown: + install -c -m 555 -o root -g wheel bsd.rd ${MOUNT_POINT}/bsd + ln ${MOUNT_POINT}/bsd ${MOUNT_POINT}/bsd.rd df -i ${MOUNT_POINT} umount ${MOUNT_POINT} vnconfig -u `cat vnd` rm -f vnd +bsd.rd: + cp ${.OBJDIR}/../../ramdisk/bsd.rd bsd.rd + unconfig: -umount -f ${MOUNT_POINT} -[ -f vnd ] && vnconfig -u `cat vnd` && rm -f vnd -.PRECIOUS: ${IMAGE} - .ifdef RELEASEDIR install: - cp ${IMAGE} ${RELEASEDIR} + cp ${FS} ${RELEASEDIR} .endif +clean cleandir: + rm -f ${FS} + .include <bsd.obj.mk> diff --git a/distrib/armv7/ramdisk/Makefile b/distrib/armv7/ramdisk/Makefile index b249675956f..1933368c3d8 100644 --- a/distrib/armv7/ramdisk/Makefile +++ b/distrib/armv7/ramdisk/Makefile @@ -1,6 +1,7 @@ -# $OpenBSD: Makefile,v 1.26 2019/04/30 23:25:19 deraadt Exp $ +# $OpenBSD: Makefile,v 1.27 2019/05/03 20:03:58 deraadt Exp $ MTREE= ${UTILS}/mtree.conf +RAMDISK= RAMDISK LISTS= ${.CURDIR}/list UTILS= ${.CURDIR}/../../miniroot @@ -15,10 +16,9 @@ bsd.rd: mr.fs bsd rdsetroot bsd.rd mr.fs bsd: - cd ${.CURDIR}/../../../sys/arch/armv7/compile/RAMDISK && \ + cd ${.CURDIR}/../../../sys/arch/${MACHINE}/compile/${RAMDISK} && \ su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && exec ${MAKE}' - cp -p ${.CURDIR}/../../../sys/arch/armv7/compile/RAMDISK/obj/bsd bsd - + cp -p ${.CURDIR}/../../../sys/arch/${MACHINE}/compile/${RAMDISK}/obj/bsd bsd mr.fs: instbin rm -rf $@.d |