stricter devname match on bioctl(8) output avoids false positives on failure
authorkn <kn@openbsd.org>
Sun, 20 Aug 2023 22:38:49 +0000 (22:38 +0000)
committerkn <kn@openbsd.org>
Sun, 20 Aug 2023 22:38:49 +0000 (22:38 +0000)
regress/usr.sbin/installboot/Makefile

index b4f64c2..d9b5260 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.38 2023/02/07 15:04:27 kn Exp $
+#      $OpenBSD: Makefile,v 1.39 2023/08/20 22:38:49 kn Exp $
 
 INSTALLBOOT ?=         /usr/sbin/installboot
 DRY_RUN =              ${INSTALLBOOT} -n
@@ -84,7 +84,7 @@ create-root: create-disks
 .if ${USE_SOFTRAID:L} == "yes"
        ${SUDO} bioctl -l"$$(sed -- s/$$/a/ ${DISKDEVFILES} | paste -sd, -- -)" \
            -c1C -k"$$(<${KEYDEVFILE})"a -- softraid0 | \
-               awk -- '{ print $$NF }' 1>${ROOTDEVFILE}
+               grep -o -- 'sd[0-9]*$$' 1>${ROOTDEVFILE}
        ${SUDO} ${FORMAT_DISK} -- "$$(<${ROOTDEVFILE})" 1>/dev/null
 .else
        ln -s -- ${DISKDEVFILES} ${ROOTDEVFILE}