Commit graph

3013 commits

Author SHA1 Message Date
Poul-Henning Kamp 9e9c1cad4c Here follows the new kernel dumping infrastructure.
Caveats:

The new savecore program is not complete in the sense that it emulates
enough of the old savecores features to do the job, but implements none
of the options yet.

I would appreciate if a userland hacker could help me out getting savecore
to do what we want it to do from a users point of view, compression,
email-notification, space reservation etc etc.  (send me email if
you are interested).

Currently, savecore will scan all devices marked as "swap" or "dump" in
/etc/fstab _or_ any devices specified on the command-line.

All architectures but i386 lack an implementation of dumpsys(), but
looking at the i386 version it should be trivial for anybody familiar
with the platform(s) to provide this function.

Documentation is quite sparse at this time, more to come.

Sponsored by:   DARPA, NAI Labs

Details:

Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set it
to be the dumpdevice.  When "off" is set, /dev/null is used.
2002-03-31 22:24:24 +00:00
Søren Schmidt 4486f609fc Add support for getting status (fan, temp, 5V and 12V levels) from
Promise Superswap enclosures.

Sponsored by: Advanis
2002-03-30 16:36:41 +00:00
Poul-Henning Kamp 041b8b0058 Get this to WARNS=4 and closer to style(9) at a sacrifice in
linelength.
2002-03-29 19:33:14 +00:00
Ruslan Ermilov 1876df83f4 Turn "ether" address family into a generic "link" family
that could be used to set/get arbitrary length link level
addresses.  Alias "lladdr" parameter and "ether" family
to the new "link" family for backward compatibility.

PR:		bin/31476
MFC after:	1 week
2002-03-27 14:29:23 +00:00
Søren Schmidt f642c834f4 Add support for creating/deleting ATA RAID's
Sponsored by: Advanis
2002-03-27 10:59:53 +00:00
Warner Losh 5416b6f4dd Add missing \ before an 'n' to get the proper newline when running
fdisk -s for each partition.
2002-03-27 06:20:20 +00:00
Pierre Beyssac 85554bf8ff Fix problem in macro definition breaking compiles with -DDEBUG.
PR:		bin/35773
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
2002-03-26 17:37:59 +00:00
Darren Reed 730c9b8cfb add extra include path to get .h files from source being used to compile 2002-03-26 10:09:09 +00:00
Pierre Beyssac bc6d68df97 Add forgotten flag in flag lists.
PR:		docs/36267	(partial)
Submitted by:	Thomas Quinot <thomas.cuivre.fr.eu.org>
2002-03-25 10:45:28 +00:00
Mark Murray 8e2e167cdd Replace __progname with the documented, more acceptable and functionally identical getprogname(3). 2002-03-24 15:17:53 +00:00
Mark Murray b813a7142b Replace __progname with the functionally identical but more
acceptable (documented) getprogname(3).
2002-03-24 15:06:48 +00:00
Pierre Beyssac 038148d678 Add option -n to i386 boot2 to disallow boot interruption by keypress.
PR:		i386/36016
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
Reviewed by:	rnordier
MFC after:	1 week
2002-03-23 19:40:27 +00:00
David E. O'Brien efc8588d57 Style(9) local vars after 'register' removal.
Requested by:	bde
2002-03-23 18:10:59 +00:00
Warner Losh d476a036e2 o remove __P
o remove main prototype
2002-03-21 13:20:49 +00:00
Warner Losh 854299908c o __P removed
o main prototype removed
2002-03-21 13:14:21 +00:00
Warner Losh 0638cc1a39 o __P removal.
o ansi function definitions.
o main prototype removal
o unifdef __STDC__
2002-03-21 13:10:52 +00:00
Mike Barcroft 40dcc8608d Revert 1.20:
Memory disks may be used for other purposes besides newfs(8), so it
isn't helpful to require the minimum size meet newfs(8)'s criteria.
2002-03-21 12:03:09 +00:00
Ruslan Ermilov 7a43a96ab0 Replaced hacks in sbin/Makefile,v 1.99 and usr.sbin/Makefile,v 1.217
with the NO_IPFILTER make.conf(5) knob.

