Commit Graph

6269 Commits

Author SHA1 Message Date
mlelstv
a62f667a0a fix logic that handles command line arguments. Now you can:
fsck /mnt/point
fsck dkX
fsck rdkX
fsck /dev/dkX
fsck /dev/rdkX
fsck NAME=wedge
2014-10-25 22:00:19 +00:00
mlelstv
ab9ddb6964 Support wedge names.
before:
    newfs dk1        - formats /dev/rdk1
    newfs rdk1       - cannot open /dev/rrdk1
    newfs /dev/dk1   - /dev/dk1 is a block-device, use raw device
    newfs /dev/rdk1  - formats /dev/rdk1

now:
    newfs dk1        - formats /dev/rdk1
    newfs rdk1       - cannot open /dev/rrdk1
    newfs /dev/dk1   - formats /dev/rdk1 (*)
    newfs /dev/rdk1  - formats /dev/rdk1
    newfs NAME=wedge - formats /dev/rdk1

(*) getfsspecname() returns the block device which must be translated.
    Passing a block device manually cannot be distinguished from this case.
2014-10-25 16:47:23 +00:00
roy
38d2e3f021 Remove the ability for userland to toggle IN6_IFF_TENTATIVE.
Preserve IN6_IFF_TENTATIVE when updating address flags.
2014-10-20 14:50:09 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
mrg
d6a1b6b395 add a whole bunch of S.M.A.R.T. status i found around various sources.
now nothing on my new SSD is unknown, except #249.
2014-10-15 06:54:04 +00:00
riastradh
c4ba54210e Paranoia: choke noisily on EOF from /dev/urandom. 2014-10-04 11:23:35 +00:00
riastradh
ba983c7779 Make gpt(8) generate v4 (random) uuids.
Don't needlessly leak your date/time and MAC address when you edit
the disk.

Read from /dev/urandom rather than calling arc4random or anything,
since this is a tool.  (Cygwin seems to have /dev/urandom, but yell
if this breaks the build on your exotic platform because it lacks
/dev/urandom.)

ok apb
2014-10-04 10:30:13 +00:00
wiz
ec23d78824 Remove trailing whitespace. 2014-10-04 07:15:54 +00:00
christos
279da39389 Allow specifying sector and media size on the command line. 2014-10-04 01:00:42 +00:00
christos
194a5fe433 provide a copy of the kernel uuid generator (with portable API calls) for
tools.
2014-10-03 20:30:06 +00:00
jnemeth
00433a3409 "0" is not guaranteed to be unique 2014-10-03 00:51:31 +00:00
apb
1029f7d668 include <sys/endian.h> for both the non-tools build,
and the tools build on a host where the file exists.

Fixes a build problem on FreeBSD, reported by Herbert J. Skuhra, where
tools/compat's configure detected that be32dec() and friends were
available in the host's <sys/endian.h>, so tools/compat did not provide
its own versions.
2014-10-02 21:27:41 +00:00
joerg
1a21d263f9 Fix tools build on !NetBSD. 2014-10-02 19:15:21 +00:00
apb
f685c2f61e It's HAVE_NBTOOL_CONFIG_H, not HAVE_NBTOOLS_CONFIG_H 2014-10-01 12:55:39 +00:00
jnemeth
870b6dcbee oops, forgot to update end of data area 2014-10-01 03:52:42 +00:00
jnemeth
c4b5bb5337 using random values for hdr->hdr_guid does not work very well 2014-10-01 01:08:25 +00:00
jnemeth
0d4fdcc249 actually return the uuid when parsing one that is in numeric format 2014-10-01 01:07:24 +00:00
jnemeth
20f10808c3 correctly show partition type in the new world order 2014-09-30 22:56:36 +00:00
jnemeth
0e826d2ca3 Check size of correct buffer. Note, just being pedantic as the buffer
being checked is the same size as the one that should have been checked.
2014-09-30 20:23:23 +00:00
christos
21c34dbb1d Add internal uuid support, since the linux+macos versions of the library
are different than than *bsd ones, and others might not have it at all.
2014-09-30 17:59:59 +00:00
wiz
c145521aad Add comma in enumeration. 2014-09-30 08:20:29 +00:00
pettai
d9141272a7 Add mpt reference, as support for this device was added recently 2014-09-30 08:14:48 +00:00
christos
c917041fda remove compat defines. 2014-09-30 02:12:55 +00:00
christos
4da1cfa89d more toolification changes 2014-09-29 22:22:03 +00:00
christos
866082940a more toolification 2014-09-29 21:04:34 +00:00
christos
a50708a134 minor toolification: need libprop... 2014-09-29 20:28:57 +00:00
jnemeth
ac204e48a2 PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option 2014-09-29 05:56:43 +00:00
jnemeth
88085c2f28 PR/44218 - David Young -- add "type" subcommand to change a partition type 2014-09-28 08:14:51 +00:00
jnemeth
e4be9d18c3 - handle a GPT that isn't an exact multiple of a sector
- adjust PMBR size, in case new disk is a different size
- don't leak as much memory
- clean up error handling somewhat
2014-09-26 08:56:34 +00:00
jnemeth
ede6a6c556 no C99isms in tool code 2014-09-26 05:34:15 +00:00
msaitoh
3821b76445 Fix compile error observed on i386. Use PRIu64. 2014-09-23 13:48:04 +00:00
jnemeth
2ed5cc2617 - make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT
2014-09-23 07:47:54 +00:00
jnemeth
4013e132a3 document the new restore subcommand 2014-09-20 22:36:09 +00:00
jnemeth
06190c9314 Initial cut of gpt restore. This functions correctly in testing,
but isn't all that pretty.  It has minimal error testing and may
leak memory.  It also only works with empty disks.  If passed "-F"
flag, it will blank the disk for you.
2014-09-20 22:11:27 +00:00
matt
3bbdf28d09 Add OpenRISC 1000 & UCB RISC-V platform support. 2014-09-19 17:45:03 +00:00
ozaki-r
ba4f0be24c Remove out-of-date comments 2014-09-17 01:00:41 +00:00
christos
6b3fd816dd PR/49206: ping6 dies with SIGINT even when it just fails to ping
When reusing the same handler for SIGALRM, make don't pretend you
got SIGINT.
2014-09-16 21:29:12 +00:00
ozaki-r
75f57c494b Write about -vlanif in ifconfig.8
PR 49114
2014-09-15 06:48:05 +00:00
ozaki-r
adf2c730e5 Add -vlanif to the help message of ifconfig
PR 49114
2014-09-15 06:46:04 +00:00
martin
58001a8b3d Initialize timespec "end" for the benefit of some gcc versions getting
"may be used uninitialized" warnings wrong.
2014-09-12 08:54:26 +00:00
roy
c6314d6139 Remove rtsol(8) and rtsold(8) as their functionality is in dhcpcd(8).
Remove rtsol(8) from rc.d/network.
Add -w seconds command to ifconfig to wait for N seconds for until DAD
has finished on all addresses.
Use ifconfig -w in rc.d/network instead of a forced sleep.

As discussed on tech-net@
2014-09-11 13:10:03 +00:00
jnemeth
e3f4016378 - dump all partitions, not just ones that are in use
- while here, squash a memory leak

     It shouldn't be necessary to backup unused partitions, however
