Your message dated Fri, 01 Mar 2019 13:05:29 +0000
with message-id <[email protected]>
and subject line Bug#923253: fixed in grub2 2.02+dfsg1-12
has caused the Debian Bug report #923253,
regarding grub-pc: Calculates wrong partition offset for EBR partitions on
FreeBSD
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
923253: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923253
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: grub-pc
Version: ...
Tags: upstream patch
Hi,
On FreeBSD, grub uses the "start" rather than the "offset" config
property to calculate the starting sector for partitions, which gives
the wrong value for EBR partitions:
> root@lemon:/home/jrtc27/src/grub2/grub2-2.02+dfsg1# geom part list
> (output trimmed and annotated)
> Geom name: ada0
> scheme: MBR
> Providers:
> 1. Name: ada0s1
> offset: 1048576 # ie 2048 sectors
> start: 2048
> 2. Name: ada0s2
> offset: 64000883712 # ie 125001726 sectors
> start: 125001726
>
> Geom name: ada0s2
> scheme: EBR
> Providers:
> 1. Name: ada0s5
> offset: 1024 # ie 2 sectors; add 125001726 from ada0s2 to get 125001728
> start: 0
> 2. Name: ada0s6
> offset: 183628727296 # ie 358649858 sectors; add 125001726 from ada0s2 to
> get 483651584
> start: 358647810 # add 125001726 from ada0s2 to get 483649536
> root@lemon:~# fdisk -l /dev/ada0
> Disk /dev/ada0: 238.5 GiB, 256060514304 bytes, 500118192 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x20b8cc40
>
> Device Boot Start End Sectors Size Id Type
> /dev/ada0p1 * 2048 124999679 124997632 59.6G 83 Linux
> /dev/ada0p2 125001726 500117503 375115778 178.9G 5 Extended
> /dev/ada0p5 125001728 483649535 358647808 171G a5 FreeBSD
> /dev/ada0p6 483651584 500117503 16465920 7.9G 82 Linux swap / Solaris
This clearly shows that the "start" field is wrong and "offset" should
be used instead. The attached patch does this and has been tested on the
above system (consider it Signed-off-by: James Clarke
<[email protected]> if forwarding upstream).
Thanks,
James
Description: osdep/freebsd: Fix partition calculation for EBR entries
For EBR partitions, "start" is the relative starting sector of the EBR header
itself, whereas "offset" is the relative starting byte of the partition's
contents, excluding the EBR header and any padding. Thus we must use "offset",
and divide by the sector size to convert to sectors.
Author: James Clarke <[email protected]>
Last-Update: 2019-02-25
---
--- a/grub-core/osdep/freebsd/getroot.c
+++ b/grub-core/osdep/freebsd/getroot.c
@@ -338,8 +338,9 @@ grub_util_follow_gpart_up (const char *n
grub_util_follow_gpart_up (name_tmp, &off, name_out);
free (name_tmp);
LIST_FOREACH (config, &provider->lg_config, lg_config)
- if (strcasecmp (config->lg_name, "start") == 0)
- off += strtoull (config->lg_val, 0, 10);
+ if (strcasecmp (config->lg_name, "offset") == 0)
+ off += strtoull (config->lg_val, 0, 10)
+ / provider->lg_sectorsize;
if (off_out)
*off_out = off;
return;
--- End Message ---
--- Begin Message ---
Source: grub2
Source-Version: 2.02+dfsg1-12
We believe that the bug you reported is fixed in the latest version of
grub2, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Colin Watson <[email protected]> (supplier of updated grub2 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Fri, 01 Mar 2019 12:34:45 +0000
Source: grub2
Architecture: source
Version: 2.02+dfsg1-12
Distribution: unstable
Urgency: medium
Maintainer: GRUB Maintainers <[email protected]>
Changed-By: Colin Watson <[email protected]>
Closes: 919029 922104 922741 923253
Changes:
grub2 (2.02+dfsg1-12) unstable; urgency=medium
.
[ Colin Watson ]
* Remove code to migrate grub-pc/install_devices to persistent device
names under /dev/disk/by-id/. This migration happened in
1.98+20100702-1, which was in squeeze (four stable releases ago), so we
no longer need to carry around this complex code.
* Preserve previous answer to grub-pc/install_devices if we have to ask
grub-pc/install_devices_disks_changed and the user chooses not to
install to any devices, so that we can recover from temporary bugs that
cause /dev/disk/by-id/ paths to change (closes: #919029).
* debian/signing-template.json.in: Add trusted_certs key (empty, since
GRUB has no hardcoded list of trusted certificates).
* util: Detect more I/O errors (closes: #922741).
.
[ Leif Lindholm ]
* arm64/efi: Fix grub_efi_get_ram_base().
.
[ Steve McIntyre ]
* grub-install: Check for arm-efi as a default target (closes: #922104).
.
[ James Clarke ]
* osdep/freebsd: Fix partition calculation for EBR entries (closes:
#923253).
Checksums-Sha1:
bdde214b3c1c2d1a3fcd5078905528cece234e42 6691 grub2_2.02+dfsg1-12.dsc
20766f9616d83edb4dcc572cf62dbb17a7e5ecb5 1126288
grub2_2.02+dfsg1-12.debian.tar.xz
7eb2257fbf0bf0db9ad28ac9e6cdcb5c378f686e 15038
grub2_2.02+dfsg1-12_source.buildinfo
Checksums-Sha256:
4e8a8c3ab7c2059486d28a93557930aaf570f69488c750edd1eb31b12879ec18 6691
grub2_2.02+dfsg1-12.dsc
8cbdb418b2e4eccedce914d123b7de6862f4f599386277312011ce32797f846e 1126288
grub2_2.02+dfsg1-12.debian.tar.xz
2121f690fa3057a1fe475d1309d76a38a5ac16a5da9548b93de3d8c250ebe34b 15038
grub2_2.02+dfsg1-12_source.buildinfo
Files:
c7ebc34dbe2dfcad2f68d9ff522051ae 6691 admin optional grub2_2.02+dfsg1-12.dsc
fd7e5314427a7db5915b8990cbb5fc56 1126288 admin optional
grub2_2.02+dfsg1-12.debian.tar.xz
9abb7b87c62a864ab5044b7e1769cf5a 15038 admin optional
grub2_2.02+dfsg1-12_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAlx5J1YACgkQOTWH2X2G
UAvK4g//YG6+7BFAQo80XOW3JGsB/BKuyXJR7ZNoEU5RLsIHmSWpPIt3v/sltiHL
D6qcknGSbcj0/knd5uo34BsxdFbBfTw3oqfoLYGJfyFy4xgNiV9b7qBETDfoWfFX
DDL/qxqI70Gu0Y6/+dIbQwsxezunTAiQ5scURL2fLHXsGP4HZrFBp5rcSSCI5zej
rZ/IoDqb/ScvQBfC5GF3QeDGGIDsvnYNL8QbASM78Te2JZ5ec4J4e6Me+GD2DxtA
VD1ybL7sB8j3EtnYjIbL/9B3DfgIS+vpqT2FXiTC7nh/k5AVobHWpX5QsWII3fvc
OfZ9oI0EUiImx9+/7ppSoqLaXu+b6otvSSgCwFdtxOnOO1UNDgGskCoda4vwJpE7
c+om5WAguXTWmDSUo6JzaggFf32R6X6L1tqOFfWguTdQ4qD0M2sakTxtISUvybGx
PZIyamkhpNlNE+g+o+my0/WjlwYw+CZeBuQXKxaw6WSZsIJbmaVWy5gEmnA6AeXf
RpvyTB1iTi9VxamG9hMSwO+MNNcVc2/JYCyIlQckutHU9dq+pdLHVpaDrsLFvzYK
NhOozNScr0CP2XK1IYdpTwQsHqg0rZM6ymjNU3UCWyMtNnCAF95XXV5KpIPV9Pza
13h4J5IScKj00ALaubZ0NsN+Tsv55+Zak8FFOwCKxC1RI9Vi3zk=
=6Jmj
-----END PGP SIGNATURE-----
--- End Message ---