+ prom_get_chosen("bootpath", bootdevice, sizeof(bootdevice));
+ DEBUG_F("/chosen/bootpath = %s\n", bootdevice);
+ if (bootdevice[0] == 0)
+ prom_get_options("boot-device", bootdevice, sizeof(bootdevice));
+ if (bootdevice[0] == 0) {
+ prom_printf("Couldn't determine boot device\n");
+ return -1;
+ }
+
+ if (!parse_device_path(bootdevice, (_machine == _MACH_Pmac) ? "hd" : "disc",
+ -1, "", &boot)) {
+ prom_printf("%s: Unable to parse\n", bootdevice);
+ return -1;
+ }
+ DEBUG_F("After parse_device_path: dev=%s, part=%d, file=%s\n",
+ boot.dev, boot.part, boot.file);
+
+ if (strlen(boot.file)) {
+ if (!strncmp(boot.file, "\\\\", 2))
+ boot.file = "\\\\";
+ else {
+ char *p, *last;
+ p = last = boot.file;
+ while(*p) {
+ if (*p == '\\')
+ last = p;
+ p++;
+ }
+ if (p)
+ *(last) = 0;
+ else
+ boot.file = "";
+ if (strlen(boot.file))
+ strcat(boot.file, "\\");
+ }
+ }
+ DEBUG_F("After path fixup: dev=%s, part=%d, file=%s\n",
+ boot.dev, boot.part, boot.file);
+
+ useconf = load_config_file(boot.dev, boot.file, boot.part);
+
+ prom_printf("Welcome to yaboot version " VERSION "\n");
+ prom_printf("Enter \"help\" to get some basic usage information\n");
+
+ /* I am fed up with lusers using the wrong partition type and
+ mailing me *when* it breaks */
+
+ if (_machine == _MACH_Pmac) {
+ char *entry = cfg_get_strg(0, "ptypewarning");
+ int warn = 1;
+ if (entry)
+ warn = strcmp(entry,
+ "I_know_the_partition_type_is_wrong_and_will_NOT_send_mail_when_booting_breaks");
+ if (warn) {
+ ptype = get_part_type(boot.dev, boot.part);
+ if ((ptype != NULL) && (strcmp(ptype, "Apple_Bootstrap")))
+ prom_printf("\nWARNING: Bootstrap partition type is wrong: \"%s\"\n"
+ " type should be: \"Apple_Bootstrap\"\n\n", ptype);
+ }
+ }
+
+ yaboot_text_ui();