Commit Graph

5681 Commits

Author SHA1 Message Date
jakllsch
5da707b805 UFS is called FFS in the NetBSD case. Display as such and accept as input. 2011-01-06 16:30:40 +00:00
jakllsch
a5fb435357 Support booting from GPT-partioned disks on PC-BIOS-compatible systems.
Much of the work in this commit was done by Mike Volokhov during GSoC 2009.
2011-01-06 01:08:48 +00:00
riz
d765f2d25b Add support for byteswapped file systems (big-endian on little-endian
host, and vice versa), to fix PR#44203.

Add support for growing (but not yet shrinking) UFS2 file systems.  Partially
addresses PR#44205.

While I'm here, reformat the code for closer adherence to KNF.

Fairly extensive testing was performed, using the shortly-to-be-committed
updated ATF tests.  Patch posted to tech-userlevel on 21 December 2010,
no comments.
2011-01-05 02:18:15 +00:00
wiz
a88611257c Fix fd leaks. Found by cppcheck. 2011-01-04 23:48:44 +00:00
wiz
80172dbf65 Fix fd leak. Found by cppcheck. 2011-01-04 23:46:34 +00:00
wiz
96a10eac53 Fix memory leaks. Found by cppcheck. 2011-01-04 23:42:48 +00:00
wiz
c3ffe691ad Use pclose for popened handles. Found by cppcheck. 2011-01-04 23:36:23 +00:00
wiz
23f77c56dc Fix file descriptor leak. Found by cppcheck. 2011-01-04 23:31:29 +00:00
wiz
a5d0318667 Use Nm. Bump date for previous. 2011-01-04 23:29:51 +00:00
spz
570cdc45bf add notes what 'device' is and also rub in that addwedge doesn't
create stuff on disk a bit more.
2011-01-04 21:42:10 +00:00
hauke
34b397c5e6 First release that shipped wdogctl(8) was 1.6, not 1.5.1. 2010-12-23 14:29:52 +00:00
riz
98ddf5ec73 Revert previous - inadvertant commit to wrong repository. 2010-12-20 00:49:23 +00:00
riz
3123e6a7e0 Pull in change from njoly@ in -current 2010-12-20 00:44:53 +00:00
njoly
e7c4f98be6 Add missing .Os macro. 2010-12-19 23:22:46 +00:00
pooka
db818c53ab Use RUMPPRG.
ok Greg Oster
2010-12-15 18:37:55 +00:00
wiz
c93380eba7 filesystem -> file system. 2010-12-14 21:49:21 +00:00
riz
a3a3268f75 Be explicit about byteswapped and ffsv2 file systems being currently
unsupported, while catching up to some changes in my local tree which
will hopefully support them at some time in the future.

Also, change "device" variable to "special", to reflect the fact
that resize_ffs will work on a plain file.
2010-12-14 20:45:22 +00:00
pooka
5f732a29cb Convert from the oldstyle cgd_kops.op_open to the newstyle prog_open
and define RUMPPRG.  Get rid of the Makefile.inc stuff, since it was
useful only for the oldstyle regime.
2010-12-14 17:46:21 +00:00
jruoho
91e230c6b8 Fix xref; module(4) -> module(7). 2010-12-14 16:23:59 +00:00
pooka
72e657672d A few weeks ago when i added "linkstr" support I didn't know that
the string parser gives a proplib object which isn't a terminated
string.  Fix that mistake now.
2010-12-14 10:51:51 +00:00
riz
16963047ea Don't special-case v1 superblocks - especially with an incorrect
calculation.
2010-12-14 04:04:20 +00:00
pooka
67a4f392d8 use crunchops for crunchables 2010-12-13 21:48:01 +00:00
pooka
e73ffdda13 Add rump client support for module utilities. It should be noted
that while modstat and modunload and builtin modules work exactly
the same as in the host case, modload loads file system kernel
modules from the rump kernel namespace.  By default, archs which
have rump support for the kernel kernel ABI have the host module
directory mapped into the rump kernel namespace at the same location
(/stand/...).  Therefore, if the *host* module directory is populated,
"rump.modload foo" will work as expected.  Otherwise, RUMP_MODULEBASE
can be used to point to the module directory.
2010-12-13 20:48:44 +00:00
pooka
e8de1d91d0 be a happy crunch build 2010-12-13 19:19:10 +00:00
njoly
6c19f9ea7b op_read return value is a ssize_t, not an int. 2010-12-13 19:17:20 +00:00
pooka
f9740ada7f RUMP_ACTION -> RUMPPRG 2010-12-13 17:42:17 +00:00
pooka
e3d9b779d8 Convert from RUMP_ACTION to RUMPPRG. 2010-12-13 17:39:47 +00:00
pooka
a415ef09e9 Convert from the .ifdef RUMP_ACTION stuff to RUMPPRG. 2010-12-13 17:35:08 +00:00
jruoho
05a9f55544 Xref module(4). 2010-12-13 10:07:46 +00:00
riz
d365bee0c8 Remove bogus check which is not actually testing anything useful,
and depending on file system data, can actually be a false error.

Fixes what I was actually testing for in bin/44209, though the
actual problem was not what I originally described.
2010-12-12 22:48:59 +00:00
mhitch
a7e78491e5 Add support for old ffsv1 superblocks. After reading an old superblock,
copy appropriate data to where they are expected in the updated superblock.
When writing the updated superblock, move the updated values back to the
old ffsv1 superblock locations.  Also check for old superblock format when
updating the last cylinder group and adjust cg_old_ncyl appropriately.
Derived from how mksf sets them.  Should address PR bin/44209.
2010-12-12 19:53:23 +00:00
pooka
a97eadf766 multicore update 2010-12-12 11:38:42 +00:00
riz
6a4bbd2cea Remove accidentally-resurrected TODO item. 2010-12-08 15:23:53 +00:00
riz
8966eced0b If we're operating on a plain file instead of a device, ftruncate() it
to ensure it's been properly extended.  Clears up some problems at certain
blocksizes which showed up during creation of atf tests, which is done
using file-backed file systems.
2010-12-08 00:25:54 +00:00
riz
0b1ff958b5 As currently written, writeat() expects disk blocks, not fs blocks, so
when testing that the last sector of the new size is writeable, make
sure we're ACTUALLY writing in the new space, instead of possibly
overwriting something in the existing fs.

