Bug 236238 - [mkimg] Round # partitions up to fill the last GPT table sector
Summary: [mkimg] Round # partitions up to fill the last GPT table sector
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Marcel Moolenaar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-05 04:33 UTC by Marcel Moolenaar
Modified: 2019-03-23 03:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Moolenaar freebsd_committer 2019-03-05 04:33:30 UTC
With 4 partitions entries per sector for GPT, have mkimg(1) round the number of entries to a multiple of 4.
Comment 1 commit-hook freebsd_committer 2019-03-05 22:56:06 UTC
A commit references this bug:

Author: marcel
Date: Tue Mar  5 22:55:36 UTC 2019
New revision: 344826
URL: https://svnweb.freebsd.org/changeset/base/344826

Log:
  Round # partitions up to fill the last GPT table sector

  Set the number of partitions entries in the GPT header to a
  multiple of the number of entries that fit in a sector.

  PR:		236238
  Reviewed by:	imp
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D19465

Changes:
  head/usr.bin/mkimg/gpt.c
  head/usr.bin/mkimg/tests/Makefile
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu
Comment 2 Marcel Moolenaar freebsd_committer 2019-03-05 22:57:15 UTC
Will be merged to stable branches in 2 weeks
Comment 3 commit-hook freebsd_committer 2019-03-22 23:56:08 UTC
A commit references this bug:

Author: marcel
Date: Fri Mar 22 23:55:38 UTC 2019
New revision: 345428
URL: https://svnweb.freebsd.org/changeset/base/345428

Log:
  MFC 344826:

  Round # partitions up to fill the last GPT table sector

  Set the number of partitions entries in the GPT header to a
  multiple of the number of entries that fit in a sector.

  PR:		236238
  Reviewed by:	imp
  Differential Revision:	https://reviews.freebsd.org/D19465

Changes:
_U  stable/12/
  stable/12/usr.bin/mkimg/gpt.c
  stable/12/usr.bin/mkimg/tests/Makefile
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu
Comment 4 commit-hook freebsd_committer 2019-03-23 03:37:20 UTC
A commit references this bug:

Author: marcel
Date: Sat Mar 23 03:37:11 UTC 2019
New revision: 345436
URL: https://svnweb.freebsd.org/changeset/base/345436

Log:
  MFC 344826:

  Round # partitions up to fill the last GPT table sector

  Set the number of partitions entries in the GPT header to a
  multiple of the number of entries that fit in a sector.

  PR:		236238
  Reviewed by:	imp
  Differential Revision:	https://reviews.freebsd.org/D19465

Changes:
_U  stable/11/
  stable/11/usr.bin/mkimg/gpt.c
  stable/11/usr.bin/mkimg/tests/Makefile
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu
  stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu
  stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu