Commit Graph

14420 Commits

Author SHA1 Message Date
Gavin Atkinson
65008e03e7 Improve bootstrapping message
MFC after:	3 days
2013-10-19 15:36:21 +00:00
Dag-Erling Smørgrav
0016a84955 Allow ~ in file names so libtool droppings in contrib don't break updates.
It has happened twice now, and is likely to happen again.

Errata notice candidate.
2013-10-19 09:40:29 +00:00
Peter Grehan
062b878f58 Changes required for OpenBSD/amd64:
- Allow a hostbridge to be created with AMD as a vendor.
  This passes the OpenBSD check to allow the use of MSI
  on a PCI bus.
- Enable the i/o interrupt section of the mptable, and
  populate it with unity ISA mappings. This allows the
  'legacy' IRQ mappings of the PCI serial port to be
  set up. Delete unused print routine that was obscuring code.
- Use the '-W' option to enable virtio single-vector MSI
  rather than an environment variable. Update the virtio
  net/block drivers to query this flag when setting up
  interrupts.: bhyverun.c
- Fix the arithmetic used to derive the century byte in
  RTC CMOS, as well as encoding it in BCD.

Reviewed by:	neel
MFC after:	3 days
2013-10-17 22:01:17 +00:00
Peter Grehan
7b8d7047af Eliminate unconditional debug printfs.
Linux writes to these nominally read-only registers,
so avoid having bhyve write warning messages to stdout
when the reg writes can be safely ignored. Change the
WPRINTF to DPRINTF which is conditional.

Reviewed by:	mav
Discussed with:	mav, Zhixiang Yu
MFC after:	3 days
2013-10-17 21:56:39 +00:00
Neel Natu
b6afa84b8c Add an option to bhyveload(8) that allows setting a loader environment variable
from the command line.

The option syntax is "-e <name=value>". It may be used multiple times to set
multiple environment variables.

Reviewed by:	grehan
Requested by:	alfred
2013-10-17 00:28:35 +00:00
Jilles Tjoelker
5d452cea64 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.

Reported by:	mdf
2013-10-16 20:04:06 +00:00
Colin Percival
cd1ab2280c When installing updates, install new directories first and remove old
directories last.