Discovered while writing tests - tests which uncovered file corruption at
certain block sizes.

XXX should rewrite writeat() to expect fs blocks instead of disk blocks.

OK mlelstv@
2010-12-07 23:29:55 +00:00
jmcneill
ed7bfdfad4 Allow for passing more than one module at a time:
$ sudo modunload auvitek xc5000 wintv_eeprom
2010-12-06 23:42:48 +00:00
pooka
39f08af21d mirror change of -lrumpcrypto ==> -lrumpkern_crypto 2010-12-05 20:13:26 +00:00
riz
3485b1dad5 Turns out, plain-file usage is already supported. *blush* 2010-12-03 05:23:34 +00:00
riz
4c7e04789a Knock one off the list. 2010-12-02 22:04:01 +00:00
riz
9f2c8ccc2b Use howmany() instead of "/" to calculate the number of cylinders for
the changed file system, so as to not drop a partial cylinder at the
end.  Fixes PR bin/44177.
2010-12-02 22:00:27 +00:00
elric
297cd81a0d Remove a line that was intended only for my personal testing and that
breaks things.
2010-12-02 18:02:58 +00:00
elric
7de6a71be4 In -G, refuse to operate if KEYGEN_URANDOM is specified as we already do
for KEYGEN_RANDOMKEY.

Print a warning if such a refusal is made---this will help the user understand
why there is an error.

Patch provided by:  Taylor R Campbell <campbell+netbsd@mumble.net>.
2010-12-02 04:54:32 +00:00
riz
6ad0ad89d6 Update TODO for resize_ffs(8), adding some stuff and removing some
ancient bits.
2010-12-01 17:39:54 +00:00
riz
6efa15a79a Do not look for a v1 file system at SBLOCK_UFS2, as this gets the wrong
superblock (first alternate) for a file system with 64k blocks.
Spotted by mhitch@.
2010-12-01 17:39:21 +00:00
riz
18174be827 Clean up this file:
- sync usage comment with current reality
- sort includes
- wrap lines
- use EXIT_FAILURE consistently
- make error messages consistent:  Cannot->Can't
- Remove "Old FFSv1 macros" in favor of system macros in ufs/ffs/fs.h .
  Leave dblksize() because it uses the on-disk dinode structure.

More cleanup is needed.
No functional changes intended.
2010-12-01 17:33:45 +00:00
phx
c122e153ac Allow standalone commands to be recognized, as in the in-kernel keymaps.
Also allow the Cmd token. Examples:
keycode 210 = Cmd Cmd_BrightnessUp
keycode 211 = Cmd_VolumeToggle
2010-11-30 12:22:06 +00:00
riz
6f8b62aac7 Restore a couple of checks for updating the cg_old_ncyl value which
were commented out with XXX and a notation to "fix once fsck is fixed."
fsck seems to have been fixed for this particular issue sometime in the
7 years since the code was brought into the tree.

Update cg_old_niblk instead of cg_ni_blk, since this tool
currently supports ffsv1 only.

With these two changes, I can grow a file system and have the result
be clean according to fsck_ffs.  Shrinking still results in an unclean
file system.

OK mhitch@

While I'm here, fix a typo in an error message.
2010-11-29 19:54:10 +00:00
elric
f130bae6f7 Remove trailing whitespace (patch provided by: Taylor R Campbell
<campbell+netbsd@mumble.net>)
2010-11-27 17:08:36 +00:00
pooka
6070963e92 xref rump_smbfs 2010-11-21 18:33:08 +00:00
pooka
6f2301fb3c Implement ifconfig linkstr as proposed on tech-net. 2010-11-15 22:42:36 +00:00
roy
50de1251a3 Support the new RTM_IFINFO and RTM_CHGADDR messages. 2010-11-12 16:32:18 +00:00
pooka
afd4d3a773 add compile-conditional rumpclient support 2010-11-11 22:56:38 +00:00
pooka
f1d4214202 Update RUMP_ACTION to use rumpclient.
The server must of course have some disks configured.  Let's say
we have this simple server with disks as a few sparse host files:

main()
{
        rump_init();
        rump_pub_etfs_register("/disk1", "./disk1.img", RUMP_ETFS_BLK);
        rump_pub_etfs_register("/disk2", "./disk2.img", RUMP_ETFS_BLK);
        rump_pub_etfs_register("/disk3", "./disk3.img", RUMP_ETFS_BLK);
        rump_pub_etfs_register("/disk4", "./disk4.img", RUMP_ETFS_BLK);
        pause();
}

And we run the server:

mainbus0 (root)
Kernelized RAIDframe activated
/disk1: hostpath ./disk1.img (97 GB)
/disk2: hostpath ./disk2.img (97 GB)
/disk3: hostpath ./disk3.img (97 GB)
/disk4: hostpath ./disk4.img (97 GB)

We can then configure the raid against the server:

> ./raidctl -c theraid.conf raid0

And lo, we have evidence of a level1 raid in the server dmesg:

raid0: RAID Level 1
raid0: Components: /disk1 /disk2 /disk3 /disk4
raid0: Total Sectors: 409599744 (199999 MB)

yea, i initialized it already in a previous run:

> ./raidctl -S raid0
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.
2010-11-08 12:42:35 +00:00
pooka
2ddc760fc7 Need getifaddrs() for the rump client since it executes sysctl(2) 2010-11-05 16:23:56 +00:00
pooka
08fc937c06 make sysctl(8) work as a rump client 2010-11-05 15:55:23 +00:00
pooka
7d1c54af24 adapt to new rumpclient_init() signature 2010-11-05 13:52:41 +00:00
hannken
08a60b309b File system snapshots are no longer experimental. 2010-11-05 10:02:53 +00:00
pooka
b10965b180 #ifdef variable correctly 2010-11-04 23:38:18 +00:00
pooka
243f716534 be consistent in what to leave outside of SMALL 2010-11-04 23:37:27 +00:00
pooka
ddce2e059a Support RUMP_ACTION to compile a rump kernel client. 2010-11-04 23:36:10 +00:00
pooka
23c2b7b527 Update RUMP_ACTION to use the newstyle rump client. 2010-11-04 23:31:12 +00:00
wiz
4958aa2ca5 Various improvements. 2010-10-31 11:39:46 +00:00
haad
1e89108160 Add resize_ffs tool to build, change default behaviour to grow filesystem
to device size. Add parameter -s to specify size if user want to shrink
filesystem.

