Commit Graph

6780 Commits

Author SHA1 Message Date
sevan
9dd4fb3ad2 Document author and the version fsck_v7fs appeared.
Replace contraction.
Bump date.
2016-09-11 04:19:52 +00:00
sevan
c6b9fd9601 Document the version fsck_msdos first appeared.
Bump date.
2016-09-11 04:12:08 +00:00
sevan
645829aa66 Document the version fsck_ffs first appeared.
Bump date.
2016-09-11 04:07:38 +00:00
sevan
a7a41f50d0 Document the author and the version fsck_ext2fs first appeared.
Bump date.
2016-09-11 03:56:00 +00:00
sevan
2817e8b69c Document the version fsck first appeared.
Bump date.
2016-09-11 03:48:11 +00:00
sevan
ef7ad9dc67 - Document the HISTORY of fdisk based on the original post to comp.unix.bsd by
Julian Elischer [1] and the Mach 2.5 Installation notes [2].
I was unable to pin point the exact version of Mach the fdisk utility appeared
as I didn't find documentation older than version 2.5 & no source code or repo
history. fdisk utility appears as a separate utility[3] in v2.5. Due to this,
I've avoided stating the exact version fdisk first appeared in Mach.
- Make correction pointed by textproc/igor
- Bump date

[1] https://groups.google.com/forum/#!searchin/comp.unix.bsd/14-Dec-89$20Robert$20Baron$20(rvb)$20at$20Carnegie-Mellon$20University%7Csort:relevance/comp.unix.bsd/Hhi45vAHxDg

[2] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_install.ps
[3] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_manpages.ps
2016-09-11 03:35:08 +00:00
sevan
260a67f942 Document the version drvctl appeard.
Reword bad sentence.
Remove space in License.
Bump date.
2016-09-11 02:59:11 +00:00
sevan
7f58cf589a dmesg first appeared in 3BSD
http://minnie.tuhs.org/cgi-bin/utree.pl?file=3BSD/usr/src/cmd/dmesg.c
Bump date.
2016-09-11 02:24:00 +00:00
sevan
386fba73ad Mention author in AUTHORS section.
Bump date.
2016-09-11 02:18:52 +00:00
sevan
e2e783ad92 Remove ignored Pp macro, highlighted by mandoc -Tlint. 2016-09-11 02:10:31 +00:00
sevan
a3477eb231 Grammar fix suggested by textproc/igor.
Syntax fix highlighted by mandoc -Tlint.
Bump date.
2016-09-11 01:59:10 +00:00
sevan
a11e4d8d20 Document the version disklabel first appeared.
Fix spelling mistakes.
Replace contraction.
Bump date.
2016-09-11 01:48:00 +00:00
sevan
9eaf2a2b2a Document the version devpubd first appeared.
Bump date.
2016-09-11 01:38:00 +00:00
sevan
85d401802e Document the version clri first appeared.
Bump date.
2016-09-11 01:31:39 +00:00
sevan
a6b62e7892 Document the version chown first appeared.
Replace contractions highlighted by textproc/igor.
Bump date.
2016-09-11 01:23:26 +00:00
sevan
d2528dc7eb Spelling mistake.
Bump date.
2016-09-11 01:09:34 +00:00
sevan
38721343cf Note which version it appeared in before the rewrite.
Bump date.
2016-09-11 01:03:15 +00:00
sevan
fb5a698902 Spelling mistake.
Bump date.
2016-09-11 00:52:39 +00:00
martin
9286e800c1 Add a bit of swapping for values in CG descriptors (used to be done
wholesale in e2fs_cgsave, but now common code keeps them in FS byte
order). Seems to fix newfs_ext2fs on big endian hosts.
2016-09-05 10:44:36 +00:00
sevan
51fe790c4c Drop main() prototype. 2016-09-05 01:00:07 +00:00
christos
99accdc793 PR/51440: Jose Luis Rodriguez Garcia: Use the standard queue.h macro instead
of playing with the TAILQ's entrails.
2016-08-25 07:43:18 +00:00
dholland
fbf3696950 Fix handling of ffsv2 inode initialization. Retires PR 51116. 2016-08-24 07:44:05 +00:00
jdolecek
76043b45b1 report also gmtoff in the output of mount options 2016-08-21 22:27:20 +00:00
christos
4d4594470b PR/51422: Jose Luis Rodriguez Garcia: completely remove B_NEEDCOMMIT 2016-08-18 08:08:02 +00:00
christos
e9843116de PR/51422: Jose Luis Rodriguez Garcia: Remove unnecessary assignment. 2016-08-18 08:04:28 +00:00
jdolecek
a5764f7139 more informative debug output for unsupported features 2016-08-15 19:13:24 +00:00
jdolecek
b720c3e2bb adjust inode size check to compare against EXT2_REV0_DINODE_SIZE, rather then sizeof(struct ext2fs_dinode), as the structure definition was expanded with the optional fields 2016-08-15 18:57:06 +00:00
jdolecek
d2d8cddee2 divorce list of features supported by fsck_ext2fs from the kernel;
while kernel might support e.g. extents, extra_isize or dir_nlink,
fsck could actually have no idea about the features
2016-08-15 18:42:15 +00:00
mlelstv
43aac176e6 Avoid error message when /dev/wedges doesn't exist yet. 2016-08-15 12:54:40 +00:00
sevan
06495a3a2e dump was there from v4.
Confirmed from the TUHS hosted copies of man pages.
Bump date.
2016-08-15 00:03:14 +00:00
jdolecek
249e8f5f7e rename struct ext2fs_dinode attribute e2di_dacl to correct
e2di_size_high; even Linux ext2 filesystem code actually uses it
unconditionally this way and ext4 code finally also calls it that way
in their struct definition too; if there was any trace of this for other
purpose it's long gone
2016-08-04 17:43:47 +00:00
nonaka
95ec03a0f0 pass EXT2_DINODE_SIZE(&sblock) as isize to e2fs_isave(). 2016-08-04 03:01:38 +00:00
pgoyette
177830b6d7 Right-align numeric columns REFS and SIZE for easier viewing 2016-08-03 23:55:47 +00:00
dholland
05ce5c4223 Apply patch from PR 43587, mostly from martin and kre. When writing a
sysctl variable using ?= fails with EPERM, don't print an error
message.

