On Wed, Jun 01, 2016 at 06:21:17PM +0200, Mark Patruck wrote:
> disklabel.c 1.219 breaks the automated disk allocation via
> template (disklabel -T)
>
> This fixes it for me:
Thanks for the report. I agree with this fix.
The problem is that readlabel() calls editor_allocspace() which will use
the default layout unless a template was provided beforehand. Currently,
the template is only parsed afterwards, so it's always the default
layout that will be used.
ok to commit this fix?
Sorry for the inconvenience.
>
> Index: disklabel.c
> ===================================================================
> RCS file: /cvs/src/sbin/disklabel/disklabel.c,v
> retrieving revision 1.219
> diff -u -p -r1.219 disklabel.c
> --- disklabel.c 29 May 2016 17:02:21 -0000 1.219
> +++ disklabel.c 1 Jun 2016 15:18:46 -0000
> @@ -206,6 +206,9 @@ main(int argc, char *argv[])
> if (f < 0)
> err(4, "%s", specname);
>
> + if (autotable != NULL)
> + parse_autotable(autotable);
> +
> if (op != WRITE || aflag || dflag)
> readlabel(f);
> else if (argc == 2 || argc == 3)
> @@ -220,9 +223,6 @@ main(int argc, char *argv[])
> if (pledge("stdio rpath wpath disklabel", NULL) == -1)
> err(1, "pledge");
> }
> -
> - if (autotable != NULL)
> - parse_autotable(autotable);
>
> switch (op) {
> case EDIT:
>
>
>
> --
> Mark Patruck ( mark at wrapped.cx )
> GPG key 0xF2865E51 / 187F F6D3 EE04 1DCE 1C74 F644 0D3C F66F F286 5E51
>
> http://www.wrapped.cx