Commit Graph

3616 Commits

Author SHA1 Message Date
Johan Karlsson
eb3beef5ad Make this WARNS=5 clean by using %j and (uintmax_t).
Look at by:	sebastian.ssmoller@web.de on audit@
2003-04-23 20:24:13 +00:00
Johan Karlsson
b107cd7718 These are WARNS=5 clean, mark them as such to keep them that way.
Look at by:	sebastian.ssmoller@web.de on audit@
2003-04-23 20:22:33 +00:00
Poul-Henning Kamp
6fd54d593e Add testcases to ensure that overwriting bootcode does not trash label. 2003-04-23 08:25:44 +00:00
Poul-Henning Kamp
97b902efd2 If we cannot open the parent device for writing, use GEOM::CONFIG_GEOM
requests to write label and bootcode.

The -r argument is ignored (with a warning).

With a lot of help from:	jake
2003-04-23 08:25:20 +00:00
Poul-Henning Kamp
fd19a46265 Do not link sunlabel to disklabel. 2003-04-23 06:37:57 +00:00
Poul-Henning Kamp
48c0057670 Add "-r" when we initialize the label first time.
Add two more tests.
2003-04-22 21:04:48 +00:00
Johan Karlsson
c0bb08c5ed Make this WARNS=2 clean by using %j and (uintmax_t).
Reviewed by:	tjr@ on audit@
Approved by:	silence from sos@
2003-04-22 19:57:46 +00:00
Poul-Henning Kamp
6ad44047ca Use explicit encoding/decoding funtions for sunlabel data structures.
Use #defines for various magic numbers.

Attach test-case to makefile.

Reviewed by:    jake
2003-04-21 20:38:15 +00:00
Poul-Henning Kamp
3d9c928705 Add minimal regression test for hotspot handling of the sunlabel. 2003-04-21 20:16:07 +00:00
Warner Losh
01ee1d1668 Kill debug printf that crept in my last commit 2003-04-21 17:25:39 +00:00
Warner Losh
5a882d775d Implement a two new flags, and change the meaning of another one.
'd': now means don't do daemon().
'D': Debug
'n': Don't wait to process all pending events before calling daemon.

In the past, devd would call daemon immediately.  However, this causes
a race.  If anything in the boot process depends on configuring the
devices configured by devd, maybe they would be configured in time,
maybe not.  Now we don't call daemon until all pending events are
processed, unless -n is specified.

# -n is actually the default for a while due to the select(2) bug in devctl
# that I just fixed to give people a chance to upgrade.
2003-04-21 06:26:08 +00:00
Warner Losh
9c1808986c Put an anti-foot-shooting measure in place. Set hw.bus.devctl_disable
to 0 when we startup.  Print a warning in this case.  This allows
people that are playing with devd by hand to have something happen.
Otherwise, it appears that devd isn't working because /dev/devctl is
disabled and producing no events.

Suggested by: peter on irc a long time ago.
2003-04-21 04:30:12 +00:00
Warner Losh
b1ee04b18e o Skip white space between variables better. This makes
'a="b" c="d" at loc=1 on busN' properly set 'c' and process the rest of
  the stirng.  Before it would ignore everything after variable 'a'.
o Parse nomatch and other events differently.  They are more different
  than the code allowed for, so we weren't properly parsing nomatch
  events.  It appears this fixes some of the demand loading issues that
  I was having with devd.

Noticed by: Gary Palmer
2003-04-21 04:00:01 +00:00
Warner Losh
3f2660bee3 devd.conf already has the examples in the todo list 2003-04-21 03:29:53 +00:00
Christian Brueffer
d4cb71fc53 Remove reference to diskpart(8)
PR:		51193
Submitted by:	Yonatan@xpert.com
2003-04-20 19:16:21 +00:00
Robert Watson
b459937e0c Throw the switch--change to UFS2 as our default file system format for
FreeBSD 5.1-RELEASE and later:

- newfs(8) will now create UFS2 file systems unless UFS1 is specifically
  requested (-O1).  To do this, I just twiddled the Oflag default.

- sysinstall(8) will now select UFS2 as the default layout for new
  file systems unless specifically requested (use '1' and '2' to change
  the file system layout in the disk labeler).  To do this, I inverted
  the ufs2 flag into a ufs1 flag, since ufs2 is now the default and
  ufs1 is the edge case.  There's a slight semantic change in the
  key behavior: '2' no longer toggles, it changes the selection to UFS2.

