+ *oflags = 0; /* Show that this is not network */
+
+#if CONFIG_KDP_INTERACTIVE_DEBUGGING
+ /* retrieve final ramdisk range and initialize KDP variables */
+ if (mdevgetrange(xchar, &kdp_core_ramdisk_addr, &kdp_core_ramdisk_size) != 0) {
+ IOLog("Unable to retrieve range for root memory device %d\n", xchar);
+ kdp_core_ramdisk_addr = 0;
+ kdp_core_ramdisk_size = 0;
+ }
+#endif
+
+ goto iofrootx; /* Join common exit... */
+ }
+ panic("IOFindBSDRoot: specified root memory device, %s, has not been configured\n", rdBootVar); /* Not there */
+ }
+ }
+
+ if ((!matching) && rdBootVar[0]) {
+ // by BSD name
+ look = rdBootVar;
+ if (look[0] == '*') {
+ look++;
+ }
+
+ if (strncmp( look, "en", strlen( "en" )) == 0) {
+ matching = IONetworkNamePrefixMatching( "en" );
+ needNetworkKexts = true;
+ } else if (strncmp( look, "uuid", strlen( "uuid" )) == 0) {
+ char *uuid;
+ OSString *uuidString;
+
+ uuid = (char *)IOMalloc( kMaxBootVar );
+
+ if (uuid) {
+ if (!PE_parse_boot_argn( "boot-uuid", uuid, kMaxBootVar )) {
+ panic( "rd=uuid but no boot-uuid=<value> specified" );
+ }
+ uuidString = OSString::withCString( uuid );
+ if (uuidString) {
+ IOService::publishResource( "boot-uuid", uuidString );
+ uuidString->release();
+ IOLog( "\nWaiting for boot volume with UUID %s\n", uuid );
+ matching = IOUUIDMatching();
+ mediaProperty = "boot-uuid-media";
+ }
+ IOFree( uuid, kMaxBootVar );
+ }
+ } else {
+ matching = IOBSDNameMatching( look );
+ }
+ }
+
+ if (!matching) {
+ OSString * astring;
+ // Match any HFS media
+
+ matching = IOService::serviceMatching( "IOMedia" );
+ astring = OSString::withCStringNoCopy("Apple_HFS");
+ if (astring) {
+ matching->setObject("Content", astring);
+ astring->release();
+ }
+ }
+
+ if (gIOKitDebug & kIOWaitQuietBeforeRoot) {
+ IOLog( "Waiting for matching to complete\n" );
+ IOService::getPlatform()->waitQuiet();
+ }
+
+ if (true && matching) {
+ OSSerialize * s = OSSerialize::withCapacity( 5 );
+
+ if (matching->serialize( s )) {
+ IOLog( "Waiting on %s\n", s->text());
+ s->release();
+ }
+ }
+
+ char namep[8];
+ if (needNetworkKexts
+ || PE_parse_boot_argn("-s", namep, sizeof(namep))) {
+ IOService::startDeferredMatches();
+ }
+
+ do {
+ t.tv_sec = ROOTDEVICETIMEOUT;
+ t.tv_nsec = 0;
+ matching->retain();
+ service = IOService::waitForService( matching, &t );
+ if ((!service) || (mountAttempts == 10)) {
+ PE_display_icon( 0, "noroot");
+ IOLog( "Still waiting for root device\n" );
+
+ if (!debugInfoPrintedOnce) {
+ debugInfoPrintedOnce = true;
+ if (gIOKitDebug & kIOLogDTree) {
+ IOLog("\nDT plane:\n");
+ IOPrintPlane( gIODTPlane );
+ }
+ if (gIOKitDebug & kIOLogServiceTree) {
+ IOLog("\nService plane:\n");
+ IOPrintPlane( gIOServicePlane );
+ }
+ if (gIOKitDebug & kIOLogMemory) {
+ IOPrintMemory();
+ }