On 29 May 2016 at 02:43, Jonathan Gray <j...@jsg.id.au> wrote:
> On Sat, May 28, 2016 at 05:38:31PM -0600, Theo de Raadt wrote:
>> CVSROOT:      /cvs
>> Module name:  src
>> Changes by:   dera...@cvs.openbsd.org 2016/05/28 17:38:31
>>
>> Modified files:
>>       sbin/disklabel : disklabel.c
>>
>> Log message:
>> back out previous; -wAT template vnd0 fails
>>
>
> The change that was backed out also broke ramdisk installs on armv7:
>
> Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a]
> disklabel: unknown disk type: (null)
>

Bob's diff was slightly flawed. I sent a 'fixed' version to them but
not generally since I don't really know what the point of the original
diff was. Attached if it is of use while they ponder it.

.... Ken
Index: disklabel.c
===================================================================
RCS file: /cvs/src/sbin/disklabel/disklabel.c,v
retrieving revision 1.214
diff -u -p -r1.214 disklabel.c
--- disklabel.c 25 Nov 2015 17:17:38 -0000      1.214
+++ disklabel.c 29 May 2016 00:25:48 -0000
@@ -211,6 +211,7 @@ main(int argc, char *argv[])
            &specname);
        if (f < 0)
                err(4, "%s", specname);
+       readlabel(f);
 
        if (autotable != NULL)
                parse_autotable(autotable);
@@ -219,19 +220,16 @@ main(int argc, char *argv[])
        case EDIT:
                if (argc != 1)
                        usage();
-               readlabel(f);
                error = edit(&lab, f);
                break;
        case EDITOR:
                if (argc != 1)
                        usage();
-               readlabel(f);
                error = editor(f);
                break;
        case READ:
                if (argc != 1)
                        usage();
-               readlabel(f);
 
                if (pledge("stdio", NULL) == -1)
                        err(1, "pledge");
@@ -245,7 +243,6 @@ main(int argc, char *argv[])
        case RESTORE:
                if (argc < 2 || argc > 3)
                        usage();
-               readlabel(f);
                if (!(t = fopen(argv[1], "r")))
                        err(4, "%s", argv[1]);
                error = getasciilabel(t, &lab);
@@ -261,9 +258,9 @@ main(int argc, char *argv[])
                fclose(t);
                break;
        case WRITE:
-               if (dflag || aflag) {
-                       readlabel(f);
-               } else if (argc < 2 || argc > 3)
+               if (dflag || aflag)
+                       ;
+               else if (argc < 2 || argc > 3)
                        usage();
                else
                        makelabel(argv[1], argc == 3 ? argv[2] : NULL, &lab);

Reply via email to