(So that we can "make the-rest-of-the-world" again.)
2002-03-21 09:15:39 +00:00
Mike Barcroft 6a1bd01754 Provide a proper error message in mdconfig(8) when a filesystem is too
small, instead of a less meaningful error in newfs(8).
2002-03-21 07:46:09 +00:00
Warner Losh b70cd7ee68 o __P removed
o ansi function prototypes
o unifdef -D__STDC__
o __dead2 on usage prototype
o remove now-bogus main prototype
2002-03-20 22:57:10 +00:00
Warner Losh 73bf18edb8 o remove __P
o Use ansi function definitions
o unifdef -D__STDC__
2002-03-20 22:53:13 +00:00
Warner Losh 2db673ab00 o remove __P
o Use ANSI function definitions
o unifdef -D__STDC__
2002-03-20 22:49:40 +00:00
David E. O'Brien 3d438ad61f Remove 'register' keyword.
It does not help modern compilers, and some may take some hit from it.
(I also found several functions that listed *every* of its 10 local vars with
 "register" -- just how many free registers do people think machines have?)
2002-03-20 17:55:10 +00:00
Darren Reed 266ef5ec2d * add extra -I path to get the "matching" header files. (and split the one
line up into three to make it more readable)
2002-03-20 09:04:34 +00:00
Darren Reed 1bdb47d692 * add extra -I path to get the "matching" header files. 2002-03-20 09:02:48 +00:00
Darren Reed b62a26b14e * need to compile printnat.c now that this function is in a separate .c file
* add extra -I path to get the "matching" header files.
2002-03-20 09:01:48 +00:00
Poul-Henning Kamp 5dccd5c649 Swing the axe and remove some archaic features from newfs which modern
diskdrives do neither need nor want:

	-O create a 4.3BSD format filesystem
	-d rotational delay between contiguous blocks
	-k sector 0 skew, per track
	-l hardware sector interleave
	-n number of distinguished rotational positions
	-p spare sectors per track
	-r revolutions/minute
	-t tracks/cylinder
	-x spare sectors per cylinder

No change in the produced filesystem image unless one or more of
these options were used.

Approved by:	mckusick
2002-03-20 07:16:15 +00:00
Warner Losh 582236c5b2 Kill register 2002-03-20 04:33:25 +00:00
Robert Watson ec3b06a0fe "-" now sends output to stdout. 2002-03-20 02:35:14 +00:00
Robert Watson b819704f1b Teach growfs's dbg_open() that a filename of "-" for output means to
open "/dev/stdout".  This doesn't actually affect growfs, but does affect
ffsinfo, permitting ffsinfo to output to the shell's stdout rather than
requiring it be dumped to a file or explicitly pointed at a special
device.

Reviewed by:	peter
2002-03-20 02:34:01 +00:00
David E. O'Brien 5461a012fd Remove ipnat until the committer can actually test his changes. 2002-03-20 02:09:50 +00:00
Alfred Perlstein 63e99e978a Hopefully fix make world.
Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
2002-03-19 22:51:53 +00:00
Poul-Henning Kamp 89fb8ee796 Add the undocumented -R option to disable randomness for regression-testing.
Add a couple of simple regression tests accessible with "make test", they
depend on the md(4) driver.

