Page MenuHomeFreeBSD

powerpc: fix release image building for Apple partitions
ClosedPublic

Authored by adrian on Sun, Jan 11, 4:06 AM.
Referenced Files
F141964535: D54639.diff
Wed, Jan 14, 6:32 AM
Unknown Object (File)
Tue, Jan 13, 11:15 PM
Unknown Object (File)
Tue, Jan 13, 12:45 PM
Unknown Object (File)
Sun, Jan 11, 7:54 PM
Unknown Object (File)
Sun, Jan 11, 1:03 PM
Unknown Object (File)
Sun, Jan 11, 10:50 AM
Unknown Object (File)
Sun, Jan 11, 10:16 AM
Unknown Object (File)
Sun, Jan 11, 8:46 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 69789
Build 66672: arc lint + arc unit

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.Sun, Jan 11, 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