the partition GUID is created at the time the GPT is created and
is never changed.  It shouldn't matter if the GUID of an unused
partition changes, but there may be some special case where it
does.  Since it isn't a big deal to record the unused partitions,
might as well do it.
2014-09-10 10:49:44 +00:00
jnemeth
ef9cc4e43f - record the sector size of the disk
- correct confusion with end_cylinder and end_sector in MBRs
2014-09-09 06:30:09 +00:00
mlelstv
76c8639541 Accept driver names only in the two args form together with a minor number.
That's what the documentation says and also avoids the case where the driver
name converted to a major number is interpreted as a packed dev_t number.
2014-08-22 22:28:50 +00:00
matt
4e8f1b53e9 Rework to be avoid a conditional assignment which results in:
sbin/ping6/ping6.c:1879:8: error: 'cbit.skip' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    cur += ntohs(cbit.skip) * 32;
2014-08-22 20:54:29 +00:00
apb
b41d70db45 Don't print ccd_size with %zu; it no longer has type size_t.
Instead, cast to uintmax_t and print with %ju.
2014-08-17 07:05:44 +00:00
sborrill
7d706cf73d Switch size_t to uint64_t in appropriate places to ensure that ccd(4) works
with component and total sizes of > 2TB.
Add COMPAT_60 code for platforms where this alters userland-accessible
structures.
Make kernel print device information when a ccd configured.
Fix some typos in comments.
2014-08-16 19:27:27 +00:00
hannken
dd877031a4 Adapt to reality -- already open BSD style nodes do not appear on
ptyfs mounts (this changed some months ago).
2014-08-13 15:48:38 +00:00
apb
3c11b029a5 Interleave 0 means concatenate serially, do not interleave.
This information was in the ccd(4) man page, but not
in ccdconfig(8) or ccd.conf(5).
2014-08-13 14:13:04 +00:00
apb
31ea3cc275 Interleave 0 means concatenate serially, do not interleave.
This information was in the ccd(4) man page, but not
in ccdconfig(8) or ccd.conf(5).
2014-08-13 13:14:35 +00:00
jnemeth
3170c9b01c Add restore subcommand.
XXX It does not actually work yet.  It is being committed now to make
later pullups easier.
2014-08-10 18:27:15 +00:00
wiz
d3df20dd66 Sync usage with manpage a bit more. 2014-08-10 17:13:14 +00:00
wiz
233b62b2e9 Sort options and mark them as optional.
Bump date for previous.
2014-08-10 17:13:02 +00:00
tls
ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
apb
fa05229ce5 Fix typo in "dreamcast" port name. 2014-08-10 06:48:51 +00:00
matt
547b3a3b01 Changes to existing files to enable building AARCH64 userland.
evbarm64-el
This is clang only.  While gcc4.8 supports aarch64, no netbsd support has
been written for aarch64 with gcc4.8.
2014-08-10 05:56:36 +00:00
wiz
3975de5b9d Bump date for previous. New sentence, new line. Use more markup.
Remove superfluous Pp in list.
2014-08-09 10:41:05 +00:00
mlelstv
2d1e5095e8 add -S option to adjust the superblock for different sector sizes. While
the kernel ignores this information, userland tools rely on it.

This is needed when moving images between devices of different sector size.
2014-08-09 10:33:46 +00:00
dholland
810ebb8769 Fix snprintf usage and, while here, don't trundle off the end of an
array. Part of PR 47976 from Henning Petersen.
2014-07-27 04:23:44 +00:00
joerg
63b30d82c2 Print uint32_t field as such. 2014-07-15 20:18:30 +00:00
dholland
b7f1700a57 Revert previous; it doesn't work because all the lfs tools
promiscuously .PATH in each other's source files, and I haven't the
time or patience to deal with it tonight.
2014-07-13 02:44:21 +00:00
dholland
ca11835cd5 G/C my_vpanic(). 2014-07-12 19:48:24 +00:00
dholland
6df0042d98 Remove pointless function indirection through panic_func(). It was
initialized to one thing, and then set to another right at the top of
main and never changed again.
2014-07-12 19:44:00 +00:00
dholland
0736ba101a Revert version 1.111 of sysinst/disks.c, which caused sysinst to
create lfs fstab entries with fsck disabled, and instead patch
fsck_lfs to exit successfully without doing anything when given the -p
(bootup preen) option. If you really want to do fsck_lfs -p, you can
do fsck_lfs -f -p to make it go.

This has been sitting in my todo queue since February 2010 and was
ok'd by the committer at the time. The original commit was based on
this post:
   http://mail-index.netbsd.org/tech-kern/2010/02/09/msg007306.html

