summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2002-04-01 23:28:35 +0000
committertmm <tmm@FreeBSD.org>2002-04-01 23:28:35 +0000
commita683bcc9224326e9d7bbf72dc76abaefe8a1d62b (patch)
tree7ff17c6b2efa2cb47fad801a7aaffc19411dd542 /sys/boot
parent7151c10d96675a4f82abd58a8a08ee3b6a8234a6 (diff)
downloadFreeBSD-src-a683bcc9224326e9d7bbf72dc76abaefe8a1d62b.zip
FreeBSD-src-a683bcc9224326e9d7bbf72dc76abaefe8a1d62b.tar.gz
Add support for booting from CD-ROM. Make it possible to enable UFS
support using make arguments.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/sparc64/loader/Makefile8
-rw-r--r--sys/boot/sparc64/loader/main.c19
2 files changed, 27 insertions, 0 deletions
diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile
index 64e686b..0fda8d4 100644
--- a/sys/boot/sparc64/loader/Makefile
+++ b/sys/boot/sparc64/loader/Makefile
@@ -7,6 +7,8 @@ NEWVERSWHAT= "bootstrap loader" sparc64
CFLAGS= -mno-app-regs
LOADER_DISK_SUPPORT?= no
+LOADER_UFS_SUPPORT?= no
+LOADER_CD9660_SUPPORT?= no
LOADER_NET_SUPPORT?= yes
LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= yes
@@ -14,6 +16,12 @@ LOADER_TFTP_SUPPORT?= yes
.if ${LOADER_DISK_SUPPORT} == "yes"
CFLAGS+= -DLOADER_DISK_SUPPORT
.endif
+.if ${LOADER_UFS_SUPPORT} == "yes"
+CFLAGS+= -DLOADER_UFS_SUPPORT
+.endif
+.if ${LOADER_CD9660_SUPPORT} == "yes"
+CFLAGS+= -DLOADER_CD9660_SUPPORT
+.endif
.if ${LOADER_NET_SUPPORT} == "yes"
CFLAGS+= -DLOADER_NET_SUPPORT
.endif
diff --git a/sys/boot/sparc64/loader/main.c b/sys/boot/sparc64/loader/main.c
index 406de39..b85286b 100644
--- a/sys/boot/sparc64/loader/main.c
+++ b/sys/boot/sparc64/loader/main.c
@@ -105,6 +105,9 @@ struct fs_ops *file_system[] = {
#ifdef LOADER_UFS_SUPPORT
&ufs_fsops,
#endif
+#ifdef LOADER_CD9660_SUPPORT
+ &cd9660_fsops,
+#endif
#ifdef LOADER_NET_SUPPORT
&nfs_fsops,
#endif
@@ -388,6 +391,22 @@ main(int (*openfirm)(void *))
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 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 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;
OpenPOWER on IntegriCloud