From deec46e40dde3e4e55692f79b10751b45a5b5343 Mon Sep 17 00:00:00 2001 From: krw Date: Mon, 7 Feb 2022 20:24:30 +0000 Subject: [PATCH] Use fdisk's -b to create boot partitions instead of -e scripts. Build, boot and install tested by visa@ ok visa@ --- distrib/armv7/miniroot/Makefile.inc | 6 ++---- distrib/armv7/ramdisk/install.md | 20 ++------------------ 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/distrib/armv7/miniroot/Makefile.inc b/distrib/armv7/miniroot/Makefile.inc index bb00f4360a8..1377104bdd1 100644 --- a/distrib/armv7/miniroot/Makefile.inc +++ b/distrib/armv7/miniroot/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.28 2021/10/12 16:39:22 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.29 2022/02/07 20:24:30 krw Exp $ FS= miniroot-${BOARD}-${OSrev}.img FSSIZE= 71424 # ffs+msdos, actually @@ -9,7 +9,6 @@ MKUBOOT?= mkuboot DISKTYPE= miniroot MSDOSSTART= 32768 MSDOSSIZE= 8192 -FFSSTART!= expr ${MSDOSSTART} + ${MSDOSSIZE} PDTB= /usr/local/share/dtb/arm PUBOOT= /usr/local/share/u-boot @@ -19,8 +18,7 @@ all: ${FS} ${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 + 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 -O 1 -t msdos -L boot /dev/r`cat vnd`i mount -o-l /dev/`cat vnd`i ${MOUNT_POINT} diff --git a/distrib/armv7/ramdisk/install.md b/distrib/armv7/ramdisk/install.md index 7ed5b77d0f3..999dc7f99e0 100644 --- a/distrib/armv7/ramdisk/install.md +++ b/distrib/armv7/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.50 2019/09/25 06:20:23 jsg Exp $ +# $OpenBSD: install.md,v 1.51 2022/02/07 20:24:30 krw Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. # All rights reserved. @@ -90,7 +90,6 @@ md_prep_fdisk() { local bootparttype="C" local bootsectorstart="32768" local bootsectorsize="32768" - local bootsectorend=$(($bootsectorstart + $bootsectorsize)) local bootfstype="msdos" local newfs_args=${NEWFSARGS_msdos} @@ -105,22 +104,7 @@ md_prep_fdisk() { case $resp in [wW]*) echo -n "Creating a ${bootfstype} partition and an OpenBSD partition for rest of $_disk..." - 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 echo "done." disklabel $_disk 2>/dev/null | grep -q "^ i:" || disklabel -w -d $_disk newfs -t ${bootfstype} ${newfs_args} ${_disk}i -- 2.20.1