and I remain unconvinced that it's the right thing, but we can at
least do it properly and not ship a sysinst with -7 that creates
permanently wrong fstab files.

Note that this may cause problems for anyone who's taken -p out of the
bootup fsck flags; but doing that is wrong, so don't.
2014-07-12 16:11:27 +00:00
christos
699f31f847 Another infinite loop fix from OpenBSD from Tobias Stoeckmann:
You can download a "proof of concept" from my website:
http://www.stoeckmann.org/openbsd/poc.iso.

Take FAT1 and it'll infinitely loop.  This fix will complete
your previous commit.
2014-07-11 14:59:53 +00:00
christos
698f62dfb8 Well, if you set FSFIXFAT, better do it... Try running fsck on:
$ newfs_msdos -C 1M ./poc.fs
    $ dd if=/dev/zero of=poc.fs conv=notrunc bs=1 count=1 seek=512

multiple times and see that it does not get fixed.
2014-07-10 21:06:20 +00:00
christos
ffdedd8608 Bring in a regression for the previous fix from OpenBSD 2014-07-10 21:00:52 +00:00
christos
0a21325ef0 From: http://marc.info/?l=openbsd-tech&m=140354518512871&w=2
more consistency checks
2014-07-07 19:04:37 +00:00
christos
d7660c3645 From: http://marc.info/?l=openbsd-tech&m=140234174104724&w=2
Avoid off-by-one on FAT12 filesystems.
2014-07-07 18:46:45 +00:00
christos
468753370f From: http://marc.info/?l=openbsd-tech&m=140275150804337&w=2
Avoid infinite loops in cluster chain linked lists.
2014-07-07 17:55:53 +00:00
christos
be4e2ccbba From: http://marc.info/?t=140304310700005&r=1&w=2
When truncating cluster chains fix the length of the cluster head.
2014-07-07 17:45:42 +00:00
zafer
9ac4e1c7a3 mention requirements for custom kernels. 2014-07-06 14:41:24 +00:00
dholland
0580599ec4 Reorg docs, part 3:
Move the documents that are papers to /usr/share/doc/papers.
Give them suitable names (including the author and year).

The key property of papers that distinguishes them from documentation
is that they're historical: they're published at a particular time and
aren't updated or maintained. (Except cosmetically.)

We should only ship papers that are of interest to users, either for
historical perspective or because they're the original research
writeup of stuff that went into the system and is still pertinent.

The ffs papers clearly meet this standard; the other one here (about
passwords, in 1978) is probably past its sell-by date.
2014-07-05 19:23:15 +00:00
dholland
c3ab26950f Rework /usr/share/doc.
Update the <bsd.doc.mk> infrastructure, and update the docs to match
the new infrastructure.

- Build and install text, ps, pdf, and/or html, not roff sources.

- Don't wire the chapter numbers into the build system, or use them in
the installed pathnames. This didn't matter much when the docs were a
museum, but now that we're theoretically going to start maintaining
them again, we're going to add and remove documents periodically and
having the chapter numbers baked in creates a lot of thrashing for no
purpose.

- Specify the document name explicitly, rather than implicitly in a
path. Use this name (instead of other random strings) as the name
of the installed files.

- Specify the document section, which is the subdirectory of
/usr/share/doc to install into.

- Allow multiple subdocuments. (That is, multiple documents in one
output directory.)

- Enumerate the .png files groff emits along with html so they can be
installed.

- Remove assorted hand-rolled rules for running roff and roff widgetry
and add enough variable settings to make these unnecessary. This
includes support for
   - explicit use of soelim
   - refer
   - tbl
   - pic
   - eqn

- Forcibly apply at least minimal amounts of sanity to certain
autogenerated roff files.

- Don't exclude USD.doc, SMM.doc, and PSD.doc directories from the
build, as they now actually do stuff.