Ideally setting a sysctl to the same value it already has should also
not fail regardless of permissions, but this would need to be done in
the kernel.
2016-07-31 23:30:28 +00:00
dholland
ed2ef35eef PR 51264 Jose Luis Rodriguez Garcia: lfs userland bufcache rehash is broken 2016-07-31 18:27:26 +00:00
dholland
fc8d0c1c35 Manipulate the signal masks so signals only arrive while we're waiting,
so they can't illegally reenter libc.

Fixes the problem Greg A. Woods describes in PR 51267, which might or
might not be the original submitter's problem.
2016-07-31 18:14:36 +00:00
dholland
52b3d9565c Don't call variables that are used "dummy". 2016-07-31 17:59:08 +00:00
martin
f0b8f9c13b From Michael Plass:
The superblock field that distinguishes between 4.2BSD and 4.4BSD
inodes is really only relevant on a UFS1 file system. Make sure that
it is a UFS1 fs before using fs_old_inodefmt.

Note that the NetBSD newfs and mkfs utilities initialize fs_old_inodefmt
even for UFS2, so problems were apparent only on file systems created
by other operating systems, for example, FreeBSD.
2016-07-28 08:24:58 +00:00
erh
2b151ae574 Eliminate the distinct path check, since the paths don't actually need to be
distinct and allowing this makes certain useful tasks possible, such as
 fixing an unpopulated /dev while a tmpfs is mounted over it.
However, require the paths to be different, as mounting a path directly over
 itself has the side effect of causing any other mount points within that path
 to no longer be accessible, and is difficult to unmount when done on /.
