Page MenuHomeFreeBSD

powerpc: fix release image building for Apple partitions
ClosedPublic

Authored by adrian on Jan 11 2026, 4:06 AM.
Referenced Files
F165048294: D54639.id169458.diff
Wed, Aug 5, 1:34 PM
Unknown Object (File)
Tue, Aug 4, 5:40 AM
Unknown Object (File)
Tue, Aug 4, 5:08 AM
Unknown Object (File)
Sat, Aug 1, 4:07 AM
Unknown Object (File)
Thu, Jul 30, 8:35 AM
Unknown Object (File)
Sun, Jul 26, 7:36 AM
Unknown Object (File)
Wed, Jul 22, 12:00 AM
Unknown Object (File)
Mon, Jul 20, 3:56 PM

Details

Summary

awk changed somewhere between 14 and 15 and it stopped accepting
a hexadecimal number as its input - it will always return 0.
This results in a very badly written apple boot block.

PR: kern/292341

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

adrian added reviewers: jhibbits, imp.
adrian added a project: PowerPC.

(no changes planned, please review!)

Impressive

release/powerpc/mkisoimages.sh
79–80

I think you could combine these lines, so OFFSET=$(printf "%d" 0x${OFFSET} | awk '{printf("%x\n",$1/512);}').

But, also, the awk change looks to be a pretty significant bug, and should be fixed, too.

release/powerpc/mkisoimages.sh
78

Yes, upstream awk changed. I thought I'd found all the places.

Just add OFFSET= $(( 0x${OFFSET} / 512 )) as the next line. you don't need awk for any of this.

option #2, thanks warner! this is cleaner!

You could combine the two lines too by

OFFSET=$((0x$(hd...) ))

I can make the case both ways... so either is fine for me.

This revision is now accepted and ready to land.Jan 11 2026, 7:00 AM
In D54639#1248394, @imp wrote:

You could combine the two lines too by

OFFSET=$((0x$(hd...) ))

yeah but then it wraps, so it's not shorter per se :-) heh