From owner-svn-src-all@FreeBSD.ORG Fri Nov 30 04:44:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F4DF7D6; Fri, 30 Nov 2012 04:44:32 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7392E8FC14; Fri, 30 Nov 2012 04:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAU4iWd3017659; Fri, 30 Nov 2012 04:44:32 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAU4iWQi017657; Fri, 30 Nov 2012 04:44:32 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201211300444.qAU4iWQi017657@svn.freebsd.org> From: Neel Natu Date: Fri, 30 Nov 2012 04:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243700 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 04:44:32 -0000 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;