From 8e2c4dfdb2aa53333156b04ad46a49f4cb6ba613 Mon Sep 17 00:00:00 2001 From: Neel Natu Date: Fri, 30 Nov 2012 04:44:32 +0000 Subject: [PATCH] Teach userboot to boot from ISO image files. Reviewed by: ae@, dfr@ Obtained from: NetApp --- sys/boot/userboot/userboot/conf.c | 1 + sys/boot/userboot/userboot/main.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/boot/userboot/userboot/conf.c b/sys/boot/userboot/userboot/conf.c index 0c57eba4d25..2a98434ec23 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 4092b9b6e8b..b9b133720e7 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;