This is generally handled by the fact that the list of filesystem objects
is sorted, but this sorting is broken by code which moves .so files ahead
(so that they're present before any binaries which use them)... that code
also moved .so files ahead of directories, which is a problem for upgrading
to 10.0 where there's a new directory containing new .so files.

Errata Notice Candidate.
2013-10-16 18:36:53 +00:00
Neel Natu
49cc03da31 Add a new capability, VM_CAP_ENABLE_INVPCID, that can be enabled to expose
'invpcid' instruction to the guest. Currently bhyve will try to enable this
capability unconditionally if it is available.

Consolidate code in bhyve to set the capabilities so it is no longer
duplicated in BSP and AP bringup.

Add a sysctl 'vm.pmap.invpcid_works' to display whether the 'invpcid'
instruction is available.

Reviewed by:	grehan
MFC after:	3 days
2013-10-16 18:20:27 +00:00
Colin Percival
aa60062e00 Speed up freebsd-update IDS by using IFS to split fields instead of
forking lots of processes to run echo|cut.  In one test this reduced
the CPU time from 980s to 134s and the wallclock time from 806s to
132s.

Submitted by:	Oleg Ginzburg
2013-10-16 08:19:58 +00:00
Kevin Lo
c4ecf85bca Fix logic error. MPPE only accepts protocol numbers 0x21 through 0xFA.
PR:	bin/175974
2013-10-16 02:55:31 +00:00
Devin Teske
67635c19d6 Make ZFSBOOT_BEROOT_NAME be ROOT by default. This is what sysutils/beadm
and OpenSolaris/Illumos beadm use.

Remove /usr/local and /var/db/pkg datasets.  Andriy Gapon writes:
I want to note that a good implementation of BEs should support a dependent
datasets feature.  Unfortunately, it seems that we do not have any good BE
implementation for FreeBSD right now.  If we had, personally I'd prefer to
have /usr/local in separate filesystem.

NOTE: Until then, remove these datasets.

Discussed on:	src-committers
Submitted by:	Bryan Drewery <bryan@shatow.net>
Reviewed by:	Allan Jude <freebsd@allanjude.com>
MFC after:	3 days
2013-10-15 18:06:33 +00:00
Devin Teske
dc755adf84 Bump .Dd date (should have been part of SVN r256549) 2013-10-15 17:52:44 +00:00
Devin Teske
6ef5a07e27 Man page updates to go along with SVN r256343, introducing zfsboot. 2013-10-15 17:33:30 +00:00
Devin Teske
abd99bbcc5 Fix SVN r256540: s/TMPETC/TMPBOOT/ for loader.conf(5) GELI entries. 2013-10-15 15:00:53 +00:00
Devin Teske
ff13404048 Document BSDINSTALL_TMPBOOT environment variable introduced by SVN r256343. 2013-10-15 14:46:37 +00:00
Devin Teske
13d8e1cee5 gjb writes: when doing encrypted zfs install, loader.conf should be updated
so bootpool is imported after boot:
        zpool_cache_load="YES"
        zpool_cache_type="/boot/zfs/zpool.cache"
        zpool_cache_name="/boot/zfs/zpool.cache"
otherwise /boot is a broken symlink after the system is up.
http://lists.freebsd.org/pipermail/freebsd-fs/2013-July/017891.html
NOTE: Fix a comment while here.

Reviewed by:	gjb
2013-10-15 14:18:15 +00:00
Gleb Smirnoff
6ed910fabe Hide 'struct ifaddr' definition from userland. Two tools left that use it,
namely ipftest(1) and ifmcstat(1). These sniff structure definition using
_WANT_IFADDR define.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-15 10:19:24 +00:00
Kevin Lo
482d883100 Use INADDR_NONE instead of -1 to check inet_addr() result.
Reviewed by:	glebius
2013-10-15 07:37:30 +00:00
Devin Teske
982726803d Add executable bit to docsinstall [old] and entropy [new] scripts.
Approved by:	re (gjb)
2013-10-15 02:07:29 +00:00
Bryan Drewery
e3ededfa24 Rename libbsdyml to libyaml, make private, and bump
SHLIB_MAJOR to 1.0

Suggested by:	des
Approved by:	bapt
MFC after:	1 week
2013-10-14 18:31:15 +00:00
Devin Teske
9acbeddc57 Fix signed integer overflow detection in f_expand_number() of strings.subr.
Approved by:	re (glebius)
2013-10-12 19:52:27 +00:00
Peter Grehan
64945a9e27 Implement the virtio block 'get-ident' operation. This eliminates the
annoying verbose boot error of the form

   g_handleattr: vtbd0 bio_length 24 len 28 -> EFAULT

The ident returned by bhyve is a text string 'BHYVE-XXXX-XXXX', where
the X's are the first bytes of the md5 hash of the backing filename.

Reviewed by:	neel
Approved by:	re (gjb)
2013-10-12 19:31:19 +00:00
Hiroki Sato
fbd868c9d8 - Add mount.fdescfs parameter to jail(8). This is similar to
mount.devfs but mounts fdescfs.  The mount happens just after
  mount.devfs.

- rc.d/jail now displays whole error message from jail(8) when a jail
  fails to start.

Approved by:	re (gjb)
2013-10-12 17:27:59 +00:00
Devin Teske
4da57f63b6 Remove the dumpdev configuration dialog, merge it into the regular
services configuration and enable it by default. Committed with
slight change to menu text for length and content.

Submitted by:	Allan Jude <freebsd@allanjude.com>
Approved by:	re (glebius)
2013-10-11 21:23:44 +00:00
Devin Teske
bce09b12c4 Incorporate PR bin/161547 to detect when an interface is wireless.
Patch from PR modified slightly for whitespace and style.

PR:		bin/161547
Submitted by:	Warren Block <wblock@wonkity.com>
Reviewed by:	Allan Jude <freebsd@allanjude.com>
Approved by:	re (glebius)
2013-10-11 21:12:48 +00:00
Devin Teske
133e25d3b7 Rewrite the keymap module to display an actual menu of selectable
keymaps *and* provide a mechanism for testing the selection. With
this commit, bsdinstall is no longer dependent on kbdmap(1). The
keymap test menu was originally submitted by Warren Block but was
modified).