This is very similar to a patch David O'Brien sent me at one point, and
that I couldn't find.

Approved by:	re (telecon)
Reviewed by:	mckusick, phk, bmah
2003-04-20 14:08:05 +00:00
Poul-Henning Kamp
d7960ce5a2 Add the beginning of a regression test.
So far it checks the overwrites of the BSD label inband (ie: dd
if=/dev/ad0a of=/dev/ad2a).

This excercises the geom::slice::hotspot code.
2003-04-18 22:20:46 +00:00
Poul-Henning Kamp
008f0e2abb Solve printf/cast issues to make this compile in i386 as well. 2003-04-18 20:27:16 +00:00
Poul-Henning Kamp
2c60b6689a First scrub of s/disklabel/bsdlabel/
bsdlabel.5 deliberately exempted, its contents looks less than useful.
2003-04-18 19:44:12 +00:00
Tom Rhodes
c3da0eb49a Quick grammar fix. 2003-04-17 17:36:31 +00:00
Ruslan Ermilov
1becd59e62 There is an undocument feature that ``route -vnd flush'' prints
a nice dump of the entire routing table.  Allow non-root users
to see it too.
2003-04-16 12:06:53 +00:00
Ruslan Ermilov
5ea3e23965 Normalize, fix ``make checkdpadd''. 2003-04-16 11:54:11 +00:00
Munechika SUMIKAWA
0fe265077e Use NI_xxx macros.
Obtained from:	KAME
MFC after:	1 week
2003-04-16 09:53:29 +00:00
Jake Burkholder
5ee414278f Hardlink sunlabel to disklabel so make release is happy. (This only affects
sparc64, where bsd^H^H^Hdisklabel isn't built.)
2003-04-15 23:49:31 +00:00
Jake Burkholder
d2f46c9060 - Use read(2) to get the existing sunlabel on a disk, instead of parsing
kern.geom.conftxt, which md disks don't show up in.  If the magic and
  the checksum are right assume its a valid sunlabel, otherwise use the
  DIOC ioctls to get the disk parameters and whip up a label out of thin
  air.
- Don't just silently create or correct invalid c partitions, warn about
  invalid ones in label proto files.
- Split checksumming into a function since we do it a couple times.  Also
  don't include the sl_cksum field in the checksum, which avoids needing
  to clear it first.

This is makes sunlabel a suitable replacement for disklabel in make release.
2003-04-15 23:46:19 +00:00
Matthew N. Dodd
71d66ceb2c Don't abuse module names to facilitate ifconfig module loading;
such abuse isn't really needed.  (And if we do need type information
associated with a module then we should make it explicit and not
use hacks.)
2003-04-15 06:25:58 +00:00
Poul-Henning Kamp
ddc6ffdccf Avoid off_t -> integer overflow when sorting the locksector addresses. 2003-04-14 09:36:39 +00:00
Maxim Konovalov
29dccd6ae1 o Skip timestamp part when checking payload.
PR:		bin/50909
Submitted by:	Barney Wolff <barney@lab.databus.com>
2003-04-14 08:34:14 +00:00
Poul-Henning Kamp
1a03d6d57a Use symbolic constants from <sys/diskmbr.h> instead of local constants.
Always set the magic sequence when we write, rather than trusting the
previously read boot code to do so.

Use explicit encoding/decoding of little endian disk image.

Remove a comment which was OBE.

Change the test vector for "fdisk -I" to reflect that there is a magic
sequence in the result now.

Add test case for "fdisk" which reads the image back.

At least for the two test-cases this program now gives the same result
on sparc64 as on i386.  The lack of an installed /boot/mbr on sparc64
raises an (un)interesting question.
2003-04-13 21:57:08 +00:00
Poul-Henning Kamp
9657a0c35e Pull in the encoding/decoding functions for struct dos_partition.
Add a very simple regression test for "fdisk -I".
2003-04-13 21:34:16 +00:00
Poul-Henning Kamp
4e8bfe1482 Add a couple of undocumented test options to MD(4) to aid in regression
testting of GEOM.
2003-04-09 11:59:29 +00:00
Matthew N. Dodd
6e3bc9dad6 Bump the date for recent commits. 2003-04-07 22:58:35 +00:00
Matthew N. Dodd
564b641ef9 Clarify the behavior of PATH_FSTAB with regard to 'tainted' execution.
Requested by:	 ru
2003-04-07 14:21:14 +00:00
Matthew N. Dodd
ef258dd967 Implement the '-F' option for mount & umount which allows the user to
specify an alternate fstab file.
2003-04-07 12:56:01 +00:00
Matthew N. Dodd
47e9b3ea64 Deal with a case where the returned packed was smaller than the
transmitted packet (because the remote host stripped off our icmp_data).