FYI I have also tried running the test against a week old newfs and it
passed.
2002-03-19 21:05:29 +00:00
Poul-Henning Kamp 8409849dd0 Further cleanups. 2002-03-19 20:01:38 +00:00
Warner Losh c1fdb43f59 Remove stray register 2002-03-19 18:47:50 +00:00
Warner Losh 34ef9eb5e6 De-__P the man page, but I suspect that we need to freshly import
sys/disklabel.h since the one in here looks a little crunchy.
2002-03-19 18:44:56 +00:00
Ian Dowse 475df34ac2 Replace a number of similar for' loops with a new ilog2()' function
that computes the base-2 log of a power of 2.
2002-03-19 17:39:01 +00:00
Ian Dowse bf57cced53 Complete the ANSIfication of newfs by converting function declarations
to C89 style.
2002-03-19 17:20:02 +00:00
Ian Dowse f7b48c89c8 The FSIRAND code is always compiled in, and it is unlikely that
anyone needs a newfs without it. Remove the #ifdef's from around
the code and the -DFSIRAND from the Makefile. Also remove redundant
declarations of random() and srandomdev().
2002-03-19 17:03:14 +00:00
Ian Dowse 9710700cb1 Remove the ancient STANDALONE code.
Approved by:	phk
2002-03-19 16:47:20 +00:00
Darren Reed a2a5557d65 both ipnat and ipfstat now use libkvm rather than their own home-rolled
kmem accessors, allowing them to be used with crash dumps as well as live
systems, now.
2002-03-19 15:07:30 +00:00
Warner Losh 1fa5ae8f93 o Remove __P
o Use ANSI function definitions
o mark usage() as __dead2
2002-03-19 13:29:39 +00:00
Peter Wemm dbfec43cd3 Move savecore build enable to MD section of Makefile, currently enabled
for i386 and alpha.  Although it builds on sparc64, it does not yet work.
A similar hack as what is used on the sparc64 MD macros can be used to
make ia64 build too, but there doesn't seem to be much point.
2002-03-19 12:07:27 +00:00
Ian Dowse af53d6d86e Remove yet more vestiges of mount_mfs. 2002-03-18 15:31:44 +00:00
Warner Losh d1a939c146 o __P
o Strict ANSI declarations.
o return (foo);
o main (int, char *[])
2002-03-18 06:59:15 +00:00
Warner Losh 326c7cdab5 o remove __P
o Use ANSI function definitions
o const poison
o remove register
2002-03-18 06:17:50 +00:00
Warner Losh e5fa3ee654 o __P removal.
o Use ANSI function definitions.
o main(int, char *[])
2002-03-18 05:00:52 +00:00
Warner Losh 323e7ff82e o Use real prototypes and ANSI function definitions.
o Remove __P.
2002-03-18 04:57:08 +00:00
Warner Losh bbbc97356c o Use real prototypes
o Remove __P.
o main(int, char *[])
2002-03-18 04:55:09 +00:00
Bruce Evans 0c08079e26 Fixed some style bugs (mainly ones not fixed or made worse by rev.1.44).
Don't use ISO string concatentation to obfuscate long single-line
messages...
2002-03-18 03:04:58 +00:00
Bruce Evans 63dab85cea Fixed some style bugs (mainly ones not fixed or made worse by rev.1.41).
Old code obfuscates long (but single-line) messages by printing them in
pieces using %s.  Rev.1.41 obfuscated some new long messages using ISO
string concatenation.  This commit only fixes the new obfuscations.
2002-03-18 02:43:14 +00:00
Bruce Evans 3ac7f11229 Removed vestiges of mount_mfs. Sorted the Makefile a bit. 2002-03-18 02:23:43 +00:00
Bruce Evans 3f305db0a2 Fixed 2 layers of breakage of WARNS. Setting WARNS unconditionally to
0 was bad and setting it unconditionally to 2 was worse.
2002-03-18 02:13:38 +00:00
Poul-Henning Kamp 345b78a301 Remove __P() and register.
Set WARNS=2

This is the beginning of a pre-UFS2 cleanup of newfs.

