-# $OpenBSD: Makefile,v 1.31 2021/07/26 12:47:46 kn Exp $
+# $OpenBSD: Makefile,v 1.32 2022/02/07 15:21:38 krw Exp $
FS= miniroot${OSrev}.img
FSSIZE= 18432
MRDISKTYPE= rdroot
MRMAKEFSARGS= -o disklabel=${MRDISKTYPE},minfree=0,density=4096
+MSDOSSTART= 63
+MSDOSSIZE!= expr ${FSSIZE} - ${MSDOSSTART}
+
all: ${FS} ${CDROM}
# PMON cannot load a gzipped kernel
${FS}: bsd.strip
dd if=/dev/zero of=${FS} bs=512 count=${FSSIZE}
vnconfig -v -t ${FSDISKTYPE} ${FS} > vnd
- echo 'u\ne 0\n83\n\n63\n*\nw\nq\n' | fdisk -e `cat vnd` > /dev/null
+ fdisk -iy -b "${MSDOSSIZE}@${MSDOSSTART}:83" `cat vnd` > /dev/null
echo 'w\ny\nq\n' | disklabel -E `cat vnd` > /dev/null
newfs_ext2fs /dev/r`cat vnd`i
mount /dev/`cat vnd`i ${MOUNT_POINT}
-# $OpenBSD: install.md,v 1.29 2020/12/09 15:45:58 deraadt Exp $
+# $OpenBSD: install.md,v 1.30 2022/02/07 15:21:38 krw Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
}
md_prep_fdisk() {
- local _disk=$1 _q _d _s _o
+ local _disk=$1 _q _d _o
while :; do
_d=whole
[wW]*)
case $(sysctl -n hw.product) in
Gdium)
- _s=32
+ echo -n "Creating a 32MB ext2 partition and an OpenBSD partition for rest of $_disk..."
+ fdisk -iy -b "65536@1:83" $_disk >/dev/null
_o="-O 1 -b 4096"
;;
EBT700)
- _s=1
+ echo -n "Creating a 1MB ext2 partition and an OpenBSD partition for rest of $_disk..."
+ fdisk -iy -b "2048@1:83" $_disk >/dev/null
_o="-O 1"
;;
*)
- _s=1
+ echo -n "Creating a 1MB ext2 partition and an OpenBSD partition for rest of $_disk..."
+ fdisk -iy -b "2048@1:83" $_disk >/dev/null
_o=""
;;
esac
- echo -n "Creating a ${_s}MB ext2 partition and an OpenBSD partition for rest of $_disk..."
- fdisk -e $_disk <<__EOT >/dev/null
-re
-e 0
-83
-
-1
-$((_s * 2048))
-e 3
-0
-e 3
-A6
-
-$((_s * 2048 + 1))
-*
-update
-write
-quit
-__EOT
echo "done."
disklabel $_disk 2>/dev/null | grep -q "^ i:" || disklabel -w -d $_disk
newfs -qt ext2fs $_o ${_disk}i