aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.initdiskless
Commit message (Collapse)AuthorAgeFilesLines
* Opps, I missed moving a couple of files in r336845.Brad Davis2018-07-281-382/+0
| | | | | | | | Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D16466 Notes: svn path=/head/; revision=336847
* userland: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327230
* Remove spurious $flags; it's a paste-o from copying the line from rc.subr.Ian Lepore2017-09-291-1/+2
| | | | | | | Also, add a comment documenting the args passed to mount_md(). Notes: svn path=/head/; revision=324108
* Enhance mdmfs(8) to work with tmpfs(5).Ian Lepore2017-09-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Existing scripts and associated config such as rc.initdiskless, rc.d/var, and others, use mdmfs to create memory filesystems. That program accepts a size argument which allows SI suffixes and treats an unsuffixed number as a count of 512 byte sectors. That makes it difficult to convert existing scripts to use tmpfs instead of mdmfs, because tmpfs treats unsuffixed numbers as a count of bytes. The script logic to deal with existing user config that might include suffixed and unsuffixed numbers is... unpleasant. Also, there is no g'tee that tmpfs will be available. It is sometimes configured out of small-resource embedded systems to save memory and flash storage space. These changes enhance mdmfs(8) so that it accepts two new values for the 'md-device' arg: 'tmpfs' and 'auto'. With tmpfs, the program always uses tmpfs(5) (and fails if it's not available). With 'auto' the program prefers tmpfs, but falls back to using md(4) if tmpfs isn't available. It also handles the -s <size> argument so that the mdconfig interpetation of unsuffixed numbers applies when tmpfs is used as well, so that existing user config keeps working after a switch to tmpfs. A new rc setting, mfs_type, is added to etc/defaults/rc.conf to let users force the use of tmpfs or md; the default value is "auto". Differential Revision: https://reviews.freebsd.org/D12301 Notes: svn path=/head/; revision=324107
* Replace md(4) usage in diskless(8) script rc.initdiskless with tmpfs(5).Stephen J. Kiernan2017-06-151-2/+2
| | | | | | | | | | | | | | Need to multiply the size of the disk passed to mount_md by 512 as mdmfs expects number of 512-byte blocks while tmpfs size option wants number of bytes. Reviewed by: brooks Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D11106 Notes: svn path=/head/; revision=319987
* etc: minor spelling fixes.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | | | Mostly comments but these tend to be user-visible. MFC after: 2 weeks Notes: svn path=/head/; revision=298887
* Revert r243228. This commit appears to cause more trouble thanChris Rees2012-11-211-1/+1
| | | | | | | | it was designed to avoid; the issue described in the PR was no longer an issue anyway. Notes: svn path=/head/; revision=243374
* cp -R misses out dotfiles; use pax instead to copy file hierarchiesChris Rees2012-11-181-1/+1
| | | | | | | | | | PR: conf/99721 (based on) Submitted by: Florian Zavatzki <f_zavatzki@blue-network.org> Approved by: hrs MFC after: 1 month Notes: svn path=/head/; revision=243228
* Spelling fixes for etc/Ulrich Spörlein2012-01-071-3/+3
| | | | Notes: svn path=/head/; revision=229783
* Remove trailing white space. No functional changes.Doug Barton2010-05-141-1/+1
| | | | Notes: svn path=/head/; revision=208060
* Add support to rc.initdiskless for /conf/T/M/remount_subdir.Bruce M Simpson2008-09-091-4/+37
| | | | | | | | | | | This allows the location of the configuration data to be relocated within the filesystem containing it. A nullfs mount is used in order to achieve this. Obtained from: XORP, Inc. Notes: svn path=/head/; revision=182895
* Add support for /conf/T/M/remount_optional.Bruce M Simpson2008-05-151-0/+8
| | | | | | | | | | | | | | | | | | The rc.initdiskless functionality is used by NanoBSD to allow configuration files to live on a separate configuration slice, which acts as NVRAM, whilst the system image is mounted read-only. Normally, if the remount command fails during boot, this is regarded as a fatal error. If /conf/T/M/remount_optional is present, this error is non-fatal. If the file is not present, the default behaviour is unchanged. This is very useful for people building live CD images using FreeBSD, where the NVRAM lives somewhere completely differently from the system image, and may be present on removable media which is not present during the initial boot. Notes: svn path=/head/; revision=179014
* - put some common code in a function handle_remount();Luigi Rizzo2006-12-031-38/+43
| | | | | | | | | | | | | | | | | | | - add better checks on non-existing directories to prevent error messages at run time; - introduce a function log() to help debugging diskless booting when things don't work; - modify the parsing of diskless_remount so you can add mount_nfs options after the pathname. You could use 'remount' to do something similar, but this way is more convenient because you don't have to hardwire the server name in the command. - document the above. I have been running the above in a diskless lab since february on RELENG_6. MFC after: 1 week Notes: svn path=/head/; revision=164862
* - Document /conf/diskless_remount in the list of special files.Brooks Davis2006-09-011-3/+11
| | | | | | | | | | | | - Note that diskless_remount files may use ".." to support mounts above the root path. - Copy dot files when populating directories from /conf. [1] PR: misc/102724 [1] Submitted by: Attila Nagy <bra at fsn.hu> [1] Notes: svn path=/head/; revision=161824
* Fix example:Ruslan Ermilov2006-08-221-12/+12
| | | | | | | | | /conf/base/diskless_remount -> /conf/base/etc/diskless_remount MFC after: 3 days Notes: svn path=/head/; revision=161533
* Creating memory file systems with softupdates enabled is pointless,Brooks Davis2006-01-111-1/+1
| | | | | | | | | | | don't do it. PR: conf/85558 Submitted by: Ralf Wenk <RZ dash FreeBSD0605 at hs dash karlsruhe dot de> MFC after: 5 days Notes: svn path=/head/; revision=154239
* Add items to unmount to the front of the list so they are unmounted inBrooks Davis2005-11-011-2/+2
| | | | | | | reverse (thus allowing /conf to be unmounted). Notes: svn path=/head/; revision=151916
* Switch from pax to tar for extracting cpio archives. pax requires aBrooks Davis2005-10-311-1/+1
| | | | | | | | | | writable /tmp (or TMPDIR) and thus is unsuitable for this job. Tested by: Joerg Pulz <Joerg dot Pulz at frm2 dot tum dot de> PR: conf/88293 Notes: svn path=/head/; revision=151914
* The -x <format> option of pax is for creation of archives, notBrooks Davis2005-10-311-1/+1
| | | | | | | | | | | | | | extraction. This will allow cpio archive support to work, at least in situations where /tmp is writable. Because pax requires a writable /tmp it is unsuitable for this task, but replacing it will come in a later commit. Submitted by: Joerg Pulz <Joerg dot Pulz at frm2 dot tum dot de> PR: conf/88293 Notes: svn path=/head/; revision=151908
* Use sysctl -q when querying for kern.bootp_cookie in order to avoidRobert Watson2005-09-151-1/+1
| | | | | | | | | printing boot-time errors that don't reflect true error conditions. MFC after: 1 week Notes: svn path=/head/; revision=150169
* Fix minor typo in a comment.Bruce A. Mah2005-08-281-1/+1
| | | | Notes: svn path=/head/; revision=149556
* Add two new template sources, /conf/bcast/${ipbca} and /conf/ip/${ip}.Brooks Davis2005-08-171-7/+18
| | | | | | | | | | These allow large installations to keep their /conf directory down to a managable number of entries. Clean up the handling of dhcp_cookie. Notes: svn path=/head/; revision=149170
* To allow /etc to be as minimal as possible in a diskless setup, we needBrooks Davis2005-04-291-7/+0
| | | | | | | | | | | | | | | | to run initdiskless before we run rcorder on /etc/rc.d. To allow this, move /etc/rc.d/initdiskless to /etc/rc.initdiskless and run it directly from /etc/rc. Remove /etc/rc.d/preseedrandom as it is no longer necessicary (we start with entropy unblocked) and was only used by initdiskless when it was needed. Discussed on: freebsd-rc Repocopy by: peter Notes: svn path=/head/; revision=145693
* Use utils from /rescue vs. /stand. Also use pax rather than cpio & gzip.David E. O'Brien2004-12-121-1/+1
| | | | Notes: svn path=/head/; revision=138729
* - Make the header conform to standard rc.d style.Mike Makonnen2004-11-051-2/+2
| | | | | | | | - The 'before ipfw' directive seems bogus, and should instead be 'before rcconf'. Notes: svn path=/head/; revision=137246
* Remove the requirement for the FreeBSD keyword as it no longerMike Makonnen2004-10-071-1/+1
| | | | | | | | | | makes any sense. Discussed with: dougb, brooks MFC after: 3 days Notes: svn path=/head/; revision=136224
* Removed whitespace at BOF, EOL & EOF.Jens Schweikhardt2004-06-061-1/+1
| | | | Notes: svn path=/head/; revision=130151
* Initdiskless must run before ipfw, or people will not be able toPoul-Henning Kamp2004-04-281-0/+1
| | | | | | | | | | | | use the conf/* stuff for their firewall configuration. Running ipfw before could seem to make sense in that it would allow one to setup access to the NFS server on a "default-deny" kernel, but it is pretty obvious to the casual observer that such a configuration never makes it far enough to mount the NFS-root in the first place. Notes: svn path=/head/; revision=128713
* Replace shell's positional parameters safely.Ruslan Ermilov2004-04-281-3/+2
| | | | Notes: svn path=/head/; revision=128706
* When using this in non-NFSroot circumstances, `mount -t nfs` mayPoul-Henning Kamp2004-04-271-1/+2
| | | | | | | | return empty. Add a dummy element to prevent the alternate action of the shell builtin "set" Notes: svn path=/head/; revision=128685
* Band-aid diskless booting by running a new preseedrandom script beforeBrooks Davis2004-04-151-0/+1
| | | | | | | | | | | | | | initdiskless. The output of several commands and if available the contents of /entropy are feed into /dev/random to kickstart the PRNG. /etc/rc.d/initrandom is left alone to maintain the previous behavior as much as possiable. Further work in this area is probably needed. Discussed with: markm Notes: svn path=/head/; revision=128286
* Extensive documentation changes to the script, but onlyLuigi Rizzo2004-03-311-40/+78
| | | | | | | | | | | | comments and empty lines have been touched. All of this should go in the diskless(8) manpage, now if we had some kind of 'literate programming' tool to extract the comments from the script and put them in a reasonable nroff format, it would be a lot easier to keep code and docs in sync Notes: svn path=/head/; revision=127663
* Minor changes mostly as discussed on the lists a few days ago:Luigi Rizzo2004-03-311-6/+22
| | | | | | | | | | | | | | | | + SUBDIR.cpio.gz prevents files from SUBDIR/ to be copied when priming the memory filesystems. This restores the old behaviour and makes the copy process a lot more efficient + look for templates also in the list of directories supplied by bootp/dhcp via the T134 option aka kern.bootp_cookie + keep track of directories temporarily mounted with "remount" or "diskless_remount" commands and unmount them once we are done with them (at the end of this script). Notes: svn path=/head/; revision=127657
* If /conf/diskless_remount exists, use it to remount the entire /confBrooks Davis2004-03-121-2/+13
| | | | | | | | directory. This allows multiple roots (say for different architectures) to share the same set of /conf files. Notes: svn path=/head/; revision=126868
* Make this file more generally usable:Poul-Henning Kamp2004-03-091-19/+35
| | | | | | | | | | | Trigger not only on diskless booting sysctls being set, but also on the existence of the file "/etc/diskless". But do not try to extract IP# related keywords in that case. Add a general "remount" facility to allow non-NFS remounting. Notes: svn path=/head/; revision=126787
* Mark scripts as not usable inside a jail by adding keyword 'nojail'.Pawel Jakub Dawidek2004-03-081-1/+1
| | | | | | | Some suggestions from: rwatson, Ruben de Groot <mail25@bzerk.org> Notes: svn path=/head/; revision=126744
* Remove trailing whitespaceDoug Barton2003-10-131-3/+3
| | | | Notes: svn path=/head/; revision=121067
* Update references to rc.diskless[12]Doug Barton2003-10-131-2/+2
| | | | Notes: svn path=/head/; revision=121066
* Bump default /etc size from 2MB to 5MB to deal with bloat^Wgrowth inKris Kennaway2003-10-121-4/+3
| | | | | | | the size of /etc. Notes: svn path=/head/; revision=121014
* Correct typo in Matt's name.Max Khon2003-08-071-1/+1
| | | | Notes: svn path=/head/; revision=118638
* Allow diskless_remount files to contain path beginning with / which willBrooks Davis2003-06-301-0/+18
| | | | | | | | | | be mounted relative to the NFS root mountpoint. Reviewed by: dillon at backplane.com MFC After: 3 days Notes: svn path=/head/; revision=117087
* Add another backslash ('\').John Hay2003-02-151-1/+1
| | | | Notes: svn path=/head/; revision=110942
* Do not unconditionally load the configuration files for the RCNG case.Matthew Dillon2002-12-221-75/+156
| | | | | | | | | | | | | | | | | Instead, load them as part of the rc.d system. This allows us to prioritize the initidiskless script so it runs before the configuration files are loaded and allows us to get rid of the exit 2 hack in /etc/rc. The exit 2 never worked anyway since it did not unset the prior configuration, causing the diskless code to not operate properly. Do a major cleanup and revamping of the diskless code for RCNG. This will be backported to the non-RCNG scripts as well as -stable. With suggestions from: Mike Makonnen <mtm@identd.net> MFC after: 7 days Notes: svn path=/head/; revision=108191
* Fix style bugs:Jens Schweikhardt2002-10-121-13/+13
| | | | | | | | | | | | | * Space -> tabs conversion. * Removed blanks before semicolon in "if ... ; then". * Proper indentation of misindented lines. * Put a full stop after some comments. * Removed whitespace at end of line. Approved by: silence from gordon Notes: svn path=/head/; revision=104980
* In a diskless setup, rc.d/initdiskless may overwrite parts of /etc onDima Dorfman2002-10-021-0/+2
| | | | | | | | | | | | | | | a per-machine or per-cluster (with different ways of expressing what's part of a cluster) basis. In order for this to be effective, rc.conf has to be reread after initdiskless is finished. Implement this by adding a hook to etc/rc which rereads rc.conf by request. This can also be implemented by renaming initdiskless to initdiskless.sh and sourcing rc.conf there manually, but it was decided that, that would be uglier than a hook in etc/rc. Developed in concert with: gordon Notes: svn path=/head/; revision=104334
* Use mdmfs(8) rather than rolling our own RAM-disks.Poul-Henning Kamp2002-09-221-4/+1
| | | | | | | Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=103799
* Stock -current has more than 300 files in /etc, so 255 inodes for theDima Dorfman2002-07-281-1/+1
| | | | | | | | | | | | /etc filesystem isn't enough; consequently, add "-i 4096" to the newfs command for /etc. This results in 1022 inodes, which should be enough for the forseeable future (although I don't know why we would ever have more than 1000 files in a default /etc). Silence by: -current Notes: svn path=/head/; revision=100791
* Merge in all the changes that Mike Makonnen has been maintaining for aGordon Tetlow2002-07-181-20/+19
| | | | | | | | | | | while. This is only the script pieces, the glue for the build comes next. Submitted by: Mike Makonnen <makonnen@pacbell.net> Reviewed by: silence on -current and -hackers Prodded by: rwatson Notes: svn path=/head/; revision=100280
* Utilize dhcp information in the kernel environment if we don't haveDavid E. O'Brien2002-04-221-1/+20
| | | | | | | | | hostname and DNS information already. Submitted by: Danny Braniss <danny@cs.huji.ac.il> Notes: svn path=/head/; revision=95280
* The usage of 'newaliases' needs to be after we know for sure that /usrDavid E. O'Brien2002-02-231-5/+0
| | | | | | | | | is mounted. Submitted by: rizzo Notes: svn path=/head/; revision=91105