Page MenuHomeFreeBSD

powerpc: fix release image building for Apple partitions
ClosedPublic

Authored by adrian on Jan 11 2026, 4:06 AM.
Referenced Files
F154392497: D54639.diff
Tue, Apr 28, 7:42 AM
Unknown Object (File)
Sat, Apr 25, 8:57 AM
Unknown Object (File)
Mon, Apr 20, 7:31 AM
Unknown Object (File)
Fri, Apr 17, 12:59 PM
Unknown Object (File)
Wed, Apr 15, 12:09 AM
Unknown Object (File)
Wed, Apr 8, 1:49 AM
Unknown Object (File)
Tue, Apr 7, 4:39 PM
Unknown Object (File)
Sun, Apr 5, 12:23 AM

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