Submitted by:	Warren Block <wblock@wonkity.com>
Reviewed by:	Allan Jude <freebsd@allanjude.com>
Approved by:	re (glebius)
2013-10-11 20:52:42 +00:00
Devin Teske
cd88b8869f Add zfsboot module as an option for automatic configuration. Default is
to run interactively but it can be scripted too (optinally completely
non-interactive). Currently supports GELI and all ZFS vdev types. Also
performs validation on selections/settings providing error messages if
necessary, explaining (in plain language) what the issue is. Currently
the auto partitioning of naked disks only supports GPT and MBR (VTOC8
pending for sparc64), so is only available for i386/amd64 install.

Submitted by:	Allan Jude <freebsd@allanjude.com>, myself
Reviewed by:	Allan Jude <freebsd@allanjude.com>
Approved by:	re (glebius)
2013-10-11 20:41:35 +00:00
Dag-Erling Smørgrav
dfc23ba54b After installation, dump 4096 bytes from /dev/random to /entropy in the
newly installed system.  This should greatly increase the amount of
entropy available when SSH host keys are generated during first boot.

Reviewed by:    markm, nathanw
Approved by:	re (gjb)
2013-10-11 20:21:44 +00:00
Devin Teske
a96ea66f3d Add new f_expand_number() (shadowing expand_number(3)).
Approved by:	re (glebius)
2013-10-11 20:12:30 +00:00
Devin Teske
1bd2b932a5 Store descriptions for DEVICE_TYPE_DISK and fix static-defaults mapping.
Add a default description for bhyve block disk device while we're here.