Apply some KNF, remove dead unused code.

Oked by christos@.
2010-10-30 21:16:07 +00:00
martin
d524fd1707 Memcpy into local variable to ensure proper alignement.
Fixes PR port-sparc64/43965.
2010-10-13 09:19:40 +00:00
ahoka
592d1c274a Avoid NaN when calculating std-dev, which fixes a crash on VAX. 2010-09-20 11:49:48 +00:00
drochner
ebb3b30048 minimal ansification/constification 2010-09-12 16:03:39 +00:00
tsutsui
b01393af8c Add a URL of Linux Documentation "The Second Extended Filesystem." 2010-09-10 15:51:20 +00:00
pooka
e596efac61 Add -G to usage, omission pointed out by wiz. Also, make usage format
nicer on a 80col terminal.
2010-08-09 21:14:26 +00:00
wiz
ed08a55d5a Sort option descriptions. 2010-08-09 20:23:20 +00:00
pooka
f87f7774e0 Add -G, which turns consistency check errors in warnings. The
current testing purpose is to create a file system with
block size > MAXPHYS.

(the check doesn't make that much sense anyway in these days of
mobile file systems, since we're interested in MAXPHYS where we
attempt to mount the file system, not where we happen to create it)
2010-08-09 17:20:57 +00:00
pooka
83c92bb41d Make it possible to set the retry timeout as a compile-time define.
This is useful for automated environments where everything (rpcbind,
mountd, nfsd and the client) is started in parallel in a split
second and there is a small chance we will race in there before
everything has been communicated to rpcbind.
2010-07-23 19:25:23 +00:00
mrg
4c92852a80 remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format.  ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k.  this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
  down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
2010-07-06 05:59:50 +00:00
dyoung
aa9db6efb2 Add to the string parse object (pstr), and its constructors, a flag that
tells whether it should detect and convert to binary a hexadecimal octet
string of the form 0x0123ABab, or leave those strings undecoded.

If the argument for a 'media', 'mediamode', 'mediaopt', '-mediaopt',
'nwkey', or 'bssid' keyword is a hexadecimal octet string, do not detect
and decode it.  (Note that setifnwkey decodes hexadecimal strings on its
own.)

