Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jul 2022 10:05:21 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        Mark Millard <marklmi@yahoo.com>, Warner Losh <imp@bsdimp.com>, "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>, "Dr. Rolf Jansen" <freebsd-rj@cyclaero.com>, freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Partition layout of ARM SD card images
Message-ID:  <1169617916.2919.1657613121111@localhost>
In-Reply-To: <491AC0F5-2A0F-402D-A503-6A9E34F20E1D@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_2918_2130341816.1657613121106
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Van: Mark Millard <marklmi@yahoo.com>
Datum: 11 juli 2022 22:04
Aan: Warner Losh <imp@bsdimp.com>
CC: "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>, "Dr. Rolf Jansen" <freebsd-rj@cyclaero.com>, freebsd-arm <freebsd-arm@freebsd.org>
Onderwerp: Re: Partition layout of ARM SD card images

> 
> 
> On 2022-Jul-11, at 09:50, Mark Millard <marklmi@yahoo.com> wrote:
> 
> > On 2022-Jul-11, at 07:38, Warner Losh <imp@bsdimp.com> wrote:
> > 
> >> On Mon, Jul 11, 2022 at 8:31 AM Rodney W. Grimes <freebsd-rwg@gndrsh.dnsmgr.net> wrote:
> >>>> 
> >>>> On 2022-Jul-10, at 14:34, Dr. Rolf Jansen <freebsd-rj@cyclaero.com> wrote:
> >>>> 
> >>>>>> Am 10.07.2022 um 17:48 schrieb Mark Millard <marklmi@yahoo.com>:
> >>>>>> 
> >>>>>> On 2022-Jul-10, at 12:26, Dr. Rolf Jansen <freebsd-rj@cyclaero.com> wrote:
> >>>>>> 
> >>>>>>> For example let's have a llok on the partition layout of, FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img (the others are similar):
> >>>>>>> 
> >>>>>>> # mdconfig -a -u 0 -t vnode -f diskimg/FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img
> >>>>>>> # gpart show md0 md0s2
> >>>>>>> 
> >>>>>>> =>     63  6291393  md0  MBR  (3.0G)
> >>>>>>>       63     2016       - free -  (1.0M)
> >>>>>>>     2079   102312    1  fat32lba  [active]  (50M)
> >>>>>>>   104391  6187041    2  freebsd  (3.0G)
> >>>>>>>  6291432       24       - free -  (12K)
> >>>>>>> 
> >>>>>>> =>      0  6187041  md0s2  BSD  (3.0G)
> >>>>>>>        0       57         - free -  (29K)
> >>>>>>>       57  6186880      1  freebsd-ufs  (2.9G)
> >>>>>>>  6186937      104         - free -  (52K)
> >>>>>>> 
> >>>>>>> The start of the fat32 boot slice s1 (containing the u-boot) stuff is neither aligned to 1M nor to 4k, it starts on an odd base. The start of the BSD payload slice s2 and its size are odd as well. The padding of 57 blocks within s2 lets the UFS partition start on a globally even base, namely 104391+57 = 104448, which as a matter of fact is 4k aligned (104448*512/4096 = 13056) and 1M aligned as well (104448*512/1024/1024 = 51), however all this keeps looking strange.
> >>>>>>> 
> >>>>>>> Are there reasons for this partition layout besides making it look more interesting? If yes, some insights would be good.
> >>>>>> 
> >>>>>> The layout details are more specific to the aarch64 RPi* context
> >>>>>> than to general aarch64 SD card images. For example, the Rock64
> >>>>>> image is different:
> >>>>>> 
> >>>>>> # mdconfig -a -u 0 -t vnode -f  FreeBSD-14.0-CURRENT-arm64-aarch64-ROCK64-20220708-a0b956f5ac5-256605.img
> >>>>>> # gpart show md0
> >>>>>> =>     40  6291376  md0  GPT  (3.0G)
> >>>>>>     40    32728       - free -  (16M)
> >>>>>>  32768   102400    1  efi  (50M)
> >>>>>> 135168  6156160    2  freebsd-ufs  (2.9G)
> >>>>>> 6291328       88       - free -  (44K)
> >>>>> 
> >>>>> This is a GPT table, while the others are still MBR. Images which come with u-boot must have a different layout.
> >>>> 
> >>>> I know it is a GPT table. That is part of the point about
> >>>> the variety of contexts that there are across the Small
> >>>> Board Computers.
> >>>> 
> >>>> No SBC that has a U-Boot/whatever needing more space
> >>>> than is provided below is going to use the same
> >>>> 2079 figure:
> >>>> 
> >>>> =>     63  ???  md0  ???  (?)
> >>>>       63     2016       - free -  (1.0M)
> >>> 
> >>> I read this thread.. and it keeps nagging me in
> >>> the back of the head, I know this 2016 number.
> >>> It is common when the sectors per track of a
> >>> drive is reported as "32", its an attempt to
> >>> 1M align such a drive, is somehow the image
> >>> creation code picking up 32 to do the align
> >>> calculation wrongly on a 63 sector/track
> >>> image?
> >>> 
> >>>>     2079   ??????    1  fat32lba  [active]  (?)
> >>> 
> >>> The OP is correct, this is a horrid state of alignment
> >>> and the cause should be tracked down and fixed!  I
> >>> can see no valid reason to have an approx
> >>> 1MB free hole that causes this missalignment,
> >>> that free hole should be (2048-63)=1985
> >> 
> >> Yes, we should be aligning at a 1M or 2M boundary on the
> >> root device, not within the partition. The offsets are supposed
> >> to do that, and if there's a problem we should fix it.
> >> 
> >>> AHhhhh thought hits me... did the code get changed
> >>> to make the images larger, and somehow the image
> >>> creation code went from a 32 sector/track fake C/H/S
> >>> to a 63 sector fake C/H/S, and the code has all
> >>> along been assuming 32 sector/track drives?
> >>> 
> >> 63 sector for 'fake' C/H/S has been a thing since at least
> >> FreeBSD 6 and maybe a little longer. There's no cutover
> >> based on image size of the device. The older ATA code,
> >> pre-cam but post SOS rewrite, would try very hard to return
> >> the values from the underlying device that it reported. And that
> >> would lead to mismatches because it was different than the lies
> >> that md told by default. But that only mattered for really old
> >> BIOSes that couldn't handle LBA/packet mode in booting (which
> >> is the primary reason the old fdisk program could set the ending CHS
> >> of partitions since the FreeBSD code used that to guess the CHS
> >> of the drive itself in the absence of other information).
> >> 
> >> I don't think the kernel has changed in this area in a very long time.
> >> At worse, we're seeing a mkimage bug.
> >> 
> >> Warner
> >> 
> >>> 
> >>> MBR vs. GPT is not the fundamental issue for that.
> >>> 
> >>> ===
> >>> Mark Millard
> >>> marklmi at yahoo.com
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> -- 
> >>> Rod Grimes                                                 rgrimes@freebsd.org
> >>> 
> >> 
> > 
> > For reference:
> > 
> > # grep -r MD_ARGS /usr/main-src/release/ | more
> > /usr/main-src/release/arm/GENERICSD.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/arm/RPI-B.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/arm64/PINE64-LTS.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/arm64/PINE64.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/arm64/PINEBOOK.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/arm64/ROCK64.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/arm64/ROCKPRO64.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/arm64/RPI.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/riscv/GENERICSD.conf:MD_ARGS="-x 63 -y 255"
> > /usr/main-src/release/release.sh:               mdconfig -f ${IMGBASE##${CHROOTDIR}} ${MD_ARGS})
> > 
> > where:
> > 
> >     -x sectors/track
> >             See the description of the -y option below.
> > 
> >     -y heads/cylinder
> >             For malloc or vnode backed devices, the -x and -y options can be
> >             used to specify a synthetic geometry.  This is useful for
> >             constructing bootable images for later download to other devices.
> 
> I'm failing to reproduce the problem when I
> try my own commands on:
> 
> # uname -apKU # manual line split
> FreeBSD 13S-ufs 13.1-STABLE FreeBSD 13.1-STABLE #40
> stable/13-n251684-815db559eccc-dirty: Sat Jul  9 14:02:23 PDT 2022
> root@CA72_16Gp_ZFS:/usr/obj/BUILDs/13S-CA72-nodbg-clang/usr/13S-src/arm64.aarch64/sys/GENERIC-NODBG-CA72
> arm64 aarch64 1301505 1301505
> 
> I tried what it looks to me the /usr/src/release/
> code would do initially for arm64/RPI.conf (but with
> my file naming and an explicit -u0 style of use):
> 
> # truncate -s3072m mmjnk.test
> # mdconfig -u0 -fmmjnk.test -x63 -y255
> # gpart create -sMBR md0
> md0 created
> # gpart show md0
> =>     63  6291393  md0  MBR  (3.0G)
>        63  6291393       - free -  (3.0G)
> # gpart add -t'!12' -a512k -s50m -b1m md0
> md0s1 added
> # gpart show md0
> =>     63  6291393  md0  MBR  (3.0G)
>        63     1985       - free -  (993K)
>      2048   102400    1  fat32lba  (50M)
>    104448  6187008       - free -  (3.0G)
> 
> I tried the same sequence in a chroot into a 13.0-RELEASE-p11
> tree on an aarch64 main [so: 14] machine. I got the same result.
> 
> But such is not what the 13.1-RELEASE build produced, for
> example:
> 
> # mdconfig -u0 -fFreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img -x63 -y255
> # gpart show md0
> =>     63  6291393  md0  MBR  (3.0G)
>        63     2016       - free -  (1.0M)
>      2079   102312    1  fat32lba  [active]  (50M)
>    104391  6187041    2  freebsd  (3.0G)
>   6291432       24       - free -  (12K)
> 
> (There are no 13.1-STABLE snapshots available to download
> and look at.)
> 
> Looking at the recent 14.0-CURRENT snapshot:
> 
> # mdconfig -u0 -fFreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20220708-a0b956f5ac5-256605.img -x63 -y255
> # gpart show md0
> =>     63  6291393  md0  MBR  (3.0G)
>        63     2016       - free -  (1.0M)
>      2079   102312    1  fat32lba  [active]  (50M)
>    104391  6187041    2  freebsd  (3.0G)
>   6291432       24       - free -  (12K)
> 
> So, also not matching.
> 
> Is there something odd about the environment for official
> snapshot/release builds that leads to getting a different
> result? Possible lack of use of some of the modern
> /usr/src/release/ material to build the images? Some issue
> associated with amd64 -> aarch64 (or armv7 / armv6 / . . .)
> cross builds?
> 
> 
> 
> I've always thought that it was too bad that the build logs
> for release and snapshot builds were not publicly available.
> Multiple times I've wished I could see what a build failure
> or other oddity looked like in the snapshot build logs in
> order to see if I could track down part of what was leading
> to the failure(s)/oddities. (I may presume that there is more
> log output than is actually set up?)
> 
> ===
> Mark Millard
> marklmi at yahoo.com
> 
> 
> 
> 
> 
> 


It seems the image builder of aarch64 13-stable is disabled. 
https://ci.freebsd.org/job/FreeBSD-stable-13-aarch64-images/
Other architectures are enabled. 


Regards,
Ronald

------=_Part_2918_2130341816.1657613121106
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html><head></head><body><br /><p><small><strong>Van:</strong> Mark Millard &lt;marklmi@yahoo.com&gt;<br /><strong>Datum:</strong> 11 juli 2022 22:04<br /><strong>Aan:</strong> Warner Losh &lt;imp@bsdimp.com&gt;<br /><strong>CC:</strong> &quot;Rodney W. Grimes&quot; &lt;freebsd-rwg@gndrsh.dnsmgr.net&gt;, &quot;Dr. Rolf Jansen&quot; &lt;freebsd-rj@cyclaero.com&gt;, freebsd-arm &lt;freebsd-arm@freebsd.org&gt;<br /><strong>Onderwerp:</strong> Re: Partition layout of ARM SD card images<br /></small></p><blockquote style="margin-left: 5px; border-left: 3px solid #ccc; margin-right: 0px; padding-left: 5px;"><div class="MessageRFC822Viewer do_not_remove" id="P"><!-- P -->
<!-- processMimeMessage --><div class="TextPlainViewer do_not_remove" id="P.P"><!-- P.P -->On 2022-Jul-11, at 09:50, Mark Millard &lt;marklmi@yahoo.com&gt; wrote:<br />
<br />
&gt; On 2022-Jul-11, at 07:38, Warner Losh &lt;imp@bsdimp.com&gt; wrote:<br />
&gt; <br />
&gt;&gt; On Mon, Jul 11, 2022 at 8:31 AM Rodney W. Grimes &lt;freebsd-rwg@gndrsh.dnsmgr.net&gt; wrote:<br />
&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt; On 2022-Jul-10, at 14:34, Dr. Rolf Jansen &lt;freebsd-rj@cyclaero.com&gt; wrote:<br />
&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt; Am 10.07.2022 um 17:48 schrieb Mark Millard &lt;marklmi@yahoo.com&gt;:<br />
&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt; On 2022-Jul-10, at 12:26, Dr. Rolf Jansen &lt;freebsd-rj@cyclaero.com&gt; wrote:<br />
&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; For example let's have a llok on the partition layout of, FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img (the others are similar):<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; # mdconfig -a -u 0 -t vnode -f diskimg/FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; # gpart show md0 md0s2<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; =&gt; &nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;6291393 &nbsp;md0 &nbsp;MBR &nbsp;(3.0G)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;&nbsp;&nbsp;&nbsp;2016 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(1.0M)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;2079 &nbsp;&nbsp;102312 &nbsp;&nbsp;&nbsp;1 &nbsp;fat32lba &nbsp;[active] &nbsp;(50M)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp;104391 &nbsp;6187041 &nbsp;&nbsp;&nbsp;2 &nbsp;freebsd &nbsp;(3.0G)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;6291432 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;24 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(12K)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; =&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 &nbsp;6187041 &nbsp;md0s2 &nbsp;BSD &nbsp;(3.0G)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(29K)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57 &nbsp;6186880 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 &nbsp;freebsd-ufs &nbsp;(2.9G)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;6186937 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(52K)<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; The start of the fat32 boot slice s1 (containing the u-boot) stuff is neither aligned to 1M nor to 4k, it starts on an odd base. The start of the BSD payload slice s2 and its size are odd as well. The padding of 57 blocks within s2 lets the UFS partition start on a globally even base, namely 104391+57 = 104448, which as a matter of fact is 4k aligned (104448*512/4096 = 13056) and 1M aligned as well (104448*512/1024/1024 = 51), however all this keeps looking strange.<br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Are there reasons for this partition layout besides making it look more interesting? If yes, some insights would be good.<br />
&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt; The layout details are more specific to the aarch64 RPi* context<br />
&gt;&gt;&gt;&gt;&gt;&gt; than to general aarch64 SD card images. For example, the Rock64<br />
&gt;&gt;&gt;&gt;&gt;&gt; image is different:<br />
&gt;&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt;&gt; # mdconfig -a -u 0 -t vnode -f &nbsp;FreeBSD-14.0-CURRENT-arm64-aarch64-ROCK64-20220708-a0b956f5ac5-256605.img<br />
&gt;&gt;&gt;&gt;&gt;&gt; # gpart show md0<br />
&gt;&gt;&gt;&gt;&gt;&gt; =&gt; &nbsp;&nbsp;&nbsp;&nbsp;40 &nbsp;6291376 &nbsp;md0 &nbsp;GPT &nbsp;(3.0G)<br />
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;40 &nbsp;&nbsp;&nbsp;32728 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(16M)<br />
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;32768 &nbsp;&nbsp;102400 &nbsp;&nbsp;&nbsp;1 &nbsp;efi &nbsp;(50M)<br />
&gt;&gt;&gt;&gt;&gt;&gt; 135168 &nbsp;6156160 &nbsp;&nbsp;&nbsp;2 &nbsp;freebsd-ufs &nbsp;(2.9G)<br />
&gt;&gt;&gt;&gt;&gt;&gt; 6291328 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;88 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(44K)<br />
&gt;&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt;&gt; This is a GPT table, while the others are still MBR. Images which come with u-boot must have a different layout.<br />
&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt; I know it is a GPT table. That is part of the point about<br />
&gt;&gt;&gt;&gt; the variety of contexts that there are across the Small<br />
&gt;&gt;&gt;&gt; Board Computers.<br />
&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt; No SBC that has a U-Boot/whatever needing more space<br />
&gt;&gt;&gt;&gt; than is provided below is going to use the same<br />
&gt;&gt;&gt;&gt; 2079 figure:<br />
&gt;&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt; =&gt; &nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;??? &nbsp;md0 &nbsp;??? &nbsp;(?)<br />
&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;&nbsp;&nbsp;&nbsp;2016 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(1.0M)<br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; I read this thread.. and it keeps nagging me in<br />
&gt;&gt;&gt; the back of the head, I know this 2016 number.<br />
&gt;&gt;&gt; It is common when the sectors per track of a<br />
&gt;&gt;&gt; drive is reported as &quot;32&quot;, its an attempt to<br />
&gt;&gt;&gt; 1M align such a drive, is somehow the image<br />
&gt;&gt;&gt; creation code picking up 32 to do the align<br />
&gt;&gt;&gt; calculation wrongly on a 63 sector/track<br />
&gt;&gt;&gt; image?<br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;2079 &nbsp;&nbsp;?????? &nbsp;&nbsp;&nbsp;1 &nbsp;fat32lba &nbsp;[active] &nbsp;(?)<br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; The OP is correct, this is a horrid state of alignment<br />
&gt;&gt;&gt; and the cause should be tracked down and fixed! &nbsp;I<br />
&gt;&gt;&gt; can see no valid reason to have an approx<br />
&gt;&gt;&gt; 1MB free hole that causes this missalignment,<br />
&gt;&gt;&gt; that free hole should be (2048-63)=1985<br />
&gt;&gt; <br />
&gt;&gt; Yes, we should be aligning at a 1M or 2M boundary on the<br />
&gt;&gt; root device, not within the partition. The offsets are supposed<br />
&gt;&gt; to do that, and if there's a problem we should fix it.<br />
&gt;&gt; <br />
&gt;&gt;&gt; AHhhhh thought hits me... did the code get changed<br />
&gt;&gt;&gt; to make the images larger, and somehow the image<br />
&gt;&gt;&gt; creation code went from a 32 sector/track fake C/H/S<br />
&gt;&gt;&gt; to a 63 sector fake C/H/S, and the code has all<br />
&gt;&gt;&gt; along been assuming 32 sector/track drives?<br />
&gt;&gt;&gt; <br />
&gt;&gt; 63 sector for 'fake' C/H/S has been a thing since at least<br />
&gt;&gt; FreeBSD 6 and maybe a little longer. There's no cutover<br />
&gt;&gt; based on image size of the device. The older ATA code,<br />
&gt;&gt; pre-cam but post SOS rewrite, would try very hard to return<br />
&gt;&gt; the values from the underlying device that it reported. And that<br />
&gt;&gt; would lead to mismatches because it was different than the lies<br />
&gt;&gt; that md told by default. But that only mattered for really old<br />
&gt;&gt; BIOSes that couldn't handle LBA/packet mode in booting (which<br />
&gt;&gt; is the primary reason the old fdisk program could set the ending CHS<br />
&gt;&gt; of partitions since the FreeBSD code used that to guess the CHS<br />
&gt;&gt; of the drive itself in the absence of other information).<br />
&gt;&gt; <br />
&gt;&gt; I don't think the kernel has changed in this area in a very long time.<br />
&gt;&gt; At worse, we're seeing a mkimage bug.<br />
&gt;&gt; <br />
&gt;&gt; Warner<br />
&gt;&gt; <br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; MBR vs. GPT is not the fundamental issue for that.<br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; ===<br />
&gt;&gt;&gt; Mark Millard<br />
&gt;&gt;&gt; marklmi at yahoo.com<br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; <br />
&gt;&gt;&gt; -- <br />
&gt;&gt;&gt; Rod Grimes &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rgrimes@freebsd.org<br />
&gt;&gt;&gt; <br />
&gt;&gt; <br />
&gt; <br />
&gt; For reference:<br />
&gt; <br />
&gt; # grep -r MD_ARGS /usr/main-src/release/ | more<br />
&gt; /usr/main-src/release/arm/GENERICSD.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/arm/RPI-B.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/arm64/PINE64-LTS.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/arm64/PINE64.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/arm64/PINEBOOK.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/arm64/ROCK64.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/arm64/ROCKPRO64.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/arm64/RPI.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/riscv/GENERICSD.conf:MD_ARGS=&quot;-x 63 -y 255&quot;<br />
&gt; /usr/main-src/release/release.sh: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mdconfig -f ${IMGBASE##${CHROOTDIR}} ${MD_ARGS})<br />
&gt; <br />
&gt; where:<br />
&gt; <br />
&gt; &nbsp;&nbsp;&nbsp;&nbsp;-x sectors/track<br />
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See the description of the -y option below.<br />
&gt; <br />
&gt; &nbsp;&nbsp;&nbsp;&nbsp;-y heads/cylinder<br />
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For malloc or vnode backed devices, the -x and -y options can be<br />
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;used to specify a synthetic geometry. &nbsp;This is useful for<br />
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constructing bootable images for later download to other devices.<br />
<br />
I'm failing to reproduce the problem when I<br />
try my own commands on:<br />
<br />
# uname -apKU # manual line split<br />
FreeBSD 13S-ufs 13.1-STABLE FreeBSD 13.1-STABLE #40<br />
stable/13-n251684-815db559eccc-dirty: Sat Jul &nbsp;9 14:02:23 PDT 2022<br />
root@CA72_16Gp_ZFS:/usr/obj/BUILDs/13S-CA72-nodbg-clang/usr/13S-src/arm64.aarch64/sys/GENERIC-NODBG-CA72<br />
arm64 aarch64 1301505 1301505<br />
<br />
I tried what it looks to me the /usr/src/release/<br />
code would do initially for arm64/RPI.conf (but with<br />
my file naming and an explicit -u0 style of use):<br />
<br />
# truncate -s3072m mmjnk.test<br />
# mdconfig -u0 -fmmjnk.test -x63 -y255<br />
# gpart create -sMBR md0<br />
md0 created<br />
# gpart show md0<br />
=&gt; &nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;6291393 &nbsp;md0 &nbsp;MBR &nbsp;(3.0G)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;6291393 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(3.0G)<br />
# gpart add -t'!12' -a512k -s50m -b1m md0<br />
md0s1 added<br />
# gpart show md0<br />
=&gt; &nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;6291393 &nbsp;md0 &nbsp;MBR &nbsp;(3.0G)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;&nbsp;&nbsp;&nbsp;1985 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(993K)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2048 &nbsp;&nbsp;102400 &nbsp;&nbsp;&nbsp;1 &nbsp;fat32lba &nbsp;(50M)<br />
&nbsp;&nbsp;&nbsp;104448 &nbsp;6187008 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(3.0G)<br />
<br />
I tried the same sequence in a chroot into a 13.0-RELEASE-p11<br />
tree on an aarch64 main [so: 14] machine. I got the same result.<br />
<br />
But such is not what the 13.1-RELEASE build produced, for<br />
example:<br />
<br />
# mdconfig -u0 -fFreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img -x63 -y255<br />
# gpart show md0<br />
=&gt; &nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;6291393 &nbsp;md0 &nbsp;MBR &nbsp;(3.0G)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;&nbsp;&nbsp;&nbsp;2016 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(1.0M)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2079 &nbsp;&nbsp;102312 &nbsp;&nbsp;&nbsp;1 &nbsp;fat32lba &nbsp;[active] &nbsp;(50M)<br />
&nbsp;&nbsp;&nbsp;104391 &nbsp;6187041 &nbsp;&nbsp;&nbsp;2 &nbsp;freebsd &nbsp;(3.0G)<br />
&nbsp;&nbsp;6291432 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;24 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(12K)<br />
<br />
(There are no 13.1-STABLE snapshots available to download<br />
and look at.)<br />
<br />
Looking at the recent 14.0-CURRENT snapshot:<br />
<br />
# mdconfig -u0 -fFreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20220708-a0b956f5ac5-256605.img -x63 -y255<br />
# gpart show md0<br />
=&gt; &nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;6291393 &nbsp;md0 &nbsp;MBR &nbsp;(3.0G)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;63 &nbsp;&nbsp;&nbsp;&nbsp;2016 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(1.0M)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2079 &nbsp;&nbsp;102312 &nbsp;&nbsp;&nbsp;1 &nbsp;fat32lba &nbsp;[active] &nbsp;(50M)<br />
&nbsp;&nbsp;&nbsp;104391 &nbsp;6187041 &nbsp;&nbsp;&nbsp;2 &nbsp;freebsd &nbsp;(3.0G)<br />
&nbsp;&nbsp;6291432 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;24 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- free - &nbsp;(12K)<br />
<br />
So, also not matching.<br />
<br />
Is there something odd about the environment for official<br />
snapshot/release builds that leads to getting a different<br />
result? Possible lack of use of some of the modern<br />
/usr/src/release/ material to build the images? Some issue<br />
associated with amd64 -&gt; aarch64 (or armv7 / armv6 / . . .)<br />
cross builds?<br />
<br />
<br />
<br />
I've always thought that it was too bad that the build logs<br />
for release and snapshot builds were not publicly available.<br />
Multiple times I've wished I could see what a build failure<br />
or other oddity looked like in the snapshot build logs in<br />
order to see if I could track down part of what was leading<br />
to the failure(s)/oddities. (I may presume that there is more<br />
log output than is actually set up?)<br />
<br />
===<br />
Mark Millard<br />
marklmi at yahoo.com<br />
<br />
<br />
</div><!-- TextPlainViewer -->
<hr />
</div><!-- MessageRFC822Viewer -->
</blockquote><br /><br />It seems the image builder of aarch64 13-stable is disabled.&nbsp;<div><a href="https://ci.freebsd.org/job/FreeBSD-stable-13-aarch64-images/">https://ci.freebsd.org/job/FreeBSD-stable-13-aarch64-images/</a></div><div>Other architectures are enabled.&nbsp;</div><div><br /></div><div>Regards,</div><div>Ronald<br /><br /></div></body></html>
------=_Part_2918_2130341816.1657613121106--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1169617916.2919.1657613121111>