svn commit: r243700 - head/sys/boot/userboot/userboot

Neel Natu neel at FreeBSD.org
Fri Nov 30 04:44:32 UTC 2012


Author: neel
Date: Fri Nov 30 04:44:32 2012
New Revision: 243700
URL: http://svnweb.freebsd.org/changeset/base/243700

Log:
  Teach userboot to boot from ISO image files.
  
  Reviewed by:	ae@, dfr@
  Obtained from:	NetApp

Modified:
  head/sys/boot/userboot/userboot/conf.c
  head/sys/boot/userboot/userboot/main.c

Modified: head/sys/boot/userboot/userboot/conf.c
==============================================================================
--- head/sys/boot/userboot/userboot/conf.c	Fri Nov 30 03:48:45 2012	(r243699)
+++ head/sys/boot/userboot/userboot/conf.c	Fri Nov 30 04:44:32 2012	(r243700)
@@ -57,6 +57,7 @@ struct devsw *devsw[] = {
 struct fs_ops *file_system[] = {
 	&host_fsops,
 	&ufs_fsops,
+	&cd9660_fsops,
 	&gzipfs_fsops,
 	NULL
 };

Modified: head/sys/boot/userboot/userboot/main.c
==============================================================================
--- head/sys/boot/userboot/userboot/main.c	Fri Nov 30 03:48:45 2012	(r243699)
+++ head/sys/boot/userboot/userboot/main.c	Fri Nov 30 04:44:32 2012	(r243700)
@@ -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;


More information about the svn-src-all mailing list