2016-07-25 04:40:51 +00:00
nonaka
1c1d2c157d Fix RCS Id. 2016-07-14 10:02:43 +00:00
wiz
8c6f2a8da1 Bump date for previous. 2016-07-12 10:56:01 +00:00
zafer
4158ea49d0 improve description regarding symbolic links. ok @wiz. 2016-07-12 09:59:42 +00:00
christos
3a39bad1de cgdconfig does not need crypto. 2016-07-01 22:50:50 +00:00
christos
55b06df259 replace openssl HMAC(3) with our hmac(3). 2016-07-01 22:50:09 +00:00
dholland
ece47fa390 Don't assume that getaddrinfo sets the result pointer to null when it
fails. (In fact it probably doesn't...)
2016-06-26 04:01:30 +00:00
dholland
a4b908377f Document external unmount programs. PR 698. Bump date. 2016-06-26 03:59:11 +00:00
dholland
383d022f18 Fix previous to avoid using an uninitialized pointer when using -R (raw). 2016-06-26 03:51:28 +00:00
dholland
4cc121caa5 If an external unmount program of the form "umount_TYPE" exists
(e.g. umount_ffs, umount_nfs, etc.) exec it instead of calling
unmount(2).

Closes PR 698.

Note that the original plan for the PR also involved adding a generic
facility to store an alternate FS type name in the kernel to use when
unmounting. This was intended to support filesystems implemented as
loopback nfs servers, where the visible mount would be of type "nfs"
pointing at localhost; in that case one would want to be able to
provide an additional string in order to run an unmount program that
would both remove that mount and also shut down the loopback nfs
server daemon.

However, in the 21+ years since the PR was filed, loopback nfs servers
have gone out of favor (for good reasons) so I don't see any need to
worry about this case at present, especially since the PR has been
hanging around this long anyway. (If anyone still has a loopback nfs
server that they want to use a custom unmount program with, file a new
PR and assign it to me and I'll deal with it specifically in the nfs
mount args structure, which unmount already knows how to retrieve and
examine.)

It is my understanding that filesystems implemented with fuse (which
has displaced the loopback nfs server model) can already set the FS
type field so no further work is needed to allow them to use a custom
unmount program. If this is not the case, please let me know and I'll
attend to it.

There is no longer any need that I see to provide a general facility
for storing an alternate filesystem type name.

(One might also ask whether there's any real need for this
functionality at all any more; this is a fair question, but (a) the
change is small and (b) there are certainly cases when doing FS
research where you want a custom unmount program; been there & done
that.)
2016-06-26 03:40:39 +00:00
dholland
75cbf5e12c When SMALL, if realpath() fails, warn() using the failing path instead
of the buffer realpath has declined to write anything into.
2016-06-26 03:05:52 +00:00
jnemeth
93fd3c01ef - fix setting of hdr_lba_alt which was broken in revision 1.10 on 2015/12/2
- switch to using gpt_last
- PR/51230 -- recreate the PMBR if it was lost
2016-06-12 12:48:32 +00:00
christos
b7b34325a9 Rename 'a' to set the active PMBR flag to 'A' 2016-06-09 19:04:43 +00:00
kre
c2246a3f2c Make "gpt show" add an "(active)" annotation to the PMBR output line
when it has been marked active for legacy (non UEFI) booting.
This was (kind of obviously) intended by the previous commit, but...
2016-06-09 17:43:36 +00:00
kre
89194609b9 Fix rendering of biosboot command synopsis. 2016-06-09 16:48:14 +00:00
christos
3017a7a39f PR/51230: Add the ability to set the active flag in the PMBR. 2016-06-09 15:12:54 +00:00
wiz
a6daee9b24 Try improving SYNOPSIS per my understanding of how this works.
Use more markup. Fix some markup.
2016-06-05 09:13:08 +00:00
joerg
0eed2a9437 Mark dead functions. 2016-06-04 20:59:49 +00:00
nonaka
cae3c2f471 nvmectl(8): Added NVM Express control utility.
Ported from FreeBSD nvmecontrol(8).
2016-06-04 16:29:35 +00:00
wiz
6975094331 Sort SEE ALSO. New sentence, new line. Punctuation nits. Use Nx. 2016-06-01 12:01:21 +00:00
pgoyette
46d007f408 Improved documentation of mount_nilfs, from PR bin/46730 2016-06-01 11:56:49 +00:00
pgoyette
596954117f Minor formatting change in swapctl -l as noted in my PR bin/51155 2016-05-31 09:34:25 +00:00
dholland
dea44b9dd8 PR 50756 David Binderman: avoid running off the end of an array in case
thing we're looking for isn't there. Which is probably impossible, but
that's not obvious.
2016-05-31 02:29:54 +00:00
joerg
1203c26a96 Add printf-like annotation. 2016-05-30 22:02:41 +00:00
mlelstv
44b25f2fac mark noreturn function exit_daemon() as __dead 2016-05-30 21:58:32 +00:00
mlelstv
6fea88c26e Several improvents to iscsid
- debug log is now using syslog
- seperate options for log level and foreground mode
- writes a pidfile so that /etc/rc.d/iscsid works
  Now links with libutil for pidfile(), the functions login() and logout()
  needed to be renamed to avoid a conflict.
- drops the nothreads option
- handles signals to shut down gracefully
- the driver may also shut down the daemon when it terminates
  Currently this cannot work as the driver can only terminate when
  the daemon has closed the driver file handle.
2016-05-29 13:35:45 +00:00
mrg
a3ddb94352 update the micron smart codes for 247/248 to match data i found in
micron's "TN-FD-33: M510DC SSD SMART Implementation Introduction"
document.

these two values can be used to calculate the write amplication
factor:

   WAF = ( A247 + A248 ) / A247
2016-05-10 08:08:59 +00:00
khorben
3df9a0e8ab More friendly error messages for modload(8) and modunload(8)
Tested on NetBSD/amd64.

From Christian Koch (cfkoch@) of EdgeBSD; thanks!
2016-05-06 00:24:45 +00:00
jakllsch
1dac11f22d The on-disk FAT array does not include anything before CLUST_FIRST,
compensate in size check.

This was tickled by my SanDisk Sansa Clip 4GB, which exactly filled the FAT array.
2016-05-02 17:33:03 +00:00
ozaki-r
09973b35ac Separate nexthop caches from the routing table
By this change, nexthop caches (IP-MAC address pair) are not stored
in the routing table anymore. Instead nexthop caches are stored in
each network interface; we already have lltable/llentry data structure
for this purpose. This change also obsoletes the concept of cloning/cloned
routes. Cloned routes no longer exist while cloning routes still exist
with renamed to connected routes.

Noticeable changes are:
- Nexthop caches aren't listed in route show/netstat -r
  - sysctl(NET_RT_DUMP) doesn't return them
  - If RTF_LLDATA is specified, it returns nexthop caches
- Several definitions of routing flags and messages are removed
  - RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and RTM_RESOLVE
- RTF_CONNECTED is added
  - It has the same value of RTF_CLONING for backward compatibility
- route's -xresolve, -[no]cloned and -llinfo options are removed
  - -[no]cloning remains because it seems there are users
  - -[no]connected is introduced and recommended
    to be used instead of -[no]cloning
- route show/netstat -r drops some flags
  - 'L' and 'c' are not seen anymore
  - 'C' now indicates a connected route
- Gateway value of a route of an interface address is now not
  a L2 address but "link#N" like a connected (cloning) route
- Proxy ARP: "arp -s ... pub" doesn't create a route

You can know details of behavior changes by seeing diffs under tests/.

Proposed on tech-net and tech-kern:
  http://mail-index.netbsd.org/tech-net/2016/03/11/msg005701.html
2016-04-04 07:37:07 +00:00
mlelstv
4842a68f63 Use the same defaults for cluster sizes as Windows. 2016-04-03 11:00:13 +00:00
ryo
ccc6dc924a no need to escape 2016-04-01 05:23:56 +00:00
christos
f4ab1bba27 -O0 for pass1.c and vax 2016-03-23 21:43:33 +00:00
dholland
89579fda21 Comment out unused logic. PR 50973 2016-03-20 04:24:46 +00:00
christos
1e4eeef8ef PR/50974: David Binderman: Remove unused code. 2016-03-17 18:56:14 +00:00
christos
c1673bd676 fix pasto 2016-03-17 01:41:54 +00:00
christos
9eac9537df Appease gcc-5 from phone@ 2016-03-17 00:54:53 +00:00
christos
c5f07454d1 PR/50921: David Binderman: Fix memory leak 2016-03-09 19:53:32 +00:00
christos
7bb0f9314c PR/50920: David Binderman: fix leak 2016-03-09 19:48:24 +00:00
christos
89e8cc1112 PR/50909: David Binderman: Optimize memset 2016-03-07 15:56:17 +00:00
christos
161a4d81ea PR/50910: David Binderman: Optimize memset. 2016-03-07 15:55:06 +00:00
dholland
60d995df79 Terminate expression with a semicolon, instead of accidentally
splicing to the next line with a comma. Noticed by Christos. Has no
actual effect, fortunately. (Compiler output is unchanged.)
2016-03-07 15:09:55 +00:00
christos
85e7d45a39 PR/50908: David Binderman: Optimize memset's 2016-03-07 14:47:25 +00:00
christos
0598d5879b PR/50909: David Binderman: Optimize memset 2016-03-07 12:48:53 +00:00
riastradh
fdeab11495 #ifdef forward declaration of setpolicy like definition. 2016-02-29 16:25:06 +00:00
riastradh
ab04408fa8 Consistently use estrlcpy for ifr.ifr_name here, not strncpy. 2016-02-29 16:23:25 +00:00
christos
a0647817d3 Add MOPT_{REL,NO}ATIME as supported by the underlying filesystems. 2016-02-21 22:51:29 +00:00
riastradh
9628679b27 Need <stdbool.h> for true/false. 2016-02-19 03:53:46 +00:00
mlelstv
c153503310 fix usage message 2016-02-06 10:35:58 +00:00
christos
a97d476aa4 fix broken patch 2016-01-31 23:11:49 +00:00
christos
0636a2fe97 PR/50729: Izumi Tsutsui: Add "SMALLPROG"-like options to disklabel(8) 2016-01-31 18:57:29 +00:00
wiz
69be113f78 New sentence, new line. Bump date. 2016-01-30 10:13:02 +00:00
mlelstv
223c7df5b3 Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.
2016-01-30 09:59:27 +00:00
christos
ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
christos
9c39ccca16 no need for <sys/mbuf.h> 2016-01-23 21:05:51 +00:00
christos
b8e29fa636 don't need mbuf.h! 2016-01-23 15:41:47 +00:00
christos
4f3d9e304d PR/50671: David Binderman: fix memory leak. 2016-01-17 15:59:26 +00:00
joerg
459b255b5e gpt_vwarnx is printf-like. 2016-01-08 18:59:01 +00:00
roy
74efc0b2e3 -W seconds will wait for the detached flag to clear on addresses on
interfaces marked up to allow time for the carrier to appear on the
interface.

This does not extend the -w option duration.
2016-01-07 11:32:21 +00:00
wiz
95e91b49e1 Sort command list in usage. 2016-01-06 23:03:13 +00:00
wiz
70ae258f94 Sort commands so I can find stuff. 2016-01-06 23:01:11 +00:00
wiz
704ad63c75 Use standard sort order for options.
Add -U to usage.
2016-01-06 22:57:44 +00:00
christos
c4e0e8f498 Access to the SET_LAST_UNIT ioctl. 2016-01-06 17:41:36 +00:00
christos
f9db75489b - add more informational messages
- handle case where last argument is an option not a device (set -l)
2015-12-29 16:45:04 +00:00
jnemeth
775c41e25a pretty up attribute display a bit 2015-12-26 13:12:16 +00:00
martin
1c2d0f1f02 Improve "show -a" display: split human readable Type: field from the Type-GUID
to avoid wrapping in the common case; add a human readable Size: display.
2015-12-26 13:08:45 +00:00
wiz
6471a2935e Simplify usage for gpt show. 2015-12-25 12:16:03 +00:00
martin
53078a2022 Add a -a flag to the show command, so we can display the full GPT with
all information in one go.
2015-12-25 10:59:56 +00:00
martin
ac62bbaf8f Fix output in an error case 2015-12-24 17:35:57 +00:00
christos
94ae268a8f mention ip6addrctl 2015-12-13 14:24:47 +00:00
pgoyette
1aa8a7614b synch usage() with the man page. 2015-12-07 03:34:00 +00:00
wiz
34c418c523 Bump date for previous.
Remove trailing whitespace.
2015-12-06 09:36:57 +00:00
christos
56604dcf08 remove more duplicated code. 2015-12-06 04:27:05 +00:00
christos
4d523900d0 Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.
2015-12-06 00:39:26 +00:00
christos
4eb04fb6c1 Add debugging and more to migration 2015-12-05 18:46:08 +00:00
christos
af38b629ef type confusion 2015-12-04 21:39:18 +00:00
christos
ffec5f5c18 Kill newline 2015-12-04 16:54:28 +00:00
christos
5b47b594ae Fix resizedisk. 2015-12-04 16:46:24 +00:00
christos
a69d504e75 put back usage from kre 2015-12-04 01:47:48 +00:00
christos
667106442f don't print dkctl message for files
fix typo
2015-12-04 01:46:32 +00:00
christos
c8b27b5883 fix label printing. 2015-12-04 01:46:12 +00:00
christos
e3058c5edd CID 1341564: Arg memory leak 2015-12-03 21:51:02 +00:00
christos
8bffbb3c7c more leak 2015-12-03 21:49:51 +00:00
christos
b58e9ed6af CID 1341563: fix leak 2015-12-03 21:48:12 +00:00
christos
e37a2a9523 CID 1341561: Argument memory leak 2015-12-03 21:46:22 +00:00
christos
560e3b65f3 CID 1341560: Free arg. 2015-12-03 21:43:25 +00:00
christos
849ad1de81 CID 1341558: Fix proplib memory leaks 2015-12-03 21:40:32 +00:00
christos
0f11011500 CID 1341556: Don't leak map info 2015-12-03 21:30:54 +00:00
christos
d293a8ecdb CID 1341548: Check error returns 2015-12-03 20:58:08 +00:00
christos
7c444fb990 compare to stdout, thanks kre 2015-12-03 04:39:41 +00:00
christos
c7ec83db51 Add a space. 2015-12-03 02:16:00 +00:00
christos
ba571ee20f Fix stray paste, noted by kre. 2015-12-03 02:09:20 +00:00
christos
5c1ccc6e9b WARNS=6 2015-12-03 02:02:43 +00:00
christos
621ecf3c5e remove extra assignment 2015-12-03 01:16:21 +00:00
christos
da0a3b4c0b eliminate static globals so that commands can be re-used. 2015-12-03 01:07:28 +00:00
christos
54261dc52d - factor out into smaller separate functions
- fix signed/unsigned confusion
- do proper write checks
- fix some memory leaks
2015-12-02 22:32:04 +00:00
christos
73ff464c21 don't hard-code the program name 2015-12-02 20:42:07 +00:00
christos
b62e64290c merge duplicated code and check allocations. 2015-12-02 20:41:10 +00:00
christos
2e738cf025 check allocations 2015-12-02 20:09:54 +00:00
christos
53de6040eb annotate map additions with non-allocated memory. 2015-12-02 20:09:33 +00:00
christos
c458b37c6c - check errors from map allocation
- make map_resize return -1 instead of 0, and handle errors locally
  explaining what's going wrong
2015-12-02 20:01:44 +00:00
christos
2eda9128ae Allow backup and restore to operate on files. 2015-12-02 12:36:53 +00:00
christos
466f99a5ab don't advertise stuff we don't support. 2015-12-02 12:24:02 +00:00
christos
ce4e8c4470 Always set NOSYNC if regular file, even if we got the size from the command
line.
2015-12-02 12:20:52 +00:00
jnemeth
de2c104cf3 hrmm...
i386devel: {245} ./gpt add -b 1000 -s 1000 disk
Segmentation fault (core dumped)

Where's my flyswatter?   .......zzzzzzzap
2015-12-02 11:20:34 +00:00
jnemeth
777094fd12 - dereferencing NULL is generally bad, found by visual inspection
- automatically set nosync when opening a file to avoid spurious errors
2015-12-02 10:19:58 +00:00
christos
272fa82935 print the old and the new style usage. 2015-12-02 04:17:25 +00:00
christos
cdf86847f5 refactor the utf code so that it does not leak memory. 2015-12-02 04:07:11 +00:00
christos
d1f209293e split out into smaller functions. 2015-12-02 04:06:47 +00:00
christos
c94670c3be use the utility function. 2015-12-02 04:06:10 +00:00
christos
b732231137 - write a function to set the entity, so that we don't reset to guid.
- entry 0 means create entry.
2015-12-02 01:01:55 +00:00
pgoyette
a1258c3a17 By default, don't display the module load address. Add a -k option
to restore display of this field.
2015-12-02 00:56:09 +00:00
christos
0f004afe33 merge command line parsers and check all memory allocations. 2015-12-01 23:29:07 +00:00
christos
1c8d6ff1b4 Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.
2015-12-01 22:49:25 +00:00
christos
bbb4a8ab26 refactor more duplicated code. 2015-12-01 19:25:24 +00:00
christos
6fb89396f8 automatically enforce readonly for the commands that don't need to write. 2015-12-01 16:33:55 +00:00
christos
8ca93e4658 Refactor the command dispatching and help printing logic. 2015-12-01 16:32:19 +00:00
christos
0b43d398b9 Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.
2015-12-01 09:05:33 +00:00
christos
68bc3825b8 - use gpt_msg to print informational messages (perhaps these should be printed
only with -v)
- don't print any messages with gpt_msg if quiet
- print a message if we didn't reconfigure the wedges
2015-12-01 02:03:55 +00:00
christos
835e6be8c3 only update the wedge information if it is supported. 2015-12-01 01:49:23 +00:00
christos
e4ed2565fe - automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.
2015-11-30 19:59:34 +00:00
wiz
634690fb1c Fix xref. 2015-11-29 21:36:35 +00:00
christos
7e254cfb82 Remove getdisksize support; we either have the ioctls (current/-7) or we
don't (non-netbsd-current/7+tools).
2015-11-29 15:32:46 +00:00
christos
2d178fa50d Add the missing cases. 2015-11-29 14:12:56 +00:00
christos
4ab2c2d9c7 Add some debugging. 2015-11-29 14:12:35 +00:00
christos
c313281022 Do division once 2015-11-29 14:03:35 +00:00
christos
f8906ab68d Only use the ioctl's if we have them. 2015-11-29 13:46:23 +00:00
jnemeth
1ca10bc795 fix build breakage for systems that do not have DIOCG{SECTOR,MEDIA}SIZE 2015-11-29 13:24:28 +00:00
christos
2599c179cc print the current map type. 2015-11-29 00:34:39 +00:00
christos
5435e55eab - use snprintf
- fix bogus logic on map_type
2015-11-29 00:15:12 +00:00
christos
ca4e0dcdd1 merge the create errors in one place and fix them. 2015-11-29 00:14:46 +00:00
pgoyette
e6045f6364 Add cross-refs from modload(8) amd modunload(8) to modctl(2) 2015-11-28 23:53:48 +00:00
christos
35da36c439 CID 1340063: fix TOCTOU 2015-11-24 14:07:18 +00:00
christos
fc8a4870ed Don't chdir to the config directory; just form the parameters file with a
path if needed.
2015-11-22 20:24:19 +00:00
christos
cd40e75014 explain how to clear an entry (without reading the source) 2015-11-22 15:53:10 +00:00
christos
d59d77037c - update NAME_MAX to match the kernel.
- add a comment about where the constant is used.
2015-11-16 17:06:47 +00:00
jnemeth
6141a178e3 correctly print the gpt header revision as a "float" 2015-11-16 12:24:13 +00:00
tnn
c9f8274c3f fix iSCSI RFC number 2015-11-10 12:41:18 +00:00
christos
51068fec25 print flags symbolically. 2015-11-04 16:04:55 +00:00
ozaki-r
c2e5d2b795 Fix rump.ping6 -c N (N > 1) doesn't work
2nd packet and subsequent packets are sent based on SIGALRM and
it depends on poll(2) returns with EINTR by the signal. However,
currently poll is rump-ified while signals aren't so the signal
doesn't wake up poll and ping6 doesn't work expectedly.

Rump-ifying signals is unsure (nobody does it for now) and the
combination use of signals and poll makes the logic a bit complex.
So let's fix the defect by stopping using signals for packet
transmissions. The new logic is derived from ping(8).

Bonus: ping6 -i 0.01 works as we expect now while the original
didn't work enough fast.
2015-11-04 08:07:54 +00:00
ozaki-r
c94323a777 Fix exit status when -c and -X is used
It exited with status 0 when at least one packet was received
and timed out. However, when we specify -c N (while N > 0),
we expect that it fails if it times out before all sent requests
are replied.
2015-11-04 07:59:25 +00:00
pgoyette
b6f71a3653 Add FLAGS to the module data displayed. Reduce some of the extra
inter-column white-space to (partly) compensate for the additional
column.
2015-11-04 04:30:42 +00:00
knakahara
fad49cfc60 rump.ping6 supports "-S" option. 2015-11-04 01:14:02 +00:00
jnemeth
902aecab13 Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.
2015-11-03 02:19:24 +00:00
christos
1428ec3f79 remove advertising clause. 2015-10-16 17:38:17 +00:00
dholland
6ada0ed75b Teach scan_ffs about lfs64.
(and also about byte-swapped lfs volumes, which might or might not
actually work)
2015-10-15 06:25:23 +00:00
dholland
06de5f4e56 Make dump recognize lfs64.
For now at least it will refuse to touch it though as it needs to be
taught more abstraction about directory entries; currently it blindly
uses struct direct from ffs and will croak on the lfs64 64-bit inode
numbers.
2015-10-15 06:25:12 +00:00
dholland
ae64c38ebb Enable lfs64 in fsck_lfs.
(and in everything else that uses this code)
2015-10-15 06:24:55 +00:00
dholland
511153d2cc Enable the creation of lfs64 volumes.
To create an lfs64 volume, use -w 64. You can also force a 32-bit
volume with -w 32, but this will fail on devices thta are too large.

lfs64 is the default for devices > 1TB. (1TB rather than 2TB because
daddr_t is signed and negative block numbers can cause interesting
complications.)

For now print a warning that the lfs64 format isn't finalized, because
it isn't. For now any lfs64 use should be limited to test data,
benchmarking, and so forth.
2015-10-15 06:24:33 +00:00
christos
fec59bb419 these are syslog-like 2015-10-14 15:53:24 +00:00
mrg
28d34520d5 don't stop processing /etc/fstab when one entry fails, both for
add and remove loops.  now when you add a new swap file and run
"swapctl -A" it won't give up after the existing one gives EBUSY
and move on to the rest.
2015-10-11 23:58:16 +00:00
dholland
0a6370d92e Use a specific SEGSUM size instead of the size of the union. 2015-10-10 22:34:19 +00:00
dholland
f3729261c1 Track down and fix two missing uses of SEGSUM_FINFOBASE(). 2015-10-10 22:34:09 +00:00
dholland
da7186290f The per-inode state 'id_entryno' is used by pass1 for a block count,
so widen it to 'long long'. pass2 uses it for the number of entries in
a directory (IIUC) which does not need to be wider than int, but for
now let's not try to split into two fields. FUTURE...
2015-10-03 08:30:13 +00:00
dholland
a07fd0a2a2 Use daddr_t instead of uint32_t for the in-memory copy of the inode
block pointers.
2015-10-03 08:30:02 +00:00
dholland
896006c986 Drop an explicit sign-extension in fsck that shouldn't be needed any
more.
2015-10-03 08:29:48 +00:00
dholland
93f2a7d5e8 Add lfs_checkword type for reading checksum data out of structures.
This is always uint32_t, but having a name for it both makes things
clearer and avoids confusion about whether it should be 32 or 64 bit.

Note: deployed in only one place (that was erroneously tagged
ondisk32) so far.
2015-10-03 08:29:34 +00:00
dholland
db7a6054ae Fix hardwired 32-bit stuff in fsck:
- compute the maximum file size using LFS_BLKPTRSIZE()
   - use the new IINFO in pass 6 instead of uint32_t pointers
   - use accessors to read and write indirect blocks
2015-10-03 08:29:21 +00:00
dholland
b82b54bc04 Remove a dead data structure. 2015-10-03 08:29:06 +00:00
dholland
7f7a5fa1e3 Apply IINFO in the other userland tools. 2015-10-03 08:28:46 +00:00
dholland
a407c8d218 Use IINFO in lfs_writeinode().
(both the kernel and the userland copies)
2015-10-03 08:28:15 +00:00
mrg
710e06c668 add smart IDs 210, 246, 247 and 248 (Micron):
+       { 210,          "Successful RAIN Recovery Count", NULL },
+       { 246,          "Total Host Sector Writes", NULL },
+       { 247,          "Contact Factory (Micron)", NULL },
+       { 248,          "Contact Factory (Micron)", NULL },

(eek i hope 247 and 248 don't move.)
2015-09-21 06:05:00 +00:00
dholland
cfe9c0210f Fix some assorted 32-bit assumptions not yet otherwise handled.
Also apply patch to fix the overt problem in PR 50246: newfs was
calculating ifpb wrong for volumes with non-default block sizes.
2015-09-21 01:24:58 +00:00
dholland
947343ea0e Add 64-bit directory entry structures, and adjust accessors accordingly.
The LFS64 directory entry has a 64-bit inode number. This is stored as
two 32-bit values to avoid inducing 64-bit alignment requirements.

The exposed type for manipulating directory entries is now
LFS_DIRHEADER, following the same convention as e.g. IFILE and SEGUSE.
(But with LFS_ on it, because.)
2015-09-21 01:24:23 +00:00
dholland
80201f5aa5 Oops; LFS_DIRECTSIZ() is going to need the fs as an argument.
Also, it turns out that dirhash needs a compile-time-constant version
of LFS_DIRECTSIZ(LFS_MAXNAMLEN+1), independent of 64-vs-32, so create
LFS_MAXDIRENTRYSIZE for this. Sigh.
2015-09-21 01:22:18 +00:00
dholland
75caa729bb Clean up struct lfs_dirtemplate. 2015-09-20 04:51:43 +00:00
dholland
805a8504cb Pass around struct lfs_dirheader instead of struct lfs_direct. 2015-09-15 15:02:25 +00:00
dholland
98320dbc87 Add an accessor function for directory names. 2015-09-15 15:02:01 +00:00
dholland
653d6346b1 Add a function lfs_copydirname() to copy directory names in place; use
it in place of (variously) memcpy and strlcpy. (The latter isn't even
correct; was probably changed blindly from strncpy at some point.)

The new function zeroes the padding in the directory entry instead of
leaving trash behind.
2015-09-15 15:01:38 +00:00
dholland
06be19e226 Tidyups/fixes preparatory to making d_name[] in struct lfs_direct size
0 instead of size LFS_MAXNAMLEN+1, and preparatory to having accessor
functions for d_name. In particular, don't create prototype entries
and copy them, and access the name field only for directory structures
that are in buffers with space for the name to exist.
2015-09-15 15:01:22 +00:00
dholland
c2c4048b2d Move the header part of struct lfs_direct to its own structure.
(lfs_dirheader)

Take the opportunity to improve the directory generation code in
make_lfs.c. (Everything else was unaffected by virtue of using
accessor functions.)
2015-09-15 14:59:58 +00:00
dholland
5a97d9e5b6 Add and use accessor functions for more of the directory entry fields. 2015-09-15 14:58:05 +00:00
ozaki-r
44996ea918 Include a few additional libc functions in rump.route to make it work with inet6
getaddrinfo and if_nametoindex are newly added to interpret interface names
in IPv6 link-local addresses. if_nametoindex looks not used in rump.route,
but it is needed because it is used indirectly from getaddrinfo.

From s-yamaguchi@IIJ
2015-09-14 05:12:52 +00:00
christos
8730816515 more recent information about unsupported drives. 2015-09-09 11:14:09 +00:00
ozaki-r
0cea365c35 Include several libc functions in rump.ping6
We need getaddrinfo, getifaddrs, if_indextoname and if_nametoindex
in addition to getnameinfo.
2015-09-09 10:06:05 +00:00
bad
6c69384dad Rename argument of rf_output_devname() from devname to name to avoid a
warning about shadowing a global symbol when compiled by buildrump.sh.
Discussed with mrg.
2015-09-08 08:59:09 +00:00
mlelstv
733f23562f A change to the GPT_TYPE list also requires a change to the GPT_TYPE
index constants.
2015-09-04 17:59:53 +00:00
dholland
ec175d5025 Add new accessors for the d_type and d_namlen fields of struct lfs_direct.
Napalm the old byteswap access logic for these.
2015-09-01 06:16:58 +00:00
dholland
5f1180cf85 Remove ulfs_daddr_t. 2015-09-01 06:15:16 +00:00
dholland
08dc10dc96 Use daddr_t, not ulfs_daddr_t, as the latter's 32 bits wide.
Don't use either for on-disk items.
Declare external data in header files.
Part 3 of 3.
2015-09-01 06:15:02 +00:00
dholland
481db95097 Use daddr_t, not ulfs_daddr_t, as the latter's 32 bits wide.
Don't use either for on-disk items.
Part 2 of 3.
2015-09-01 06:13:57 +00:00
dholland
dfb99dfd3e Use daddr_t, not ulfs_daddr_t, as the latter's 32 bits wide.
Don't use either for on-disk items.
Part 1 of 3.
2015-09-01 06:13:33 +00:00
dholland
30c3aa6e8a Tidy the MAXSYMLINKLEN macros. 2015-09-01 06:12:33 +00:00
dholland
eb2560adae The ifile's inode number is constant. (it is always 1)
Therefore, storing the value in the superblock and reading it out
again is silly and offers the opportunity for it to become corrupted.
So, don't do that (most of the code already didn't) and use the
existing constant instead. Initialize new 32-bit superblocks with
the value for the sake of old userland programs, but don't keep the
value in the 64-bit superblock at all.

(approved by Margo Seltzer)
2015-09-01 06:12:04 +00:00
dholland
4b344787e1 Make the inode fields in the 64-bit superblock 64 bits wide.
Reasoning as before.

Note that I am not going through and checking for 64->32 truncations
in inode numbers; I'm sure there are quite a few, but that's a project
for later.
2015-09-01 06:11:06 +00:00
dholland
4d398b859d Add byteswapping to the dinode accessors.
This prevents regressions in the ulfs code when switching to the new
accessors. Note that while adding byteswapping to the other accessors
is straightforward, I haven't done it yet; and that also is not enough
to make LFS_EI work, because there are places lying around that bypass
the accessors for one reason and another and all of them need to be
updated. That is going to have to wait for a later day as LFS_EI is
not on the critical path right now.
2015-09-01 06:10:16 +00:00
dholland
da32f22c2a Use the lfs dinode accessors in place of the ufs-derived ones.
(Mostly.)

The ufs-derived ones are fake structure member macros, which are gross
and not very safe. Also, it seems that a lot of places in the lfs code
were using the ffsv1 branch of them unconditionally, and this way it's
guaranteed all those places have been updated.

Found while doing this: for non-devices, have getattr produce NODEV
in the rdev field instead of leaking the address of the first direct
block.
2015-09-01 06:08:37 +00:00
jnemeth
8eaf165929 update client OS version as well 2015-08-30 10:49:57 +00:00
jnemeth
aca6703611 PR/49616 - Andreas Gustafsson -- bring modload example into era of MODULAR 2015-08-30 10:46:52 +00:00
mlelstv
77d8bce2f4 Calculate sector size from superblock and use that instead of DEV_BSIZE. 2015-08-30 05:23:17 +00:00
mlelstv
6e7966e6f5 Use getfsspecname also when not found in /etc/fstab. 2015-08-26 05:41:20 +00:00
bouyer
2266c911f6 Consistently use iswap64() and 64bit intermediate variable, as well as
64bit formats for c_tapea. Fixes tape useage report for large filesystems.
2015-08-24 17:37:10 +00:00
bouyer
262ce6cb8d Default the read block size (-k default value) to kern.maxphys (usually
64k these days). This gives a noticable performance boost on large filesystems.
2015-08-24 17:34:03 +00:00
christos
cf0ea7fe31 swap the formats too, not just the args. 2015-08-23 16:00:23 +00:00
dholland
336a1ae812 Fix reversed arguments to a print. nice and confusing... 2015-08-23 09:29:46 +00:00
dholland
c9cfc4bd98 Part two of dinodes; use the same union everywhere.
(previously the ufs-derived code had things set up slightly different)

Remove a bunch of associated mess.
2015-08-19 20:33:29 +00:00
knakahara
84f76c9c0f Add intrctl(8). 2015-08-17 06:42:45 +00:00
dholland
b1828e0ba3 Hack up dinode usage to be 64 vs. 32 as needed. Part 1.
(This part changes the native lfs code; the ufs-derived code already
has 64 vs. 32 logic, but as aspects of it are unsafe, and don't
entirely interoperate cleanly with the lfs 64/32 stuff, pass 2 will be
rehashing that.)
2015-08-12 18:28:00 +00:00
dholland
e54b457c15 Provide 32-bit and 64-bit versions of FINFO.
This also entailed sorting out part of struct segment, as that
contains a pointer into the current FINFO data.
2015-08-12 18:27:01 +00:00
dholland
2e090556c4 Make 32-bit and 64-bit versions of SEGSUM.
Also fix some of the FINFO handling as it's closely entangled.
2015-08-12 18:26:26 +00:00
dholland
32577c4f1c Add IFILE32 and IFILE64 structures for the on-disk ifile entries.
Add and use accessors. There are also a bunch of places that cast and
I hope I've found them all...
2015-08-12 18:25:51 +00:00
dholland
f11e4edeba Make 32-bit and 64-bit versions of CLEANERINFO.
XXX: while this is written to disk, it seems like much of it would
XXX: be better set up as a commpage shared with the cleaner.
2015-08-12 18:25:03 +00:00
mrg
d7c39481bd add an example for rescanning ATA busses. 2015-08-08 07:52:52 +00:00
ozaki-r
2a4e5e0f61 Introduce rump.ping6
We use ping6 frequently in ATF tests so let's have rump-ified one.
2015-08-06 14:45:54 +00:00
dholland
076dce6286 Use intmax_t to print daddr_t; from sevan@. 2015-08-03 04:16:10 +00:00
dholland
9e5184b86b Add a (draft) 64-bit superblock. Make things build again.
Add pieces of support for using both superblock types where
convenient, and specifically to the superblock accessors, but don't
actually enable it anywhere.

First substantive step on PR 50000.
2015-08-02 18:18:09 +00:00
dholland
992b9a23af Use accessor functions for the version field of the lfs superblock.
I thought at first maybe the cases that test the version should be
rolled into the accessors, but on the whole I think the conclusion on
that is no.
2015-08-02 18:14:16 +00:00
dholland
31c72b56c0 Don't include ufs headers. 2015-08-02 18:12:18 +00:00
dholland
9263edc766 Use the lfs header file and lfs's mount args struct, not ufsmount.h
and the ffs mount args struct, for mounting lfs.

(they are the same, so this doesn't matter yet, but still...)
2015-08-02 18:11:57 +00:00
dholland
ae8b3536ce Typo in comment. 2015-08-02 18:11:36 +00:00
dholland
eed9c32288 Use c99 initializers. 2015-08-02 18:11:12 +00:00
dholland
078ffcb8d8 Second batch of 64 -> 32 truncations in lfs, along with more minor
tidyups and corrections in passing.
2015-08-02 18:10:07 +00:00