From: kn Date: Wed, 31 Aug 2022 23:10:01 +0000 (+0000) Subject: Silence cleanup, rename internal setup targets for clarity X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c29a2df68aa3c61a4cc9f4581c9c72739d0929e1;p=openbsd Silence cleanup, rename internal setup targets for clarity --- diff --git a/regress/usr.sbin/installboot/Makefile b/regress/usr.sbin/installboot/Makefile index 046f2d73c27..5daac787250 100644 --- a/regress/usr.sbin/installboot/Makefile +++ b/regress/usr.sbin/installboot/Makefile @@ -1,13 +1,13 @@ -# $OpenBSD: Makefile,v 1.11 2022/08/31 22:54:41 kn Exp $ +# $OpenBSD: Makefile,v 1.12 2022/08/31 23:10:01 kn Exp $ INSTALLBOOT ?= /usr/sbin/installboot DRY_RUN = ${INSTALLBOOT} -n REAL_RUN = ${INSTALLBOOT} # installboot(8) behaviour for multi-chunk softraid(4) differs across platforms -NCHUNKS ?= 1 2 -DISKFILES = ${NCHUNKS:=disk%.img} -DISKDEVFILES = ${NCHUNKS:=diskdev%.txt} +NDISKS ?= 1 2 +DISKFILES = ${NDISKS:=disk%.img} +DISKDEVFILES = ${NDISKS:=diskdev%.txt} ROOTDEVFILE = rootdev.txt MOUNTPOINT = mnt STAGEDIR = /usr/mdec @@ -25,23 +25,22 @@ STAGENAMES = bootblk ofwboot .endif STAGEFILES = ${STAGENAMES:=${STAGEDIR}/%} -REGRESS_SETUP_ONCE = copy-bootstrap-to-softraid +REGRESS_SETUP_ONCE = copy-bootstrap-to-root -create-new-chunks: -.for n in ${NCHUNKS} +create-disks: +.for n in ${NDISKS} dd if=/dev/zero of=disk${n}.img bs=1m count=0 seek=64 status=none ${SUDO} vnconfig -- disk${n}.img 1>diskdev${n}.txt .endfor -# what the installer does, see /usr/src/distrib/$(machine)/ramdisk/install.md -format-new-chunks: create-new-chunks +format-disks: create-disks .for devfile in ${DISKDEVFILES} ${SUDO} ${FORMAT_DISK} -- "$$(<${devfile})" 1>/dev/null printf 'a\n\n\n\nRAID\nw\nq\n' | \ ${SUDO} disklabel -E -- "$$(<${devfile})" 1>/dev/null .endfor -create-new-softraid: format-new-chunks +create-root: format-disks ${SUDO} bioctl -l"$$(sed -- s/$$/a/ ${DISKDEVFILES} | paste -sd, -- -)" \ -cc -- softraid0 | \ awk -- '{ print $$NF }' 1>${ROOTDEVFILE} @@ -49,13 +48,13 @@ create-new-softraid: format-new-chunks create-mountpoint: mkdir -- ${MOUNTPOINT} -format-new-softraid: create-new-softraid create-mountpoint +format-root: create-root create-mountpoint ${SUDO} ${FORMAT_DISK} -- "$$(<${ROOTDEVFILE})" 1>/dev/null ${SUDO} disklabel -Aw -- "$$(<${ROOTDEVFILE})" ${SUDO} newfs -q -- "$$(<${ROOTDEVFILE})"a 1>/dev/null ${SUDO} mount -- /dev/"$$(<${ROOTDEVFILE})"a ${MOUNTPOINT} -copy-bootstrap-to-softraid: format-new-softraid +copy-bootstrap-to-root: format-root ${SUDO} mkdir -- ${MOUNTPOINT}/usr ${SUDO} cp -r -- ${STAGEDIR} ${MOUNTPOINT}/usr/ @@ -63,19 +62,17 @@ copy-bootstrap-to-softraid: format-new-softraid # must be first as some targets expect a working filesystem REGRESS_TARGETS = prepare -# what the installer does, see /usr/src/distrib/$(machine)/ramdisk/install.md -# do this as regress target and not in format-new-chunks prepare: ${SUDO} ${REAL_RUN} -p -- "$$(<${ROOTDEVFILE})" # XXX -p is not yet softraid(4) aware, need to prepare chunks manually -. for devfile in ${DISKDEVFILES} +.for devfile in ${DISKDEVFILES} ${SUDO} ${REAL_RUN} -p -- "$$(<${devfile})" -. endfor +.endfor REGRESS_TARGETS += dry-prepare \ dry-default \ dry-root \ - root-installer \ + root \ root-explicit-stages dry-prepare: @@ -87,9 +84,8 @@ dry-default: dry-root: ${SUDO} ${DRY_RUN} -r/ -- "$$(<${ROOTDEVFILE})" -# what the installer does, see /usr/src/distrib/$(machine)/ramdisk/install.md -# XXX fails with NCHUNKS > 1 on sparc64, 1 <= NCHUNKS <= 4 works on amd64 -root-installer: +# XXX fails with NDISKS > 1 on sparc64, 1 <= NDISKS <= 4 works on amd64 +root: ${SUDO} ${REAL_RUN} -r ${MOUNTPOINT} "$$(<${ROOTDEVFILE})" root-explicit-stages: @@ -120,11 +116,11 @@ REGRESS_CLEANUP = cleanup # allow failure to always cleanup as much as possible cleanup: - -${SUDO} umount -- ${MOUNTPOINT} - -rmdir -- ${MOUNTPOINT} - -${SUDO} bioctl -d -- "$$(<${ROOTDEVFILE})" + -${SUDO} umount -- ${MOUNTPOINT} 2>/dev/null + -rmdir -- ${MOUNTPOINT} 2>/dev/null + -${SUDO} bioctl -d -- "$$(<${ROOTDEVFILE})" 2>/dev/null .for devfile in ${DISKDEVFILES} - -${SUDO} vnconfig -u -- "$$(<${devfile})" + -${SUDO} vnconfig -u -- "$$(<${devfile})" 2>/dev/null .endfor .include