diff options
Diffstat (limited to 'distrib/armv7/miniroot/Makefile.inc')
-rw-r--r-- | distrib/armv7/miniroot/Makefile.inc | 67 |
1 files changed, 26 insertions, 41 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> |