This fixes a bug noticed by Jim Miller where the trailing zero-octets
were discarded from hexadecimal octet-string arguments for 'nwkey'.
2010-07-01 16:44:05 +00:00
dyoung
de51d12924 Apparently, -g belongs in the DBG variable, not in CFLAGS. Make it so
on a line that is commented-out in this makefile.
2010-07-01 16:28:21 +00:00
dyoung
83fdd687cf Change a > to a >= to avoid writing to the character after the end of
the buffer passed to get_string().
2010-07-01 16:12:23 +00:00
kefren
a7449c28c6 add MPLS clue - mpls and tag keywords 2010-06-26 14:29:36 +00:00
pooka
5d8421fd1d naughty naughty, don't peek into src/sys 2010-06-14 14:42:49 +00:00
riz
b82a6579fe Remove _PATH_NOLOGIN before reboot, as well as before exit(), to prevent
a root file system which has been marked read-only in fstab from continuing
to prevent logins after reboot.  From Ian D. Leroux in PR#43390.
2010-06-09 04:51:53 +00:00
dholland
0bf3480c62 Change getnum() to use intmax_t instead of int, so it doesn't overflow
between 2^31 and 2^32. Adjust call sites accordingly. PR 43354.
2010-05-28 07:40:53 +00:00
pooka
d4af2513b1 PUFFSDEVELVERS is a goner 2010-05-21 11:59:38 +00:00
wiz
8d31c36840 Mention that dkctl(8) does not modify on-disk data, and add xrefs to
fdisk(8) and gpt(8). Bump date.
2010-05-18 23:33:03 +00:00
jruoho
04636eae18 Use a list for the list of bugs. 2010-05-14 05:04:58 +00:00
tnozaki
50eb6aadde cast isblank(3)'s argument to unsigned char. 2010-05-13 17:52:11 +00:00
mbalmer
8e64e5f559 Fix grammar in a line of output.
From Hywel Mallett via FreeBSD.
2010-05-12 21:21:59 +00:00
kefren
c890d3f5e0 Update also keywords.{c,h} generator in order to reflect latest changes. 2010-05-12 19:26:33 +00:00
christos
c69676936c PR/40455: Mihai Chelaru: Add noreject noblackhole options 2010-05-12 17:56:13 +00:00
plunky
a5a749a5f7 C99 says that offsetof() expands to a constant expresssion, so we
can't use variable array index in there. Do the calculation manually
for C99 compilers (pcc)
2010-04-20 21:25:25 +00:00
wiz
c4f8f360fc New sentence, new line. Sort SEE ALSO.
Improve formatting of option list.
2010-04-11 21:29:37 +00:00
hannken
738a97ca87 Add -x option which allows to run `fsck_msdos -n' on a snapshot of
a live file system.

While here modify snap_open() to accept a character device as its
first arg and remove now unneeded get_snap_device().

Reviewed by: Manuel Bouyer <bouyer@netbsd.org>
2010-04-11 08:23:51 +00:00
mrg
e00e7bd5c0 implement CTLTYPE_BOOL support. it was entirely missing. HI MATT! 2010-04-11 01:52:10 +00:00
wiz
d129d948ec Minor punctuation fixes, improve and sort SYNOPSIS, sort flag descriptions.
From Bug Hunting in PR 43130.
2010-04-07 09:40:58 +00:00
wiz
01ab0048e9 Sort option descriptions, per PR 43119 by Bug Hunting.
Refer to -r from -w.
Bump date.
2010-04-05 18:08:41 +00:00
plunky
ba9e7b8487 use -Wno-pointer-sign in the HAVE_PCC case also 2010-04-03 11:55:41 +00:00
christos
f8c6b14cc1 fix printf format. 2010-04-02 19:33:09 +00:00
christos
79bdd20aa6 PR/43105: Peter Kerwien: Destroying a GPT partition with dd will cause gpt
destroy / create to fail. When reading the GPT label from the end of the disk
ignore errors if the GPT label at the beginning of the disk was not found.
2010-04-02 13:36:59 +00:00
pooka
4ec51947cc convert to parseargs 2010-03-31 13:33:14 +00:00
pooka
3bc1bb4f0e initialize canon_dev 2010-03-31 13:10:10 +00:00
joerg
a26d6af163 Kill stray t. 2010-03-31 04:17:23 +00:00
joerg
44f960014f \\ -> \e 2010-03-30 14:26:55 +00:00
joerg
104dbdf3ec Assume o umlaut is transliterated by nroff as needed.
\\ -> \e
2010-03-30 14:07:50 +00:00
joerg
4a90fd399e \\ -> \e 2010-03-30 14:05:32 +00:00
pooka
23d5534a55 Avoid known unknown if the kernel presents us with an unknown
unknown for module class and/or source.

related to PR kern/43014
2010-03-19 16:25:33 +00:00
jld
9abd7e4959 Give a more polite message for raidctl -m on a non-parity RAID set. 2010-03-16 03:23:47 +00:00
mrg
a597c96c7d add SMART code 187: "Reported uncorrect". from smartmontools. 2010-03-13 19:49:50 +00:00
plunky
858911baa2 fix sign-compare issue 2010-03-13 13:45:05 +00:00
jld
8ccd0f67a6 Exclude parity map regions that don't actually exist from the dirty region count
in `raidctl -m`.  Makes for less confusing output during `raidctl -i`.
2010-03-13 07:21:37 +00:00
christos
20ebd2a462 PR/42952: The Grey Wolf: Fix for "true incremental". Don't overload level
9, use a new level "i" which is logically 10.
2010-03-11 01:32:59 +00:00
abs
6c6ab6a995 Relegate edlabel to use in extremely memory constrained install
ramdisks and prefer disklabel elsewhere.
Based on discussion on affected port lists (port-sparc port-sparc64
port-sun3 port-sun2 port-atari port-mvme68k).
All listed ports plus amd64 test built after change
2010-03-10 23:13:09 +00:00
mlelstv
bc76b1d5b0 When clearing a log on failure, not only ask the kernel to ignore an
existing log but to remove it on next mount.
2010-03-06 11:31:40 +00:00
christos
c6af1de885 - use warn/err properly
- wrap long lines
2010-03-06 00:30:54 +00:00
pooka
04e9fbfc62 Remove no longer used -DNFS. 2010-03-05 19:53:37 +00:00
pooka
696ffdd08a note module changes 2010-03-05 18:51:22 +00:00
pooka
0299287e5f Use 8k buffer, since 4k is too short for the default list (might
save one round of modctl()).
2010-03-05 10:27:16 +00:00
wiz
f704e3fc5c -i does not take an argument. Remove unnecessary Bk/Ek. New sentence, new line. 2010-02-26 07:01:17 +00:00
christos
c40eb1e731 PR/42883: Greywolf: Add -i flag which brings "true incremental" capability. 2010-02-26 02:11:40 +00:00
tsutsui
5b900f2697 Avoid line break in `Linux Ext2' strings. 2010-02-25 13:09:17 +00:00
hannken
626b19f88a Dont pass option -x down to fsck_xxxfs.
Hi christos ...
2010-02-24 13:56:07 +00:00
tsutsui
62936fc84a 32 bit UID and GID support on ext2fs has been added since 5.0
so remove description about the limitations from BUGS section.
2010-02-22 09:45:02 +00:00
mlelstv
d3dff438aa dev_bsize wasn't initialized. The actual value doesn't matter since
the same value is used to compute byte offsets into the special file
but a value of zero causes a division by zero.
2010-02-21 16:24:21 +00:00
wiz
1a64f4201c Call the file system "ext2" consistently. Suggested by tsutsui. 2010-02-21 13:26:45 +00:00
wiz
dcced1277c Fix string, noted by tsutsui. 2010-02-21 13:23:15 +00:00
ahoka
daea46045b Fix two problems with argc handling in bioctl(8), which makes
bioctl(8) dump core if expected arguments are not passed in.

Closes PR bin/39946 (patch by Juan RP).
2010-02-20 22:25:54 +00:00
mlelstv
6ae5a6ad41 Initialize device_name before opendisk to avoid
"unable to open device '(null)'" error messages
when the opendisk fails.
2010-02-20 08:47:10 +00:00
wiz
8f657e21de Fix typo (specifed -> specified). 2010-02-18 14:00:39 +00:00
wiz
40effc38c9 Pull over some of Jason McIntyre's fixes for newfs_ext2fs.
Suggested by tsutsui.
2010-02-18 13:51:45 +00:00
wiz
380455a930 Fix pasto noted by tsutsui. 2010-02-18 13:49:19 +00:00
wiz
e386b4ea79 Use Dq for double quotes; remove trailing whitespace. 2010-02-18 06:57:17 +00:00
christos
639f597520 Add -x <mountpoint> ``exclude'' option. 2010-02-17 23:30:21 +00:00
wiz
841db612d9 Various fixes from Jason McIntyre <jmc@kerhand.co.uk>. 2010-02-17 21:39:14 +00:00
mlelstv
7974872552 Three changes in a single commit.
- drop the notion of frags (LFS fragments) vs fsb (FFS fragments)
  The code uses a complicated unity function that just makes the
  code difficult to understand.

- support larger sector sizes. Fix disk address computations
  to use DEV_BSIZE in the kernel as required by device drivers
  and to use sector sizes in userland.

- Fix several locking bugs in lfs_bio.c and lfs_subr.c.
2010-02-16 23:20:30 +00:00
plunky
f5c86c146d use
.if defined(HAVE_GCC) && ${HAVE_GCC} == 4

rather than

.if ${HAVE_GCC} == 4

