Commit Graph

6901 Commits

Author SHA1 Message Date
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