aboutsummaryrefslogtreecommitdiff
path: root/sbin/savecore
Commit message (Collapse)AuthorAgeFilesLines
* Add a flag that reports the existence of a dump, and does nothing else.Doug Barton2003-09-042-4/+32
| | | | | | | | | | | The immediate purpose for this option is to use it in rc.d so that we can make savecore behavior conditional. Tremendous assistance with ideas and sanity checking provided by tjr and b@etek.chalmers.se. Notes: svn path=/head/; revision=119734
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* s/filesystem/file system/g as discussed on -developersTom Rhodes2002-08-211-2/+2
| | | | Notes: svn path=/head/; revision=102231
* The .Nm utility.Philippe Charnier2002-07-061-1/+1
| | | | Notes: svn path=/head/; revision=99503
* Fix breakage caused by allocating the I/O buffer. There was aMarcel Moolenaar2002-06-021-2/+5
| | | | | | | | | | sizeof(buf) lurking around that I missed. PR: 38811 Submitted by: Adrian Colley <aecolley@spamcop.net> Notes: svn path=/head/; revision=97746
* mdoc(7) police: nits.Ruslan Ermilov2002-05-291-8/+21
| | | | Notes: svn path=/head/; revision=97477
* Work around a memory fault on ia64 caused by having the 1MB buffer onMarcel Moolenaar2002-05-271-1/+16
| | | | | | | | the stack in DoFile(). This needs some investigation. In the mean time we do a one time malloc() for the buffer to have it on the heap instead. Notes: svn path=/head/; revision=97340
* Style.Ruslan Ermilov2002-05-131-3/+4
| | | | Notes: svn path=/head/; revision=96519
* Make argument to printf match format.Marcel Moolenaar2002-05-061-1/+1
| | | | Notes: svn path=/head/; revision=96103
* - revert back to vmcore.#Bill Fenner2002-05-053-109/+271
| | | | | | | | | | | | | | | | | - reimplement -z - use syslog() - improve consistancy of messages - allow -f to recover cleared dumps - return bufsize to 1024 * 1024 - return the ability to write sparse files - update man page - fix minfree to require 2k for info file instead of the kernel size - include Berkeley copyright too due to amount of old code copied Submitted by: Chad David <davidc@acns.ab.ca> Notes: svn path=/head/; revision=96049
* Restore the minfree functionality into savecore. This patchMaxime Henrion2002-05-041-7/+80
| | | | | | | | | | | restores the check_space() function with small modifications to make it work with the current code. The patch was slightly modified by Bill Fenner to handle error messages better. Reviewed by: fenner Notes: svn path=/head/; revision=96025
* Add FBSDID. Start errx(3) messages with lowercase. Remove a ')' with no '('.Philippe Charnier2002-04-211-14/+15
| | | | | | | | | In usage(), use fprintf(3) instead of errx(3), to make the printed string really start with `usage: ...'. Reviewed by: marcel Notes: svn path=/head/; revision=95183
* Push the .info file contents out when we're done so people canPoul-Henning Kamp2002-04-191-0/+1
| | | | | | | read the description while the megs shift from one place to another. Notes: svn path=/head/; revision=95039
* High-level changes (user visible):Marcel Moolenaar2002-04-131-56/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Implement -c (clear) to clear previously kept headers (note that dumps not cleared will remain until -c is used), o Implement -f (force) to allow re-saving a previously saved dump, o Implement -k (keep) and make clearing the dump header the default, o Implement -v (verbose) and make most output conditional upon it, o Emit minimal output for the non-verbose case with the assumption that savecore is run mostly from within /etc/rc, o Update usage message to reflect what is and what's not, o mark -d as obsolete. Low-level changes: o Rename devname to device, for devname mirrors a global declaration and GCC 3.x warns about it, o Open the dump device R/W for clear and !keep to work, o Reorder the locals of DoFile according to style(9), o Remove newlines from strings passed to warn* and err*, o Use stat(2) to check if a dump has been saved before, o Truncate existing core and info files to support force, o First check for the magic and the version before we complain about parity errors. This prevents emitting parity error messages when there's no dump, o Keep track of the number of headers found and the number of headers saved to support the minimal output, o Close files we opened in DoFile. Not critical, but cleaner. Notes: svn path=/head/; revision=94580
* Move generic disk ioctls from <sys/disklabel.h> to <sys/disk.h>.Poul-Henning Kamp2002-04-081-1/+1
| | | | | | | Sponsored by: DARPA & NAI Labs Notes: svn path=/head/; revision=94182
* Make the kernel dump header endianness invariant by always dumpingMarcel Moolenaar2002-04-031-11/+15
| | | | | | | | | | | | in dump byte order (=network byte order). Swap blocksize and dumptime to avoid extraneous padding on 64-bit architectures. Use CTASSERT instead of runtime checks to make sure the header is 512 bytes large. Various style(9) fixes. Reviewed by: phk, bde, mike Notes: svn path=/head/; revision=93717
* Add long long casts so that this compiles on archs with 64-bit longs.John Baldwin2002-04-011-4/+4
| | | | | | | Pointy-hat to: phk Notes: svn path=/head/; revision=93562
* Duh, savecore is called savecore.Poul-Henning Kamp2002-04-011-1/+1
| | | | Notes: svn path=/head/; revision=93515
* Savecore:Poul-Henning Kamp2002-03-312-747/+170
| | | | | | | | | | | | | Commandline compatible with the previous savecore unless you specify any options, none of them are implemented (yet). Scans all devices marked "dump" or "swap" for dump header signatures and saves dumps off under a name which is a MD5 hash of the header information. This should give unique filenames. A *.info file contains ascii version of the header information. Notes: svn path=/head/; revision=93492
* o remove __PWarner Losh2002-03-211-16/+16
| | | | | | | o remove main prototype Notes: svn path=/head/; revision=92883
* Remove 'register' keyword.David E. O'Brien2002-03-201-5/+5
| | | | | | | | | 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?) Notes: svn path=/head/; revision=92806
* Sparc64 support.Dag-Erling Smørgrav2002-03-111-7/+7
| | | | Notes: svn path=/head/; revision=92086
* Default to WARNS=2.David E. O'Brien2001-12-041-0/+1
| | | | | | | | | Binary builds that cannot handle this must explicitly set WARNS=0. Reviewed by: mike Notes: svn path=/head/; revision=87325
* Add a Xref to dumpon.Nick Hibma2001-10-281-0/+1
| | | | Notes: svn path=/head/; revision=85629
* Remove some bogus "(off_t)(dumplo + value)" and "(off_t)dumplo" casts,Peter Wemm2001-10-051-16/+18
| | | | | | | | since dumplo is now an off_t. Scratch a couple of other itches as well. s/L_SET/SEEK_SET/ Notes: svn path=/head/; revision=84509
* Argh. Fix another >2GB savecore problem.Peter Wemm2001-10-051-1/+1
| | | | | | | Reported by: mki@mozone.net Notes: svn path=/head/; revision=84508
* fix savecore so that it works on the alpha after the size changeAndrew Gallatin2001-09-131-2/+2
| | | | | | | | | | | | | of dumpmag from an int to a u_long in rev 1.41 -- without this change, savecore will always fail like this: #savecore -v /var/crash dumplo = 874356736 (1707728 * 512) savecore: magic number mismatch (8fca0101 != 8fca0101) savecore: no core dump Notes: svn path=/head/; revision=83415
* mdoc(7) police: restore the correct sorting of SEE ALSO.Ruslan Ermilov2001-09-111-1/+1
| | | | Notes: svn path=/head/; revision=83332
* * Switch from doing compress(1)ed crashdumps with the -z flag to usingKris Kennaway2001-09-063-39/+42
| | | | | | | | | | | | | | gzip(1). gdb doesn't understand these, but then again it didn't understand compressed crashdumps either. * Change a stray lseek() into a Lseek() * Remove the extraneous prototype for log() which has apparently never existed in FreeBSD's sources Obtained from: NetBSD (partially) MFC after: 2 weeks Notes: svn path=/head/; revision=83140
* Banish hard-coded KERNBASE references from savecore. DynamicallyPeter Wemm2001-08-241-1/+15
| | | | | | | adjust to whatever kernbase is in the kernel that we are dumping. Notes: svn path=/head/; revision=82265
* Silence non-constant format string warnings by marking functionsKris Kennaway2001-08-191-1/+1
| | | | | | | | | | as __printflike()/__printf0like(), adding const, or adding missing "%s" format strings, as appropriate. MFC after: 2 weeks Notes: svn path=/head/; revision=81911
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79530
* dumpmag is 'u_long dumpmag' in the kernel, not 'int'. If this worked onPeter Wemm2001-06-091-4/+6
| | | | | | | | | the Alpha, it was because of luck that it was little endian. Tidy up the dumpsize/dumppages confusion and the out of date comments. Notes: svn path=/head/; revision=77927
* 'int dumpsize; /* memory size in bytes */' is not good for machinesPeter Wemm2001-06-081-3/+5
| | | | | | | with 2GB or more of ram. Notes: svn path=/head/; revision=77892
* - Backout botched attempt to introduce MANSECT feature.Ruslan Ermilov2001-03-261-0/+1
| | | | | | | - MAN[1-9] -> MAN. Notes: svn path=/head/; revision=74815
* Set the default manual section for sbin/ to 8.Ruslan Ermilov2001-03-201-1/+1
| | | | Notes: svn path=/head/; revision=74531
* Restore the -c option, which was accidentally removed from the getoptDag-Erling Smørgrav2001-03-061-1/+1
| | | | | | | string two revisions ago. Notes: svn path=/head/; revision=73828
* Document the new -k option in usage message and man page.Dag-Erling Smørgrav2001-02-162-2/+4
| | | | Notes: svn path=/head/; revision=72542
* Add a -k option that prevents clearing the dump after saving it.Dag-Erling Smørgrav2001-02-161-16/+57
| | | | | | | | | | | | Use sysctlbyname() instead of sysctl(). Clear up and simplify the version extraction code. Attempt to detect stretches of zeroes in the dump and avoid writing them to disk to save space and time. Notes: svn path=/head/; revision=72541
* Prepare for mdoc(7)NG.Ruslan Ermilov2001-01-161-2/+2
| | | | Notes: svn path=/head/; revision=71099
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-2/+2
| | | | Notes: svn path=/head/; revision=68960
* Work much harder at obtaining a correct device node. If what devname(3)Dag-Erling Smørgrav2000-10-171-31/+89
| | | | | | | | | | | | | | | returns doesn't exist, or doesn't match the desired device, fall back to scanning /dev for a matching node, and as a last resort, if that fails, try to create the node ourselves as /dev/dump. Add comments to several variables and functions. Clean up syslog(3) usage; use %m instead of strerror(3). Other minor cleanup. Notes: svn path=/head/; revision=67264
* Remove superfluous code:Dag-Erling Smørgrav2000-09-281-77/+28
| | | | | | | | | | | | | | 1) use devname() instead of searching /dev for the dump device 2) use fopen() instead of open() so we don't need to differentiate between compressing and not compressing when writing the core file or the kernel (zopen() returns a FILE *, so we just use fwrite() in both cases) There should be no functional changes. Notes: svn path=/head/; revision=66429
* I'm not sure what changed to cause this, but using 'dirname' as a variablePeter Wemm2000-09-031-8/+8
| | | | | | | | was colliding with dirname() in libc.a and causing a Sig 10/bus error. Just change dirname to savedir and be done with it. Notes: svn path=/head/; revision=65396
* Tidy up the offset calculations.Paul Saab2000-05-091-5/+4
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=60293
* Read the correct size into kdumplo.Paul Saab2000-05-091-1/+1
| | | | | | | Botched/Noticed by: peter Notes: svn path=/head/; revision=60219
* Allow savecore to work on > 2GB partitions.Paul Saab2000-05-081-2/+4
| | | | | | | Submitted by: peter Notes: svn path=/head/; revision=60213
* Fixed style bugs in rev.1.28. Rev.1.28 was not submitted by bde.Bruce Evans2000-03-201-2/+3
| | | | Notes: svn path=/head/; revision=58403
* Only character devices exsist these days. Make savecore understandPaul Saab2000-03-201-33/+8
| | | | | | | this. Notes: svn path=/head/; revision=58324
* Fix bogus initialization of using a sledge hammer to quite -Wall, badDavid E. O'Brien1999-12-211-5/+4
| | | | | | | | | indention, and size issue between 32 and 64bit machines. Submitted by: bde Notes: svn path=/head/; revision=54933