Re: git: 1dfcff294e44 - main - release: increase IMAGE_SIZE for arm, arm64, riscv [odd alignment for SBC images]

From: Warner Losh <imp_at_bsdimp.com>
Date: Tue, 19 Jul 2022 22:45:13 UTC
On Tue, Jul 19, 2022, 2:42 PM Glen Barber <gjb@freebsd.org> wrote:

> On Tue, Jul 19, 2022 at 04:35:36PM -0400, Ed Maste wrote:
> > On Sun, 17 Jul 2022 at 13:08, Rodney W. Grimes
> > <freebsd-rwg@gndrsh.dnsmgr.net> wrote:
> >
> > > Perhaps an assert for kern.geom.part.mbr.enforce_chs not
> > > being zero in /usr/src/release scripts is in order so that
> > > the builds blow up rather than produce BAD images.
> >
> > This is a good interim step (before switching to mkimg).
> >
> > Perhaps:
> >
> > diff --git a/release/tools/arm.subr b/release/tools/arm.subr
> > index 77b708bca4a2..94e0ee89deaf 100644
> > --- a/release/tools/arm.subr
> > +++ b/release/tools/arm.subr
> > @@ -62,6 +62,10 @@ umount_loop() {
> >  }
> >
> >  arm_create_disk() {
> > +       if [ $(sysctl -n kern.geom.part.mbr.enforce_chs) != 0 ]; then
> > +               return 1
> > +       fi
> > +
> >         # Create the target raw file and temporary work directory.
> >         chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev}
> >         if [ "${PART_SCHEME}" = "GPT" ]; then
> >
>
> My concern with this is kern.geom.part.mbr.enforce_chs is always '1' on
> the builders, which effectively means all arm builds will fail every
> time.  I think we need to get to the actual root of the problem here,
> versus applying band-aids to a shark bite.
>

I think this is the actual problem. While such pedantry can be useful for
ancient picky BIOSes, these days only the LBA fields of the MBR are used.
And the fake BIOS geometry is crazy weird. We can likely tweak it to be
more friendly.

Why is it == 1 on the builder? If people want things aligned gpart has an
option for years iirc to do that. And we want that off for the builds.

Warner

P.s. the last BIOS that I had to deal with where this mattered was a 133MHz
pentium PC104 board in 2002 or 2003.

>