opnsense-src/tools/tools
Pawel Jakub Dawidek 1ae7ff8ba6 Because ZFS boot code was very fragile in the past and real PITA to debug,
introduce zfsboottest.sh script that will verify if it will be possible to boot
from the given pool.

	# zfsboottest.sh system

Where "system" is pool name of the pool we want to boot from.

What is being verified by the script:
- Does the pool exist?
- Does it have bootfs property configured?
- Is mountpoint property of the boot dataset set to 'legacy'?

Dataset configured in bootfs property has to be mounted to perform more
checks:
- Does the /boot directory in boot dataset exist?
- Is this dataset configured as root file system in /etc/fstab or set
  in vfs.root.mountfrom variable in /boot/loader.conf?

By using zfsboottest tool the script will read all the files in /boot
directory using ZFS boot code and calculate their checksums.
Then, it will walk /boot directory using find(1) though regular file sytem
and also read all the files in /boot directory and calculate their checksums.
If any of the files cannot be looked up, read or checksum is invalid it will
be reported and booting off of this pool is probably not possible.

Some additional checks may be interesting as well. For example if the disks
contain proper pmbr and gptzfsboot code or if all expected files in /boot/
are present.

When upgrading FreeBSD, one should snapshot datasets that contain operating
system, upgrade (install new world and kernel) and use zfsboottest.sh to verify
if it will be possible to boot from new configuration. If all is good one
should upgrade boot blocks, by eg.:

	# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

If something is wrong, one should rollback datasets and report the problems.

MFC after:	3 days
2011-10-21 13:44:26 +00:00
..
aac Fix warnings and set WARNS to 6. 2011-03-11 18:51:42 +00:00
ansify
ath Add athradar, an implementation of the radar parameter diagnostic 2011-07-22 09:34:31 +00:00
backout_commit
build_option_survey
bus_autoconf - Need to respect the module name and the USB mode when accumulating device ID's. 2011-06-25 15:22:44 +00:00
cd2dvd
cfi Fix warnings and set WARNS to 6. 2011-03-11 18:48:28 +00:00
commitsdb
crypto
cxgbetool Add "context" subcommand to fetch and display SGE context. 2011-06-11 04:55:15 +00:00
cxgbtool Move cxgbtool from usr.sbin to tools/tools. 2011-08-10 22:03:34 +00:00
editing
epfe
ether_reflect [mdoc] Fixed .Dt call. 2011-05-25 14:13:53 +00:00
find-sb
gdb_regofs
genericize
hcomp
html-mv
ifinfo Make ifinfo build. The struct if_data members ifi_recvquota and 2009-03-04 01:31:09 +00:00
ipw
iso Update URLs and fix regex to work with current version of the files. 2011-05-22 09:48:25 +00:00
iwi Fix warnings and style(9) issues. 2011-03-11 19:32:15 +00:00
kdrv
kernelcruft
kerninclude
kernxref
kttcp
mcgrab Moved mcgrab(1) into a separate directory -- our .mk infrastructure 2010-02-25 14:36:50 +00:00
mctest Fix an error in our results printing. 2010-11-16 20:39:52 +00:00
mfc
mfi
mid
mtxstat
mwl Update the includes to two more levels of subdirs. 2009-09-24 11:11:00 +00:00
nanobsd Fix build after TARGET_BIG_ENDIAN was nuked from orbit. 2011-10-11 01:11:57 +00:00
ncpus mptable.h is now in include/x86. 2011-03-11 18:44:16 +00:00
net80211 Fixed missing or broken library dependencies. 2010-02-25 14:42:26 +00:00
netrate Fix alignment assumptions. 2011-09-02 16:40:18 +00:00
notescheck Add a new tool which attempts to check for kernel configuration options that 2009-12-24 14:32:11 +00:00
npe add npe tools; first is npestats which reports device statistics 2009-05-23 19:16:34 +00:00
nxge
pciroms
pirtool
portsinfo
prstats
release
scsi-defects
sysbuild Improve the check for ports which have gone missing, and just ignore 2011-02-17 08:54:22 +00:00
syscall_timing Add microbenchmark for create/unlink of a zero-byte file. 2010-10-24 09:14:21 +00:00
sysdoc update smp related documentation after recent changes 2011-07-30 20:42:14 +00:00
termcap Instead of only being able to compare two terminal definitions, now 2009-06-14 13:46:32 +00:00
tinybsd Remove vestiges of 'slip'. 2010-06-19 09:21:34 +00:00
tionxcl
track
umastat tools/umastat: more cleanups 2010-09-21 05:36:30 +00:00
usb
vhba Consistently set us to be SPC3 for our inquiry data. 2010-08-11 17:25:14 +00:00
vimage mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the 2010-05-13 12:07:55 +00:00
vop_table
vxge Give some sort of message when the program is not run as root. 2011-05-03 16:00:36 +00:00
whereintheworld
zfsboottest Because ZFS boot code was very fragile in the past and real PITA to debug, 2011-10-21 13:44:26 +00:00
README Move cxgbtool from usr.sbin to tools/tools. 2011-08-10 22:03:34 +00:00