as HAVE_GCC may be undefined
2010-02-08 07:56:06 +00:00
christos
c68c36a514 Centralize time printing and deal with ctime possibly returning NULL. 2010-02-04 23:55:42 +00:00
roy
98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
mlelstv
0aef69272b Skip handling of APPLEUFS_LABEL if it is smaller than a device block.
In particular:

- newfs will not try to erase the label
- fsck_ffs will not try to validate the label

This lets newfs and fsck work on 2048-byte-per-sector media.

Does Apple UFS support such media and how?
2010-01-31 16:04:34 +00:00
is
c41a4b460e Use getnameinfo() for printing AppleTalk addresses. While here, fix
printing of broadcast for this address family (AT broadcast is fixed
node 255 on the local net).
2010-01-30 18:30:33 +00:00
drochner
821d4396bd follow KS_GROUP_Ascii->KS_GROUP_Plain rename in kernel,
noticed by Andreas Gustafsson
2010-01-29 09:49:34 +00:00
christos
13a5940614 use warn/err appropriately. 2010-01-27 18:34:02 +00:00
pooka
03fdf6b025 error message: \n\n -> \n 2010-01-27 17:02:06 +00:00
spz
1cb24f3feb range-check what we assign to int cachebufs from calculations with
uint64_t usermem. This only becomes relevant if you have several TB of RAM.
Promoting cachebufs to uint64_t is not necessary as it gets limited to
(currently) 512 anyway.

fixes the last issue of PR: 19852
2010-01-27 12:20:25 +00:00
wiz
e08d841a54 + Fatal errors due to uninitialized components are ignored.
for -C. For dillo@
2010-01-27 09:26:16 +00:00
wiz
4421a69224 Consistently use "START disks" in examples. Bump date. 2010-01-27 08:56:08 +00:00
is
000fbf6b41 Add AF_APPLETALK support to getnameinfo(); make "route show" use it.
Doesn't print "ranges" yet (should it be done here?); only numeric
output.
2010-01-26 21:27:54 +00:00
jakllsch
ce12229e40 Add display of Long Physical Sector and Long Logical Sectors feature set
information to atactl identify output.

Also:
- remove caddr_t cast
- warn about invalid IDENTIFY data checksum (when possible)
- humanize capacity in power-of-10 format
- remove semi-pointless ATAPI check
- slightly rework command queue depth output to be less conversational
2010-01-25 01:24:11 +00:00
dyoung
6abb73d262 Compare a pointer with NULL instead of testing its "truth." 2010-01-22 23:50:07 +00:00
pooka
0552fc0a0c from main with return 0;
(Why did I manage to succesfully build n times, including a full
distribution build, without tripping this before ?!?)
2010-01-14 22:06:54 +00:00
pooka
ce626609cc Remove puffs| from vfstype before making comparison to determine if
fs is mounted.

Fixes slightly-miscategorized kern/37626.
2010-01-14 21:46:24 +00:00
pooka
707f1f2b92 If getargs and vfs has PUFFS_TYPEPREFIX, use mount_puffs to query args. 2010-01-14 21:30:17 +00:00
pooka
335e5fc6dc Descend into mount_puffs. 2010-01-14 21:29:26 +00:00
pooka
0f16a0e5f3 Add a generic puffs kernel utility for querying mount arguments.
E.g.:
	golem> dtfs -r 'chr 15 25' dtfs /puffs
	golem> mount_puffs -o getargs dtfs /puffs
	version=26, flags=0x10, root cookie=0xbb90c0c0, root type=VCHR, root size=0, root rdev=0xf19
2010-01-14 21:25:48 +00:00
christos
808212fb9d missing errno.h 2010-01-07 04:21:28 +00:00
christos
36cd9355e9 make this compile again. 2010-01-07 01:39:56 +00:00
christos
87e82597b6 PR/42568: Pedro F. Giffuni: Better signal handling from OpenBSD, but simplified. 2010-01-06 18:12:37 +00:00
tsutsui
d3724ba41f Add necessary byteswap ops for tools disklabel(8) used with -F option
(treating a target disk as a regular file and suppressing ioctl(2)s)
on reading/writing disklabel in a target file.
This allows cross build enviroment creating bootable disk images
for targets in different endian.
No functional changes to native (non-tools) disklabel(8) command.

