Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Nov 2012 04:44:32 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243700 - head/sys/boot/userboot/userboot
Message-ID:  <201211300444.qAU4iWQi017657@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211300444.qAU4iWQi017657>