14355 Commits

Author SHA1 Message Date
eadler
ec294fd7f5 MFC r258779,r258780,r258787,r258822:
Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

Similar to the (1 << 31) case it is not defined to do (2 << 30).

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.
2014-02-04 03:36:42 +00:00
jhb
647b92bf0a MFC 260206:
Rework the DSDT generation code a bit to generate more accurate info about
LPC devices.  Among other things, the LPC serial ports now appear as
ACPI devices.
2014-01-29 13:35:12 +00:00
jhb
2fa5ef25cf MFC 260910:
- Allow PCI devices that are attached to a driver to be identified by their
  device name instead of just the selector.
- Accept an optional device argument to -l to restrict the output to only
  listing details about a single device.  This is mostly useful in
  conjunction with other flags like -e or -c to allow a user to query
  details about a single device.
2014-01-28 21:56:18 +00:00
ache
1626ab813a MFC: r261146
Bad timespec_subtract() calculations produce negative tv_nsec on i386
which cause EINVAL returned from nanosleep() which cause loop in
cron_sleep() and making all cron jobs to start about 30 seconds earlier
(which cause f.e. logfiles rotation by newsyslog delayed by 1 hour).

Use simple and proved calculations from kernel's timespecsub() instead.
2014-01-28 13:29:54 +00:00
glebius
c3a529c9ca Merged /head:r256510,256512,257376,257469,260052:
Make 'netstat -i' use getifaddrs(3) instead of kvm(3).
2014-01-27 08:15:21 +00:00
bapt
4b032c82b7 Implicit include of sys/queue.h instead of relying on gelf.h/libelf.h to bring it
Newer version of gelf.h and libelf.h does not include sys/queue.h anymore

Submitted by:	kaiw
2014-01-25 01:08:35 +00:00
jhb
6414202f61 MFC 259826,259997,259998:
Support soft power-off via the ACPI S5 state for bhyve guests and wire
up a virtual power button to SIGTERM:
- Implement the PM1_EVT and PM1_CTL registers required by ACPI.
- Emulate the Reset Control register at I/O port 0xcf9.
- Advertise an _S5 package.
- Implement an SMI_CMD register with commands to enable and disable ACPI.
  Currently the only change when ACPI is enabled is to enable the virtual
  power button via SIGTERM.
- Implement a fixed-feature power button when ACPI is enabled by asserting
  PWRBTN_STS in PM1_EVT when SIGTERM is received.
- Add support for EVFILT_SIGNAL events to mevent.
- Implement support for the ACPI system command interrupt (SCI) and assert
  it when needed based on the values in PM1_EVT.  Mark the SCI as active-low
  and level triggered in the MADT and MP Table.
2014-01-23 20:35:32 +00:00
jhb
e1016866c7 MFC 257422,257661,258075,258476,258494,258579,258609,258699:
Several enhancements to the I/O APIC support in bhyve including:
- Move the I/O APIC device model from userspace into vmm.ko and add
  ioctls to assert and deassert I/O APIC pins.
- Add HPET device emulation including a single timer block with 8 timers.
- Remove the 'vdev' abstraction.

Approved by:	neel
2014-01-23 20:21:39 +00:00
glebius
6cb9337539 Merge r259855: We have in base iconv.
PR:		185135
2014-01-22 10:35:30 +00:00
dteske
1f9d47c9f7 MFC r260261 (gavin):
Lower the priority of the "connect to any open wireless network" network
description, so guaranteeing that any other defined network will be tried
first.

MFC r260262 (gavin):
Allow bsdinstall to use WPA-Enterprise networks when installing.  This
only allows basic username/password config, and does not provide the
ability to set any of the other WPA options.  Regardless, this is
generally sufficient to associate.