Closes PR toolchain/42357.
2010-01-05 15:45:26 +00:00
elad
34edb026e5 Keep an internal variable indicating whether securelevel is present, and
don't blindly try to get/set it. Prevents error messages that don't make
sense if securelevel isn't supported by the kernel.
2009-12-29 17:07:17 +00:00
dsl
5281921f56 Add info for -A ptn_alignment[/ptn_0_offset] 2009-12-23 20:56:18 +00:00
dsl
4d8b353d15 Put #endif in correct place - fixes PR/42500
Update usage() for -A, and rename one of the variables for clarity.
2009-12-23 18:50:40 +00:00
mbalmer
c84c875a15 Bump date. 2009-12-23 09:18:48 +00:00
mbalmer
8a65aabe5b Fix typo in command output. 2009-12-23 09:13:21 +00:00
dsl
9193c05dda Add support for partition being aligned on non-cylinder boundaries.
Info can be specified with -A parameter.
Default is based on how the first partition is defined.
For empty disks larger than 128GB (arbitrary figure) use 1MB alignment.
2009-12-22 21:55:12 +00:00
dsl
5cb32d7a27 Editing partitions larger than 1TB works better if 'decimal' returns
64 bit integer values!
2009-12-22 21:04:37 +00:00
pooka
c23e4f05d3 Don't -I from $S/sys. 2009-12-22 17:50:22 +00:00
dsl
795733c59e Add a large comment about disk geometries.
Rename (with #defines) the variables use for aligning partitions to
separate them from the bios geometry.
All in advance of allowing other partition alignments (eg 2048 sectors).
2009-12-20 17:32:09 +00:00
dsl
e9c65c5007 Push the mount path for mount_mfs through realpath().
This matches what other fs do.
Fixes PR/20362
2009-12-20 15:21:13 +00:00
pooka
0f5249be8d Use CMSG_SPACE() for buffer when receiving file descriptors.
Doesn't break i386 and might be better for sparc64.
2009-12-19 16:01:25 +00:00
pooka
eb2ef0c632 Use RUMP_ACTION to avoid having to specify the same information
in the Makefiles of all the consumers.
2009-12-19 15:03:34 +00:00
pooka
3d1523b600 Use implicit -F for regular files, much like disklabel(8). 2009-12-17 14:27:49 +00:00
nakayama
1c54a66d99 System utilities, boot programs and kernel modules are machine
(port) specific not CPU, so use MACHINE not MACHINE_ARCH.
2009-12-13 05:01:32 +00:00
jld
9bd6e2661a Slight change to the wording of the parity map info: the parity is
"marked clean" after however much inactivity; it is *actually* clean
as soon as the component disks all do their thing (on the order of ms,
usually), just the same as before.

The bikeshed is now less of a taupe and more of an ecru.
2009-12-10 20:20:59 +00:00
pooka
a9b5fcccfc Note conversion to puffs for the kernel driver. 2009-12-05 20:34:28 +00:00
pooka
3b4bfde519 use puffs_cookie_t. no functional change. 2009-12-05 20:29:19 +00:00
pooka
8dec10527a Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs.  User functionality remains the same.
(missed new file in change batch)
2009-12-05 20:25:32 +00:00
pooka
70d4493c77 Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs.  User functionality remains the same.
2009-12-05 20:11:01 +00:00
pooka
d6224f4507 Remove support for NetBSD/playstation2. 2009-12-05 16:29:10 +00:00
pooka
bc6c058985 Add note saying that special must be a raw device.
PR bin/42391
2009-12-01 10:56:33 +00:00
pooka
3cf07ff872 Remove vinum-removal sentence fragment, similarly to newfs(8). 2009-12-01 08:47:25 +00:00
pooka
56a6edc13a Use getprogname() instead of hardcoding "mount_nfs" to get the
right info in rump_nfs.
2009-11-30 17:17:55 +00:00
tsutsui
1baf5ea42e Add a bunch of useful typical examples. Also use appropriate markup there. 2009-11-29 04:19:55 +00:00
tsutsui
1735ad7d34 Update -u usage to follow changes in fdisk.c rev 1.125:
>> Allow MB, GB and CYL (not just M, G and C) and lower case.
>> Don't output a splurious 'd' before "cyl".
>> Fixes PR/37414.

XXX "NNcy" is also allowed?
2009-11-28 17:25:45 +00:00
tsutsui
d5fb21858d Clarify description of -f and -u options.
(-u means updating partition data, not interactive mode)
2009-11-28 16:45:20 +00:00
tsutsui
e7730664e0 Don't use #ifdef __${MACHINE_ARCH}__ to enable machine dependent features.
Instead, use proper macro defined in Makefile per ${MACHINE_ARCH}.

__${MACHINE_ARCH}__ doesn't represent an architecture of tool's target
but an architecture of binaries being compiled, so required features
are not prolery enabled or unintentionally enabled on certain host
and target combinations during src/tools build.
2009-11-28 12:14:53 +00:00
tsutsui
93f39165ae Make dreamcast, evbsh3, and mmeye use -DUSE_MBR.
All of these ports use src/sys/arch/sh3/sh3/disksubr.c
which is MBR aware.
2009-11-28 11:26:36 +00:00
abs
b861177ec4 - Display "Enter '?' for help" when starting interactive mode
- Use %.40g rather than %g when printing sectors and MB for existing
  partition size/offset.
  Changes [1.93802e+06c, 1953525105s, 953870M]:
  to:     [1938021c, 1953525105s, 953869.6875M]:
2009-11-28 10:52:10 +00:00
abs
e115d85122 Shuffle the order of examples to put the interactive option (-i) ahead
of $EDITOR and "disklabel -w -r /dev/rsd0c sd2212 foo"
2009-11-28 10:28:22 +00:00
tsutsui
fcf4b7e0c1 Remove fdisk/mbr for macppc which was blindly pulled from OpenBSD.
It just fakes MBR partition map which contains 1MB FAT16B partition
and ~1GB OpenBSD partition, and we can always create necessary
MBR partitions for OpenFirmware by the fdisk(8) command itself.
2009-11-27 15:37:32 +00:00
mbalmer
124961627e s/the the/the/ 2009-11-22 18:40:26 +00:00
wiz
feb9cdd5a3 Remove trailing whitespace. 2009-11-17 19:35:48 +00:00
jld
9e2ba7b416 Bump date; also fix typo pointed out by snj@. 2009-11-17 19:09:38 +00:00
jld
f1a1ad338d Finally commit the RAIDframe parity map Summer Of Code project.
Drastically reduces the amount of time spent rewriting parity after an
unclean shutdown by keeping better track of which regions might have had
outstanding writes.  Enabled by default; can be disabled on a per-set
basis, or tuned, with the new raidctl(8) commands.

Discussed on tech-kern@ to a general air of approval; exhortations to
commit from mrg@, christos@, and others.

Thanks to Google for their sponsorship, oster@ for mentoring the
project, assorted developers for trying very hard to break it, and
probably more I'm forgetting.
2009-11-17 18:54:26 +00:00
dsl
fb64c309b2 Allow MB, GB and CYL (not just M, G and C) and lower case.
Don't output a splurious 'd' before "cyl".
Fixes PR/37414.
Patch in PR is wrong!
2009-11-04 22:25:56 +00:00
christos
4d3e7c5df2 remove ancient ifdefs (Aleksej Saushev) 2009-11-02 00:47:09 +00:00
dsl
3b8f95158f Make absence of /usr/mdec/mbr only a warning.
Fixes PR/26510
2009-10-31 20:41:00 +00:00
christos
2853bbf4b7 use %option instead of #define YY_NO_... 2009-10-29 14:49:02 +00:00
christos
05a0c94cec no need for noinput 2009-10-29 14:34:06 +00:00
christos
cd2a002a7a no unput 2009-10-28 20:59:46 +00:00
christos
652adce2ab add %option noyywrap 2009-10-28 19:43:56 +00:00
christos
1a15c56ae5 we don't need unput 2009-10-28 17:25:44 +00:00
christos
cad376bd0d merge 2.32 which is actually 2.31. Most important change is:
- use multicast over point-to-point (GRE) links as proposed by Dan Lukes.
2009-10-26 02:53:15 +00:00
joerg
65828ca533 Use .%U. 2009-10-25 18:34:04 +00:00
tsutsui
ab4082e001 - u_short -> uint16_t
- KNF a bit
2009-10-24 18:15:45 +00:00
snj
febb7cce65 Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder). 2009-10-21 23:12:09 +00:00
snj
550147bd6a Remove 3rd and 4th clauses in christos' license. OK christos. 2009-10-21 01:07:44 +00:00
bouyer
6d07b400dc Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
2009-10-19 18:41:07 +00:00
wiz
6365332879 Document -n, from Jukka Ruohonen in private mail.
Bump date.
2009-10-19 14:35:04 +00:00
joerg
b2ed4022ca Do not use .Xo / .Xc without a good reason. 2009-10-14 22:00:55 +00:00
pooka
4be222467f fix prototypes of function pointers to varargs syscalls 2009-10-13 22:04:31 +00:00
pooka
2ff8677b99 close rump kernel file descriptors properly 2009-10-11 12:51:58 +00:00
pooka
4f5a394d32 Support RUMP_ACTION, i.e. compile-time switch to make this execute
rump syscalls to configure raidframe in a rump kernel.
2009-10-11 12:14:05 +00:00
pooka
c50311a2dc fspec: dev -> canon_dev 2009-10-07 20:42:09 +00:00
pooka
96c1f4851b Mount from canon_dev instead of dev. 2009-10-07 20:34:02 +00:00
wiz
0fe31f2e87 Drop trailing whitespace. 2009-10-03 07:37:01 +00:00
elad
50c13fc074 Make modstat output look pretty again. 2009-10-03 02:27:43 +00:00
elad
1df9608023 Centralize documentation about exported sysctl variables in the relevant
secmodel's man-page.
2009-10-02 20:31:19 +00:00
elad
52734536eb Bump date to today's date (rather than when the changes were made). 2009-10-02 19:50:37 +00:00
elad
53ca19a3b3 First part of secmodel cleanup and other misc. changes:
- Separate the suser part of the bsd44 secmodel into its own secmodel
    and directory, pending even more cleanups. For revision history
    purposes, the original location of the files was

        src/sys/secmodel/bsd44/secmodel_bsd44_suser.c
        src/sys/secmodel/bsd44/suser.h

  - Add a man-page for secmodel_suser(9) and update the one for
    secmodel_bsd44(9).

  - Add a "secmodel" module class and use it. Userland program and
    documentation updated.

  - Manage secmodel count (nsecmodels) through the module framework.
    This eliminates the need for secmodel_{,de}register() calls in
    secmodel code.

  - Prepare for secmodel modularization by adding relevant module bits.
    The secmodels don't allow auto unload. The bsd44 secmodel depends
    on the suser and securelevel secmodels. The overlay secmodel depends
    on the bsd44 secmodel. As the module class is only cosmetic, and to
    prevent ambiguity, the bsd44 and overlay secmodels are prefixed with
    "secmodel_".

  - Adapt the overlay secmodel to recent changes (mainly vnode scope).

  - Stop using link-sets for the sysctl node(s) creation.

  - Keep sysctl variables under nodes of their relevant secmodels. In
    other words, don't create duplicates for the suser/securelevel
    secmodels under the bsd44 secmodel, as the latter is merely used
    for "grouping".

  - For the suser and securelevel secmodels, "advertise presence" in
    relevant sysctl nodes (sysctl.security.models.{suser,securelevel}).

  - Get rid of the LKM preprocessor stuff.

  - As secmodels are now modules, there's no need for an explicit call
    to secmodel_start(); it's handled by the module framework. That
    said, the module framework was adjusted to properly load secmodels
    early during system startup.

  - Adapt rump to changes: Instead of using empty stubs for securelevel,
    simply use the suser secmodel. Also replace secmodel_start() with a
    call to secmodel_suser_start().

  - 5.99.20.

