vfs_mount.c (93467) | vfs_mount.c (94936) |
---|---|
1/*- 2 * Copyright (c) 1999 Michael Smith 3 * All rights reserved. 4 * Copyright (c) 1999 Poul-Henning Kamp 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1999 Michael Smith 3 * All rights reserved. 4 * Copyright (c) 1999 Poul-Henning Kamp 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/kern/vfs_mount.c 93467 2002-03-31 07:15:28Z phk $ | 28 * $FreeBSD: head/sys/kern/vfs_mount.c 94936 2002-04-17 13:06:36Z mux $ |
29 */ 30 31/* 32 * Locate and mount the root filesystem. 33 * 34 * The root filesystem is detailed in the kernel environment variable 35 * vfs.root.mountfrom, which is expected to be in the general format 36 * --- 60 unchanged lines hidden (view full) --- 97dev_t rootdev = NODEV; 98 99/* 100 * Find and mount the root filesystem 101 */ 102void 103vfs_mountroot(void *foo __unused) 104{ | 29 */ 30 31/* 32 * Locate and mount the root filesystem. 33 * 34 * The root filesystem is detailed in the kernel environment variable 35 * vfs.root.mountfrom, which is expected to be in the general format 36 * --- 60 unchanged lines hidden (view full) --- 97dev_t rootdev = NODEV; 98 99/* 100 * Find and mount the root filesystem 101 */ 102void 103vfs_mountroot(void *foo __unused) 104{ |
105 int i; | 105 char *cp; 106 int i, error; |
106 107 /* 108 * The root filesystem information is compiled in, and we are 109 * booted with instructions to use it. 110 */ 111#ifdef ROOTDEVNAME 112 if ((boothowto & RB_DFLTROOT) && 113 !vfs_mountroot_try(ROOTDEVNAME)) --- 20 unchanged lines hidden (view full) --- 134 } 135 } 136 137 /* 138 * Try to use the value read by the loader from /etc/fstab, or 139 * supplied via some other means. This is the preferred 140 * mechanism. 141 */ | 107 108 /* 109 * The root filesystem information is compiled in, and we are 110 * booted with instructions to use it. 111 */ 112#ifdef ROOTDEVNAME 113 if ((boothowto & RB_DFLTROOT) && 114 !vfs_mountroot_try(ROOTDEVNAME)) --- 20 unchanged lines hidden (view full) --- 135 } 136 } 137 138 /* 139 * Try to use the value read by the loader from /etc/fstab, or 140 * supplied via some other means. This is the preferred 141 * mechanism. 142 */ |
142 if (!vfs_mountroot_try(getenv("vfs.root.mountfrom"))) 143 return; | 143 if ((cp = getenv("vfs.root.mountfrom")) != NULL) { 144 error = vfs_mountroot_try(cp); 145 freeenv(cp); 146 if (!error) 147 return; 148 } |
144 145 /* 146 * Try values that may have been computed by the machine-dependant 147 * legacy code. 148 */ 149 if (!vfs_mountroot_try(rootdevnames[0])) 150 return; 151 if (!vfs_mountroot_try(rootdevnames[1])) --- 240 unchanged lines hidden --- | 149 150 /* 151 * Try values that may have been computed by the machine-dependant 152 * legacy code. 153 */ 154 if (!vfs_mountroot_try(rootdevnames[0])) 155 return; 156 if (!vfs_mountroot_try(rootdevnames[1])) --- 240 unchanged lines hidden --- |