Commit Graph

7070 Commits

Author SHA1 Message Date
mlelstv da22d85db7 Ignore EXT4 'kbytes written' field when validating alternate superblock. 2019-03-31 13:16:52 +00:00
mlelstv 25aaa28e7c No longer rely on data in disklabel to deduce alternate superblock
positions from block size. Instead use the same defaults as newfs_ext2fs.

Side effect is that fsck_ext2fs now works with wedges.
2019-03-31 10:55:58 +00:00
mlelstv fcaa2faa3e remove debug printfs from last commit. 2019-03-31 10:52:00 +00:00
mlelstv bbddb1419d Ignore recorded last mount point when validating alternate superblocks.
Compute log_bsize correctly. This fixes computation of alternate
superblock addresses.
2019-03-30 17:32:40 +00:00
martin d48fad1d9d Allow -b to specify a partition for "gpt unset" as well. 2019-03-26 14:55:02 +00:00
martin d0774e18ba When displaying a single partition (gpt show -i ...) display offset
and size in sectors (instead of the totally confusing bytes),
followed by the humanized byte offset/size.

This makes the numbers match the "gpt show" or "gpt show -a"
output.
2019-03-26 11:23:55 +00:00
martin 1756583860 Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.
2019-03-25 20:15:49 +00:00
wiz d774658d68 Bump date for previous. 2019-03-25 07:03:17 +00:00
manu eeb96f8c80 Add -U flag to dump(8) and dump_lfs(8) to specify dumpdates entry
This address situations where dump(8) cannot figure out the device being
dumped. It also allows tracking of subvolume dumps by using virtual
device as dumpdates entry.
2019-03-25 02:13:01 +00:00
martin 2ee402b3d0 Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).
2019-03-24 13:45:35 +00:00
martin f2b09ed0f6 Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.
2019-03-24 13:31:00 +00:00
mlelstv 5ca1f5a8c5 print little-endian header fields correctly. 2019-03-14 10:26:10 +00:00
mrg 6a0755298a make ext2fs rev1 the default. this enables LARGEFILES support. 2019-03-06 05:11:13 +00:00
mrg 51102cfc35 - smart vendor support now does try to guess the vendor,
adjust the BUGS to suit
- claim some copyright
2019-03-03 04:51:57 +00:00
mrg 37b18b6d27 add a samsung specific SMART table with:
235 - POR Recovery Count
	243 - SATA Downshift Count
	244 - Thermal Throttle Status
	245 - Timed Workload Media Wear
	251 - NAND Writes

all 5 turn up on newer samsung SSDs, though 3 of them all
read 65535 for me across muliplte devices.
2019-03-03 04:48:19 +00:00
jnemeth 487d107169 Make it clear when displaying data from the MBR. 2019-03-03 03:20:42 +00:00
jnemeth f23b40fcf3 add some more FAT file system types 2019-03-03 02:28:14 +00:00
christos c8d11eb8cc Use getfsspecname() to fill the filesystem argument in dumpdates.
While here, make sure that the error strings terminate with newline
consistently, and add a function that adds the system error string.
2019-03-01 16:42:11 +00:00
mrg 7aa75b6a2f add some intel specific smart values, and be more specific for
a bunch of micron/crucial values.
2019-03-01 02:33:43 +00:00
martin 8010630c8f Make "gpt migrate" work for disks with FAT32 and NTFS partitions 2019-02-10 10:35:51 +00:00
oster 6b6fd5e205 Correct printed IOCTL name that was incorrect since rev 1.5. 2019-02-06 22:38:10 +00:00
mrg 7b743cfc69 - add the string length as an explicit parameter to get_time_string()
- remove casts when the same type is used on both sides
- expand hours_buffer[] to fit the range of hours in an 'int'
- add a work around for the sprintf() truncation checker that fails
  to detect that 'minutes' and 'seconds' have a small range
2019-02-04 09:31:22 +00:00
mrg 82974f2217 check for snprintf() truncation and fail sanely if so, rather than
attempting to use a file that won't exist or isn't secure.
2019-02-04 08:21:11 +00:00
mrg f0885992ce - bump buffer sizes to avoid potential truncation issues 2019-02-04 04:36:41 +00:00
mrg 272df19f70 - mark Exit() __dead
- bump a buffer size to avoid possible truncation
- adding missing fallthru comment
2019-02-03 12:17:14 +00:00
mrg fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
martin be31cead4d Fix three MBR extended partition related bugs:
1) when walking an extended MBR chain, do not assign duplicate indices
 2) the pointer to the next MBR may be any of the MBR_PTYPE_EXT* variants
 3) the ext MBR chain links are relative to the primary extended partition,
    unlike the contained partitions which are relative to the extended MBR
    block address.
