mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Removed ROOTSLICE_HUNT. The root device is now found better by
getvfsent() in most cases. (The main exception is when /etc/fstab still hasn't been converted to use a slice for the root device, the root device is a SCSI device, and the /dev/sd* inode for this device still hasn't been renamed to /dev/da*.)
This commit is contained in:
parent
b5be346ff7
commit
ba2f0650b6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42438
|
@ -1,12 +1,9 @@
|
|||
# @(#)Makefile 8.6 (Berkeley) 5/8/95
|
||||
# $Id: Makefile,v 1.6 1998/01/20 10:39:57 bde Exp $
|
||||
# $Id: Makefile,v 1.7 1998/03/08 14:50:00 msmith Exp $
|
||||
|
||||
PROG= mount
|
||||
SRCS= mount.c mount_ufs.c getmntopts.c vfslist.c
|
||||
MAN8= mount.8
|
||||
# We do NOT install the getmntopts.3 man page.
|
||||
|
||||
# We support the ROOTSLICE_HUNT hack
|
||||
CFLAGS+=-DROOTSLICE_HUNT
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
|
|
@ -42,7 +42,7 @@ static const char copyright[] =
|
|||
static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: mount_ufs.c,v 1.14 1998/07/06 07:12:38 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -80,10 +80,6 @@ mount_ufs(argc, argv)
|
|||
char *fs_name;
|
||||
struct vfsconf vfc;
|
||||
int error = 0;
|
||||
#ifdef ROOTSLICE_HUNT
|
||||
int slice, result, unit;
|
||||
char part, devbuf[MAXPATHLEN], devpfx[MAXPATHLEN];
|
||||
#endif
|
||||
|
||||
mntflags = 0;
|
||||
optind = optreset = 1; /* Reset for parse of new argv. */
|
||||
|
@ -125,36 +121,8 @@ mount_ufs(argc, argv)
|
|||
warnx("ufs filesystem is not available");
|
||||
return (1);
|
||||
}
|
||||
#ifdef ROOTSLICE_HUNT
|
||||
result = -1;
|
||||
/*
|
||||
* If we are mounting root, and we have a mount of something that
|
||||
* might be the compatibility slice, try mounting other slices
|
||||
* first. If the kernel has done the right thing and mounted
|
||||
* the slice because the disk is really sliced, this will find
|
||||
* the real root filesystem. If not, we'll try what was supplied.
|
||||
*/
|
||||
if (!strcmp(fs_name, "/") &&
|
||||
(sscanf(args.fspec, "%[^0-9]%d%c", devpfx, &unit, &part) == 3) &&
|
||||
(part >= 'a') &&
|
||||
(part <= 'h')) {
|
||||
for (slice = 1; (slice < 32) && (result < 0); slice++) {
|
||||
sprintf(devbuf, "%s%ds%d%c",
|
||||
devpfx, unit, slice, part);
|
||||
args.fspec = devbuf;
|
||||
result = mount(vfc.vfc_name, fs_name, mntflags, &args);
|
||||
}
|
||||
args.fspec = argv[0];
|
||||
}
|
||||
if (result == 0)
|
||||
warnx("*** update /etc/fstab entry for %s to use %s ***",
|
||||
fs_name, devbuf);
|
||||
/* Try the mount as originally requested */
|
||||
if ((result < 0) &&
|
||||
(mount(vfc.vfc_name, fs_name, mntflags, &args) < 0)) {
|
||||
#else
|
||||
|
||||
if (mount(vfc.vfc_name, fs_name, mntflags, &args) < 0) {
|
||||
#endif
|
||||
switch (errno) {
|
||||
case EMFILE:
|
||||
warnx("%s on %s: mount table full",
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
# @(#)Makefile 8.6 (Berkeley) 5/8/95
|
||||
# $Id: Makefile,v 1.6 1998/01/20 10:39:57 bde Exp $
|
||||
# $Id: Makefile,v 1.7 1998/03/08 14:50:00 msmith Exp $
|
||||
|
||||
PROG= mount
|
||||
SRCS= mount.c mount_ufs.c getmntopts.c vfslist.c
|
||||
MAN8= mount.8
|
||||
# We do NOT install the getmntopts.3 man page.
|
||||
|
||||
# We support the ROOTSLICE_HUNT hack
|
||||
CFLAGS+=-DROOTSLICE_HUNT
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
|
|
@ -42,7 +42,7 @@ static const char copyright[] =
|
|||
static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: mount_ufs.c,v 1.14 1998/07/06 07:12:38 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -80,10 +80,6 @@ mount_ufs(argc, argv)
|
|||
char *fs_name;
|
||||
struct vfsconf vfc;
|
||||
int error = 0;
|
||||
#ifdef ROOTSLICE_HUNT
|
||||
int slice, result, unit;
|
||||
char part, devbuf[MAXPATHLEN], devpfx[MAXPATHLEN];
|
||||
#endif
|
||||
|
||||
mntflags = 0;
|
||||
optind = optreset = 1; /* Reset for parse of new argv. */
|
||||
|
@ -125,36 +121,8 @@ mount_ufs(argc, argv)
|
|||
warnx("ufs filesystem is not available");
|
||||
return (1);
|
||||
}
|
||||
#ifdef ROOTSLICE_HUNT
|
||||
result = -1;
|
||||
/*
|
||||
* If we are mounting root, and we have a mount of something that
|
||||
* might be the compatibility slice, try mounting other slices
|
||||
* first. If the kernel has done the right thing and mounted
|
||||
* the slice because the disk is really sliced, this will find
|
||||
* the real root filesystem. If not, we'll try what was supplied.
|
||||
*/
|
||||
if (!strcmp(fs_name, "/") &&
|
||||
(sscanf(args.fspec, "%[^0-9]%d%c", devpfx, &unit, &part) == 3) &&
|
||||
(part >= 'a') &&
|
||||
(part <= 'h')) {
|
||||
for (slice = 1; (slice < 32) && (result < 0); slice++) {
|
||||
sprintf(devbuf, "%s%ds%d%c",
|
||||
devpfx, unit, slice, part);
|
||||
args.fspec = devbuf;
|
||||
result = mount(vfc.vfc_name, fs_name, mntflags, &args);
|
||||
}
|
||||
args.fspec = argv[0];
|
||||
}
|
||||
if (result == 0)
|
||||
warnx("*** update /etc/fstab entry for %s to use %s ***",
|
||||
fs_name, devbuf);
|
||||
/* Try the mount as originally requested */
|
||||
if ((result < 0) &&
|
||||
(mount(vfc.vfc_name, fs_name, mntflags, &args) < 0)) {
|
||||
#else
|
||||
|
||||
if (mount(vfc.vfc_name, fs_name, mntflags, &args) < 0) {
|
||||
#endif
|
||||
switch (errno) {
|
||||
case EMFILE:
|
||||
warnx("%s on %s: mount table full",
|
||||
|
|
Loading…
Reference in a new issue