Testing was done on i386 ("release" build). Spearated module_init()
changes were tested on sparc and sparc64 as well by martin@ (thanks!).

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/09/25/msg006135.html
2009-10-02 18:50:12 +00:00
elad
55a6f2a937 Remove stale references to the "read only at securelevel [12]" flags in
the documentation and code comments.
2009-09-30 04:30:50 +00:00
bouyer
59e1504d12 Restore changes from 1.86 and 1.87 after commit of 1.88. 2009-09-27 17:13:37 +00:00
apb
29d1bfefcb Make the exit status from "swapctl -A" and "swapctl -U" tri-state:
0 for success; 1 for error; and 2 when no devices of the appropriate type
are defined in fstab(5).  Previously, "no apropriate devices" was
indistinguishable from "error".
2009-09-24 16:15:20 +00:00
reinoud
b8b9c8efc5 Update TODO message; we can format with meta data partitions, only not yet for
BD-R, i.e. UDF 2.60.
2009-09-17 10:37:28 +00:00
tsutsui
aa68f4ed1a - no space needed between -I and dir per gcc(1)
- it's still better to use ${NETBSDSRCDIR} per other existing Makefiles
2009-09-16 15:08:29 +00:00
tsutsui
d60368466f Add comments that Makefile.inc should have shared stuff with
src/distrib/utils/x_ifconfig for install media.
2009-09-16 14:59:45 +00:00
he
ad8225c04b Move the addition of pfsync.c from Makefile.inc to Makefile,
so that this part doesn't get included in install media versions
of ifconfig, as per comments on source-changes@ from Izumi Tsutsui.
Also re-instate the use of ${.CURDIR} when setting up the include path.
2009-09-15 09:22:07 +00:00
he
4cf3355067 Change from using ${.CURDIR} to ${NETBSDSRCDIR} because this file
may be included by different parts of the source tree, in particular
deep down in the distrib/ tree, where ../.. isn't sufficient to "climb"
up to the top of the tree.  Fixes the build at least for our arc port.
2009-09-14 15:12:21 +00:00
pooka
84e795ea60 Set fspec to canon_dev instead of dev. 2009-09-14 12:43:46 +00:00
degroote
2d48ac808c Import pfsync support from OpenBSD 4.2
Pfsync interface exposes change in the pf(4) over a pseudo-interface, and can
be used to synchronise different pf.

