summaryrefslogtreecommitdiff
path: root/distrib/riscv64
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2021-05-11 15:18:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2021-05-11 15:18:49 +0000
commitc79bc3a8514d66ec21f1153e60b4cf2fe57da7b8 (patch)
tree58e969f58873b8f7bdf8bd9d3dfd8eefc335cbc6 /distrib/riscv64
parentf483d8dec22bd85da6886087cc4ce72a7cebfc8c (diff)
initial attempt at install*.img
Diffstat (limited to 'distrib/riscv64')
-rw-r--r--distrib/riscv64/Makefile6
-rw-r--r--distrib/riscv64/iso/Makefile64
2 files changed, 69 insertions, 1 deletions
diff --git a/distrib/riscv64/Makefile b/distrib/riscv64/Makefile
index 512ed7b9b75..23e65e5dc4b 100644
--- a/distrib/riscv64/Makefile
+++ b/distrib/riscv64/Makefile
@@ -1,7 +1,11 @@
-# $OpenBSD: Makefile,v 1.1 2021/04/27 23:57:38 drahn Exp $
+# $OpenBSD: Makefile,v 1.2 2021/05/11 15:18:48 deraadt Exp $
SUBDIR= ramdisk
+.if make(obj) || make(cleandir) || make(clean)
+SUBDIR+= iso
+.endif
+
unconfig:
cd ramdisk; ${MAKE} unconfig
diff --git a/distrib/riscv64/iso/Makefile b/distrib/riscv64/iso/Makefile
new file mode 100644
index 00000000000..34b2142a3de
--- /dev/null
+++ b/distrib/riscv64/iso/Makefile
@@ -0,0 +1,64 @@
+# $OpenBSD: Makefile,v 1.1 2021/05/11 15:18:48 deraadt Exp $
+
+FS= install${OSrev}.img
+FSSIZE= 1032192
+FSDISKTYPE= install
+
+MOUNT_POINT= /mnt
+
+RELXDIR?= /home/relx-${MACHINE}
+RELDIR?= /home/rel-${MACHINE}
+
+BASE= ${RELDIR}/base${OSrev}.tgz ${RELDIR}/comp${OSrev}.tgz \
+ ${RELDIR}/game${OSrev}.tgz ${RELDIR}/man${OSrev}.tgz \
+ ${RELDIR}/bsd ${RELDIR}/bsd.mp ${RELDIR}/bsd.rd \
+ ${RELDIR}/INSTALL.${MACHINE}
+XBASE= ${RELXDIR}/xbase${OSrev}.tgz ${RELXDIR}/xfont${OSrev}.tgz \
+ ${RELXDIR}/xshare${OSrev}.tgz ${RELXDIR}/xserv${OSrev}.tgz
+
+MSDOSSTART= 32768
+MSDOSSIZE= 8192
+FFSSTART!= expr ${MSDOSSTART} + ${MSDOSSIZE}
+
+NEWFS_ARGS_msdos=-L boot -c1 -F16
+MOUNT_ARGS_msdos=-o-l
+
+all: ${FS}
+
+${FS}: ${BASE} ${XBASE}
+ dd if=/dev/zero of=${FS} bs=512 count=${FSSIZE}
+ vnconfig -v ${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 ${NEWFS_ARGS_msdos} /dev/r`cat vnd`i
+ mount ${MOUNT_ARGS_msdos} /dev/`cat vnd`i ${MOUNT_POINT}
+ mkdir -p ${MOUNT_POINT}/efi/boot
+ cp /usr/mdec/BOOTAA64.EFI ${MOUNT_POINT}/efi/boot/bootaa64.efi
+ echo bootriscv64.efi > ${MOUNT_POINT}/efi/boot/startup.nsh
+ umount ${MOUNT_POINT}
+
+ newfs -O 1 -m 0 -o space -i 524288 -c ${FSSIZE} /dev/r`cat vnd`a
+ mount /dev/`cat vnd`a ${MOUNT_POINT}
+ mkdir -p ${MOUNT_POINT}/${OSREV}/${MACHINE}
+ cp -p ${BASE} ${MOUNT_POINT}/${OSREV}/${MACHINE}
+ cp -p ${XBASE} ${MOUNT_POINT}/${OSREV}/${MACHINE}
+ ln ${MOUNT_POINT}/${OSREV}/${MACHINE}/bsd.rd ${MOUNT_POINT}/bsd.rd
+ ln ${MOUNT_POINT}/${OSREV}/${MACHINE}/bsd.rd ${MOUNT_POINT}/bsd
+
+ cat ${RELDIR}/SHA256 ${RELXDIR}/SHA256 > \
+ ${MOUNT_POINT}/${OSREV}/${MACHINE}/SHA256
+ # XXX no SHA256.sig
+ df -i ${MOUNT_POINT}
+ umount ${MOUNT_POINT}
+ vnconfig -u `cat vnd`
+ rm -f vnd
+
+install:
+ cp ${CDROM} ${FS} ${RELDIR}/
+
+clean cleandir:
+ rm -f ${CDROM} ${FS}
+ rm -rf cd-dir
+
+.include <bsd.obj.mk>