Logging the presence of a keydisk the same way offline data chunks are
reported seems unjustified.

Noting offline chunks serves as warning, so the user can bring them
online and update bootblocks.

Keydisks, however, are not to be touched by installboot(8) in any case
and whether they're present/absent or on/offline should make no
difference to installboot.

So a) drop the "is keydisk - skipping" message and b) hoist the keydisk
check before the offline check so as to avoid "not online - skipping"
messages for offline keydisks.

Feedback? Objection? OK?

Index: efi_softraid.c
===================================================================
RCS file: /cvs/src/usr.sbin/installboot/efi_softraid.c,v
retrieving revision 1.3
diff -u -p -r1.3 efi_softraid.c
--- efi_softraid.c      5 Oct 2022 09:58:43 -0000       1.3
+++ efi_softraid.c      22 Oct 2022 17:57:31 -0000
@@ -47,16 +47,14 @@ sr_install_bootblk(int devfd, int vol, i
        if (ioctl(devfd, BIOCDISK, &bd) == -1)
                err(1, "BIOCDISK");
 
-       /* Check disk status. */
-       if (bd.bd_status != BIOC_SDONLINE && bd.bd_status != BIOC_SDREBUILD) {
-               fprintf(stderr, "softraid chunk %u not online - skipping...\n",
-                   disk);
+       /* Keydisks always have a size of zero. */
+       if (bd.bd_size == 0) {
                return;
        }
 
-       /* Keydisks always have a size of zero. */
-       if (bd.bd_size == 0) {
-               fprintf(stderr, "softraid chunk %u is keydisk - skipping...\n",
+       /* Check disk status. */
+       if (bd.bd_status != BIOC_SDONLINE && bd.bd_status != BIOC_SDREBUILD) {
+               fprintf(stderr, "softraid chunk %u not online - skipping...\n",
                    disk);
                return;
        }
Index: i386_softraid.c
===================================================================
RCS file: /cvs/src/usr.sbin/installboot/i386_softraid.c,v
retrieving revision 1.20
diff -u -p -r1.20 i386_softraid.c
--- i386_softraid.c     5 Oct 2022 09:58:43 -0000       1.20
+++ i386_softraid.c     22 Oct 2022 17:57:27 -0000
@@ -58,16 +58,14 @@ sr_install_bootblk(int devfd, int vol, i
        if (ioctl(devfd, BIOCDISK, &bd) == -1)
                err(1, "BIOCDISK");
 
-       /* Check disk status. */
-       if (bd.bd_status != BIOC_SDONLINE && bd.bd_status != BIOC_SDREBUILD) {
-               fprintf(stderr, "softraid chunk %u not online - skipping...\n",
-                   disk);
+       /* Keydisks always have a size of zero. */
+       if (bd.bd_size == 0) {
                return;
        }
 
-       /* Keydisks always have a size of zero. */
-       if (bd.bd_size == 0) {
-               fprintf(stderr, "softraid chunk %u is keydisk - skipping...\n",
+       /* Check disk status. */
+       if (bd.bd_status != BIOC_SDONLINE && bd.bd_status != BIOC_SDREBUILD) {
+               fprintf(stderr, "softraid chunk %u not online - skipping...\n",
                    disk);
                return;
        }
Index: sparc64_softraid.c
===================================================================
RCS file: /cvs/src/usr.sbin/installboot/sparc64_softraid.c,v
retrieving revision 1.7
diff -u -p -r1.7 sparc64_softraid.c
--- sparc64_softraid.c  5 Oct 2022 09:58:43 -0000       1.7
+++ sparc64_softraid.c  22 Oct 2022 17:57:28 -0000
@@ -48,16 +48,14 @@ sr_install_bootblk(int devfd, int vol, i
        if (ioctl(devfd, BIOCDISK, &bd) == -1)
                err(1, "BIOCDISK");
 
-       /* Check disk status. */
-       if (bd.bd_status != BIOC_SDONLINE && bd.bd_status != BIOC_SDREBUILD) {
-               fprintf(stderr, "softraid chunk %u not online - skipping...\n",
-                   disk);
+       /* Keydisks always have a size of zero. */
+       if (bd.bd_size == 0) {
                return;
        }
 
-       /* Keydisks always have a size of zero. */
-       if (bd.bd_size == 0) {
-               fprintf(stderr, "softraid chunk %u is keydisk - skipping...\n",
+       /* Check disk status. */
+       if (bd.bd_status != BIOC_SDONLINE && bd.bd_status != BIOC_SDREBUILD) {
+               fprintf(stderr, "softraid chunk %u not online - skipping...\n",
                    disk);
                return;
        }

Reply via email to