summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_mountroot.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r298819:bdrewery2016-06-271-1/+1
| | | | sys/kern: spelling fixes in comments.
* MFC r287964:trasz2016-01-121-18/+29
| | | | | | | | | | | | | Kernel part of reroot support - a way to change rootfs without reboot. Note that the mountlist manipulations are somewhat fragile, and not very pretty. The reason for this is to avoid changing vfs_mountroot(), which is (obviously) rather mission-critical, but not very well documented, and thus hard to test properly. It might be possible to rework it to use its own simple root mount mechanism instead of vfs_mountroot(). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2698
* MFC r287107:trasz2016-01-121-0/+6
| | | | | | | | | Make vfs_unmountall() unmount /dev after /, not before. The only reason this didn't result in an unclean shutdown is that devfs ignores MNT_FORCE flag. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3467
* MFC r288091:bdrewery2015-09-291-9/+5
| | | | vfs_mountroot_shuffle() never returns non-zero.
* MFC r267351:mav2014-06-221-12/+15
| | | | | | Move root_mount_hold() functionality to separate mutex. It has nothing to share with mutex protecting list of mounted file systems.
* MFC r259892:dim2013-12-281-7/+0
| | | | | In sys/kern/vfs_mountroot.c, remove static function parse_isspace(), which is unused since r214006.
* In r243868, the error message buffer errmsg have been changed fromdelphij2013-09-091-1/+1
| | | | | | | | | | | an on-stack array to a pointer and therefore sizeof(errmsg) would become 4 or 8 bytes depending on the architecture. Fix this by using ERRMSGL in place of sizeof(). Submitted by: J David <j.david.lists@gmail.com> MFC after: 3 days Approved by: re (kib)
* Add a tunable for the default timeout.marcel2013-08-031-0/+1
|
* Changes to allow using BOOTP_NFSROOT and mounting an nfs root filesystemian2013-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | other than the one specified by the BOOTP server. This configures NFS using the BOOTP protocol while also respecting other root-path options such as setting vfs.root.mountfrom in the environment or using the RB_DFLTROOT boot option. It allows you to override the root path provided by the server, or to supply a root path when the server provides IP configuration but no root path info. This maintains the historical BOOTP_NFSROOT behavior of panicking on a failure to mount the root path provided by the server, unless you've provided an alternative via the ROOTDEVNAME kernel option or by setting vfs.root.mountfrom. The behavior of panicking when given no other options is preserved because it amounts to a bit of a retry loop that could eventually recover from a transient network or server problem. The user can now override the root path from loader(8) even if the kernel is compiled with BOOTP_NFSROOT. If vfs.root.mountfrom is set in the environment it is used unconditionally -- it always overrides the BOOTP info. If it begins with [old]nfs: then the BOOTP code uses it instead of the server-provided info. If it specifies some other filesystem then the bootp code will not panic like it used to and the code in vfs_mountroot.c will invoke the right filesystem to do the mount. If the kernel is compiled with the ROOTDEVNAME option, then that name is used by the BOOTP code if either * The server doesn't provide a pathname. * The boothowto flags include RB_DFLTROOT. The latter allows the user to compile in alternate path in ROOTDEVNAME such as ufs:/dev/da0s1a and boot from that path by setting boot_dftlroot=1 in loader(8) or using the '-r' option in boot(8). The one thing not provided here is automatic failover from a server-provided path to a compiled-in one without the user manually requesting that. The code just isn't currently structured in a way that makes that possible with a lot of rewrite. I think the ability to set vfs.root.mountfrom and to use ROOTDEVNAME automatically when the server doesn't provide a name covers the most common needs. A set of patches submitted by Lars Eggert provided the part I couldn't figure out by myself when I tried to do this last year; many thanks. Reviewed by: rodrigc
* post mountroot event after a real/final root is mountedavg2013-03-231-2/+2
| | | | | | | | | not every time an intermediate root (including the first devfs) is mounted. This is also consistent with waking up via root_mount_complete. Reviewed by: jhb MFC after: 13 days
* Do not allocate buffer of the 255 bytes length on the stack.kib2012-12-041-3/+6
| | | | | Reported and tested by: sig6247@gmail.com MFC after: 1 week
* Remove the support for using non-mpsafe filesystem modules.kib2012-10-221-5/+2
| | | | | | | | | | | | In particular, do not lock Giant conditionally when calling into the filesystem module, remove the VFS_LOCK_GIANT() and related macros. Stop handling buffers belonging to non-mpsafe filesystems. The VFS_VERSION is bumped to indicate the interface change which does not result in the interface signatures changes. Conducted and reviewed by: attilio Tested by: pho
* Fix found places where uio_resid is truncated to int.kib2012-02-211-3/+2
| | | | | | | | | Add the sysctl debug.iosize_max_clamp, enabled by default. Setting the sysctl to zero allows to perform the SSIZE_MAX-sized i/o requests from the usermode. Discussed with: bde, das (previous versions) MFC after: 1 month
* replace uses of libkern gets with cngetsavg2011-12-171-2/+2
| | | | MFC after: 2 months
* Don't terminate the interactive root mount prompt on mount failure.marcel2011-10-231-20/+21
| | | | | | | | This restores the previous behaviour. While here, match '?' and '.' inputs exactly and improve the error message. Requested by: avg@ Derived from a patch by: Arnaud Lacombe <lacombar@gmail.com>
* Include sys/sbuf.h directly.ae2011-07-111-0/+1
|
* Make RB_CDROM work. This should probably check for a disc in cd1 and acd1nwhitehorn2011-01-081-2/+2
| | | | as well.
* Add support for asterisk characters when filling in the GELI passworded2010-11-141-1/+1
| | | | | | | | | | | during boot. Change the last argument of gets() to indicate a visibility flag and add definitions for the numerical constants. Except for the value 2, gets() will behave exactly the same, so existing consumers shouldn't break. We only use it in two places, though. Submitted by: lme (older version)
* ZFS pool name is not a real device in devfs. Do not wait forae2010-10-191-1/+2
| | | | | | | device appear when mounting root from ZFS. Reviewed by: marcel Approved by: mav (mentor)
* Re-implement the root mount logic using a recursive approach, whereby eachmarcel2010-10-181-326/+738
| | | | | | | | | | | | | | | | | | | | | root file system (starting with devfs and a synthesized configuration) can contain directives for mounting another file system as root. The old root file system is re-mounted under the new root file system (with /.mount or /mnt as the mount point) to allow access to the underlying file system. The configuration allows for creating vnode-backed memory disks that can subsequently be mounted as root. This allows for an efficient and low- cost way to distribute and boot FreeBSD software images that reside on some storage media. When trying a mount, the kernel will wait for the device in question to arrive. The timeout is configurable and is part of the configuration. This allows arbitrarily complex GEOM configurations to be constructed on the fly. A side-effect of this change is that all root specifications, whether compiled into the kernel or typed at the prompt can contain root mount options.
* Split the root mount logic from the (generic) mount code and movemarcel2010-10-021-0/+626
it (the root mount code) into a new file called vfs_mountroot.c The split is almost trivial, as the code is almost perfectly non-intertwined. The only adjustment needed was to move the UMA zone allocation out of vfs_mountroot() [in vfs_mountroot.c] and into vfs_mount.c, where it had to be done as a SYSINIT [see vfs_mount_init()]. There are no functional changes with this commit.
OpenPOWER on IntegriCloud