-# $OpenBSD: Makefile,v 1.2 2021/04/17 21:19:41 sthen Exp $
+# $OpenBSD: Makefile,v 1.3 2022/02/10 20:07:47 krw Exp $
FS= install${OSrev}.img
FSSIZE= 1032192
# this offset is required by Rockchip
MSDOSSTART= 32768
MSDOSSIZE= 16384
-FFSSTART!= expr ${MSDOSSTART} + ${MSDOSSIZE}
NEWFS_ARGS_msdos=-L boot -c1 -F16
MOUNT_ARGS_msdos=-o-l
${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
+ fdisk -iy -b "${MSDOSSIZE}@${MSDOSSTART}:c" `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}
-# $OpenBSD: Makefile,v 1.23 2021/07/26 12:47:45 kn Exp $
+# $OpenBSD: Makefile,v 1.24 2022/02/10 20:07:47 krw Exp $
FS= miniroot${OSrev}.img
FSSIZE= 88064
# this offset is required by Rockchip
MSDOSSTART= 32768
MSDOSSIZE= 16384
-FFSSTART!= expr ${MSDOSSTART} + ${MSDOSSIZE}
NEWFS_ARGS_msdos=-L boot -c1 -F16
MOUNT_ARGS_msdos=-o-l
${FS}: bsd.rd
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
+ fdisk -iy -b "${MSDOSSIZE}@${MSDOSSTART}:c" `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}
-# $OpenBSD: install.md,v 1.24 2022/02/04 16:08:39 kettenis Exp $
+# $OpenBSD: install.md,v 1.25 2022/02/10 20:07:47 krw Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
md_prep_fdisk() {
local _disk=$1 _d _type=MBR
- local bootpart=
local bootparttype="C"
local bootsectorstart="32768"
local bootsectorsize="32768"
- local bootsectorend=$(($bootsectorstart + $bootsectorsize))
local bootfstype="msdos"
while :; do
_d=whole
if disk_has $_disk gpt; then
- [[ $_disk == $ROOTDISK ]] && bootpart="-b ${bootsectorsize}"
_type=GPT
fdisk $_disk
elif disk_has $_disk mbr; then
[wW]*)
echo -n "Creating a ${bootfstype} partition and an OpenBSD partition for rest of $_disk..."
if disk_has $_disk gpt apfsisc; then
- fdisk -Ay ${bootpart} ${_disk} >/dev/null
+ if [[ $_disk == $ROOTDISK ]]; then
+ fdisk -Ay -b "${bootsectorsize}" ${_disk} >/dev/null
+ else
+ fdisk -Ay ${_disk} >/dev/null
+ fi
elif disk_has $_disk gpt; then
- fdisk -gy ${bootpart} ${_disk} >/dev/null
+ if [[ $_disk == $ROOTDISK ]]; then
+ fdisk -gy -b "${bootsectorsize}" ${_disk} >/dev/null
+ else
+ fdisk -gy ${_disk} >/dev/null
+ fi
else
- fdisk -e ${_disk} <<__EOT >/dev/null
-reinit
-e 0
-${bootparttype}
-n
-${bootsectorstart}
-${bootsectorsize}
-f 0
-e 3
-A6
-n
-${bootsectorend}
-
-write
-quit
-__EOT
+ fdisk -iy -b "${bootsectorsize}@${bootsectorstart}:${bootparttype}" ${_disk} >/dev/null
fi
echo "done."
installboot -p $_disk