summaryrefslogtreecommitdiffstats
path: root/sys/boot/sparc64/loader/main.c
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-11-10 19:17:36 +0000
committerjake <jake@FreeBSD.org>2002-11-10 19:17:36 +0000
commit73d398d702d8489985977353b7f67aaabb9d840c (patch)
treeafef4c9c5cb095c3438e4a1874a05286c64fec0e /sys/boot/sparc64/loader/main.c
parent1ff96af1eab5b5285540c2bb95862f1687e10252 (diff)
downloadFreeBSD-src-73d398d702d8489985977353b7f67aaabb9d840c.zip
FreeBSD-src-73d398d702d8489985977353b7f67aaabb9d840c.tar.gz
Change the device path representation in libofw to use the full firmware
path, instead of an internal i386 specific one. Don't try to interpret a disklabel in ofw_disk.c, open the partition's device node directly and let the firmware do it. This fixes booting from a partition other than 'a' on sparc64, which is needed to support more installation methods. No objection: ppc
Diffstat (limited to 'sys/boot/sparc64/loader/main.c')
-rw-r--r--sys/boot/sparc64/loader/main.c52
1 files changed, 17 insertions, 35 deletions
diff --git a/sys/boot/sparc64/loader/main.c b/sys/boot/sparc64/loader/main.c
index 43e3c77..3354bc2 100644
--- a/sys/boot/sparc64/loader/main.c
+++ b/sys/boot/sparc64/loader/main.c
@@ -75,7 +75,6 @@ vm_offset_t heapva;
phandle_t pmemh; /* OFW memory handle */
struct memory_slice memslices[18];
-struct ofw_devdesc bootdev;
/*
* Machine dependent structures that the machine independent
@@ -368,9 +367,6 @@ main(int (*openfirm)(void *))
archsw.arch_copyout = ofw_copyout;
archsw.arch_readin = sparc64_readin;
archsw.arch_autoload = sparc64_autoload;
-#ifdef ELF_CRC32
- archsw.arch_crc32 = sparc64_crc32;
-#endif
init_heap();
setheap((void *)heapva, (void *)(heapva + HEAPSZ));
@@ -398,46 +394,32 @@ main(int (*openfirm)(void *))
chosenh = OF_finddevice("/chosen");
OF_getprop(chosenh, "bootpath", bootpath, sizeof(bootpath));
- bootdev.d_type = ofw_devicetype(bootpath);
- switch (bootdev.d_type) {
- case DEVT_DISK:
- bootdev.d_dev = &ofwdisk;
- /*
- * Sun compatible bootable CD-ROMs have a disk label placed
- * before the cd9660 data, with the actual filesystem being
- * in the first partition, while the other partitions contain
- * pseudo disk labels with embedded boot blocks for different
- * architectures, which may be followed by UFS filesystems.
- * The firmware will set the boot path to the partition it
- * boots from ('f' in the sun4u case), but we want the kernel
- * to be loaded from the cd9660 fs ('a'), so the boot path
- * needs to be altered.
- */
- if (strstr(bootpath, "cdrom") != NULL &&
- bootpath[strlen(bootpath) - 2] == ':') {
- bootpath[strlen(bootpath) - 1] = 'a';
- printf("Boot path set to %s\n", bootpath);
- }
- strncpy(bootdev.d_kind.ofwdisk.path, bootpath, 64);
- ofw_parseofwdev(&bootdev, bootpath);
- break;
- case DEVT_NET:
- bootdev.d_dev = &netdev;
- strncpy(bootdev.d_kind.netif.path, bootpath, 64);
- bootdev.d_kind.netif.unit = 0;
- break;
+ /*
+ * Sun compatible bootable CD-ROMs have a disk label placed
+ * before the cd9660 data, with the actual filesystem being
+ * in the first partition, while the other partitions contain
+ * pseudo disk labels with embedded boot blocks for different
+ * architectures, which may be followed by UFS filesystems.
+ * The firmware will set the boot path to the partition it
+ * boots from ('f' in the sun4u case), but we want the kernel
+ * to be loaded from the cd9660 fs ('a'), so the boot path
+ * needs to be altered.
+ */
+ if (bootpath[strlen(bootpath) - 2] == ':' &&
+ bootpath[strlen(bootpath) - 1] == 'f') {
+ bootpath[strlen(bootpath) - 1] = 'a';
+ printf("Boot path set to %s\n", bootpath);
}
- env_setenv("currdev", EV_VOLATILE, ofw_fmtdev(&bootdev),
+ env_setenv("currdev", EV_VOLATILE, bootpath,
ofw_setcurrdev, env_nounset);
- env_setenv("loaddev", EV_VOLATILE, ofw_fmtdev(&bootdev),
+ env_setenv("loaddev", EV_VOLATILE, bootpath,
env_noset, env_nounset);
printf("\n");
printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
printf("(%s, %s)\n", bootprog_maker, bootprog_date);
printf("bootpath=\"%s\"\n", bootpath);
- printf("loaddev=%s\n", getenv("loaddev"));
/* Give control to the machine independent loader code. */
interact();
OpenPOWER on IntegriCloud