# $FreeBSD$

This directory is for tools.

A tool is something which is sometimes useful, and doesn't fit any of
the other categories.

Please make a subdir per program, and add a brief description to this
file.

ansify		Convert K&R-style function definitions to ANSI style
ath		Tools specific to the Atheros 802.11 support
backout_commit	A tool for reading in a commit message and generating
		a script that will backout the commit.
cfi		Common Flash Interface (CFI) tool
commitsdb	A tool for reconstructing commit history using md5
		checksums of the commit logs.
crypto		Test and exercise tools related to the crypto framework
cxgbetool	A tool for the cxgbe(4) driver.
cxgbtool	A tool for the cxgb(4) driver.
diffburst	OBSOLETE: equivalent functionality is available via split -p.
		For example: "split -p ^diff < patchfile". See split(1).
editing		Editor modes and the like to help editing FreeBSD code.
epfe 		Extract printing filter examples from printing.sgml.
ether_reflect	An Ethernet packet reflector for low level testing.
find-sb		Scan a disk for possible filesystem superblocks.
gdb_regofs	A simple tool that prints out a register offset table
		for mapping gdb(1) register numbers to struct reg and
		struct fpreg offsets. The tool is useful on selected
		platforms only.
genericize	Turn a kernel config into something that can more easily
		be diffed against the appropriate GENERIC.
hcomp		Compress header files by removing comments and whitespace.
html-mv         Rename HTML generated filenames to human readable filenames.
ifinfo		Uses the interface MIB to print out all the information
		an interface exports in an ugly form.
iso             Tool to compare the iso3166 and iso639 files in
		/usr/share/misc with the data from the master sites.
iwi		Tools specific to the Intel PRO/Wireless 2200BG/2225BG/2915ABG
		support.
kdrv		KernelDriver; add/list/remove third-party kernel driver
		source to/in/from a kernel source tree.
kernelcruft	Shellscript to find orphaned *.c files in /sys
kerninclude	Shellscript to find unused #includes in the kernel.
kernxref	Shellscript to cross reference symbols in the LINT kernel.
kttcp		An in-kernel version of the ttcp network performance tool
mctest		A multicast test program
mfc		Merge a directory from HEAD to a branch where it does not
		already exist and other MFC related script(s).
mid	 	Create a Message-ID database for mailing lists.
mwl		Tools specific to the Marvell 88W8363 support
ncpus		Count the number of processors
notescheck	Check for missing devices and options in NOTES files.
npe		Tools specific to the Intel IXP4XXX NPE device
nxge		A diagnostic tool for the nxge(4) driver
pciid		Generate src/share/misc/pci_vendors.
pciroms		A tool for dumping PCI ROM images. WARNING: alpha quality.
pirtool		A tool for dumping the $PIR table on i386 machines at runtime.
portsinfo 	Generate list of new ports for last two weeks.
prstats		Generate statistics about the PR database.
recoverdisk	Copy as much data as possible from a defective disk.
scsi-defects	Get at the primary or grown defect list of a SCSI disk.
sysdoc		Build a manual page with available sysctls for a specific
		kernel configuration.
tinybsd		Script to build FreeBSD embedded systems.
track		Track the progress of a world / kernel build
vimage		An interim utility for managing the virtualized network
		stack infrastructure.
vop_table	Generates a HTML document that shows all the VOP's in
		the kernel.
vxge		A diagnostic tool for the vxge(4) driver
whereintheworld	Summarizes "make world" output.