Commit Graph

6647 Commits

Author SHA1 Message Date
ozaki-r
6011d36bd6 Fix rump.{netstat,route} shows host's interface names in link local addresses
Interface names of IPv6 link local addresses are resolved
by getnameinfo(3). So we need to rump-ify it as well as
if_indextoname and getifaddrs.
2015-05-15 06:58:59 +00:00
mlelstv
1490a7ba80 Add documentation for the drvctl driver and add reference.
Fixes PR 49895.
2015-05-13 07:28:49 +00:00
roy
e0cc834e99 ioctl -> prog_ioctl as pointed out by pooka@ 2015-05-12 14:05:29 +00:00
pgoyette
77cc846abe Use _PATH_WATCHDOG from <paths.h> instead of locally-defined value. 2015-05-06 23:08:30 +00:00
roy
dbb6db0ed0 Report IN_IFF_TENTATIVE and friends.
Wait for IN_IFF_TENTATIVE to be removed with the -w flag.
2015-05-02 14:43:51 +00:00
christos
874b0026ee Add missing doc flags (B,M,m) 2015-04-29 17:07:11 +00:00
christos
c4603cb30b - use calloc to zero memory
- pass the proper buffer to mkdir
- fix for apple ufs
2015-04-29 01:49:25 +00:00
christos
4f6ce6a7d2 reduce bss usage 2015-04-28 15:15:53 +00:00
christos
d5a931670f remove 80211 stats if small. 2015-04-28 15:14:57 +00:00
prlw1
9521ae7bfd Fix typos 2015-04-28 09:48:30 +00:00
christos
c902c296d4 fix mistake in previous 2015-04-27 17:05:58 +00:00
maxv
3220cb2ac6 Be a bit more verbose if the kernel rejects a file 2015-04-26 09:20:09 +00:00
christos
74c7e628de make table smaller in size. 2015-04-25 21:43:53 +00:00
christos
8e83ba138f Add the once -o option like ping 2015-04-24 00:42:56 +00:00
abs
b46e0d1534 newfs_msdos allowed suffixes such as 'k', 'm' for some parameters,
but amusingly this did not include Block size, or Sectors per cluster.
Allow for all numeric parameters (If I want to specify the number
of drive heads as '1K', then why not?)
2015-04-23 13:27:14 +00:00
roy
a7a37fb042 Move the INET6 specific code for wait_dad_exec() into af_inet6
by using a new afswtch hook af_addr_tentative.
2015-04-22 17:42:22 +00:00
ozaki-r
df66dd74ee Fix rump.route shows host's interface names
Let it use rump-ified if_indextoname and getifaddrs
to get rump kernel's interfaces, which is the same way
as ifconfig.
2015-04-22 03:07:55 +00:00
mrg
2603e0673f remove various HAVE_GCC=45 fragments. 2015-04-15 19:13:46 +00:00
riastradh
db8ca554ec Use <sys/rndio.h> instead of <sys/rnd.h>. 2015-04-13 22:18:50 +00:00
jmcneill
d0b93bc844 if the -p flag is specified, display a progress bar while growing the file-system 2015-04-06 22:44:04 +00:00
mlelstv
f3a445024e factor out geometry calculation and use this also in CheckOnly mode.
be a bit more verbose in Verbose mode.
2015-04-06 13:33:42 +00:00
mlelstv
4962b364b8 Handle case in grow() where last cylinder group is too small for ufs2.
Align with code in shrink().
2015-04-06 12:38:21 +00:00
wiz
5a1645e4da New sentence, new line. Sort option descriptions. 2015-03-29 19:42:15 +00:00
chopps
f89312b935 - Fix fallout for recent bread() change (removing cred arg). 2015-03-29 19:35:58 +00:00
chopps
ae3fcf098a - Add -c to check to see if grow/shrink is required
- Divide by DEV_BSIZE when returning size of file.
- Update manpage
2015-03-29 19:33:55 +00:00
riastradh
9ea98f4524 Use != -1' instead of == 0' out of paranoia. 2015-03-28 17:25:33 +00:00
riastradh
bb5cf371be Make get_dev_size work on regular files too. 2015-03-28 17:22:46 +00:00
roy
a37502b2b6 Add RTF_BROADCAST to mark routes used for the broadcast address when
they are created on the fly. This makes it clear what the route is for
and allows an optimisation in ip_output() by avoiding a call to
in_broadcast() because most of the time we do talk to a host.
It also avoids a needless allocation for the storage of llinfo_arp and
thus vanishes from arp(8) - it showed as incomplete anyway so this
is a nice side effect.

Guard against this and routes marked with RTF_BLACKHOLE in
ip_fastforward().
While here, guard against routes marked with RTF_BLACKHOLE in
ip6_fastforward().
RTF_BROADCAST is IPv4 only, so don't bother checking that here.
2015-03-23 18:33:17 +00:00
enami
c1e351a1b2 Don't truncate at microseconds while preserving timestamps.
One of motivation of this change is to make the behavior of test(1)
-nt/ot with preserved copy (like cp -p) closer to the NetBSD 6.
Of course whether full timestamps are kept or not depends also on
underlying file system.

