Backout "Reflect script failure in exit code"
authorkn <kn@openbsd.org>
Wed, 14 Sep 2022 16:43:00 +0000 (16:43 +0000)
committerkn <kn@openbsd.org>
Wed, 14 Sep 2022 16:43:00 +0000 (16:43 +0000)
amd64 install using (G)PT seems busted as reported by tb

usr.sbin/installboot/efi_installboot.c
usr.sbin/installboot/i386_installboot.c
usr.sbin/installboot/loongson_installboot.c
usr.sbin/installboot/macppc_installboot.c
usr.sbin/installboot/octeon_installboot.c
usr.sbin/installboot/powerpc64_installboot.c

index 54142ce..b0b26b8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: efi_installboot.c,v 1.5 2022/09/09 15:53:16 kn Exp $  */
+/*     $OpenBSD: efi_installboot.c,v 1.6 2022/09/14 16:43:00 kn Exp $  */
 /*     $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
 
 /*
@@ -41,7 +41,6 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 
 #include <err.h>
 #include <errno.h>
@@ -103,11 +102,15 @@ md_prepareboot(int devfd, char *dev)
                warnx("disklabel type unknown");
 
        part = findgptefisys(devfd, &dl);
-       if (part == -1)
-               part = findmbrfat(devfd, &dl);
        if (part != -1) {
-               if (create_filesystem(&dl, (char)part) == -1)
-                       exit(1);
+               create_filesystem(&dl, (char)part);
+               return;
+       }
+
+       part = findmbrfat(devfd, &dl);
+       if (part != -1) {
+               create_filesystem(&dl, (char)part);
+               return;
        }
 }
 
@@ -176,8 +179,6 @@ create_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        return rslt;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt))
-                       return -1;
        }
 
        return 0;
@@ -231,10 +232,6 @@ write_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        goto rmdir;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt)) {
-                       rslt = -1;
-                       goto rmdir;
-               }
                if (mount(MOUNT_MSDOS, dst, 0, &args) == -1) {
                        /* Try newfs'ing it. */
                        rslt = create_filesystem(dl, part);
index 122bc16..b637c08 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: i386_installboot.c,v 1.42 2022/09/09 15:53:16 kn Exp $        */
+/*     $OpenBSD: i386_installboot.c,v 1.43 2022/09/14 16:43:00 kn Exp $        */
 /*     $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
 
 /*
@@ -46,7 +46,6 @@
 #include <sys/stat.h>
 #include <sys/sysctl.h>
 #include <sys/time.h>
-#include <sys/wait.h>
 
 #include <ufs/ufs/dinode.h>
 #include <ufs/ufs/dir.h>
@@ -147,8 +146,8 @@ md_prepareboot(int devfd, char *dev)
 
        part = findgptefisys(devfd, &dl);
        if (part != -1) {
-               if (create_filesystem(&dl, (char)part) == -1)
-                       exit(1);
+               create_filesystem(&dl, (char)part);
+               return;
        }
 }
 
@@ -281,8 +280,6 @@ create_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        return rslt;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt))
-                       return -1;
        }
 
        return 0;
@@ -336,10 +333,6 @@ write_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        goto rmdir;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt)) {
-                       rslt = -1;
-                       goto rmdir;
-               }
                if (mount(MOUNT_MSDOS, dst, 0, &args) == -1) {
                        /* Try newfs'ing it. */
                        rslt = create_filesystem(dl, part);
index e91f135..f40ad57 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: loongson_installboot.c,v 1.6 2022/09/11 07:38:33 miod Exp $   */
+/*     $OpenBSD: loongson_installboot.c,v 1.7 2022/09/14 16:43:00 kn Exp $     */
 /*     $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
 
 /*
@@ -41,7 +41,6 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 
 #include <err.h>
 #include <errno.h>
@@ -144,10 +143,6 @@ write_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        goto rmdir;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt)) {
-                       rslt = -1;
-                       goto rmdir;
-               }
                if (mount(MOUNT_EXT2FS, dst, 0, &args) == -1) {
                        /* Try newfs'ing it. */
                        rslt = snprintf(cmd, sizeof(cmd), newfsfmt,
@@ -162,10 +157,6 @@ write_filesystem(struct disklabel *dl, char part)
                                warn("system('%s') failed", cmd);
                                goto rmdir;
                        }
