How to get 'IOPlatformUUID' on OS X 10.4?

I need to get UUID value on 10.4 but the command seems not to be supported here.

ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }'

Above command is working fine on 10.5. Is this not supported on 10.4?

Also I am trying to fetch UUID using below code on 10.4, which is also not working:

void vlm getSystemUUIDMAC(char * uuid, int bufSize)
{
io registry_entryt ioRegistryRoot = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
CFStringRef uuidCf = (CFStringRef) IORegistryEntryCreateCFProperty(ioRegistryRoot, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
IOObjectRelease(ioRegistryRoot);
CFStringGetCString(uuidCf, uuid, bufSize, kCFStringEncodingMacRoman);
CFRelease(uuidCf);
}


And the above code executes well on 10.5.

Any help would be appreciated.

iMac, Mac OS X (10.4.10)

Posted on Mar 28, 2011 10:41 PM

Reply
2 replies

Mar 31, 2011 9:47 AM in response to ankur17

Hi ankur17, and a warm welcome to the forums! 🙂

I was hoping somebody could answer that here, but I guess not.

Xcode 3.x automatically adds a UUID load command to the executable file inside your kernel extension. However, the kernel linker in Mac OS X 10.4.x on PowerPC-based systems doesn't know how to handle this UUID load command, so the linker rejects the load request.

You can work around this by adding -Xlinker -no_uuid to the Other Linker Flags build setting for the PowerPC side only of your kext using the following steps.


http://developer.apple.com/library/mac/#qa/qa1628/_index.html

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to get 'IOPlatformUUID' on OS X 10.4?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.