The ifdef added in mv(1) since existing ifdefs was our local change
to compile it on solaris (though I couldn't test it):
http://mail-index.netbsd.org/tech-userlevel/2014/11/28/msg008831.html
2015-03-02 03:17:24 +00:00
mlelstv
4b8999e0dd safely update existing wedge links 2015-03-01 14:21:17 +00:00
roy
43800a7e73 Teach route(8) about RTF_LOCAL. 2015-02-26 09:56:11 +00:00
wiz
2122be46d6 Bump date for previous.
New sentence, new line.
2015-02-25 09:01:08 +00:00
mlelstv
0a7f816b6d Let drvctl -p select elements from an array property by numeric index. 2015-02-24 18:15:29 +00:00
joerg
a39ebfb79e Move communication socket to /var/run, especially when starting iscsid
during boot, it might disappear otherwise.
2015-02-21 20:33:44 +00:00
christos
3d6eb1fc0f let's make this compile again. 2015-02-15 21:46:49 +00:00
jmcneill
481b9e731c At startup, instead of doing run-hooks for each device, call run-hooks
once with a list of all found devices. This lets us batch calls to MAKEDEV
which results in a noticeable improvement in Raspberry Pi boot time.

Run the initial device enumeration hooks before detaching from the foreground,
ensuring that any required devices have been created before the rc.d script
exits.
2015-02-15 15:56:30 +00:00
roy
9fbc750691 Display the IPv6 address flags autoconf and temporary 2015-01-20 22:13:19 +00:00
christos
a451832ee3 kill 1 copy of strtonum. 2015-01-16 20:12:28 +00:00
christos
20d9dd5566 make netname4 match the netname6 signature avoiding a NULL pointer. 2015-01-07 22:38:32 +00:00
msaitoh
27d20d98fc Add missing "addr" and "static" commands. 2015-01-05 00:36:23 +00:00
pooka
15c9a10afd gcc 4.9 produces vfork clobberation warnings for "name" and "buflen".
Since there's no performance reason to use vfork here, just replace it
with fork and be done with warnings once and for all.
2015-01-04 22:05:37 +00:00
reinoud
4897154dae Fix volumesetname to comply to UDF 2.01 [2.2.2.5] 2015-01-02 21:01:12 +00:00
christos
52e8eb1316 Fix the 3 programs that use DTYPE_ (disklabel disk types) constants from the
kernel. Two of them are inside ifdefs.
2015-01-02 19:46:02 +00:00
mlelstv
d15e4a5d5d Avoid mixing cluster numbers and sector numbers. Makes code more readable. 2015-01-02 06:21:28 +00:00
christos
15f5b75638 abort earlier. 2014-12-29 16:35:38 +00:00
christos
59069b7aab Provide a simple getdisksize() api for gpt(8). 2014-12-29 16:27:43 +00:00
christos
ccbdb0d177 Factor out the getdisksize() drvctl method, and provide an alternative that
directly uses the disk ioctl's instead of relying on the drvctl device driver
which is currently not mandatory.
2014-12-29 16:27:06 +00:00
prlw1
f44489f8dc MKINET6=no build fixes
http://mail-index.netbsd.org/tech-net/2014/12/13/msg004898.html
2014-12-20 13:15:48 +00:00
roy
62cbe5902e Note that RTM_CHANGE can also change the gateway 2014-12-17 10:56:09 +00:00
christos
d980f336d5 fix possibly uninitialized variable. 2014-12-14 23:27:14 +00:00
christos
d4b702a5f2 avoid local variable shadowing devname. 2014-12-14 23:25:07 +00:00
wiz
b1ec4779e4 Bump date for previous. Fix typo. 2014-12-14 17:15:14 +00:00
mlelstv
a0b59f5f8a Add validation methods "mbr" and "gpt" for disks without a valid disklabel. 2014-12-14 12:31:39 +00:00
mlelstv
f902d9ca42 support wedge names.
The default param file for a wedge is still named after the device (dkN)
which might be unpredictable. Use an explicit param file instead.
2014-12-14 11:31:39 +00:00
mlelstv
490457d5da Make ccdconfig resolve wedge names. 2014-12-07 10:44:34 +00:00
mlelstv
9171ddc6ae Fix handling of -t option for the type command.
Match any type, when no option is given, just like for the label command.
2014-12-07 09:51:42 +00:00
wiz
d12dcb884c Bump date for previous. 2014-12-06 21:53:55 +00:00
mlelstv
c3505b64dc Add some more common partition types. 2014-12-06 12:24:22 +00:00
mbalmer
89b27dd856 Add reference to mount_chfs, bump date. 2014-12-06 12:12:17 +00:00
christos
3747949d9f Instead of zerodivide, give a useful error message. 2014-12-04 01:41:37 +00:00
christos
27fad02cd4 Complete the routing argument table by including the ID's used in the routing
display.
2014-12-01 20:30:27 +00:00
christos
b5ac626c87 Adjust default packet size to 56 data bytes (64 total).
Make error messages consistent.
2014-11-29 14:48:42 +00:00
christos
0c4052c0de PR/49423: Martin Husemann: ping for small packets does not work in -7 or
-current
XXX: pullup 7?
2014-11-27 19:43:58 +00:00
christos
aeb66be189 - pass the proper argument vector so that subcommands can use getopt.
- add -q and -e for listwedges.
2014-11-23 15:43:49 +00:00
mlelstv
96f40a63cc handle constness better 2014-11-17 07:15:28 +00:00
mlelstv
477be5f2de handle constness 2014-11-17 07:13:42 +00:00
mlelstv
8e3b364b00 Report the argument instead of (null) when opendisk fails. 2014-11-17 07:11:18 +00:00
joerg
c87c6690c0 Skip vendor if the string is empty. 2014-11-15 01:52:01 +00:00
christos
2bd97efc9a PR/47704: Takahiro HAYASHI: Add -L flag 2014-11-12 03:34:08 +00:00
christos
802a4e04fc remove debugging 2014-11-09 22:50:38 +00:00
christos
66d4eaa769 add handler for /kern/evcnt and print the actual error when failing. 2014-11-09 18:36:02 +00:00
christos
521e0d5bd2 give a little more space 2014-11-08 00:47:32 +00:00
christos
74d147444a Now that the code can support tags and verbose route printing, enable them.
Also document previously undocumented flags.
2014-11-07 14:57:08 +00:00
christos
30f4c8e6f6 Factor out the netstat route printing code and use it here. There is no
point in having 2 different copies; fixes PR/49371
2014-11-06 21:29:32 +00:00
wiz
88a571cbd8 New sentence, new line. Bump date for previous. 2014-11-05 09:26:26 +00:00
mlelstv
cfe8bb2a9d Add 'makewedges' option to autodiscover wedges from a changed label. 2014-11-04 08:00:44 +00:00
msaitoh
48b712a059 Add #include <inttypes.h> for intmax_t to fix compile error. 2014-11-04 03:05:43 +00:00
jakllsch
d8015429ba ClusterOffset actually needs to be able to be negative. 2014-11-03 18:55:04 +00:00
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
jakllsch
6b4d75e30b Always print the MBR drive serial number, even if it's 0. 2014-03-10 15:42:51 +00:00
joerg
f6d86cb881 Make pointer NULL check non-fatal for a bogus condition. 2014-03-04 21:07:22 +00:00
blymn
473e93d0fc Correct usage of clri. 2014-03-03 12:12:18 +00:00
skrll
6d3ceb1d61 Rename NetBSD/hp700 to NetBSD/hppa.
Unfortunately our VCS isn't very helpful here.
2014-02-24 07:23:38 +00:00
maxv
897b0b47db Fix error message; argv[1] could be NULL 2014-02-09 13:40:59 +00:00
matt
5a355fa389 Rename link to link_pkw to avoid shadowing the link syscall. 2014-01-19 22:31:13 +00:00
apb
81c929ad04 Overwrite the seed file from the beginning, using pwrite(2). 2014-01-15 15:05:27 +00:00
joerg
8e1ba910ea Fix arguments for write. 2014-01-15 10:13:25 +00:00
christos
81c8b4d072 use __func__, EXIT_{SUCCESS,FAILURE} 2014-01-10 18:37:18 +00:00
pooka
bbfd34f128 give err() some reason to avoid:
sysctl.c:2713:5: error: zero-length gnu_printf format string [-Werror=format-zero-length]
2014-01-10 09:38:56 +00:00
christos
6a0886ad81 perror is obsolete, use warn and add missing paren. 2014-01-08 01:56:20 +00:00
degroote
f2475e079d Before scanning, check if the card is up. If it is not the case, exit
with some useful error message. Add some note about this fact in the man
page too.
2014-01-07 20:25:24 +00:00
martin
88bc910896 PR bin/46743: mark the "next free cluster" value in the file system
info block as unitialized.
2014-01-05 12:52:39 +00:00
wiz
2873a037aa New sentence, new line. Remove trailing whitespace. 2014-01-04 15:35:10 +00:00
dholland
ed70881960 Add crossreference to fd(4) as noted a while back in PR 45694. Bump date. 2013-12-30 08:43:22 +00:00
christos
f28e660726 moved to external 2013-12-25 22:04:52 +00:00
wiz
b07680d7fe Bump date for previous. 2013-12-19 07:49:50 +00:00
jnemeth
4fb24d0cac Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming
2013-12-19 06:46:51 +00:00
jnemeth
6f2d9e3758 If we want to GUIDs to display with correct endian, it helps to decode it first. 2013-12-18 03:20:09 +00:00
apb
81b1fb1df7 In all man pages that say:
The -H, -L and -P options are ignored unless the -R option is
    specified.  In addition, these options override each other and the
    command's actions are determined by the last one specified.

Add:

    The default is as if the -P option had been specified.
2013-12-17 09:54:08 +00:00
jnemeth
53733ab887 Explicitly state which partition was added/modified. 2013-12-10 01:05:00 +00:00
wiz
d860f590d4 Fix typo ("then" instead of "than") 2013-12-09 09:35:16 +00:00
wiz
918b300e20 Fix typo. 2013-12-09 09:22:44 +00:00
jnemeth
1cb2b94165 Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine.  The purpose of these
is to set and unset partition attributes.
2013-12-09 08:03:17 +00:00
jnemeth
66ad0e75ae For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.
2013-12-09 01:35:02 +00:00
jnemeth
2098c8504e For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.
2013-12-08 09:32:51 +00:00
jnemeth
e3e68bccc8 fix off-by-one error 2013-12-08 08:30:01 +00:00
jnemeth
024b3f7622 Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed.  This simplifies the code
and prevents surprises.  If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option.  This change was requested by
wiz@, and after some thought I agree with it.
2013-12-06 02:31:31 +00:00
jakllsch
16550bc8bd Use MBR_PTYPE_ defines from <sys/bootblock.h>. 2013-12-04 20:15:51 +00:00
jakllsch
e22b4ebb4a Mirror my changes of src/sbin/gpt/create.c 1.4 in migrate.c;
Use less bogus CHS addresses in PMBR.
With the ending head set at 0xff one machine I have will never leave
the initial startup screen if such a disk is present. Additionally,
Wikipedia suggests without citiation that 254 is the maximium allowable
value for the head, and this seems to be the case.
2013-12-04 19:59:47 +00:00
wiz
3d5220baa3 Bump date for previous. 2013-12-04 18:05:21 +00:00
martin
26fd9dad41 Fix err/errx confusion, pointed out by rmind. 2013-12-04 15:10:11 +00:00
martin
eb2a978b87 Provide variants of the -s option to allow limiting the tmpfs dynamically
at mount time to 1/Nth or to N percent of the available ram.
2013-12-04 13:30:35 +00:00
bouyer
7e810dc605 Fix pasto in the !ufs2 case (use dp->dp1 and not of dp->dp2).
This would be a problem only when allocating a new data block and the
indir block is already allocated, which explains why automated tests didn't
find it.
Problem reported on tech-kern@ and fix tested by manu@.
2013-12-02 18:46:52 +00:00
jnemeth
925666ef9b Add two new options:
-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change
2013-11-30 19:43:53 +00:00
jnemeth
2b199b9458 when calling dehumanize_number() make sure the resulting number is >= 1 2013-11-28 01:37:14 +00:00
christos
d873a92b9b CID 1132762: Add error check for negative, to make zero-divide in module
impossible.
2013-11-27 20:40:48 +00:00
christos
bb7996ed1a CID 1132764: Bogus test 2013-11-27 20:34:34 +00:00
jnemeth
9299334f79 Remove FreeBSD specific code as per message to tech-userlevel. 2013-11-27 01:47:53 +00:00
jnemeth
e066617c02 Only skip past _PATH_DEV if it is actually present. 2013-11-23 08:59:04 +00:00
jnemeth
9ceccfb63b change the "-b blocknr" parameter to accept a "human number" 2013-11-22 04:21:02 +00:00
jnemeth
d883a91427 bump date 2013-11-22 03:51:06 +00:00
jnemeth
4f22d16faa In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are.  Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.
2013-11-22 03:50:05 +00:00
wiz
00996309f7 shrunk. 2013-11-20 08:11:36 +00:00
jnemeth
0a08058311 Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.
2013-11-20 08:08:47 +00:00
jnemeth
49ca570b23 delete an errant where it is obvious what the code is doing 2013-11-19 22:41:43 +00:00
jnemeth
477692ee49 When setting a label on the new partition, be sure to set the label
in the secondary partition table as well.
2013-11-19 19:10:29 +00:00
jnemeth
a3d649686c update synopsis for add subcommand 2013-11-19 05:07:40 +00:00
jnemeth
650728b4e3 Add two new options to the "add" subcommand:
-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.
2013-11-19 05:03:41 +00:00
christos
611f94995e CID 1125874: Fix memory leak 2013-11-13 21:25:40 +00:00
christos
f55ff5e8dd vax specific gcc 4.8.1 hacks 2013-11-09 21:39:27 +00:00
christos
997b1a5c45 put instruction generation bug for the vax for 4.8 too 2013-11-09 16:01:58 +00:00
kefren
88644df51c Bring tunnel src_addr and dst_addr on the same line 2013-11-09 13:10:35 +00:00
kefren
beafc35b81 Remove esis reference 2013-11-05 07:42:48 +00:00
apb
c2ebc84464 Add a reference to secmodel_extensions(9), to make it a little easier to
figure out how to enable mounts for unprivileged users.  (Why don't we
just explain vfs.generic.usermount in the mount(8) man page?)

Also add another example of different ways in which the "special"
argument is interpreted by different file systems: mount_tmpfs(8)
ignores it.
2013-10-31 07:37:06 +00:00
drochner
958a129dbd -recognize CF cards by the magic value in inquiry data
-kill CFG_ATAPI_MASK, didn't see anything in the specs supporting
 that it exists
2013-10-30 15:37:49 +00:00
joerg
6cfd1a95ed Mark usage as dead. 2013-10-29 16:11:15 +00:00
mbalmer
99ed7cd168 link luactl(8) to the build 2013-10-28 19:05:21 +00:00
jnemeth
f60aa973c9 cosmetic fix from drochner@ 2013-10-26 20:31:23 +00:00
mbalmer
6737b686a3 bump date for previous 2013-10-24 13:00:21 +00:00
mbalmer
0fa457fe55 remove lua class 2013-10-24 10:36:25 +00:00
jnemeth
34523e4b09 - markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example
2013-10-24 06:59:03 +00:00
mbalmer
c1f5fe0a62 use MODULE_CLASS_MISC for Lua modules 2013-10-23 18:57:40 +00:00
jnemeth
389cfa7c1b In a NetBSD disklabel, p_offset is from the beginning of the disk,
not the beginning of the NetBSD partition.
2013-10-22 07:30:20 +00:00
mbalmer
5cfde5e1f7 properly display Lua modules 2013-10-21 17:14:06 +00:00
jnemeth
8ba45a6a68 revert typo fix; teach me to blindly take changes from upstream 2013-10-20 21:13:23 +00:00
mbalmer
45802ab30c attach tty line discipline by name, not by number. remove unused case value. lgtm christos 2013-10-20 20:17:52 +00:00
christos
344e379dcb put back oldflags and __USE it. 2013-10-19 23:14:27 +00:00
christos
f2bb6cd861 remove unused 2013-10-19 17:04:41 +00:00
christos
740c6aa538 use correct function 2013-10-19 15:59:15 +00:00
christos
730b60ec52 use symbolic flags 2013-10-19 15:50:26 +00:00
tsutsui
0148f33f56 Wrap long lines overflowed after EXT2_ prefix addtion to fs macro. 2013-10-19 13:42:10 +00:00
jnemeth
63dfdcda5b Convert FreeBSD numeric FS_<type>s to labels by request. 2013-10-19 09:31:24 +00:00
jnemeth
000bb24ef9 - convert FreeBSD FS_<type> to numbers where they don't match NetBSD
- add support for migrating NetBSD disklabel'ed disks (only 7 years late)
- use labels for partition types
2013-10-19 08:13:21 +00:00
jnemeth
f2e89ca7fd recognize FreeBSD ZFS partition 2013-10-19 02:07:08 +00:00
jnemeth
e3d872f434 Add code for detecting FreeBSD ZFS partitions.
XXX  Need to add code for migrating NetBSD disklabel'ed disks.
2013-10-19 01:58:33 +00:00
jnemeth
a79ba98d4b type fix: accommodate. -> accomodate. 2013-10-19 01:19:03 +00:00
christos
3e4993b396 fix unused variable warnings. 2013-10-19 01:09:58 +00:00
christos
dc30329cc3 avoit type punning 2013-10-19 01:09:16 +00:00
christos
86785464fe avoid bogus uninitialized gcc warning 2013-10-19 01:08:25 +00:00
christos
52ebde656f gcc warns about array bounds limits, but unfortunately the API here requires
flex arrays in a union which is not allowed. So do a trivial pointer assignment
to baffle gcc again.
2013-10-19 00:57:41 +00:00
christos
f304780793 use scopeid functions 2013-10-19 00:39:39 +00:00
christos
0dd81edd01 use the new scopeid functions 2013-10-19 00:35:30 +00:00
christos
77f96119f9 avoid pointer gymnastics 2013-10-18 21:01:00 +00:00
wiz
ff37728867 Still more markup. Sort. 2013-10-17 09:44:22 +00:00
mbalmer
0e6ee7d369 there is no assign command 2013-10-17 09:33:40 +00:00
wiz
120c3e92eb More markup, typo fixes, update date and NetBSD version for import. 2013-10-17 08:21:03 +00:00
mbalmer
d0767a360b luactl(8) is a command to control lua(4) 2013-10-16 19:48:21 +00:00
jdc
6dc8fb4754 Belatedly note root on RAIDframe support for sandpoint. 2013-10-07 10:50:37 +00:00
dholland
af9796645f english usage patrol 2013-10-07 05:06:45 +00:00
apb
d53a09e4f6 Suggest using -b 1023/255/63 for modern disks where the BIOS is
configured to use LBA-Assisted translation.
2013-10-06 12:27:15 +00:00
ast
7d4f6c34b0 No code change: corrected spelling in comment, removed trailing white spaces. 2013-10-05 08:06:35 +00:00
apb
86fd64c325 The "-s" flag is passed to init by the kernel, not by the boot loader. 2013-10-02 22:07:56 +00:00
apb
06dcf00819 Document that the kernel may try several paths for init.
XXX: This should be in the kernel documentation, not in the init(8) man page.
2013-10-02 22:01:47 +00:00
tron
b0eb4d7e9b Note that NetBSD/amd64 can boot of RAID volumes. 2013-09-20 06:43:57 +00:00
joerg
57e0a316cc GC mopts. 2013-09-13 21:03:29 +00:00
riz
8dcf7f1af2 Add an item to the list (SIGINFO support). 2013-09-09 19:37:17 +00:00
mlelstv
6fa7c3413b Fix handling of NAME aliases in /etc/fstab. 2013-09-08 13:26:05 +00:00
reinoud
a5532a8260 Add the blockingnr determination for the -rom versions 2013-08-25 14:13:47 +00:00
matt
8176d96907 Add m68000/coldfire.
Add evbcf.
2013-08-22 00:26:23 +00:00
riz
eab0544017 A number of new earm MACHINE_ARCH have shown up recently; make sure
we can deduce their endianness.
2013-08-11 17:15:15 +00:00
dholland
6616a3c018 This passes WARNS=5. 2013-08-11 06:05:30 +00:00
dholland
cccb31c834 These pass WARNS=5, so don't set WARNS=4 2013-08-11 06:04:38 +00:00
dholland
b062143a54 WARNS=5 is the default in sbin, don't need to set it explicitly. 2013-08-11 05:56:55 +00:00
tron
986f886c15 Fix tool build under Mac OS X by using gettimeofday(2) instead of
clock_gettime(2). This needs a proper auto-config check.
2013-08-10 23:25:35 +00:00
reinoud
857cc1af09 Fix possible 32 bit issues. In practice hard to reach but better be safe than
sorry.
2013-08-09 15:11:08 +00:00
soren
2d96a254f8 TRIM showed up sometime between ATA-7 and ATA-8. 2013-08-06 19:13:13 +00:00
reinoud
254934d244 Switch back program version to the version of the newfs_udf/makefs code.
While here, visit the 80 columns police :)
2013-08-06 13:15:30 +00:00
reinoud
fd80b116d5 Oops, forgot to export a_udf_version() that checks if the input string is a
valid UDF version notation.
2013-08-06 12:49:13 +00:00
wiz
5d1c7f9125 Fix article. 2013-08-06 12:15:20 +00:00
wiz
b37178189d Sort sections. Remove superfluous Ed. 2013-08-06 12:14:43 +00:00
reinoud
67b0bef892 Clarify volumeset name restrictions when specifying it in newfs_udf(8) 2013-08-06 11:57:25 +00:00
reinoud
933037aa09 Fix misplaced BUGS section and fix layout 2013-08-06 11:38:51 +00:00
reinoud
3551bde30d Fix memory leaks found by Coverity and fix memoryleaks in the new code 2013-08-06 08:18:08 +00:00
reinoud
950c47822d Fix newfs(8) to compile again. 2013-08-05 20:52:08 +00:00
joerg
9656a3f6dc Allow building UDF parts of makefs on !NetBSD. 2013-08-05 17:12:04 +00:00
reinoud
94ec67ed92 Fix memset() arguments to use the right type for sizeof() and streamline its
use of sizeof() to allways use the right type.
2013-08-05 16:44:58 +00:00
wiz
43ccd8ccbb Sort. 2013-08-05 14:28:48 +00:00
reinoud
1b03698582 Adjust newfs_udf to be sharing code with the new `makefs -t udf' to be
comitted.
2013-08-05 14:11:30 +00:00
soren
35985c7122 Don't use \t to align text columns.
Add a few attribute descriptions.
2013-08-03 18:35:31 +00:00
kefren
708985b712 Add -tag description as suggested in PR/45071 2013-07-24 06:28:10 +00:00
wiz
a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
matt
625db931b8 Use MACHINE_CPU with m68k (m68000 will not be matched due to MKPIC=no) 2013-07-18 21:59:46 +00:00
reinoud
b26724915d Add comment to udf_do_rootdir(). Might eventually be moved to newfs_udf(8) 2013-07-18 12:50:51 +00:00
reinoud
a2747c513b Initial split up for making newfs_udf(8) routines suitable for makefs_udf(8) 2013-07-18 12:44:21 +00:00
christos
d8748c5de0 print the next parser name instead of just the pointer in debugging. 2013-07-17 15:42:03 +00:00
christos
ee1471609b Allow -v to be used with other commands (list scan for example) as documented. 2013-07-17 15:40:42 +00:00
khorben
257dd81b98 Let init be built easily with the CHROOT capability enabled.
This allows the ramdisk used in the incoming support for full-disk encryption to contain crunched binaries (much like sysinst) while booting a regular system (unlike sysinst).
2013-07-15 00:18:03 +00:00
wiz
9f55e7c8e5 Sort sections. New sentence, new line. Fix macro. 2013-07-02 20:53:10 +00:00
reinoud
c7950296a0 Update newfs_udf to allow for creating file images with -F and specifying
sector sizes with -S.

For this i had to recycle the -S parameter but its preserved as an extension
to the -P parameter. These parameters are hardly ever use though since using
either or both the origional -S and the -P parameter without specific values
would break the standard. Also the -F now has a double meaning.
2013-07-02 14:59:01 +00:00
christos
b8a7bdb609 move proto to small 2013-07-02 01:39:17 +00:00
christos
958c0aac6e Instead of borrowing the mount code to get the nfs arguments, just use
the system call directly. It is shorter and works...
2013-07-01 15:16:33 +00:00
christos
3a4a09ca06 one copy of the name is enough, and free it. 2013-06-29 23:06:29 +00:00
christos
18c826e11c declare the variables that getnfsargs need in getnfsargs so that they can
easily be used from other programs.
2013-06-29 22:56:26 +00:00
christos
da960e0858 Use the protocol we mounted the filesystem with instead of always udp.
(untested, but should fail back to udp).
2013-06-29 22:53:04 +00:00
reinoud
052045ad4c Small rewording of the examples section. 2013-06-29 20:41:47 +00:00
riz
78ae231e57 Display the load address of modules. PR bin/47951. 2013-06-26 17:55:38 +00:00
dholland
75571afd93 Stick ffs_ in front of the following macros:
fragstoblks()
   blkstofrags()
   fragnum()
   blknum()

to finish the job of distinguishing them from the lfs versions, which
Christos renamed the other day.

I believe this is the last of the overtly ambiguous exported symbols
from ffs... or at least, the last of the ones that conflicted with lfs.
ffs still pollutes the C namespace very broadly (as does ufs) and this
needs quite a bit more cleanup.

XXX: boo on macros with lowercase names. But I'm not tackling that just yet.
2013-06-23 22:03:34 +00:00
dholland
e1610ba4cb Stick ffs_, ext2_, chfs_, filecore_, cd9660_, or mfs_ in front of
the following symbols so as to disambiguate fully. (Christos already
did the lfs ones.)

   lblkno
   lblktosize
   lfragtosize
   numfrags
   blkroundup
   fragroundup
2013-06-23 07:28:36 +00:00
dholland
cc2e18968d Revert accidental commit of the change for PR 47911; got rolled into
other stuff by mistake.
2013-06-23 04:14:28 +00:00
dholland
2737439da3 fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB()

(Christos already did the lfs ones a few days back)
2013-06-23 02:06:04 +00:00
dholland
de893df3a9 blkoff() -> ffs_blkoff() stragglers 2013-06-19 18:02:21 +00:00
dholland
f1333577b5 Rename ambiguous macros:
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE
   NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR
   INOPB -> FFS_INOPB, LFS_INOPB
   INOPF -> FFS_INOPF, LFS_INOPF
   blksize -> ffs_blksize, ext2_blksize, or lfs_blksize
   sblksize -> ffs_blksize

These are not the only ambiguously defined filesystem macros, of
course, there's a pile more. I may not have found all the ambiguous
definitions of blksize(), too, as there are a lot of other things
called 'blksize' in the system.
2013-06-19 17:51:25 +00:00
dholland
8c01dce56b Make this build again. hi christos 2013-06-19 06:15:54 +00:00
christos
d418f0d0f1 make this compile again 2013-06-19 01:07:55 +00:00
christos
855bb66ef7 Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.
2013-06-18 18:18:57 +00:00
christos
289b275fc3 revert part of previous commit 2013-06-15 12:29:02 +00:00
christos
78f1cd9f5b handle new lfs split 2013-06-15 01:27:19 +00:00
christos
ec6fb31453 fix compilation 2013-06-15 01:26:48 +00:00
tsutsui
c7276dbc04 Remove old workaround for Cygwin.
http://mail-index.netbsd.org/source-changes/2003/05/08/0042.html

16bit dev_t for !__CYGWIN_USE_BIG_TYPES__ was removed in Cygwin 1.7.2
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/include/cygwin/types.h?cvsroot=src#rev1.32
and __dev32_t has been removed since 1.7.19.
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/include/cygwin/types.h?cvsroot=src#rev1.36
2013-06-14 16:28:20 +00:00
christos
2882a9c896 List all cgd's no matter if they are not contiguously allocated 2013-06-09 18:37:40 +00:00
dholland
9daf003ef2 Stick UFS_ in front of these symbols:
DIRBLKSIZ
   DIRECTSIZ
   DIRSIZ
   OLDDIRFMT
   NEWDIRFMT

Part of PR 47909.

(two stragglers in this commit; oops)
2013-06-09 18:29:25 +00:00
dholland
5a420c1b9a Stick UFS_ in front of these symbols:
DIRBLKSIZ
   DIRECTSIZ
   DIRSIZ
   OLDDIRFMT
   NEWDIRFMT

Part of PR 47909.
2013-06-09 17:57:08 +00:00
dholland
dc37d54c5e Add unsafe hacks to make this build going forward.
XXX: unsafe hacks are unsafe -- dump needs to be cleaned up to make
XXX: it more fs-independent.
2013-06-08 23:37:37 +00:00
dholland
602ba1f79c dp->di_u.inumber -> dp->di_inumber
Should have been part of the previous changeset that applied that
change to lfs.h. I'd quite like to know why the test build I ran
didn't trip on this.
2013-06-08 23:12:13 +00:00
dholland
a65dc3fc86 Redo these changes properly:
-r1.12 libexec/lfs_cleanerd/Makefile
 -r1.15 sbin/fsck_lfs/Makefile
 -r1.6 sbin/newfs_lfs/Makefile

hi ad@
2013-06-08 21:13:19 +00:00
dholland
c13a12500a Tidy up the LFS userland build hacks.
Don't use -I${NETBSDSRCDIR}/sys; don't include files other than the
exported LFS headers, which are lfs.h, lfs_inode.h, and (for now)
lfs_extern.h.
2013-06-08 02:16:03 +00:00
dholland
25bc01ad43 DIRBLKSIZ -> LFS_DIRBLKSIZ
DIRECTSIZ -> LFS_DIRECTSIZ
DIRSIZ -> LFS_DIRSIZ
OLDDIRFMT -> LFS_OLDDIRFMT
NEWDIRFMT -> LFS_NEWDIRFMT
IFTODT -> LFS_IFTODT
DTTOIF -> LFS_DTTOIF
2013-06-08 02:14:46 +00:00
dholland
4b157546cf struct direct -> struct lfs_direct
struct dirtemplate -> struct lfs_dirtemplate
struct odirtemplate -> struct lfs_odirtemplate
DT_* -> LFS_DT_*
2013-06-08 02:12:56 +00:00
dholland
b6eb36b1f1 Stick LFS_ in front of IFMT, IFIFO, IFREG, etc. so as not to conflict
with the UFS copies of these symbols. (Which themselves ought to have
UFS_ stuck on.)
2013-06-08 02:11:11 +00:00
dholland
5fce92dbf7 Move the dinode (on-disk inode) structures to lfs.h, since they are
and will be obviously required by userland tools that need to read
the on-disk structures.

Also, DINODE{1,2}_SIZE -> LFS_DINODE{1,2}_SIZE.
2013-06-08 02:09:35 +00:00
dholland
a4fc39c06d Cleanups and hacks to make lfs userland stuff build:
- lfs_cksum.c doesn't actually need ulfs_inode.h any more.
   - neither does lfs_itimes.c.
   - add hacks to fsck_lfs to make it compile.
   - add hacks to newfs_lfs to make it compile.
   - fix warning in ulfs_quota.c when quotas are fully disabled
     (as I guess is happening with the rumpity version)

XXX: This commit adds -I${NETBSDSRCDIR}/sys to the Makefiles for
XXX: fsck_lfs, newfs_lfs, and lfs_cleanerd. This needs to be cleaned
XXX: up ASAP; but I consider this less problematic in the short term
XXX: than spewing ulfs_*.h into /usr/include.
2013-06-06 00:54:49 +00:00
dholland
f67ddac196 ufs -> ulfs for newfs_lfs 2013-06-06 00:53:12 +00:00
dholland
1ebd9aa225 ufs -> ulfs for fsck_lfs. 2013-06-06 00:52:50 +00:00
wiz
faa87fa7ed Sync with man page. From jmc@openbsd. 2013-06-02 13:27:20 +00:00
wiz
c9aebf8ce5 Improvements from jmc@openbsd. 2013-06-02 13:27:12 +00:00
wiz
d19a931ddc De-capitalize `.Nd' macro argument.
From Bug Hunting.
2013-05-29 14:56:19 +00:00
wiz
0d33e4d5b7 Instead of 'no space', say 'not enough space' in error message. 2013-05-26 21:26:17 +00:00
christos
cb39557cb2 %td is for ptrdiff_t not for off_t 2013-05-15 00:47:43 +00:00
christos
c3e11c3703 - avoid using globals where it is simple.
- simplify: only use stdio for output.
2013-05-13 18:44:11 +00:00
christos
1e2e5a9113 CVE 1020933: Prevent integer overflow by using wider type 2013-05-13 18:01:08 +00:00
christos
7d5016218f CVE 1020935: Prevent overflow 2013-05-13 17:58:50 +00:00
skrll
4cc906c4aa Add an arch_endian entry for x86_64. 2013-05-05 15:59:42 +00:00
matt
4fdf02c17a Make sure to initialize byteorder if native. 2013-05-03 21:23:36 +00:00
matt
b1e3ebd45b Fix tpyos. 2013-05-03 16:39:00 +00:00
matt
af8f0546ca Make disklabel a MI tool. It will use MACHINE/MACHINE_ARCH to determine
the disklabel params as well as allowing command-line options of -M <machine>
and -B {le,be} to specify MACHINE and byteorder to be used.
2013-05-03 16:05:11 +00:00
christos
c1bdad31a0 avoid initialization bug in vax gcc: int i; foo(&i); 2013-05-03 00:01:15 +00:00
christos
c673655ecf one less kvm groveller. Use sysctl to get ccd info. 2013-04-27 17:12:36 +00:00
jakllsch
3106f2915c Improve support for logical sector sizes greater than 512. 2013-04-14 22:48:22 +00:00
jakllsch
aff82b369b Make getdiskinfo() always return correct dkwedge_info for the raw partition.
A real disk's raw partition does not implement DIOCGWEDGEINFO, but does
implement DIOCGDINFO.  This was resulting in the returned wedge information
containing 32-bit-clamped values for size of the raw partition, with no
indication thereof.
2013-04-13 22:08:57 +00:00
jakllsch
0c2fc5cb54 Make pre-initialized partition type uuid_t symbols 'static const'.
This conserves a few hundred bytes of total program size by
allowing the linker to merge duplicates.
2013-04-13 18:32:01 +00:00
jakllsch
774af6a912 drop trailing whitespace 2013-04-13 18:25:56 +00:00
jakllsch
287267eb57 Clean up gpt(8) a bit more
uuid_create_nil(3) and uuid_is_nil(3) take a uuid_t*, not a pointer to
an array of bytes merely casted to compatible type.