-                       if (WIFEXITED(rslt) && WEXITSTATUS(rslt)) {
-                               rslt = -1;
-                               goto rmdir;
-                       }
                        rslt = mount(MOUNT_EXT2FS, dst, 0, &args);
                        if (rslt == -1) {
                                warn("unable to mount ext2fs partition");
index fe5c1c7..a8144bc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: macppc_installboot.c,v 1.7 2022/09/09 15:53:16 kn Exp $       */
+/*     $OpenBSD: macppc_installboot.c,v 1.8 2022/09/14 16:43:00 kn Exp $       */
 
 /*
  * Copyright (c) 2011 Joel Sing <jsing@openbsd.org>
@@ -40,7 +40,6 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 
 #include <err.h>
 #include <errno.h>
@@ -88,8 +87,8 @@ md_prepareboot(int devfd, char *dev)
 
        part = findmbrfat(devfd, &dl);
        if (part != -1) {
-               if (create_filesystem(&dl, (char)part) == -1)
-                       exit(1);
+               create_filesystem(&dl, (char)part);
+               return;
        }
 }
 
@@ -152,8 +151,6 @@ create_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        return rslt;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt))
-                       return -1;
        }
 
        return 0;
@@ -204,10 +201,6 @@ write_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        goto rmdir;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt)) {
-                       rslt = -1;
-                       goto rmdir;
-               }
                if (mount(MOUNT_MSDOS, dst, 0, &args) == -1) {
                        /* Try newfs'ing it. */
                        rslt = create_filesystem(dl, part);
index 7a4f36a..40fc87d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: octeon_installboot.c,v 1.6 2022/09/09 15:53:16 kn Exp $       */
+/*     $OpenBSD: octeon_installboot.c,v 1.7 2022/09/14 16:43:00 kn Exp $       */
 
 /*
  * Copyright (c) 2011 Joel Sing <jsing@openbsd.org>
@@ -40,7 +40,6 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 
 #include <err.h>
 #include <errno.h>
@@ -86,8 +85,8 @@ md_prepareboot(int devfd, char *dev)
 
        part = findmbrfat(devfd, &dl);
        if (part != -1) {
-               if (create_filesystem(&dl, (char)part) == -1)
-                       exit(1);
+               create_filesystem(&dl, (char)part);
+               return;
        }
 }
 
@@ -150,8 +149,6 @@ create_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        return rslt;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt))
-                       return -1;
        }
 
        return 0;
@@ -205,10 +202,6 @@ write_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        goto rmdir;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt)) {
-                       rslt = -1;
-                       goto rmdir;
-               }
                if (mount(MOUNT_MSDOS, dst, 0, &args) == -1) {
                        /* Try newfs'ing it. */
                        rslt = create_filesystem(dl, part);
index e56d6ab..602e019 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: powerpc64_installboot.c,v 1.5 2022/09/09 15:53:16 kn Exp $    */
+/*     $OpenBSD: powerpc64_installboot.c,v 1.6 2022/09/14 16:43:00 kn Exp $    */
 
 /*
  * Copyright (c) 2011 Joel Sing <jsing@openbsd.org>
@@ -40,7 +40,6 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 
 #include <err.h>
 #include <errno.h>
@@ -88,8 +87,8 @@ md_prepareboot(int devfd, char *dev)
 
        part = findmbrfat(devfd, &dl);
        if (part != -1) {
-               if (create_filesystem(&dl, (char)part) == -1)
-                       exit(1);
+               create_filesystem(&dl, (char)part);
+               return;
        }
 }
 
@@ -157,8 +156,6 @@ create_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        return rslt;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt))
-                       return -1;
        }
 
        return 0;
@@ -213,10 +210,6 @@ write_filesystem(struct disklabel *dl, char part)
                        warn("system('%s') failed", cmd);
                        goto rmdir;
                }
-               if (WIFEXITED(rslt) && WEXITSTATUS(rslt)) {
-                       rslt = -1;
-                       goto rmdir;
-               }
                if (mount(MOUNT_MSDOS, dir, 0, &args) == -1) {
                        /* Try newfs'ing it. */
                        rslt = create_filesystem(dl, part);