From eec254e1cada0b5ce3eb305ea97f756c7db19faf Mon Sep 17 00:00:00 2001 From: miod Date: Mon, 6 Jan 2014 21:03:13 +0000 Subject: [PATCH] Rework the setup of the bootable installation cd-rom (installXX.iso) to contain both a 2048-byte sector ffs filesystem, and a 512-byte volume header, so that the IP27 boot magic^Wuglyness recently added to the boot-only cd-rom (cdXX.iso) can be applied as well. The full-blown installation iso can now boot on IP27/28/30/32/35. --- distrib/sgi/iso/Makefile | 67 ++++++++++++++++++++++++++++++---------- etc/etc.sgi/disktab | 9 +++--- 2 files changed, 55 insertions(+), 21 deletions(-) diff --git a/distrib/sgi/iso/Makefile b/distrib/sgi/iso/Makefile index 28772a8ed89..18d965b6f11 100644 --- a/distrib/sgi/iso/Makefile +++ b/distrib/sgi/iso/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.18 2012/05/25 17:32:38 miod Exp $ +# $OpenBSD: Makefile,v 1.19 2014/01/06 21:03:13 miod Exp $ TOP= ${.CURDIR}/.. @@ -24,25 +24,55 @@ XBASE= ${RELXDIR}/xbase${OSrev}.tgz ${RELXDIR}/xetc${OSrev}.tgz \ all: ${CDROM} -# Note regarding sgivol -h value: -# boot32 currently (2012/05/25) needs 22 2048 byte sectors, boot64 needs 50, -# bootecoff needs 20, and we need to keep some room for growth. -# IF THIS VALUE IS EVER CHANGED, make sure it is consistent with the `cdroot' -# layout in /etc/disktab! +# Note regarding volume header size: +# boot32 currently (2013/12/29) needs 81 512 byte sectors, boot64 needs 190, +# bootecoff needs 73, the XFS partition needs 32768, and we need to keep some +# room for growth. + +# The following values need to be consistent with the `cdroot' layout in +# /etc/disktab +SGIVOLSZ=8320 # oa, pp (size of volume header in 2048 byte sectors) +FFSSZ=153472 # pa (size of the ffs partition in 2048 byte sectors) +CDROMSZ=316 # nt (size of the iso image in megabytes) + +# Creating an IP27 bootable CD-ROM image with a usable FFS filesystem on it +# is extremely tricky. We are facing the following challenges: +# - the IP27 XFS filesystem will only get recognized correctly if the volume +# header uses 512 byte sectors. +# - the OpenBSD disklabel will reuse the sector size from the volume header, +# yet we need to build a label with 2048 byte sectors. +# This can be overcome by building a 512 byte sector volume header, then +# filling the 2048 byte sector filesystem. + ${CDROM}: -rm -rf ${.OBJDIR}/cd-dir mkdir -p ${.OBJDIR}/cd-dir/ - dd if=/dev/zero of=${.OBJDIR}/${CDROM} bs=2048b count=300 - vnconfig -v -c -t cdroot vnd0 ${.OBJDIR}/${CDROM} + dd if=/dev/zero of=${.OBJDIR}/${CDROM} bs=2048b count=${CDROMSZ} + + # Create the 512 byte sector volume header - /usr/mdec/sgivol -i -h 128 vnd0 - /usr/mdec/sgivol -w bootecoff ${DESTDIR}/usr/mdec/bootecoff vnd0 - /usr/mdec/sgivol -l bootecoff sash vnd0 - /usr/mdec/sgivol -w boot32 ${DESTDIR}/usr/mdec/boot32 vnd0 - /usr/mdec/sgivol -l boot32 sashARCS vnd0 - /usr/mdec/sgivol -w boot64 ${DESTDIR}/usr/mdec/boot64 vnd0 - /usr/mdec/sgivol -l boot64 sash64 vnd0 + vnconfig -v -c vnd0 ${.OBJDIR}/${CDROM} + + /usr/mdec/sgivol -qi -h `expr ${SGIVOLSZ} \* 4` vnd0 + uudecode -o ${.OBJDIR}/xfs512.bin.gz \ + ${.CURDIR}/../cdfs/xfs512.bin.gz.uue + gzip -d ${.OBJDIR}/xfs512.bin.gz + cat ${DESTDIR}/usr/mdec/boot64 >> ${.OBJDIR}/xfs512.bin + dd if=${.OBJDIR}/xfs512.bin of=${.OBJDIR}/xfs obs=16m conv=osync + /usr/mdec/sgivol -qw xfsboot ${.OBJDIR}/xfs vnd0 + /usr/mdec/sgivol -qw bootecof ${DESTDIR}/usr/mdec/bootecoff vnd0 + /usr/mdec/sgivol -ql bootecof sash vnd0 + /usr/mdec/sgivol -qw boot32 ${DESTDIR}/usr/mdec/boot32 vnd0 + /usr/mdec/sgivol -ql boot32 sashARCS vnd0 + /usr/mdec/sgivol -qw boot64 ${DESTDIR}/usr/mdec/boot64 vnd0 + /usr/mdec/sgivol -ql boot64 sash64 vnd0 + + vnconfig -u vnd0 + + # Create the 2048 byte sector media with the FFS partition + + vnconfig -v -c -t cdroot vnd0 ${.OBJDIR}/${CDROM} disklabel -w vnd0 cdroot "OpenBSD/sgi " newfs /dev/rvnd0a @@ -68,6 +98,11 @@ ${CDROM}: cp -p ${XBASE} ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE} umount ${.OBJDIR}/cd-dir + + # Summary + disklabel vnd0 + /usr/mdec/sgivol vnd0 + vnconfig -u vnd0 install: @@ -84,7 +119,7 @@ unconfig: -vnconfig -u vnd0 clean cleandir: - /bin/rm -f ${CDROM} + /bin/rm -f ${CDROM} xfs512.bin xfs rm -rf cd-dir .include diff --git a/etc/etc.sgi/disktab b/etc/etc.sgi/disktab index 8814ae7444c..9fcde52a4b8 100644 --- a/etc/etc.sgi/disktab +++ b/etc/etc.sgi/disktab @@ -1,4 +1,4 @@ -# $OpenBSD: disktab,v 1.12 2012/05/25 17:32:38 miod Exp $ +# $OpenBSD: disktab,v 1.13 2014/01/06 21:03:13 miod Exp $ rdroot|ramdiskroot|RAM-disk root FS image:\ :ty=simulated:se#512:nc#20:nt#4:ns#128:\ @@ -11,7 +11,6 @@ minicdroot|minicdramdiskroot|Boot CD-ROM image:\ :ob#0:pb#0:oc#0:pc#24576: cdroot|cdramdiskroot|Installation CD-ROM image:\ - :ty=simulated:se#2048:nc#16:nt#300:ns#32:\ - :ta=4.2BSD:oa#128:pa#153472:fa#2048:ba#16384:\ - :ob#0:pb#0:oc#0:pc#153600:op#0:pp#128: - + :ty=simulated:se#2048:nc#16:nt#316:ns#32:\ + :ta=4.2BSD:oa#8320:pa#153472:fa#2048:ba#16384:\ + :ob#0:pb#0:oc#0:pc#161792:op#0:pp#8320: -- 2.20.1