Sponsored by:	DARPA, NAI Labs
2002-03-17 09:01:41 +00:00
Ruslan Ermilov f303d23186 This sounds better. 2002-03-15 18:12:13 +00:00
Ruslan Ermilov d1f8bca053 mdoc(7) police: tiny fixes. 2002-03-15 15:07:39 +00:00
Ruslan Ermilov e629e744a2 mdoc(7) police: GC duplicate VCS ID. 2002-03-15 15:02:13 +00:00
Ruslan Ermilov 424616bb1c mdoc(7) police: misc fixes. 2002-03-15 14:56:53 +00:00
Ruslan Ermilov 86fbcc3207 mdoc(7) police: kill whitespace at eol. 2002-03-15 14:45:45 +00:00
Ruslan Ermilov 992b9b7a2a mdoc(7) police: tiny fixes. 2002-03-15 14:34:10 +00:00
Ruslan Ermilov e3390c2a99 mdoc(7) police: tiny fixes. 2002-03-15 14:28:05 +00:00
Bill Fumerola 78d9ac5774 minor grammar fixes 2002-03-14 10:09:19 +00:00
Robert Nordier 8a1917d017 Clarify the cylinder > 1023 issue, now that EDD support is automatic.
Also drop a note about undocumented features that was intended to
cover the since-documented slice-selection syntax.
2002-03-13 19:00:19 +00:00
Ruslan Ermilov cd6ab711b3 Document the "slice" syntax.
Prodded by:	ambrisko
2002-03-13 12:30:46 +00:00
Ruslan Ermilov 9662d32c73 Implement -m and -p loader(8) "boot" command options in boot2.
(This is more useful for 4.x where boot blocks can still load
kernels, modulo the PR kern/17422.)
2002-03-13 11:03:36 +00:00
Murray Stokely 64f24fd5b8 Add information about multi-session CDs from the log message of r1.4.
Also, add an examples section and show how to mount a Kodak Photo-CD.

PR:		docs/35206
2002-03-13 08:27:27 +00:00
Luigi Rizzo 617cc038bc Document the existence of machdep.guessed_bootdev, as suggested
by Sheldon.
For a detailed description look at the commit log for sysctl.c
rev.1.42 -- i do not think it is appropriate to put the full
description in this manpage, and the "boot" and "loader" manpages
where this description might go are also missing a description of
a number of similar variables, so i think this it is ok to limit
documentation to this now, and update it later when I (or someone
else) have a chance to revise "boot" and "loader".
2002-03-12 13:55:19 +00:00
Dag-Erling Smørgrav 66a79b3d49 Sparc64 support. 2002-03-11 11:23:48 +00:00
Luigi Rizzo bca9bbeae7 Make the handling of machdep.guessed_bootdev compiled on i386 only. 2002-03-11 06:50:28 +00:00
David E. O'Brien fd43aa1c2c Add complete Sparc64 support.
Submitted by:	tmm

Dike out vax support.
2002-03-11 04:41:42 +00:00
David E. O'Brien 90b8f6bab5 * Support the Sparc64.
* Do not default to any particular platform.  Require that we explicitly
  support a particular platform.
2002-03-11 04:20:37 +00:00
Dima Dorfman c871474800 Chase sysctl name.
Submitted by:	Christopher Sharp <christopher_sharp@web.de>
2002-03-11 00:07:55 +00:00
Luigi Rizzo 60cf2c1254 Export a (machine dependent) kernel variable bootdev as
machdep.guessed_bootdev, and add code to sysctl to parse its value
and give a (not necessarily correct) name to the device we booted
from (the main motivation for this code is to use the info in the
PicoBSD boot scripts, and the impact on the kernel is minimal).

NOTE: the information available in bootdev is not always reliable,
so you should not trust it too much.  The parsing code is the same
as in boot2.c, and cannot cover all cases -- as it is, it seems to
work fine with floppies and IDE disks recognised by the BIOS. It
_should_ work as well with SCSI disks recognised by the BIOS.
Booting from a CDROM in floppy emulation will return /dev/fd0 (because
this is what the BIOS tells us).
Booting off the network (e.g. with etherboot) leaves bootdev unset so
the value will be printed as "invalid (0xffffffff)".

Finally, this feature might go away at some point, hopefully when we
have a more reliable way to get the same information.