2019-01-27 13:16:05 +00:00
pgoyette d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
mlelstv e93ebd453a Avoid crash when no algorithm is specified in parameter file. 2018-12-30 12:05:48 +00:00
wiz e63c9a2484 Sort SEE ALSO. 2018-12-29 18:34:01 +00:00
alnsn 7f3a8bf678 s/Dec/December/. 2018-12-28 18:33:54 +00:00
mrg 926d7d66f0 avoid infinite loop in kmem_check(). fixes bug introduced in previous. 2018-12-27 21:25:46 +00:00
alnsn 4b140abf1c Document that cgd.conf supports NAME=label and ROOT.<suffix> targets.
XXX Default paramsfile for NAME=label is /etc/cgd/dkNN (resolved wedge
partition) and /etc/cgd/ROOT.<suffix> for ROOT.<suffix>. This isn't yet
documented. IMO, it should be the other way around: /etc/cgd/label
for the former and /et/cgd/[root-device] for the latter.
2018-12-27 21:17:08 +00:00
msaitoh 7b54e0066d Add SIOCSETHERCAP. It's used to change ec_capenable. 2018-12-21 08:58:08 +00:00
martin 2e2c571302 Add a query function (for external code) to enumerate the know guids.
Add recently added VMware GUIDs to the internal enum type.
Fix some short names (bogus + duplicate).
2018-12-20 14:58:10 +00:00
christos f5cba070b3 Address of packed member might not be aligned. 2018-12-09 17:52:48 +00:00
wiz 122244022d Remove trailing whitespace. 2018-12-05 14:45:59 +00:00
mrg 3d07a0370e "smart status" already obtains the ata parameters to check if smart
is actually supported, so we can attempt to guess a vendor smart
table from the model name.  add basic support for all the micron /
crucial disk names i could find, and add a couple more micron
specific values.

XXX: probably should add regex support for matching, and probably
     should be more restrictive with the current matches.
2018-12-05 06:49:54 +00:00
jdolecek b066f5eebd since NVMe 1.2 (which defined the ONCS bit), the bit (4) is whether controller
supports 'Save' field in Set Features, and 'Select' field for Get Features,
not the support for the 'Set Features' command itself
2018-12-01 18:29:19 +00:00
mlelstv 71e18f4b60 When merging entries with the keyboard map, print only the resulting changes.
While here, replace bcopy with standad memcpy.
2018-11-23 06:31:57 +00:00
ozaki-r 75d57a2a1e Fix the format of ifconfig linkstr; it takes an argument 2018-11-15 04:37:20 +00:00
ozaki-r bd3e222d34 ifconfig: add linkstr/-linkstr to the help message 2018-11-15 04:36:46 +00:00
mlelstv 51aec893ad In validate_bootsel, the code assumed that arr[j][i] can be accessed
with something like arr[0][j*ARRAYWIDTH+i]. gcc no longer allows such
hacks and discards the code silently because of undefined behaviour.
2018-11-14 12:05:29 +00:00
christos 2888de0106 Improve examples and netmask information (from Dan Plassche) 2018-11-12 00:56:26 +00:00
msaitoh 54c9821e53 "s/ are are / are /" in comment. No functional change. 2018-11-08 06:34:40 +00:00
mrg d482d53137 put a bunch of the kvm_read + warn on failure code into a macro that
describes more about what failed.  now errors tell you which actual
variable was being requested instead of simply saying "not yours".

tested on amd64 as working.  written for arm64 testing.
2018-11-06 04:07:22 +00:00
mrg f5f53dd6ab add support to detect the 3 vmware GPT partition types:
- VMKcore (dump partition)
- VMFS
- VMware reserved

this enables vmkcore partitions for netbsd swap or dump, as well
as naming all of them.
2018-11-06 04:04:33 +00:00
wiz 233a76a940 Use more appropriate macros. Make a sentence easier to read. 2018-11-03 10:51:14 +00:00
mrg ca08a0c2e1 extend "smart status" command to "smart status [vendor]", and supply a
"Micron" (for Micron/Crucial) list with their documented values.

this allows the vendor-specific data to be used.