This work was part of my 2009 GSoC

No objection on tech-net@
2009-09-14 10:36:48 +00:00
bouyer
601b0385bb Restore change from 1.39 after previous commit. 2009-09-13 18:30:30 +00:00
bouyer
cab6cd67bc Do some basic checks of the WAPBL journal, to abort the boot before the
kernel refuse to mount a filesystem read-write (booting a system
multiuser with critical filesystems read-only is bad):
Add a check_wapbl() which will check some WAPBL values in the superblock,
and try to read the journal via wapbl_replay_start() if there is one.
pfatal() if one of these fail (abort boot if in preen mode,
as "CONTINUE" otherwise). In non-preen mode the bogus journal will
be cleared.
check_wapbl() is always called if the superblock supports WAPBL.
Even if FS_DOWAPBL is not there, there could be flags asking the
kernel to clear or create a log with bogus values which would cause the
kernel refuse to mount the filesystem.
Discussed in
http://mail-index.netbsd.org/tech-kern/2009/08/17/msg005896.html
and followups.
2009-09-13 14:25:28 +00:00
bouyer
32992733fa Allow tunefs to clear any type of WAPBL log, not only in-filesystem
ones. Discussed in
http://mail-index.netbsd.org/tech-kern/2009/08/17/msg005896.html
and followups.
2009-09-13 14:13:23 +00:00
dyoung
230fd8c662 This should fix 'carpdev <ifname>' or, at least, not break it more
badly than before.
2009-09-11 23:22:28 +00:00
dyoung
c5d5f7697a Make ifconfig(8) set and display preference numbers for IPv6
addresses.  Make the kernel support SIOC[SG]IFADDRPREF for IPv6
interface addresses.

In in6ifa_ifpforlinklocal(), consult preference numbers before
making an otherwise arbitrary choice of in6_ifaddr.  Otherwise,
preference numbers are *not* consulted by the kernel, but that will
be rather easy for somebody with a little bit of free time to fix.

Please note that setting the preference number for a link-local
IPv6 address does not work right, yet, but that ought to be fixed
soon.

In support of the changes above,

1 Add a method to struct domain for "externalizing" a sockaddr, and
  provide an implementation for IPv6.  Expect more work in this area: it
  may be more proper to say that the IPv6 implementation "internalizes"
  a sockaddr.  Add sockaddr_externalize().

2 Add a subroutine, sofamily(), that returns a struct socket's address
  family or AF_UNSPEC.

3 Make a lot of IPv4-specific code generic, and move it from
  sys/netinet/ to sys/net/ for re-use by IPv6 parts of the kernel and
  ifconfig(8).
2009-09-11 22:06:29 +00:00
wiz
94c9674d9d Add xref to pkgsrc/net/gated, so people know where to find gated(8).
Improve markup of RFCs in SEE ALSO.
Sort options.
Bump date.
2009-09-11 11:44:38 +00:00
pooka
14e70b7ba7 fix LP64 builds. yay, C type system.
patch from Joachim Kuebart
2009-09-10 09:10:29 +00:00
pooka
8b0a183ce8 Remember to add cgdconfig.h too. 2009-09-08 22:16:56 +00:00
pooka
7ae6c0a6f6 * allow specification of kernel operations vector
* make it possible to build cgdconfig as a library
2009-09-08 21:36:35 +00:00
pooka
d7e67263d0 build smb_kernelops 2009-09-06 18:39:04 +00:00
pooka
630289bcad Include Makefile.inc earlier to make dot.nsmbrc install properly.
Pointed out by gson.
2009-09-05 18:37:51 +00:00
pooka
573d907442 Provide Makefile.inc which contains source module names and paths. 2009-09-04 18:25:56 +00:00
pooka
7f37fbb7ea Install smb headers relevant for userspace and make mount_smbfs
use installed headers instead of src/sys.
2009-09-03 12:04:50 +00:00
joerg
350a39e662 Fix markup 2009-08-22 00:14:21 +00:00
dogcow
9098338f79 Instead of exiting with an obscure error message if -N /kernelname isn't
specified, blithely assume the kernel will consume around 20 megs.
2009-08-18 04:02:39 +00:00
bouyer
7095ec7992 fix pasto: UFS_WAPBL_FLAGS_CREATE_LOG is "create-log" not "clear-log" 2009-08-17 21:28:24 +00:00
martin
c69e3f0a0e Add <sys/exec_aout.h> includes 2009-08-16 18:01:49 +00:00
tron
e67b5654ff Ignore the "-P" option as intended to make this work with e.g.
"fsck_flags=-pP" in "/etc/rc.conf".

Patch supplied by Pierre Pronchery in PR bin/41490.
2009-08-16 13:50:54 +00:00
yamt
44484fcfa9 an example. 2009-08-10 02:56:23 +00:00
apb
0b08bd10ac Allow rcorder-visualise.sh to accept an optional set of file names on
the command line.  By default it uses /etc/rc.d/*, as before.  Sample
usage: /usr/src/rcorder-visualise.sh /usr/src/etc/rc.d/*.
2009-08-09 17:08:53 +00:00
dyoung
fcabb0789a Describe the -N flag. 2009-08-07 20:13:12 +00:00
dyoung
ae9b1bdb85 Use getnameinfo(3) instead of inet_ntoa(3) to convert IPv4 addresses
to names.
2009-08-07 19:35:55 +00:00
dyoung
ab7c5957a9 Add option -N. -N is just the opposite of option -n in netstat(8)
or route(8): it tells ifconfig(8) to try to resolve numbers to
hosts and service names.

This default ifconfig behavior stays the same as it always was.
2009-08-07 18:53:37 +00:00
pooka
4979347199 remember to add cleaner_main() prototype 2009-08-06 00:58:32 +00:00
pooka
fe44f86a99 in const where available 2009-08-06 00:55:08 +00:00
pooka
709a4d5bb6 Define syscalls of lfs userspace tools (cleaner, mainly) through
a struct called kernelops, which contains standard system calls
for the normal case and rump system calls for the rump case.

Make it possible to run the lfs cleaner in a library fashion (taking
the quick route with the implementation).
2009-08-06 00:51:55 +00:00