MFC-after: 5 days
2002-03-10 20:08:44 +00:00
Søren Schmidt c75ece6633 Check the <channel> arg a bit more.
Submitted by: David Malone <dwmalone@maths.tcd.ie>
2002-03-10 13:59:00 +00:00
Dima Dorfman 42277d473c Document `sysctl variable=/dev/foo' syntax.
PR:		34184
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
2002-03-10 09:53:39 +00:00
Dima Dorfman 1c1a8b560e Remove inappropriate .Op calls in examples.
PR:		35689
Submitted by:	Gary W. Swearingen <swear@blarg.net>
2002-03-10 09:10:06 +00:00
Dima Dorfman a697e022f0 Minor English fixes.
PR:		35730
Submitted by:	Gary W. Swearingen <swear@blarg.net>
2002-03-10 08:50:53 +00:00
Søren Schmidt de7997511b Update headers 2002-03-04 21:11:30 +00:00
Poul-Henning Kamp 5b4455186e A bit of premptive GEOM POLA magic: If we don't get a virgin disklabel
from /dev/food0, then try from /dev/f00d0c, in strange cases this work.
2002-03-03 21:21:45 +00:00
Søren Schmidt 0df4b5542c Add the RAID rebuild command. 2002-03-03 15:41:57 +00:00
Ian Dowse 9ac0768d74 Add a new "-S" flag to dump to allow it just print out dump estimate
size and then exit.

PR:		bin/35450
Submitted by:	Mark Hannon <markhannon@optushome.com.au>
Obtained from:	NetBSD
MFC after:	1 week
2002-03-01 20:54:23 +00:00
Hajimu UMEMOTO 4adb3cea54 Show standard deviation.
PR:		bin/35433
Submitted by:	Morten Rodal <morten@rodal.no>,
		Maxim Konovalov <maxim@macomnet.ru>
MFC after:	1 week
2002-03-01 09:49:48 +00:00
Makoto Matsushita 0ed8a30f62 Fix "make release.4" breakage.
src/contrib/isc-dhcp/includes/minires/resolv.h has a 'extern' definition
but it makes an error when linking crunched binary just like this:

	dhclient.lo: In function `MRres_nquery':
	dhclient.lo(.text+0x2dcce): undefined reference to `__h_errno_set'
	dhclient.lo(.text+0x2dd5b): undefined reference to `__h_errno_set'
	dhclient.lo: In function `MRres_nquerydomain':
	dhclient.lo(.text+0x2de53): undefined reference to `__h_errno_set'

The author understands this will be a problem (see comments in resolv.h).
Murray said that the author will fix this, but as a temporary solution,
modifying the source code and not to use __h_errno_set.

BTW, I'm sorry that previous commitlog in src/sbin/dhclient/Makefile should
read "Found by:" instead of "Confirmed by"; I just found that rev 1.15
has a typo so fixed.

Tested on: ushi.jp.FreeBSD.org with today's 5-current source code.
           (belive me, "make release.4" works fine now)
2002-02-28 16:17:18 +00:00
Brooks Davis 71c7d82d26 Some style(9) whitespace fixes and a correction to the copyright. 2002-02-28 01:03:27 +00:00
Makoto Matsushita 226e3b6ec6 For unbraking "make release": s/client/common/g
(these files are sitting in src/contrib/isc-dhcp/common, not .../client.)

Confirmed by: 5.0-CURRENT-20020228-JPSNAP at snapshots.jp.FreeBSD.org
2002-02-28 00:02:33 +00:00
Bill Fenner 5db89bc7e6 Use network byte order for the ICMP sequence number. This is only
significant when monitoring packets on another system, since
 otherwise the ICMP sequence number is only used by the ping client.
2002-02-27 22:37:22 +00:00
Dima Dorfman 76183f3453 Introduce a version field to `struct xucred' in place of one of the
spares (the size of the field was changed from u_short to u_int to
reflect what it really ends up being).  Accordingly, change users of
xucred to set and check this field as appropriate.  In the kernel,
this is being done inside the new cru2x() routine which takes a
`struct ucred' and fills out a `struct xucred' according to the
former.  This also has the pleasant sideaffect of removing some
duplicate code.