Note: currently we can't generate pdf. This turns out to be a
nontrivial problem with no immediate solution forthcoming. So for now,
as a workaround, install compressed .ps as the printable form.
2014-07-05 19:22:02 +00:00
martin
b46d62604d Remove reference to (no longer) fixed 4 mbyte kernel memory being reserved,
it is now dynamic.
2014-06-07 10:03:44 +00:00
martin
804dc5f91b Get rid of all sysc_init_field uses - initialize fields directly in C99
notation.
2014-05-16 12:22:32 +00:00
martin
722b7feb56 Do not loop over children if a node is not marked as CTLTYPE_NODE. 2014-05-16 08:59:24 +00:00
mrg
424f4c982d open the tty with O_RDWR|O_NONBLOCK. it seems valid to ask for
write permission when we're setting flags, and ucom(4) has an
existing workaround for a bug when O_RDWR is not used, and thus
ttyflags would not work for ucom devices.
2014-05-04 20:43:30 +00:00
christos
bf3bbb4c0d allow update 2014-04-30 01:33:11 +00:00
martin
724e066fba Increase alignement of the global "buf" variable to cover all pointers it
is casted too. Fixes a crash on arm v5.
2014-04-26 14:15:08 +00:00
martin
ba42c3117b Provide proper alignement for "buf" - it is casted to a struct fs pointer,
so it requires the same alignement.
Fixes crashes on armv5.
2014-04-26 13:23:49 +00:00
christos
e6c9ef61dd Fix volume name (Ed Maste) 2014-04-24 23:49:40 +00:00
justin
802f624689 Iterate over fields of struct seperately to avoid warnings from pedantic compilers 2014-04-05 12:32:27 +00:00
christos
12c14aedcc the bug has been fixed. 2014-04-04 21:19:35 +00:00
christos
b2fb66aceb remove debugging. 2014-04-04 16:15:30 +00:00
wiz
57965cb9dc -s:
If the optional arguments are not provided, they stay as before or
use the same defaults as the interactive mode, if new.

(feel free to improve)
2014-04-04 13:07:30 +00:00
wiz
ec456f9653 Fix a bug in previous and update detailed -s description. 2014-04-04 09:32:56 +00:00
wiz
dd17dc5d6c Update SYNOPSIS.
Christos, please check.
2014-04-03 21:56:19 +00:00
christos
52334fd887 Add the ability to "softroot" mount (i.e. mount root only when the raid
set contains the boot device), as opposed to "hardroot" (the previous
default which forces the raid to be root no matter what).
2014-04-03 18:54:10 +00:00
christos
1e0f8240e6 instead of using ugly -1's make args optional 2014-04-03 17:07:11 +00:00
christos
6449a2097b default to something reasonable (like the interactive mode does) instead
of 0 when -1 is specified for the start or size.
2014-04-01 19:08:48 +00:00
martin
aad6ef8bb5 Bring back the playstation2 port - now that a toolchain for it is
available again.
2014-03-31 11:25:47 +00:00
christos
58dbdf3810 Allow -1 values in the -s <sysid>/<start>/<size> indicate use the previous
values. For example:
fdisk -f -i /dev/rsd0d # initialize mbr and create an msdos partition.
fdisk -f -u -0 -a -s 169/-1/-1 /dev/rsd0d # converts the msdos partition
to a netbsd one, and makes it active.
2014-03-30 22:18:13 +00:00
apb
292aec205d When the third arg to fwrite() is a size in bytes, then the second arg
should be 1.  sizeof(*mbuf) happens to equal 1, but it's better not
to rely on that.
2014-03-28 18:27:14 +00:00
dholland
9761f1c2dc don't use sprintf 2014-03-23 05:39:32 +00:00
dholland
deef948629 missed one 2014-03-23 05:38:14 +00:00
dholland
4db4c6282f don't use sprintf 2014-03-23 05:36:58 +00:00
dholland
ccc32d7898 don't use sprintf 2014-03-23 05:26:23 +00:00
dholland
c4044741ea don't use sprintf 2014-03-23 05:07:59 +00:00
riastradh
6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00