Approved by:	re (glebius)
2013-10-11 20:10:41 +00:00
Devin Teske
0c20fe6fda Add $VAR_ZFSINTERACTIVE (zfsInteractive) and new f_zfsinteractive() for
determining when a script wants to be nonInteractive but selectively
wants ZFS operations to be *interactive* (this is analgous to already
existing $VAR_NETINTERACTIVE (netInteractive) and f_netinteractive()
used for the same purpose (script wants to be nonInteractive but wants
network operations to be *interactive*).

Approved by:	re (glebius)
2013-10-11 20:08:34 +00:00
Devin Teske
efa13f7e0b Fix a bug that would occur in application death when debugging was enabled
if you ended up in f_dialog_*_constrain() (indirectly, of course) with a
purposefully-set NULL height, width, or rows parameter (because you didn't
care to have that attribute calculated). Fix typo in a comment while here.

Approved by:	re (glebius)
2013-10-11 20:07:04 +00:00
Devin Teske
3636c2354e Add keymap.subr for presenting custom keymap dialogs (with X11 support).
Approved by:	re (glebius)
2013-10-11 18:21:05 +00:00
Devin Teske
5bd5e0c398 Add a USE_DIALOG global (analogous to USE_XDIALOG); useful for inserting
text into a prompt or command syntax iff dialog(1) is in-use.

Approved by:	re (glebius)
2013-10-11 18:14:49 +00:00
Devin Teske
fcaed0c1a5 Fix a minor bug; if strings.subr was included by itself it may not have
access to f_dprintf from common.subr -- fix this by including common.subr.

Approved by:	re (glebius)
2013-10-11 17:54:22 +00:00
Devin Teske
6bfa4a638c Add support for obtaining the capacity of disks. Add comment while here.
Approved by:	re (glebius)
2013-10-11 17:52:43 +00:00
Hiroki Sato
84b354cb9a - Update rc.d/jail to use a jail(8) configuration file instead of
command line options.  The "jail_<jname>_*" rc.conf(5) variables for
  per-jail configuration are automatically converted to
  /var/run/jail.<jname>.conf before the jail(8) utility is invoked.
  This is transparently backward compatible.

- Fix a minor bug in jail(8) which prevented it from returning false
  when jail -r failed.

Approved by:	re (glebius)
2013-10-10 09:32:27 +00:00
Peter Grehan
2a8d400a2e Allow a 4-byte write to PCI config space to overlap
the 2 read-only bytes at the start of a PCI capability.
This is the sequence that OpenBSD uses when enabling
MSI interrupts, and works fine on real h/w.

In bhyve, convert the 4 byte write to a 2-byte write to
the r/w area past the first 2 r/o bytes of a capability.

Reviewed by:	neel
Approved by:	re@ (blanket)
2013-10-09 23:53:21 +00:00
Joel Dahl
5239e66cc2 Fix missing .
Approved by:	re (blanket)
2013-10-09 20:00:04 +00:00
Edward Tomasz Napierala
0b50e35921 Plug memory leak.
Coverity CID:	1087991
Approved by:	re (gjb)
Sponsored by:	FreeBSD Foundation
2013-10-09 13:48:08 +00:00
Edward Tomasz Napierala
9e55679baf Fix memory overrun.
Coverity CID:	1092478
Approved by:	re (gjb)
Sponsored by:	FreeBSD Foundation
2013-10-09 13:45:07 +00:00
Edward Tomasz Napierala
5989c4cc16 Plug memory leaks.
Coverity CID:	1087993, 1087992
Approved by:	re (marius)
Sponsored by:	FreeBSD Foundation
2013-10-09 13:28:45 +00:00
Edward Tomasz Napierala
bd32ec0619 Fix two off-by-ones.
Coverity CID:	1087999, 1011375
Approved by:	re (glebius)
Sponsored by:	FreeBSD Foundation
2013-10-09 12:30:52 +00:00
Edward Tomasz Napierala
846c5adb77 Fix incorrect use of sizeof().
Coverity CID:	1011303
Approved by:	re (glebius)
Sponsored by:	FreeBSD Foundation
2013-10-09 12:19:48 +00:00
Edward Tomasz Napierala
1af403658b Fix off-by-one.
Coverity CID:	1011375
Approved by:	re (glebius)
Sponsored by:	FreeBSD Foundation
2013-10-09 12:17:40 +00:00
Devin Teske
f677a9e267 Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-use
throughout the bsdconfig(8) code. While we're here, add an explicit argument
to lvalue-seeking invocations of "return" that previously had no argument.
Also, consolidate a single instance of double-newline and remove some
comments that are no longer required (given increased readability with new
exit codes).

Approved by:	re (glebius)
2013-10-09 08:12:26 +00:00
Neel Natu
200758f114 Parse the memory size parameter using expand_number() to allow specifying
the memory size more intuitively (e.g. 512M, 4G etc).

Submitted by:	rodrigc
Reviewed by:	grehan
Approved by:	re (blanket)
2013-10-09 03:56:07 +00:00
Dimitry Andric
cdb9cd7ad2 In usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the form
"assignment makes pointer from integer without a cast", by changing the
cmd_lst and rbis members of struct ahci_port from integers to pointers.

Also surround a pow-of-2 test expression with parentheses to clarify it,
and avoid another gcc warning.

Approved by:	re (glebius)
Reviewed by:	grehan, mav
2013-10-08 19:39:21 +00:00
Dimitry Andric
e70cb911b6 After r256062, the static function fbsdrun_get_next_cpu() in
usr.sbin/bhyve/bhyverun.c is no longer used, so remove it to silence a
gcc warning.

Approved by:	re (glebius)
2013-10-08 18:09:00 +00:00
Neel Natu
4a06a0fe79 Change the behavior of bhyve such that the gdb listening port is opt-in
rather than opt-out.

Prior to this change if the "-g" option was not specified then a listening
socket for tunneling gdb packets would be opened at port 6466. If a second
virtual machine is fired up, also without the "-g" option, then that would
fail because there is already a listener on port 6466.

After this change if a gdb tunnel port needs to be created it needs to be
explicitly specified with a "-g <portnum>" command line option.

Reviewed by:	grehan@
Approved by:	re@ (blanket)
2013-10-08 16:36:17 +00:00