Perhaps in the future this could allow full configuring (e.g. being able
to set "anonymous identity", and perhaps some of the more obscure WPA
options), though perhaps that will better belong in bsdconfig when that
grows wlan config ability.
2014-01-15 08:17:31 +00:00
dteske
b12b4da87e MFC r260260 (gavin): Remove what appears to be a stray debugging printf. 2014-01-15 08:12:19 +00:00
dteske
c7d6611e4d MFC r259686:
Move the installer's keymap solution introduced by SVN r259468. The new
location of /etc/rc.local on the install media is more appropriate as it
knows serial vs. non-serial and can also do the change earlier (so that
even the initial Install dialog can benefit from the change).

Discussed with:	nwhitehorn
2014-01-15 08:10:41 +00:00
dteske
75e3be07b8 MFC r257824,257826-257830,258411: Updates to sysrc(8)
257824: Fix a bug with `-d' form working as documented
257826: Add `--version' long option
257827: Add a `-c' option for `check only'
257828: Comments and whitespace
257829: Fix a bug with `-e' introduced by above 257828
257830: Document SYSRC_VERBOSE enviroment variable in the manual
258411: Revert the above 257830 (both merged to get .Dd bump in man-page)
2014-01-15 08:03:01 +00:00
dteske
a35804263c MFC r259054:
Performance and debugging enhancements:
+ Remove UNAME_P=$(...) from startup/misc -- already supplied by common.subr
+ Use f_getvar instead of $(eval echo \$$var) -- f_getvar is sub-shell free
+ Add `-e' and `-k var' options to f_eval_catch -- increasing use-cases
+ Use f_eval_catch to display errors on failure -- reducing duplicated code
+ Use f_eval_catch when we need output from a command -- improving debugging
+ Optimize f_isinter of strings.subr for performance -- now sub-shell free
+ Improve error checking on pidfiles -- using f_eval_catch and f_isinteger
+ Use $var_to_set arg of f_ifconfig_{inet,netmask} -- eliminate sub-shells
+ Use f_sprintf instead of $(printf ...) -- consolidate sub-shells
+ Use $var_to_set arg of f_route_get_default -- eliminate sub-shells
+ Add f_count to replace $(set -- ...;echo $#) -- eliminate sub-shells
+ Add f_count_ifs to replace $(IFS=x;set -- ...;echo $#) -- no sub-shells
+ Replace var="$var${var:+ }..." in loops with var="$var ..." with a follow-
  up var="${var# }" to trim leading whitespace -- optimize loops
+ Use $var_to_set arg of f_resolv_conf_nameservers -- eliminate sub-shells
+ Comments for the f_eval_catch function
+ Remove a duplicate `local ... desc ...' in f_device_get_all of device.subr
+ Use $var_to_set arg of f_device_capacity -- eliminate sub-shells
+ Whitespace fixes in f_dialog_init of dialog.subr
+ Optimize f_inet_atoi of media/tcpip.subr for performance -- sub-shell free
+ In several cases, send stderr to /dev/null -- clean up runtime execution
+ Change f_err of common.subr to go to program stderr not terminal stderr,
  allowing redirection of output from functions that use f_err
+ Disable debugging when using f_getvar to get variable argument to
  f_startup_rcconf_map_expand of startup/rcconf.subr
+ Use f_replace_all instead of $(echo ... | tr | sed) -- performance
+ Add a $var_to_set option to f_index_{file,menusel_{command,keyword}} of
  common.subr -- centralize sub-shells
2014-01-15 07:49:17 +00:00
dteske
44abef9537 MFC r258458:
Improve network device scanning in the netdev module. First, make it use the
`device.subr' framework (improving performane and reducing sub-shells). Next
improve the `device.subr' framework itself. Make use of the `flags' device
struct member for network interfaces to indicate if an interface is Active,
Wired Ethernet, or 802.11 Wireless. Functions have been added to make checks
against the `flags' bit-field quick and efficient. Last, add function for
rescanning the network to update the device registers. Remove an unnecessary
local (ifn) while we're here (use already provided local `if').
2014-01-15 07:42:31 +00:00
dteske
a623494f5e MFC r258355,258360,258400-258401,258406-258407,258418,258430,258439,258589-
258590,258592,258727-258728,258785, with the following descriptions:

Revisions 258400-258401,258406-258407,258590,258727-258728,258785:
+ Add a new `includes' module (see: bsdconfig includes -h) for exploring
  the bsdconfig(8) API

Remaining revisions:
258592: Sort all the messages.subr files
258355: Fix typo in a comment in networking/device.subr
258360: Whitespace, style, and other changes in networking/device.subr
258418: Quote interface names for good measure in networking/device.subr
258430: Remove an unused line in networking/device.subr
258439: Minor bugfix to f_die() function in common.subr
258589: Minor bugfix to syscons_ttys module
2014-01-15 07:36:34 +00:00
remko
dfee5da730 MFC r260446
virtio-block does not exist, the correct name is virtio-blk.

  PR:	    185573
  Submitted by:    Allan Jude
  Facilitated by: Snow B.V.
2014-01-11 23:10:59 +00:00
dim
01c13c7d48 MFC r260334:
Split the last gcc-specific flags off into CFLAGS.gcc.  This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC r260369:

Apply band-aid for 32-bit compat libs failures after r260334: put back
-Qunused-arguments for clang for now, until I can figure out a way to
make it unneeded in all scenarios.  Sorry about the breakage.
2014-01-09 23:08:56 +00:00
trociny
5eee015d1e MFC r260049:
Add mibs for hastd(1) queue stats.
2014-01-07 21:23:41 +00:00
sbruno
1bba01828c MFC r258901:
svn r251516 resized the buf argument a bit too much. Pass a hardcoded
size of 6 to humanize_number() to resolve this.

PR:	bin/184405
Submitted by:	jhb
2014-01-05 17:29:53 +00:00
pluknet
988d1d6a86 MFC r259870:
Do not truncate the ``command'' column in ``ps'' output.
2014-01-02 15:43:23 +00:00
jhb
33f454b5c1 MFC 258063,258064,258066,258097,258185,259134:
- Add an -s option to the regression tests that specifies a path to an
  alternate etcupdate.sh script to test.  This allows a non-installed
  version of the script to be tested more easily.
- Add a pre-world mode of updating similar to the -p option that can be
  passed to mergemaster.
- Fix a couple of issues with -F:
  - Fix ALWAYS_INSTALL to take precedence over the FreeBSD ID checks.
  - Fix the -F option in the case that the only upstream change is a
    change in the FreeBSD ID and the local file is removed.
- Refresh /etc/localtime after each update using tzsetup -r.
- Regenerate /var/db/services.db when /etc/services changes.
2013-12-27 19:53:42 +00:00
jhb
bf62f8539b MFC 259013:
Fix the processor table entry structure to use a fixed-width type for
32-bit fields so it is the correct size on amd64.  Remove a workaround
for the broken structure from bhyve(8).
2013-12-24 19:10:56 +00:00
jilles
d08ecc86b4 MFC r256650: kldxref: Add static keyword to the new function only used in the
same file.

The WARNS level is not such that the omission broke the build.
2013-12-22 23:08:33 +00:00
dteske
a3e8666201 MFC r259276,259468-259470,259472,259474,259476-259478,259480-259481,259570,
259572, and 259597-259598...

r259276: Fix bug in `services' script in adding dumpdev comment to rc.conf
r259468: Ignore spurious escape generated by VMware's Ctrl-Cmd combination
r259469: Mask errors in `config' script from newaliases(1) about non-FQHN
r259470: Set atime=on for /var/mail zfsboot dataset to support mail server
r259472: Accept NULL input for zfsboot SWAP to indicate SWAP of zero bytes
r259474: Multiple changes, including bug-fixes and debugging improvements
r259476: Change default ZFS disk layout, making it easier to resize
r259477: fletcher4 is now the default (zfsboot related)
r259478: De-uglify the geli(8)-setup infobox (zfsboot related)
r259480: Fix ghosted zroot issue by always performing labelclear on swap
r259481: Auto-enable 4k sector alignmet when geli(8) is enabled (zfsboot)
r259570: Fix numerical comparison error (zfsboot)
r259572: Mask spurious rm error in bsdinstall_log from `auto' script
r259597: Fix zfsboot regression when installing to 3+ disks
r259598: Set cachefile property of bootpool so it imports to new system
2013-12-19 18:52:41 +00:00
bdrewery
2d967091e5 MFC r259266:
Fix multi-repository support by properly respecting 'enabled' flag.

  This will read the REPOS_DIR env/config setting (default is /etc/pkg
  and /usr/local/etc/pkg/repos) and use the last enabled repository.

  This can be changed in the environment using a comma-separated list,
  or in /usr/local/etc/pkg.conf with JSON array syntax of:
      REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"]

Approved by:	bapt (mentor)
2013-12-19 12:33:24 +00:00
grehan
e704ad0c2f MFC r259302,r259413
r259302
  bhyve(8) man page

r259413
  mdoc: sort SEE ALSO
2013-12-18 03:51:04 +00:00
gjb
4dddfdac35 MFC r259426, r259427:
r259426:
  Add a pkg(8) repository configuration file for cdrom-based package
  installation.

  As part of the 'pkg-stage' target, copy the configuration file
  to the 'packages/repos/' directory on the DVD filesystem.

r259427:
  Export 'REPOS_DIR' when the selected source medium for package
  installation is cdrom.  This enables bsdconfig(8) to make use
  of the on-disc pkg(8) repository configuration, which fixes
  package selection and installation from the dvd installer.

Sponsored by:	The FreeBSD Foundation
2013-12-18 01:14:25 +00:00
eadler
607f8e622d MFC r259132,r259133,r259143:
Per the resolution of POSIX bug 0000779 (note 0002050) add support for using 'i'
	as a case insensitive flag.

	Add regression test for recently added 'i' flag in r259132.

	the i modifier was added in r259132 since POSIX recently agreed to add
	it. Switch uses of /I to /i.

PR:		standards/184641
2013-12-16 01:20:18 +00:00
gjb
1948707197 MFC r259113, r259115, r259144, r259148:
r259113 (dteske):
  Fix failed attempt to send pkg(8) stderr to /dev/null

r259115 (dteske):
  Prevent truncating /tmp/bsdinstall_log each time we
  exec a module.

r259144 (dteske):
  Fix a regression after successfully installing to encrypted
  ZFS root, the passphrase is not accepted and a message about
  "incorrect key" is displayed.

r259148 (dteske):
  Fix a regression resulting in mountroot prompt after attempting
  to install to encrypted ZFS root (caused by a typo in a
  variable name -- ZFSBOOT_BOOT_FSNAME -> ZFSBOOT_BOOTFS_NAME).

Sponsored by:	The FreeBSD Foundation
2013-12-14 20:55:53 +00:00
ian
3360970b01 MFC r258076, r258077:
This fixes 3 problems in syslogd related to sizing receive buffers...

  - A call was misplaced at the wrong level of nested if blocks, so that
    the buffers for unix domain sockets (/dev/log, /dev/klog) were never
    increased at all; they remained at a way-too-small default size of 4096.

  - The function that was supposed to double the size of the buffer
    sometimes did nothing, and sometimes installed a wildly-wrong buffer
    size (either too large or too small) due to an unitialized 'slen'
    variable passed to getsockopt().  Most often it doubled the UDP buffers
    from 40k to 80k because accidentally there would be harmless stack
    garbage in the unitialized variables.

  - The whole concept of blindly doubling a socket's buffer size without
    knowing what size it started at is a design flaw that has to be called a
    bug.  If the double_rbuf() function had worked at all (I.E., if the
    other two bugs didn't exist) this would lead to UDP sockets having an
    80k buffer while unix dgram sockets get an 8k buffer.  There's nothing
    about the problem being solved that requires larger buffers for UDP than
    for unix dgram sockets -- the buffering requirements are the same
    regardless of socket type.

  This change renames the double_rbuf() function to increase_rbuf() and
  increases the buffer size on all types of sockets to 80k.  80k was
  chosen only because it appears to be the size the original change was
  shooting for, and it certainly seems to be reasonably large (I might
  have picked 64k in the absence of any historical guidance).

  Add ENETUNREACH and EADDRNOTAVAIL to the list of errors that are potentially
  transient and shouldn't result in closing the socket and giving up forever.
2013-12-14 00:25:57 +00:00
trasz
77844c8786 MFC r259182:
Fix handling for empty auth-groups.  Without it, ctld child process
would either exit on assertion, or, if assertions are not enabled,
fail to authenticate the target.

Sponsored by:	The FreeBSD Foundation
2013-12-13 15:23:07 +00:00
grehan
3f29e37aef MFC r256657,r257018,r257347,r257423,r257729,r257767,
r257933,r258609,r258614,r258668,r258673,r258855

Pull in some minor bugfixes and functionality enhancements
from CURRENT. These are candidates to be moved to 10.0-release.

r258855
mdoc: quote string properly.

r258673
Don't create an initial value for the host filesystem of "/".

r258668
Allow bhyve and bhyveload to attach to tty devices.

r258614
The 22-bit Data Byte Count (DBC) field of a Physical Region Descriptor was
being read as a 32-bit quantity by the bhyve AHCI driver.

r258609
Fix discrepancy between the IOAPIC ID advertised by firmware tables and the
actual value read by the guest.

r257933
Route the legacy timer interrupt (IRQ0) to pin 2 of the IOAPIC.

r257767
Fix an off-by-one error when iterating over the emulated PCI BARs.

r257729
Add the VM name to the process name with setproctitle().

r257423
Make the virtual ioapic available unconditionally in a bhyve virtual machine.

r257347
Update copyright to include the author of the LPC bridge emulation code.

hand-merge r257018
Tidy usage messages for bhyve and bhyveload.

r256657
Add an option to bhyveload(8) that allows setting a loader environment variable
from the command line.

Discussed with:	neel
2013-12-13 06:59:18 +00:00
eadler
82cc6046d5 MFC r259156:
mtest(8): use correct macro in mdoc

	The An macros is used for authors while the Ar macro is used for arguments.
	AFAIK mcast-addr and ifname are not authors.

PR:		docs/184649
2013-12-13 00:56:05 +00:00
dteske
17574f5acb MFC r258927: Fix a regression introduced by SVN r257842 that prevents
Encryption from being enabled.

Approved by:	re (gjb)
2013-12-07 00:33:10 +00:00
trasz
d3ef2c7747 MFC r258842:
Grammar fix.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2013-12-05 16:29:22 +00:00
trasz
f6339a17f9 MFC r258841:
Fix typos.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2013-12-05 16:14:56 +00:00
gjb
5ddf02a63e MFC r258854:
Fix PKG_ABI detection in bsdconfig(8) after pkg-1.2 is released, since
  the format of 'pkg -vv' output has changed.

Approved by:	re (hrs)
Sponsored by:	The FreeBSD Foundation
2013-12-05 01:06:05 +00:00
gjb
b7e8f6268b MFC r258550:
Do not create pkg.conf, as it is not necessary anymore
  and packagesite is deprecated

Approved by:	re (glebius)
Sponsored by:	The FreeBSD Foundation
2013-11-30 17:33:49 +00:00
bdrewery
8769ca5500 MFC r258348:
Document 'enabled' as boolean instead of string.

Approved by:	bapt (implicit)
Approved by:	re (gjb)
2013-11-29 21:12:35 +00:00
delphij
ce8816672a MFC r257879:
Fix typo in r256646: We want to generate lists of directories in
INDEX-OLD and INDEX-NEW and compare them, not generate the same
list of directories from INDEX-OLD twice...

Pointy hats to: cperciva & everybody who didn't proofread
		EN-13:04 enough
Errata Notice:	FreeBSD-EN-13:05.freebsd-update
Approved by:	re (gjb)
2013-11-28 22:06:37 +00:00
brooks
4355776cd8 MFC: r258456
Fix mergemaster -U by forcing FreeBSD 9 compatiblity in mtree when mtree is
nmtree.

The mtree output used by mergemaster in this case was clearly not meant for
computer consumption and an approach based on -f <file1> -f <file2> would
probably be a better idea, but this is a minimal change.

Approved by:	re (glebius)
2013-11-26 16:13:48 +00:00
dteske
d0873bf093 MFC Revisions:
256549: man-page updates
256551: .Dd bump in manpage
256553: bootenv -> ROOT fix
257842: monster list of fixes
257843: minor touchup
257844: copy install log
257845: fixup to last
257872: mdoc fixup
257939: debug check
258021: MBR bootcode fixup

Reviewed by:	many
Discussed on:	-current
Approved by:	re (hrs)
2013-11-21 03:40:52 +00:00
dteske
7f36b7bf08 MFC r257755-257756,257780-257785,257787-257793, and
257795,257817,257819,257937-257938,258029,258263-258267:
257755: SRV records
257756: fix spurious error message
257780: Whitespace
257781: Comments and funny syntax
257782: Debug file truncation is optional
257783: f_show_err for debugging
257784: f_eval_catch for debugging
257785: fix size calculations bug
257787: fix broken HTTP "any" media type
257788: more debugging
257789: Comments
257790: fix printf usage bug
257791: f_[v]sprintf added
257792: Comments
257793: fix off-by-one error in size calcs
257795: Replace pkg-tools with pkgng
257817: fix cosmetic typos
257819: Use `pkg -vv' to get ABI
257937: Adjustment to last
257938: Adjustment to last
258029: Comments
258263: Shuffle code around
258264: Remove unused code
258265: Debugging. Use f_eval_catch with pkg
258266: Shutdown media on exit from packages
258267: Fix pkg install from DVD

Reviewed by:	many
Discussed on:	-current
Approved by:	re (hrs)
2013-11-21 03:38:47 +00:00
trasz
77d8ffb510 Fix typo.
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2013-11-14 12:14:27 +00:00
glebius
0daddca6bd Merge r257945 from head:
Do not use just freed memory.

Approved by:	re (kib)
2013-11-14 09:26:52 +00:00
glebius
bb108535ba Merge r257888, r258049 from head:
- Use system libiconv, instead of trying to dlopen() it.
  - Just disable recoding support in libsmb if built WITHOUT_ICONV.

PR:		183153
Approved by:	re (kib)
2013-11-14 09:25:29 +00:00
gjb
4f116e3822 MFC r257749:
Switch to using pkg(8) for the doc install in bsdinstall(8).
  This also bootstraps the system with pkg(8) for future use.

Approved by:	re (delphij)
PR:		183488
Sponsored by:	The FreeBSD Foundation
2013-11-09 00:59:31 +00:00
bdrewery
c49734a56e MFC r257668:
Use proper capitalization for FreeBSD.org

Approved by:	bapt
Approved by:	re (gjb)
2013-11-07 15:43:41 +00:00
bdrewery
8ca6127d10 MFC r257505:
Add -f support to 'pkg bootstrap' and 'pkg add' to force installation
  of pkg(8) even if already installed.

  This is useful if you somehow messup pkg(8) and need to reinstall from
  remote with it already being registered in the pkg(8) /var/db/pkg database.

  Also add some sanity checks to 'pkg add'.

Approved by:	bapt
Approved by:	re (glebius)
2013-11-04 13:01:29 +00:00