Teach userboot to boot from ISO image files.

Reviewed by:	ae@, dfr@
Obtained from:	NetApp
This commit is contained in:
Neel Natu 2012-11-30 04:44:32 +00:00
parent 4f6c4eb93a
commit 8e2c4dfdb2
2 changed files with 7 additions and 4 deletions

View File

@ -57,6 +57,7 @@ struct devsw *devsw[] = {
struct fs_ops *file_system[] = {
&host_fsops,
&ufs_fsops,
&cd9660_fsops,
&gzipfs_fsops,
NULL
};

View File

@ -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;