there appears to be no simple way to automatically determine the right
vendor to use -- identify data seems to be the only obvious way and
that data can be and is changed by OEMs.  (eg, a disk may be listed as
being "dell", but dell don't make disks.)  as such, no attempt is made
to automatically determine if a vendor list should be used.
2018-10-31 20:00:56 +00:00
kre c576beb79a kern.boottime was changed from a struct timeval to a struct timespec
in January 2009 (the Christos' time merge, when time_t went to 64 bits).

sysctl needs to catch up.   (So do other progs, which will happen, eventually,
but most of them are unaffected in any practical way.)

If you are running a system (NetBSD 6 or later) without this change, try
	sysctl -nn kern.boottime
and marvel at the result (in theory, seconds.microseconds) most
probably being something like:
	jinx$ sysctl -nn kern.boottime
	1540801874.999995564
(There is a 1 in 1000 chance your system will have booted
in the interval [0 , 999999] nanoseconds after some second,
in which case this will not be observed.   You should get
(almost) the same value after this change - just now it is as
it should be (there should now always be 9 digits after the '.').

On the other hand, if you're on a big-endian 64 bit host (running
64 bit sysctl) you would have always seen 0 for the microseconds field.
That should be fixed by this.

In sysctl(7) also document what we mean by "the time the system booted".

XXX Pullup -8
XXX Pullup -7
XXX Pullup -6 (oops, missed that one...)
2018-10-30 19:41:21 +00:00
kre 7008793d77 Correct the 6 second offset issue between the time reported by
dmesg -T and the actual time a message was produced, noted on
current-users by Geoff Wing (Oct 27, 2018).

The size of the offset would depend upon architecture, and processor,
but was the delay from starting the clocks to initialising the time
of day (after mounting root, in case that is needed).

Change the kernel to set boottime to be the time at which the
clocks were started, rather than the time at which it is init'd
(by subtracting the interval between).

Correct dmesg to properly compute the ToD based upon the
boottime (which is a timespec, not a timeval, and has been
since Jan 2009) and the time logged in the message.

Note that this can (rarely) be 1 second earlier than date reports.
This occurs  when the time when the message was logged was actually
in the next second, but the timecounters have not yet processed
the tick, and so the time of the last tick, near the end of the
previous second, is reported instead.   Since times are always
truncated, rather than rounded, it is occasionally possible to
observe that disparity (if you try hard enough).

IOW: sys/kern/subr_prf.c:addtstamp() uses getnanouptime() rather
than nanouptime().

Note in dmesg(8) that -T conversions are gibberish other than
when the message comes from current the running kernel.  (It
could be fixed when -M is used, for messages generated by the
kernel whose corpse is being observed.   But hasn't been...)
2018-10-30 19:40:35 +00:00
mlelstv a66cbab44c When changing entries skip those that do not match the -L option.
Should fix PR 53668.
2018-10-14 20:10:49 +00:00
hannken 74ee23a34f Add a test for duplicate inodes on the persistent snapshot list. 2018-10-05 09:49:23 +00:00
jmcneill c2d1c4cbdd Add libpuffs (fixes sun2 build) 2018-10-03 13:34:44 +00:00
jmcneill 3bd68f4ea1 Install mount_qemufwcfg everywhere instead of just x86. 2018-09-30 15:56:46 +00:00
wiz dccb361dc8 Fix wrong macro, use An. 2018-09-25 09:55:41 +00:00
maxv 6049b090a1 Remove the userland part of ISDN. The kernel part is untouched for now.
ipppctl was actually an exact copy of pppoectl; there is no functional
change in pppoectl in this commit.
2018-09-23 07:24:19 +00:00
kre bbc0ac65c7 Whitespace. NFC. 2018-09-20 23:46:42 +00:00
kre 4cf82913ec Use the locale's numeric radix character ("decimal point") more generally
(in !SMALL versions of dmesg).
2018-09-20 19:50:42 +00:00
kre ff30845eba s/or/of/ (a common typo of mine) and s/or// (too many of them.) 2018-09-20 10:03:31 +00:00
kre 3d4a88b591 Remove #if 0'd code that somehow got mangled in the (somewhat messy)
commit process and ended up being a syntax error...
2018-09-20 06:06:06 +00:00
wiz 604e240dd5 Remove a comma and some trailing whitespace. 2018-09-20 01:11:19 +00:00
christos 9f61665baf changes from kre@
- pass intmax to fmtydhmsf instead of time_t to avoid extra conversions.
- make -TTT mean "always keep 3 decimal digits of duration precision" (ie:
  always print ms)  (including trailing 0's, even .000 if it happens)
- make -T (all forms) be subject to the locale (obey the radix character)
- don't print ymd, since that would require calendar calculations to get
  right.
2018-09-19 23:02:14 +00:00
kre 2f9f119b68 Allow a third use of -T to force .NNN (always three digits) in -TT
(ISO8601 durations) format for timestamps - that is,not dropping trailing 0's.
2018-09-19 22:58:03 +00:00
kre 0d9f7721aa In -TT mode (ISO8601 duration timestamps) print milliseconds as
decimal fractions of a second (as they should be) rather than integer
milliseconds (ie nnn.1means nnn seconds and 1/10 of a second, not
nnn seconds, and 1 millisecond).   While here convert some inappropriate
time_t usage to intmax_t which works better (int, or long, would probably
work just as well).
2018-09-19 22:55:12 +00:00
christos a1d2abcab8 add -TT printing ISO 8601 duration 2018-09-19 00:15:05 +00:00
kre bf1152873a Remove uses of test -o 2018-09-16 22:37:24 +00:00
prlw1 30eeab08c0 typo 2018-09-01 11:46:52 +00:00
sevan 0a08194f8e Add the -T flag to usage() 2018-08-27 15:50:39 +00:00
sevan 697ce8551e Remove references to -c flag which was never included. 2018-08-27 15:16:49 +00:00
sevan ae1f9ce6c8 Add missing -z flag to usage() 2018-08-27 14:55:46 +00:00
sevan 3a6f34847d Remove reference to -c flag which was never implemented. 2018-08-27 00:36:03 +00:00
roy 5d499f6897 Resolve every route(4) message type before printing anything more about it
other than the type and length.

This solves the issue where RTM_ONEWADDR is received and it tries to
parse route information from it.
2018-08-14 20:53:07 +00:00
roy 76fcbe2e7c Mark _error() as printflikee 2018-08-02 03:40:51 +00:00
wiz b277a5a934 Various improvements to the man page. 2018-08-01 17:26:30 +00:00
sevan 162b461b88 Remove references to XNS 2018-07-31 21:22:09 +00:00
sevan 6733b800d4 Remove ISO & XNS references which are now long gone. 2018-07-31 20:54:18 +00:00
khorben d7f036be09 Add a port of the umb(4) driver from OpenBSD
The umb(4) driver provides support for USB MBIM (Mobile Broadband
Interface Model) devices.

MBIM devices establish connections via cellular networks such as GPRS,
UMTS, and LTE. They appear as a regular point-to-point network interface, transporting raw IP frames.

Required configuration parameters like PIN and APN have to be set with
umbctl(8), a new tool specific to this driver. The IP address is configured
automatically; the default route and DNS server information have to be set
separately.

The driver is not fully functional yet, it is therefore still marked as
experimental and disabled by default. Any help welcome to complete it!

Tested on NetBSD/amd64, with a Sierra Wireless EM7345 LTE modem on a Lenovo
ThinkPad T440s. No functional change expected otherwise.
2018-07-31 16:44:28 +00:00
wiz 75bef1827d Remove superfluous macro. 2018-07-18 17:57:00 +00:00
dholland be73ca0156 Document what rrestore is (was once) for. PR 53442.
CVS: ----------------------------------------------------------------------
2018-07-15 06:16:12 +00:00
dholland c0640bfe41 Document what rdump is (was once) for. PR 53442. 2018-07-15 06:14:13 +00:00
jnemeth aa3b5bb2ee Not all things that write to the disk do something that dk(4) will
be interested in.  Let individual commands decide if ioctl(DIOCMWEDGES)
should be done.  I was conservative and set the flag on any command
that might create/modify/delete partitions in any way.
2018-07-03 03:41:23 +00:00
sevan ab8dd17d7b vnconfig name is retained for backwards compatibility. Use vndconfig.
Heads up by <tsutsui>
2018-06-30 09:27:41 +00:00
sevan 8ec25d68b5 Note vnconfig(8) may be of interest, especially when looking to mount an iso via
loopback.
2018-06-29 19:13:19 +00:00
kamil bd8efe16d3 Avoid misaligned access in disklabel(8) in find_label()
Introduce a new helper variable tlp and use it for memory access.

Detected with MKSANITIZER/UBSan

A patch by <christos>
2018-06-27 01:14:48 +00:00
zafer c3796b42cb Remove duplicate assignments.
Fixes PR bin/51512 by Jose Luis Rodriguez Garcia
2018-06-12 20:12:21 +00:00
kamil 5f51a87ea5 Correct Undefined Behavior in ifconfig(8)
Unportable left shift reported with MKSANITIZER=yes USE_SANITIZER=undefined:

# ifconfig
alc0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ec_capabilities=3<VLAN_MTU,VLAN_HWTAGGING>
        ec_enabled=0
        address: xx:xx:xx:xx:xx:xx
/public/src.git/sbin/ifconfig/af_inet.c:102:34: runtime error: left shift of 16777215 by 8 places cannot be represented in type 'int'
        inet 192.168.0.38/24 broadcast 192.168.0.255 flags 0x0
        inet6 xxxx::xxxx:xxxx:xxxx:xxx%alc0/64 flags 0x0 scopeid 0x1
lo0: flags=0x8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33624
        inet 127.0.0.1/8 flags 0x0
        inet6 ::1/128 flags 0x20<NODAD>
        inet6 fe80::1%lo0/64 flags 0x0 scopeid 0x2

Change shifting left 1 to shifting 1U. This corrects the issue.

        if (cidr < 32) {                /* more than 1 bit in mask */
                /* check for non-contig netmask */
                if ((mask ^ (((1 << cidr) - 1) << (32 - cidr))) != 0) // <- here
                        return -1;      /* noncontig, no pfxlen */
        }

Solution suggested by <uwe>

Sponsored by <The NetBSD Foundation>
2018-06-11 17:45:50 +00:00
kamil 1c426e1841 Restore the MKGROFF=bo MKCXX=yes build
Mark the documentation in dc(1), gprof(1), rogue(6) and fsck_ffs(8) with
the .roff flag in SUBDIR.

Sponsored by <The NetBSD Foundation>
2018-06-11 14:18:16 +00:00
wiz 36ad4ce7a8 Remove Tn for standard abbreviations. 2018-05-17 06:37:06 +00:00
thorpej e832c294bb Default NFS mounts to using TCP transport instead of UDP.
PR kern/53166
2018-05-17 02:34:31 +00:00
kre 0efffb3e4f With the change to use getpass_r the 128 byte passphrase limit no
longer applies, so update the BUGS section here to reflect that change.
The limit now is 1023 whichever method is used to fetch the passphrase.
2018-05-09 20:23:35 +00:00
alnsn 265610788f use explicit_memset(3) 2018-05-09 19:38:46 +00:00
alnsn 98def45107 Missed one change when doing a manual merge of my patch with kre's commit. 2018-05-09 18:18:11 +00:00
alnsn bf3984213d Add '-e' option (echo the passphrase) and wipe the passphrase after use.
XXX Using memset for wiping isn't a good idea because memset is likely
optimised away by gcc. This should be revisited.
2018-05-09 18:11:56 +00:00
wiz 9f41709322 Add commas in enumeration. 2018-05-09 17:35:03 +00:00
kre 2d50dc8f17 Fix missing -p in usage message (noted by Christoph Badura, thanks),
and update -l usage as well.

While here fix man page synopses and a few other odds and ends.
2018-05-09 14:27:41 +00:00
kre 99316b228e Check arg count in configure() at entry, rather than later.
This avoids the stupid null deref I added a couple of commits
ago (on bad usage) and also simplifies the rest of the routine
which no longer needs to check the arg count nearly as much.

Thanks to Alexander Nasonov for finding the null deref bug.
2018-05-09 13:19:33 +00:00
kre ed050bc6ea Fix usage for rump. Fixes test breakage caused by previous commit. 2018-05-06 20:55:42 +00:00
kre 8880a43f55 Check whether the cgd device selected is available to be
configured,that is, not already in use, before requesting
passwords from the user (or elsewhere).
2018-05-05 11:28:44 +00:00
kre 1c825c2c91 Spello. (it is "existence").
ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!
2018-05-01 21:16:02 +00:00
wiz 64f2452046 Bump date for new EXIT STATUS section. 2018-05-01 21:04:01 +00:00
wiz 32e2530e6d Sort sections. 2018-05-01 21:03:37 +00:00
martin 72be6dafa1 Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.
2018-05-01 08:17:13 +00:00
maxv b5d4b113f7 Add code 3 of paramprob, part of RFC7112: "IPv6 First Fragment has
incomplete IPv6 Header Chain". Handle this code in ping6.
2018-04-24 07:22:32 +00:00
maxv 519a11ad08 Remove annoying (void) casts. 2018-04-24 07:12:04 +00:00
maxv f025b20b34 Remove double include and unused macros. 2018-04-23 18:48:30 +00:00
maxv f4598fe58b Remove the "-R" option. It uses IPV6_REACHCONF, but we've never had
this.
2018-04-23 18:44:39 +00:00
maxv fa0be10b46 Fix usage(), A/E don't exist. 2018-04-23 18:37:19 +00:00
maxv ed8f79525d Simplify: remove #ifdefs for constants that are always defined, and
remove their #else's (some of which can't compile, since they use values
that since got removed).
2018-04-23 18:32:18 +00:00
maxv a845eccede Remove dead/broken code, we want to favor RFC3542 over RFC2292. No
functional change. traceroute6 and rtadvd did the same.
2018-04-23 10:35:20 +00:00
wiz da9f189127 Sort options. Sort option descriptions. Remove Tn.
Sync usage (more) with man page.
2018-04-23 07:25:36 +00:00
maxv 9948652569 Remove the "hops" parameter, it uses RH0, which is deprecated by RFC5095,
and doesn't work on modern networks anymore.
2018-04-23 06:51:25 +00:00
nonaka ca639f32c5 nvmectl(8): Remove some wdc subcommands from man page.
- wdc drive-log
- wdc get-crash-dump
- wdc purge
- wdc purge-monitor
2018-04-18 10:17:54 +00:00
nonaka d2ae75c29e nvmectl(8): fix subcommand usage. 2018-04-18 10:16:22 +00:00
nonaka 6ac76f5b92 nvmectl(8): Add big-endian support.
from FreeBSD nvmecontolr(8) r329824.
2018-04-18 10:11:44 +00:00
nonaka 605c860b16 nvmectl(8): fix wdc command usage. 2018-04-17 15:31:00 +00:00
nonaka 1f5086ec4f nvmectl(8): Sync with FreeBSD nvmecontrol(8) r328763. 2018-04-17 08:54:35 +00:00
maxv bc7ed98e99 typo in comment 2018-04-15 08:27:21 +00:00
kre 329132e2a8 Make timestamp reading code adapt to whatever precision (up to
nanoseconds, 9 digits) the kernel happens to send in the timestamps
in log messages.

Output (numeric) timestamps (when produced) are unchanged and always
in microseconds (for now).
2018-04-14 01:37:34 +00:00
kre 2b71f00cba Minor wording change (no date bump needed.) 2018-04-14 01:34:47 +00:00
mrg 28731ff616 if a new map entry doesn't fit, be more verbose about the sizes. 2018-04-11 07:14:23 +00:00
mrg d144e17dce add information about how to boot from gpt. mostly taken from the wiki. 2018-04-11 07:13:18 +00:00
wiz ba701a99f9 Update usage. 2018-04-11 06:41:23 +00:00
wiz a10e00a15c Sort flags in SYNOPSIS. 2018-04-11 06:40:53 +00:00
christos 2fef76cb66 match the linux dmesg flags. 2018-04-10 22:21:52 +00:00
christos 6d9827c89d eat NUL's first so that the state machine is not altered by them. 2018-04-02 01:15:31 +00:00
christos eb23b853bb handle log being before timestamp... 2018-04-01 19:36:13 +00:00
christos db02d1fb9e Handle new timestamp sequences. 2018-04-01 19:31:16 +00:00
ryo fe33aa2786 Add initial support for ARMv8 (AARCH64) (by nisimura@ and ryo@)
- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@, jmcneill@)
2018-04-01 04:35:01 +00:00
mlelstv 20bad51beb Handle sector sizes != 512, check partition overlaps, improve guessing
of filesystem parameters.
2018-03-30 13:14:25 +00:00
christos 373dcdfac1 PR/51418: Jose Luis Rodriguez Garcia: Fix incore src/sbin/fsck_lfs/bufcache.c
XXX: pullup-8, pullup-7
2018-03-30 12:56:46 +00:00
nakayama 6ebbd813f6 Follow the ioctl arg changes of RAIDFRAME_GET_COMPONENT_LABEL and
RAIDFRAME_CHECK_*_STATUS_EXT.

This should fix strange raidctl -s outputs reported in
current-users ML.
2018-03-24 19:41:35 +00:00
roy 68900ca448 Handle the routing socket overflowing gracefully. 2018-03-23 11:57:33 +00:00
mlelstv a23ee50408 Check device parameter to avoid segfaults. Agument synopsis for -l option. 2018-03-19 09:06:20 +00:00
jdolecek f24079bab1 use setprogname()/getprogname(), do not hardcode the prognam name in fixed
strings
2018-03-17 11:07:26 +00:00
jakllsch fbdc91920d Revert functional changes in previous, at expense of strict KNF conformance. 2018-02-14 17:43:09 +00:00
hannken 6e4615fb0f Treat an inode with "mode == 0" and "blocks != 0" as partially allocated
and clear it as ffs_newvnode() tests for "blocks == 0".
2018-02-13 11:20:08 +00:00
sevan 9b1213ca1f Spelling 2018-02-13 00:34:11 +00:00
dholland 32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
mrg 1b8d2f5ad2 update for GCC 6:
- read_rt() has a missing {} issue.
2018-02-06 09:33:07 +00:00
mrg 845c916a36 updates for GCC 6.4:
identd has aliasing violations, use -fno-strict-aliasing.

newfs_msdos's getbpbinfo() has missing {} issues.

sysctl's kern_cp_id() has missing {} issues.
2018-02-04 09:03:23 +00:00
uwe 6a5e01dbb3 It's not literal "-options" so use .Ar 2018-01-24 12:04:47 +00:00
skrll ac34435581 Remove port-acorn26
OK core@
2018-01-24 09:04:40 +00:00
wiz 64727772b4 Fix typos.
XXX: does not compile for me because of constness issues
2018-01-23 15:02:03 +00:00
wiz 55bf1e41e9 Improve description of options. Based on comments by Tomohiro Kusumi. 2018-01-23 14:58:46 +00:00
wiz c54beb77bd Sync usage with man page. 2018-01-22 10:41:18 +00:00
wiz cf7ae89ea7 Add RCS Id, simplify wording, sort.
The option arguments need to be properly described.
2018-01-22 10:40:22 +00:00
kamil 8d6d0994ab Improve the mount_autofs(8) stub documentation
Improve DESCRIPTION and NAME.
2018-01-22 10:34:20 +00:00
kamil 0689dd382b Add mount_autofs(8) from DragonFly BSD 2018-01-22 09:45:32 +00:00
mrg f2b04ca083 implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly.  remove useless 'row' in a few
places.  add COMPAT_80 and put the old ioctls there.

raidframeio.h:
  RAIDFRAME_TEST_ACC
  - remove, unused
  RAIDFRAME_GET_COMPONENT_LABEL
  - convert to label not pointer to label
  RAIDFRAME_CHECK_RECON_STATUS_EXT
  RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
  RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
  - convert to progress info not pointer to info
  RAIDFRAME_GET_INFO
  - version entirely.
raidframevar.h:
  - rf_recon_req{} has row, flags and raidPtr removed (they're
    not a useful part of this interface.)
  - RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
  - RF_RaidDisk_s{} is re-ordered slightly to fix alignment
    padding - the actual data was already OK.
  - InstallSpareTable() loses row argument

rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.

rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.

move several of the per-ioctl code blocks into separate functions.

add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.

add missing case for RAIDFRAME_GET_INFO50.

adjust raid tests to use the new .conf format, and add a case to
test the old method as well.

raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified.  for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)

note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 00:32:48 +00:00
sborrill 3610eeec38 Explain what suffixes are accepted when specifying a size. 2018-01-15 12:20:47 +00:00
christos 5e79a1598d Add mount_autofs 2018-01-14 22:44:04 +00:00
wiz 5d07b5f046 Sort SEE ALSO. 2018-01-09 09:15:57 +00:00
christos b985414b8f Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
2018-01-09 03:31:12 +00:00
wiz dd5857855f Bump date for previous. 2018-01-07 18:11:35 +00:00
christos 0cc54e49cb KNF. 2018-01-07 15:26:43 +00:00
kre b36637ee94 PR bin/52905
Document, and properly implement, the -q and -e options to dkctl xxN listwedges.
(implementation fix supplied by Petar Bogdanovic.)
2018-01-07 12:29:25 +00:00
christos 97576db071 Use the definitions from the standard header files and replace homebrew
snprintb with the libutil one.
2017-12-13 17:42:44 +00:00
uwe 034a499654 Fix typo in flag name. We should probably just use IFFBITS string
that <net/if.h> defines.

PR bin/52815
2017-12-13 11:31:42 +00:00
wiz 7f40156188 Sync (dead) usage with man page. 2017-11-30 15:42:18 +00:00
christos 9362976817 clang does not like dead unused functions. 2017-11-30 03:31:08 +00:00
wiz c969bed60e Install qemufwcfg(4) and mount_qemufwcfg(8). 2017-11-28 11:59:16 +00:00
wiz 89fac405e7 Fix typo found by jmcneill. 2017-11-28 11:55:30 +00:00
wiz 44464768a4 Add mount_qemufwcfg man page for review. 2017-11-28 11:10:31 +00:00
christos bf50363c57 don't error on unknown options. 2017-11-26 15:03:15 +00:00
christos 301f930221 more cleanups, const 2017-11-26 03:51:45 +00:00
christos 1fc9073d30 cleanup, knf, remove debugging printf, homebrew alloc macros, types. 2017-11-26 03:06:24 +00:00
jmcneill a06265e3d0 Build and install mount_qemufwcfg on i386 and amd64 2017-11-25 23:29:43 +00:00
jmcneill c91601382a Add virtual filesystem for QEMU Firmware Configuration interface. 2017-11-25 23:23:39 +00:00
kre 70c1fd98e2 Several more cleanups:
1. Don't force use of "for" when "while" works better.
2. No need to check c != '\0' when we also check (c == ' ' || c == '\t')
3. Use the size of the buffer we're using, rather than a different one
   (not really a concern, they're the same size)
4. Don't use fscanf() to read file data, use fgets() & sscanf().
5. After using a pointer as a char *, validate alignment before switching
   to int * (can only fail if kernel #define gets set stupidly)   Or #6...
6. Validate sparemap file name isn't too long for assigned space.
7. recognise that strlen() returns size_t - don't shove it into an int.
8. On out of mem, be more clear which allocation failed in warning msg.

ATF tests all pass.   But I don't think they use sparemap files.
2017-11-22 00:31:31 +00:00
christos dbab137455 Avoid needless pointer calisthenics: &foo[0] -> foo 2017-11-21 16:31:37 +00:00
kre e8f6b3ae2f With char bug[SIZE] using sizeof(bug[0]) is kind of boring, use
sizeof(bug) instead...
2017-11-21 16:19:31 +00:00
kre 24b75d09bd White space and comment formatting. NFC. 2017-11-20 22:16:23 +00:00
wiz a1ebe6684c Remove Tn. Remove undefined .Sp. Use tagged list instead of hanging one
with .brs.
2017-11-20 21:59:30 +00:00
christos 6937a5d56d stop using magic constants
wrap long lines
use warn{,x}
make static
knf
2017-11-20 19:10:45 +00:00
kardel cb7aeb8243 support NAME=<wedge name> syntax for disks and spares 2017-11-20 18:37:56 +00:00
christos 1fd6f11802 Clarify the program naming convention, and use consistently <fstype> instead
of XXX.
2017-11-20 16:41:55 +00:00
christos 030580eaff user librumpres 2017-10-10 19:30:06 +00:00
mlelstv 9ffedbd04f Fix computation of left-over fragments also for ufs2.
Fixes PR 52600.
2017-10-09 05:24:26 +00:00
mlelstv ff454992cd clarify that alignment is the number of bytes to align to. 2017-10-03 06:55:04 +00:00
joerg d8b81801d6 Really don't include ioctl code for tools build. 2017-10-02 22:02:05 +00:00
maya 79d830d6a0 unifdef sgi. NFCI 2017-10-02 11:02:19 +00:00
maya ff0b390a62 un-ifdef sgi. NFC 2017-10-02 10:08:11 +00:00
christos 7ebfc10b9a PR/52590: David H. Gutteridge: Minor documentation improvements 2017-10-01 22:59:19 +00:00
mlelstv fa4874d540 - More fixes to use 64bit offsets.
- Compute left-over fragments also for FFS2.
2017-10-01 07:18:39 +00:00
kre 9d73fa5606 Fix the syntax (pointed out by David H. Gutteridge on source-changes-d).
Fix the build...
2017-09-30 18:32:52 +00:00
riastradh 84bea879cb Use int64_t for loop index so we don't iterate forever/until trap. 2017-09-30 15:25:16 +00:00
sborrill 0e0ce305cc Fix the most obvious integer overflow errors which can lead to superblock
corruption. Thanks to riastradh@

For example:

# df /data
Filesystem    1K-blocks       Used      Avail %Cap Mounted on
/dev/ccd0d   -19974939099004 -19982708701532 -737868756431824584   0% /data

# dumpfs -s /dev/rccd0d
file system: /dev/rccd0d
format  FFSv2
endian  little-endian
location 65536  (-b 128)
magic   19540119        time    Thu Sep 28 13:18:10 2017
superblock location     65536   id      [ 595fa4a5 3363fe37 ]
cylgrp  dynamic inodes  FFSv2   sblock  FFSv2   fslevel 5
nbfree  242773148       ndir    211185  nifree  650798800       nffree
215448
ncg     13933   size    2647654400      blocks  -4993734774751
bsize   32768   shift   15      mask    0xffff8000
fsize   4096    shift   12      mask    0xfffff000
frag    8       shift   3       fsbtodb 3
bpg     23754   fpg     190032  ipg     46848
minfree 5%      optim   time    maxcontig 2     maxbpg  4096
symlinklen 120  contigsumsize 2
maxfilesize 0x000800800805ffff
nindir  4096    inopb   128
avgfilesize 16384       avgfpdir 64
sblkno  24      cblkno  32      iblkno  40      dblkno  2968
sbsize  4096    cgsize  32768
csaddr  35792   cssize  225280
cgrotor 0       fmod    0       ronly   0       clean   0x01
wapbl version 0x1       location 2      flags 0x0
wapbl loc0 6354693888   loc1 131072     loc2 512        loc3 3
flags   none
fsmnt   /data
volname         swuid   0
2017-09-28 17:07:20 +00:00
christos 47a4080915 use __arraycount 2017-09-07 10:23:33 +00:00
christos d68621905c - make sure that the utf16 string is padded with 0's where needed.
- since the utf16 string is not 0 terminated, pass the size of the string.
2017-09-06 18:17:18 +00:00
christos dec6dba63c PR/52522: Piotr Meyer: Don't NUL terminate the gpt label name.
XXX: pullup-8
2017-09-05 18:30:46 +00:00
wiz ce31ac2bf0 Bump date for previous. 2017-08-28 05:58:08 +00:00
kamil a69b333e73 Remove the filesystem tracing feature
This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
 - /proc/#/ctl from mount_procfs(8)
 - P_FSTRACE note from the documentation of ps(1)
 - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
 - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
 - source code file miscfs/procfs/procfs_ctl.c
 - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
 - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
 - PSL_FSTRACE (0x00010000) from sys/sys/proc.h
 - P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>
2017-08-28 00:46:06 +00:00
uwe feec5ded24 Use NULL instead of 0 for null pointer. 2017-08-07 22:08:12 +00:00
wiz bcd2b17ff2 Fix punctuation markup. 2017-08-05 20:25:41 +00:00
wiz cd2cf51300 Use Fx/Nx. 2017-08-05 20:21:08 +00:00
mrg 9cb0f8bd7b add a "saveblks <file>" command that saves the data blocks of the current
inode into named file.
2017-08-04 07:19:35 +00:00
kre 7cd73c9220 Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...
2017-08-04 02:43:56 +00:00
msaitoh 1848778b0b Add note about bootme flag:
The bootme flag is used to indicate which partiotion should be booted
	by UEFI boot code.
2017-08-03 14:39:31 +00:00
wiz d3d1d19dfa Fix Dt argument. 2017-07-18 19:50:54 +00:00