Submitted by:	 Maxim Konovalov <maxim@macomnet.ru>
2003-04-07 12:05:50 +00:00
Matthew N. Dodd
5c514aeee8 Quiet warning. 2003-04-07 11:44:48 +00:00
Matthew N. Dodd
a3165d16af Avoid a name conflict with future functionality:
getfstab() -> dump_getfstab()
2003-04-07 11:34:12 +00:00
Darren Reed
0533695204 Change the default syslog facility from LOG_LOCAL0 to LOG_SECURITY after
discussion on security@freebsd.org.
2003-04-05 10:42:38 +00:00
Poul-Henning Kamp
5b03e4b6a1 Output machdep.guessed_bootdev as an integer rather than try to format
it according to ancient and obsolete rules.

This removes one more user of <sys/diskslice.h>
2003-04-03 21:41:14 +00:00
Poul-Henning Kamp
1e01677906 Don't pull in geom_enc.c any more. 2003-04-03 12:36:56 +00:00
Robert Watson
6ab0d6c220 When kill(-1) returns ESRCH, it could be because the current process
doesn't have a process group, which can occur if you're working with
a custom init that doesn't set up a full tty context.  Rather than
refusing to reboot, ignore ESRCH from the kill attempt in reboot(8).
2003-04-02 22:13:56 +00:00
Matthew N. Dodd
2c56e246fa Back out support for RFC3514.
RFC3514 poses an unacceptale risk to compliant systems.
2003-04-02 20:14:44 +00:00
Maxim Konovalov
33e1dc7738 IP_EVIL -> IP_EF 2003-04-02 14:52:21 +00:00
Yaroslav Tykhiy
252bcf459d Give clearer diagnostics on some cases of invalid
combinations of mdconfig(8) command-line arguments.

Make mdconfig(8) accept "-a -f file -o options"
equally with "-a -f file" (assuming "-t vnode".)
2003-04-01 15:23:55 +00:00
Yaroslav Tykhiy
29f3f095a6 Don't die of SIGSEGV on a missing fstype field
in a saved disklabel file.

MFC after:	1 week
2003-04-01 14:44:53 +00:00
Ruslan Ermilov
887c67148e This can't obviously be cleaner than system headers. 2003-04-01 11:11:38 +00:00
Matthew N. Dodd
09139a4537 Implement support for RFC 3514 (The Security Flag in the IPv4 Header).
(See: ftp://ftp.rfc-editor.org/in-notes/rfc3514.txt)

This fulfills the host requirements for userland support by
way of the setsockopt() IP_EVIL_INTENT message.

There are three sysctl tunables provided to govern system behavior.

	net.inet.ip.rfc3514:

		Enables support for rfc3514.  As this is an
		Informational RFC and support is not yet widespread
		this option is disabled by default.

	net.inet.ip.hear_no_evil

		 If set the host will discard all received evil packets.

	net.inet.ip.speak_no_evil

		If set the host will discard all transmitted evil packets.

The IP statistics counter 'ips_evil' (available via 'netstat') provides
information on the number of 'evil' packets recieved.

For reference, the '-E' option to 'ping' has been provided to demonstrate
and test the implementation.
2003-04-01 08:21:44 +00:00
Poul-Henning Kamp
8b3ee9cd3b Use new GEOM OAM. Kernels have supported this for a number of days, so
people should be OK.
2003-03-31 18:38:31 +00:00
Poul-Henning Kamp
c0fdfdba29 Use default geometry in case the device doesn't provide one:
512 for sectorsize.
	63 for sectors.
	255 for heads.
This will mostly show up on MD(4) devices.
2003-03-29 22:06:52 +00:00
Sean Chittenden
5fe45f18e7 Small mdoc fix 2003-03-29 02:09:02 +00:00