Commit Graph

6261 Commits

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