Additonally, there no need for extra casts and address-of operations when
using le_uuid_*() functions.

Furthermore, le_uuid_*() are identical to uuid_*_le functions in
libc/libuuid, so use those instead on NetBSD.
2013-04-13 18:04:33 +00:00
jakllsch
fe89322e15 Use correct spelling of "secondary" in comments. 2013-04-13 16:48:03 +00:00
rodent
6212f5ad46 s/user code/user mode/1 2013-03-30 11:07:40 +00:00
christos
f27e0a25cc Document debug 2013-03-29 21:46:32 +00:00
christos
7e8a523e59 pdisk has moved 2013-03-23 15:43:37 +00:00
mlelstv
9e59300471 For MFS, no longer use heuristic based on rlimit to determine mmap size.
This is no longer functional with current memory allocation routines.
2013-03-17 12:25:36 +00:00
yamt
4398e962ce more precision for F_TIMING64 2013-03-06 11:33:08 +00:00
joerg
e240adbd0b Retire OSI network stack. OK core@ 2013-03-01 18:25:13 +00:00
wiz
cd5f9eed2e Remove trailing whitespace. 2013-02-27 21:21:47 +00:00
is
959a998bde Fix terminology issue brought up by Bug Hunting in PR 47314.
The boot records in extended partitions are called "Extended Boot Record"
(EBR); use that in the documentation where appropriate.
2013-02-27 20:43:00 +00:00
christos
c1fffff4c4 Don't produce spurious errors when creating labels on files. 2013-02-13 00:40:28 +00:00
christos
26a38a4618 CID/979997: missing va_end() 2013-02-09 01:50:04 +00:00
jakllsch
8c9dbb49b1 Decode 6Gbps signaling SATA capability in IDENTIFY DEVICE data. 2013-02-08 03:58:36 +00:00
apb
819da78f2e Abort on error from prop_dictionary_augment. 2013-02-07 13:21:34 +00:00
apb
acc2342d2c Avoid dereferencing NULL. Coverity CID 275201.
Also fix a typo in previous: !== should be !=
2013-02-07 13:20:51 +00:00
apb
2f2c48e223 Don't pass NULL to prop_dictionary_set.
Coverity CID 275196.
2013-02-07 12:04:01 +00:00
apb
beb9ef8fe5 Don't call prop_distionary_make_immutable on a NULL pointer.
Coverity CID 275179.
2013-02-07 11:24:15 +00:00
apb
bf5fabe51d free(bbp) in error paths. Coverity CID 274748. 2013-02-07 11:00:59 +00:00
apb
392ef41021 getrawpartition(3) may fail, so call it only once and test for failure.
Coverity CID 274527.
2013-02-07 10:44:45 +00:00
matt
2f0a3a2017 There are other little endian arm machine_arches other than "arm" 2013-02-05 07:22:59 +00:00
christos
2d1d9d47bc don't truncate the file if an offset is given. 2013-02-03 03:21:42 +00:00
christos
9eab57ada8 nbtool_config.h undefines _NETBSD_SOURCE, and that makes <sys/types.h> not
define cpuid_t, which makes <sys/mount.h> unincludable. Although this is a
bug in the build system, it is simpler to fix it here.
2013-01-27 21:56:26 +00:00
christos
3060c42593 toolify 2013-01-24 19:24:56 +00:00
christos
0a4e19dfb8 use return instead of exit. 2013-01-24 17:53:49 +00:00
christos
9c80670845 don't do the partition dance for makefs; we have no real disk 2013-01-24 00:10:09 +00:00
christos
c613c761ab We don't need getdiskinfo() for makefs() since we always deal with an image. 2013-01-23 22:48:18 +00:00
christos
30441591f7 fix regressions after split. 2013-01-23 15:29:15 +00:00
dholland
dcd34a91c5 Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
2013-01-22 09:39:11 +00:00
christos
aed35c482d Split the make fs portion into a function; do argument tests inside the
function.
2013-01-21 20:28:38 +00:00
jakllsch
6959a7ad63 Now that GPT_ENT_TYPE_LINUX_DATA is diffrent from the Windows one, use it. 2013-01-18 17:58:15 +00:00
christos
772a10450c move dk_ioctl to a header file for the benefit of x-building. 2013-01-17 18:33:58 +00:00
jakllsch
ec5e5d471b An uninitialized next-free-cluster value in the file system information
block is valid; do not consider it for correction.
2013-01-17 16:45:48 +00:00
christos
b7825cc95f - simplify getinput.
- add adjust command.
2013-01-15 23:52:48 +00:00
dholland
1df724eeb6 Use __printflike. 2013-01-13 23:45:35 +00:00
dholland
0f01602e5e Use void * for I/O functions and remove no-longer-needed casts. 2013-01-13 23:17:18 +00:00
dholland
aaa9827ea1 Use more static. 2013-01-13 23:07:16 +00:00
dholland
a010b743a6 Use static; remove unused global var this uncovered. 2013-01-13 22:59:31 +00:00
dholland
895e26fb92 Use <ctype.h> functions correctly. 2013-01-13 22:54:24 +00:00
dholland
9c53e91b7d Add some const. 2013-01-13 22:53:01 +00:00
mlelstv
9fc3186941 Support symlinks to a block device to resolve the name of the
corresponding raw device.
2013-01-13 19:53:16 +00:00