Reviewed by:	rwatson
2002-02-27 04:45:37 +00:00
Murray Stokely d52ccfe321 Add some ifdef(RELEASE_CRUNCH) goo to explicitly list the requisite
object files for crunchgen.  Without this patch, release.4 will fail
to build the crunched binaries for the release floppies.
2002-02-26 15:12:54 +00:00
Bruce Evans ce68584226 #include <sys/time.h> instead of depending on namespace pollution in
<sys/stat.h> for its prerequisite <sys/time.h>.

#include <sys/param.h> in the correct place instead of bogusly including
<sys/types.h>.
2002-02-25 03:36:06 +00:00
David E. O'Brien d5c6e8dee0 Neutralize bits of ns_parse.c with bad juju. 2002-02-20 05:45:59 +00:00
David E. O'Brien 3c442e5104 Style cleanup.
Approved by:	Murray
2002-02-19 22:23:49 +00:00
Murray Stokely 0829ba2c77 Makefile glue for DHCP v3 import. 2002-02-19 12:57:18 +00:00
Mike Barcroft fd8e4ebc8c o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
  source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
  Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
  POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
  and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
  complexities associated with having MD (asm and inline) versions, and
  having to prevent exposure of these functions in other headers that
  happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
  third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on:	alpha, i386
Reviewed by:	bde, jake, tmm
2002-02-18 20:35:27 +00:00
Josef Karthauser 978d3bfe9c Add some more partition types.
PR:		i386/14793
MFC after:	3 days
2002-02-18 19:32:38 +00:00
Ian Dowse ab3d6ee098 Use a more robust scheme for determining how many blocks to skip
after an EOT-terminated volume. We keep track of the current record
number, and synchronise it with the c_tapea field each time we read
a header. Avoid the use of c_firstrec because some bugs in dump can
cause it to be set incorrectly.

Move the initialisation of some variables to avoid compiler warnings.
2002-02-18 02:29:47 +00:00
Ian Dowse dea08b6818 When we reach the end of the dump in findinode(), ask for another
volume if we missed some earlier tapes (the user can still enter
'none' later if the tapes are unavailable). Previously with 'x'
restores, we might not ask for all tapes if the tapes are supplied
in reverse order.

Clarify the message that describes what volume should be mounted
first; reverse order is only efficient when extracting a few files.
2002-02-18 00:54:18 +00:00
Ian Dowse 2bb823d2b9 Supply progress information in dump's process title, which is useful
for monitoring automated backups. This is based on a patch by Mikhail
Teterin, with some changes to make its operation clearer and to
update the proctitle more frequently.

PR:		bin/32138
2002-02-16 21:05:16 +00:00
Ian Dowse 19f8080e63 On receipt of a SIGINFO, schedule an immediate printout of the
percentage complete and remaining time estimate.

PR:		bin/32138
Submitted by:	mi
2002-02-16 20:22:26 +00:00
Luigi Rizzo 535862401b Do not disable IPv6 and vlan support when RELEASE_CRUNCH is defined.
We do support already IPv6 in the RELENG_4 boot floppies, and
vlan might be desirable as well.
2002-02-15 03:57:06 +00:00
Ian Dowse cfd8a00918 In createfiles(), properly handle a number of cases where no further
volumes are available, instead of getting stuck in a loop calling
getvol(). Normally restore in 'x' or 'i' modes will ask for a new
(earlier) volume when the current inode number on the tape is greater
than the last inode to be restored, since there can be no further
inodes of interest on that volume. However we don't want to change
volumes in this case either if the user explicitly said that there
are no more tapes, or if we are looking at the first volume.

When no more volumes are available but there are still inodes that
we have not found, we now just fall through to the code that prints
out a list of any missing files, so the restore completes normally.
Also simplify the logic a bit by always returning to the start of
the main for(;;) loop whenever the volume has changed.

This should completely fix the "Changing volumes on pipe input" bug
that is often observed when restoring dumps of active filesystems.

PR:		bin/4176, bin/34604, misc/34675
2002-02-14 01:30:45 +00:00