summaryrefslogtreecommitdiffstats
path: root/sys/boot/sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/sparc64')
-rw-r--r--sys/boot/sparc64/loader/main.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/sys/boot/sparc64/loader/main.c b/sys/boot/sparc64/loader/main.c
index 5a0badf..1cdcaee 100644
--- a/sys/boot/sparc64/loader/main.c
+++ b/sys/boot/sparc64/loader/main.c
@@ -160,17 +160,19 @@ struct devsw *devsw[] = {
#ifdef LOADER_ZFS_SUPPORT
&zfs_dev,
#endif
- 0
+ NULL
};
+
struct arch_switch archsw;
static struct file_format sparc64_elf = {
__elfN(loadfile),
__elfN(exec)
};
+
struct file_format *file_formats[] = {
&sparc64_elf,
- 0
+ NULL
};
struct fs_ops *file_system[] = {
@@ -198,19 +200,20 @@ struct fs_ops *file_system[] = {
#ifdef LOADER_TFTP_SUPPORT
&tftp_fsops,
#endif
- 0
+ NULL
};
+
struct netif_driver *netif_drivers[] = {
#ifdef LOADER_NET_SUPPORT
&ofwnet,
#endif
- 0
+ NULL
};
extern struct console ofwconsole;
struct console *consoles[] = {
&ofwconsole,
- 0
+ NULL
};
#ifdef LOADER_DEBUG
@@ -854,24 +857,6 @@ main(int (*openfirm)(void *))
OF_getprop(chosen, "bootpath", bootpath, sizeof(bootpath));
/*
- * 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' &&
- strstr(bootpath, "cdrom") != NULL) {
- bootpath[strlen(bootpath) - 1] = 'a';
- printf("Boot path set to %s\n", bootpath);
- }
-
- /*
* Initialize devices.
*/
for (dp = devsw; *dp != 0; dp++)
@@ -883,9 +868,24 @@ main(int (*openfirm)(void *))
(void)strncpy(bootpath, zfs_fmtdev(&zfs_currdev),
sizeof(bootpath) - 1);
bootpath[sizeof(bootpath) - 1] = '\0';
- }
+ } else
#endif
+ /*
+ * Sun compatible bootable CD-ROMs have a disk label placed before
+ * the ISO 9660 data, with the actual file system 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 file systems.
+ * The firmware will set the boot path to the partition it boots from
+ * ('f' in the sun4u/sun4v case), but we want the kernel to be loaded
+ * from the ISO 9660 file system ('a'), so the boot path needs to be
+ * altered.
+ */
+ if (bootpath[strlen(bootpath) - 2] == ':' &&
+ bootpath[strlen(bootpath) - 1] == 'f')
+ bootpath[strlen(bootpath) - 1] = 'a';
+
env_setenv("currdev", EV_VOLATILE, bootpath,
ofw_setcurrdev, env_nounset);
env_setenv("loaddev", EV_VOLATILE, bootpath,
OpenPOWER on IntegriCloud