Commit Graph

4398 Commits

Author SHA1 Message Date
bapt
2f45771b4b Use a script wrapper for <compress>grep
Import the wrapper script from zstdgrep (written by wiz@netbsd.org)

Modify it to support more than just zstd (adding support for gzip,
lzma, xz and bzip2)

Write a simple manpage dedicated for it.

Only use that new wrapper both for gnu grep and bsd grep

Next step will be removing code related to compression format from bsdgrep

Reviewed by:	kevans
Approved by:	kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D15193
2018-04-25 13:23:58 +00:00
mckusick
c2d88526f7 Fix incorrect output for a file consisting of a single full-size
block followed by a discontiguous fragment.

Add checks for unallocated inodes and inodes with unknown mode
types.

Cleanup variable declarations by changing from type `int' to types
like ufs_lbn_t, ufs2_daddr_t, etc.

Reported by: bde
2018-04-19 22:43:55 +00:00
brooks
93bd79f30a Add sortbench.
This is a set of benchmarks of qsort, mergesort, heapsort, and
optionally wikisort and a script to run them.

Submitted by:	Miles Fertel <milesfertel@college.harvard.edu>
Sponsored by:	Google Summer of Code 2017
Differential Revision:	https://reviews.freebsd.org/D12677
2018-04-19 21:53:57 +00:00
mckusick
3e8df1eea5 In addition to the existing argument format:
prtblknos filesystem_device inode ...

add an additional argument format:

	prtblknos file

which is more convenient than figuring out the filesystem
and inode number for "file".

When given a list of multiple inodes, rather than exiting
the program on an error with one of them, skip over it and
continue with the next one.

Submitted by: bde
2018-04-18 23:08:10 +00:00
mckusick
5e674c7664 Check the inode type and only attempt to print block lists for
regular files, directories, and symbolic links that require
external storage.

Correct the handling of files with holes and files that have
one or more large blocks and end with a fragment.

Reported by: bde
2018-04-18 22:24:44 +00:00
emaste
cb5abd6e17 Remove mention of tools/recoverdisk, now in sbin
PR:		227570
MFC after:	3 days
2018-04-18 14:02:37 +00:00
mckusick
e9a893e557 Add (intmax_t) type casts to some printf parameters to keep i386 happy. 2018-04-08 07:18:29 +00:00
mckusick
1c8afb9a0e Split tools/diag/prtblknos into two parts:
main.c - opens disk and processes the argument list
		 of inodes to be printed
	prtblknos.c - prints out the list of blocks used by an inode

This change allows the fsdb program to import prtblknos() to use when
printing out the set of blocks used by an inode.

This program was switched to using the libufs library to ease its
integration with fsdb and any other filesystem utility that might
want to use it in the future.
2018-04-08 06:52:58 +00:00
cem
5cded89b02 cryptocheck: Add Chacha20 cipher to tool 2018-03-29 04:14:37 +00:00
cem
e89a3c0e55 cryptotest: Add chacha20 cipher 2018-03-29 04:07:53 +00:00
cem
4c8d0980b7 cryptotest: Add blake2 hashes to tool
Sponsored by:	Dell EMC Isilon
2018-03-27 17:34:28 +00:00
jhb
fabaeee1e4 Update the license to note my work on cryptocheck was sponsored.
Sponsored by:	Chelsio Communications
2018-03-26 22:30:17 +00:00
kevans
503b2fb104 lua-lint: Hint that try_include is now an accepted global
try_include was added in r331563.
2018-03-26 19:08:19 +00:00
cem
54a580348e cryptocheck: Add support for Blake2{B,S} hashes
Since they are not yet present in the version of openssl in base, this will
require installing the ports openssl.

Sponsored by:	Dell EMC Isilon
2018-03-23 05:37:18 +00:00
cem
cfffe134ad Bring in JHB's cryptocheck tool
It can be used to validate basic algorithm correctness on a variety of inputs,
by comarison to openssl.

While here, add some sanity to the crypto/Makefile.

The tool may not be perfect, but getting it in tree where collaboration can
happen is a nice first step.  The pace of development outside of svn seems
to have slowed down mid-2017.

Obtained from:	github bsdjhb/freebsd:cryptocheck
Sponsored by:	Dell EMC Isilon
2018-03-23 04:31:19 +00:00
hselasky
d1efa6e93f Add kernel and userspace code to dump the firmware state of supported
ConnectX-4/5 devices in mlx5core.

The dump is obtained by reading a predefined register map from the
non-destructive crspace, accessible by the vendor-specific PCIe
capability (VSC). The dump is stored in preallocated kernel memory and
managed by the mlx5tool(8), which communicates with the driver using a
character device node.

The utility allows to store the dump in format
    <address> <value>
into a file, to reset the dump content, and to manually initiate the
dump.

A call to mlx5_fwdump() should be added at the places where a dump
must be fetched automatically. The most likely place is right before a
firmware reset request.

Submitted by:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-08 15:21:56 +00:00
kevans
a02d0ad25e lua-lint: Whitelist cli_execute_unparsed as a global 2018-03-07 18:41:16 +00:00
kevans
3449d2e6d5 Add --globals printc to lua-lint
We provide a global 'printc' as of r330282; make luacheck aware of this fact
so that we can use it without complaints.
2018-03-02 16:51:43 +00:00
kevans
292576b24d Add descriptions for recently added loader options 2018-03-01 22:00:38 +00:00
kevans
34466a0e55 Back out r330252; will reapply with an actual commit message 2018-03-01 21:59:30 +00:00
kevans
5d08418b50 MFC after: 1 week 2018-03-01 21:57:08 +00:00
kevans
6eeb735b44 Remove LOADER_EFI description files
LOADER_EFI functionality got folded into EFI as of r330248.
2018-03-01 21:51:20 +00:00
kevans
8dc36d5c2c Add missing punctuation to *_LOADER_EFI descriptions... 2018-02-28 15:47:24 +00:00
kevans
1f54682dce Some missing LOADER_EFI build option descriptions 2018-02-28 15:28:04 +00:00
kevans
898476b1a8 Add missing WITH_BSD_GREP_FASTMATCH description
MFC after:	3 days
2018-02-28 15:27:36 +00:00
emaste
33289f97a0 Add kernel retpoline option for amd64
Retpoline is a compiler-based mitigation for CVE-2017-5715, also known
as Spectre V2, that protects against speculative execution branch target
injection attacks.

In this commit it is disabled by default, but will be changed in a
followup commit.

Reviewed by:	bdrewery (previous version)
MFC after:	3 days
Security:	CVE-2017-5715
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D14242
2018-02-28 14:57:45 +00:00
kevans
5c3354db03 lua-lint: Add note about luacheck in ports, silence warning
luacheck was added in ports r462609.

Silence warning about cli_execute -- it's non-standard, but for our setup it
will be a standard global.
2018-02-22 15:29:57 +00:00
kevans
6c747fa217 Add script for linting stand/lua to tools/boot.
We require some --globals due to custom loader extensions in our
environment. Add everything required for this to tools/boot so that other
interested parties can get up and go with linting our scripts and not get a
bunch of false-positives.
2018-02-22 04:28:52 +00:00
imp
39d6c095a6 Add LOADER_DEBUG regression test 2018-02-21 23:49:18 +00:00
eadler
26ce627de6 tools/80211: correct array index
wh->i_dur is a two byte value; not a single byte set twice

Reported by:	swildner@DragonFlyBSD.org
2018-02-19 19:01:46 +00:00
hselasky
fbff6d32c4 Remove obsolete tool, bus_autoconf, which is replaced by devmatch(8). 2018-02-17 14:40:28 +00:00
kevans
38e2478e2c lua-test: Image the loader test directory if it doesn't exist yet 2018-02-16 20:26:18 +00:00
kevans
220ebfad83 Default to /tmp/loadertest for lua test scripts 2018-02-16 20:23:48 +00:00
imp
a2cbd35965 Simplify building before installing. 2018-02-15 18:58:03 +00:00
kevans
1f63ed4d64 Build loader before installing it in lua-img.sh
Slightly more foolproof when all you're wanting to do is quickly get off the
ground with testing the lua loader.
2018-02-15 17:56:45 +00:00
kevans
541433fc7f Set svn:executable on lua-img.sh 2018-02-15 17:47:43 +00:00
imp
330eb63ccb Simple script to image a small test area from a built tree. Build with
'cd stand; make MK_FORTH=no MK_LOADER_LUA=yes' then run this script.
You can then test with lua-test.sh with the same parameter.
2018-02-14 18:21:54 +00:00
imp
0c97eda44a A quick test script that we can run to use userboot's test mode to
excersize the load loader. Assumes that we already have a suitable
root area that you pass in with the first arg.
2018-02-14 17:51:51 +00:00
imp
0d0658d73e Add lua to build script 2018-02-12 15:32:05 +00:00
imp
974e9d9ccc Add Lua as a scripting langauge to /boot/loader
liblua glues the lua run time into the boot loader. It implements all
the runtime routines that lua expects. In addition, it has a few
standard 'C' headers that nueter various aspects of the LUA build that
are too specific to lua to be in libsa. Many refinements from the
original code to improve implementation and the number of included lua
libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default
module path. Numerous cleanups from the original GSoC project,
including hacking libsa to allow lua to be built with only one change
outside luaconf.h.

Add the final bit of lua glue to bring in liblua and plug into the
multiple interpreter framework, previously committed.

Add LOADER_LUA option, currently off by default.

Presently, this is an experimental option. One must opt-in to using
this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been
lightly tested, so keep a backup copy of your old loader handy.
The menu code, coming in the next commit, hasn't been exhaustively
tested. A LUA boot loader is 60k larger than a FORTH one, which is
80k larger than a no-interpreter one. Subtle changes in size
may tip things past some subtle limit (the binary is ~430k now
when built with LUA). A future version may offer coexistance.

Bump FreeBSD version to 1200058 to mark the milestone.

Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur,
Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh
reworked it extensively into its current form.

Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader
Sponsored by: Google Summer of Code
Relnotes: Yes
MFC After: 1 month
Differential Review: https://reviews.freebsd.org/D14295
2018-02-12 15:31:53 +00:00
asomers
958bc4fbc9 Convert tools/regression/sockets/socketpair to ATF
Reviewed by:	cem
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D14305
2018-02-10 19:43:52 +00:00
emaste
b93a9fbc91 Promote llvm-cov to a standalone option
Introduce WITH_/WITHOUT_LLVM_COV to match GCC's WITH_/WITHOUT_GCOV.
It is intended to provide a superset of the interface and functionality
of gcov.

It is enabled by default when building Clang, similarly to gcov and GCC.

This change moves one file in libllvm to be compiled unconditionally.
Previously it was included only when WITH_CLANG_EXTRAS was set, but the
complexity of a new special case for (CLANG_EXTRAS | LLVM_COV) is not
worth avoiding a tiny increase in build time.

Reviewed by:	dim, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D142645
2018-02-10 00:22:35 +00:00
mckusick
a39494df2c Add an explanation of the block size units output by prtblknos.
Suggested by: Ravi Pokala (rpokala@)
2018-02-09 22:23:10 +00:00
mckusick
9ccdf8ab4d This is a little C-program that can be used to print out the list
of blocks used by a requested list of inodes.

For example, to list the blocks referenced by your kernel:

guest_12 % df /
Filesystem      1K-blocks     Used   Avail Capacity  Mounted on
/dev/gpt/rootfs  20307196 10707336 7975288    57%    /

guest_12 % ls -i /boot/kernel/kernel
160603 /boot/kernel/kernel

guest_12 % ./prtblknos /dev/gpt/rootfs 160603
160603:	lbn 0-7 blkno 3217584-3217647
	lbn 8-11 blkno 3217864-3217895 distance 216
First-level indirect, blkno 3217896-3217903 distance 0
	lbn 12-19 blkno 3217904-3217967 distance 8
	lbn 20-75 blkno 3251816-3252263 distance 33848
	lbn 76-83 blkno 3252368-3252431 distance 104
	lbn 84-91 blkno 3252464-3252527 distance 32
	lbn 92-852 blkno 3252896-3258983 distance 368

Each contiguous range of blocks is printed on a line.
The distance metric is the size of the gap from the end of the
previous set of blocks to the beginning of the next set of blocks.
Short distances are desirable.
2018-02-09 19:10:46 +00:00
kevans
1adeb0a164 Teach nanobsd about armv7, add -m to qemu invocations
qemu defaults to 128 MiB of RAM, which has been found to not necessarily be
enough for booting the system, at least on amd64 and armv7

Add a sensible -m 512 to the examples so that they'll work out of the box
in the general case.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14234
2018-02-09 14:31:11 +00:00
bapt
50d352992c Remove gdbtui, it was already not installed on every arches
only installed on arm and sparc64.
It is the only bits that keeps us having libreadline in base
The rest of gdb can be switched to libedit and will be in another
commit
2018-02-06 11:54:20 +00:00
marius
73ed29e147 Flesh out the creation of sparc64 UFS images. This has only been verified
to yield working images in a native build as rootgen.sh generally doesn't
support cross-testing so far.
2018-02-05 00:18:21 +00:00
imp
8643952b7d Fix backward conditional.
Pointed out by: david boyer
2018-02-03 21:56:38 +00:00
eadler
bbfaf54245 tools: remove note about diffburst.
Said tool was removed in 1999 in r51579
2018-01-28 05:45:20 +00:00
dim
b64d96a23d Merge ^/head r327624 through r327885. 2018-01-12 18:23:35 +00:00