summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2012-11-30 04:44:32 +0000
committerneel <neel@FreeBSD.org>2012-11-30 04:44:32 +0000
commit82060712efbe2e4ac18d2855231ce427da90c31b (patch)
tree223380edcf596484952ea30d095acac9d072b475
parent2afe31052cd5af15e541c153558bced79e9ccc0a (diff)
downloadFreeBSD-src-82060712efbe2e4ac18d2855231ce427da90c31b.zip
FreeBSD-src-82060712efbe2e4ac18d2855231ce427da90c31b.tar.gz
Teach userboot to boot from ISO image files.
Reviewed by: ae@, dfr@ Obtained from: NetApp
-rw-r--r--sys/boot/userboot/userboot/conf.c1
-rw-r--r--sys/boot/userboot/userboot/main.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/boot/userboot/userboot/conf.c b/sys/boot/userboot/userboot/conf.c
index 0c57eba..2a98434 100644
--- a/sys/boot/userboot/userboot/conf.c
+++ b/sys/boot/userboot/userboot/conf.c
@@ -57,6 +57,7 @@ struct devsw *devsw[] = {
struct fs_ops *file_system[] = {
&host_fsops,
&ufs_fsops,
+ &cd9660_fsops,
&gzipfs_fsops,
NULL
};
diff --git a/sys/boot/userboot/userboot/main.c b/sys/boot/userboot/userboot/main.c
index 4092b9b..b9b1337 100644
--- a/sys/boot/userboot/userboot/main.c
+++ b/sys/boot/userboot/userboot/main.c
@@ -153,11 +153,13 @@ extract_currdev(void)
dev.d_slice = 0;
dev.d_partition = 0;
/*
- * Figure out if we are using MBR or GPT - for GPT we
- * set the partition to 0 since everything is a GPT slice.
+ * If we cannot auto-detect the partition type then
+ * access the disk as a raw device.
*/
- if (dev.d_dev->dv_open(NULL, &dev))
- dev.d_partition = 255;
+ if (dev.d_dev->dv_open(NULL, &dev)) {
+ dev.d_slice = -1;
+ dev.d_partition = -1;
+ }
} else {
dev.d_dev = &host_dev;
dev.d_type = dev.d_dev->dv_type;
OpenPOWER on IntegriCloud