diff options
author | tmm <tmm@FreeBSD.org> | 2002-04-01 23:28:35 +0000 |
---|---|---|
committer | tmm <tmm@FreeBSD.org> | 2002-04-01 23:28:35 +0000 |
commit | a683bcc9224326e9d7bbf72dc76abaefe8a1d62b (patch) | |
tree | 7ff17c6b2efa2cb47fad801a7aaffc19411dd542 /sys/boot/sparc64/loader/main.c | |
parent | 7151c10d96675a4f82abd58a8a08ee3b6a8234a6 (diff) | |
download | FreeBSD-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/sparc64/loader/main.c')
-rw-r--r-- | sys/boot/sparc64/loader/main.c | 19 |
1 files changed, 19 insertions, 0 deletions
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; |