Commit Graph

24 Commits

Author SHA1 Message Date
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Doug Rabson
5eeb4f737f imgact_binmisc: Optionally pre-open the interpreter vnode
This allows the use of chroot and/or jail environments which depend on
interpreters registed with imgact_binmisc to use emulator binaries from
the host to emulate programs inside the chroot.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D37432
2022-12-08 14:32:03 +00:00
Mark Johnston
c7fcb36f56 binmiscctl: Avoid segfault with "binmiscctl add" and no extra params
MFC after:	1 week
2021-02-08 09:20:38 -05:00
Kyle Evans
2c5e865059 binmiscctl(8): miscellaneous cleanup
- Bad whitespace in Makefile.
- Reordered headers, sys/ first.
- Annotated fatal/usage __dead2 to help `make analyze` out a little bit.
- Spell a couple of sizeof constructs as "nitems" and "howmany" instead.

MFC after:	1 week
2020-11-07 03:43:45 +00:00
Mitchell Horne
d0adbca274 Add RISC-V interpreter example
Now that RISC-V support has landed in qemu-user-static, add to the list
of examples in the binmiscctl(8) manpage.

Reviewed by:	kevans
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D24646
2020-05-01 01:31:19 +00:00
Warner Losh
d2299c69ff Remove sparc64 example.
Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593
2020-02-10 17:16:26 +00:00
Mateusz Piotrowski
caba8c7d3f Improve the binmiscctl manual page
- Use "Fl -" instead of "Cm --" for long options.
- Sort options alphabetically.
- Pet "mandoc -Tlint".
- Clean up the description of the "--interpreter" option.
- Clean up the description of the first example in the examples section.
- Use ".Bd -literal -offset indent" for all example code blocks for consistency.
- Use "Nm" instead of "Cm binmiscctl".
- Indent all examples for consistency.

Reviewed by:	allanjude
Approved by:	mat (mentor)
Differential Revision:	https://reviews.freebsd.org/D15589
2018-07-20 22:50:21 +00:00
Warner Losh
829ec26617 Don't leak resources on duplicate -m or -M arguments. Last one wins.
CID: 1204385, 1204384
2017-12-28 05:32:59 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Justin Hibbits
9cede44051 Correct the binmiscctl(8) man page for powerpc64
Magic for powerpc64 erroneously specified ELFCLASS32 instead of ELFCLASS64.

Submitted by:	luca.pizzamiglio _AT_ gmail DOT com
MFC after:	3 days
2017-09-04 20:57:38 +00:00
Sean Bruno
4b5e2f8ea0 binmiscctl should use modfind instead of kldfind
kldfind() only matches kernel modules, so if you link imgact_binmisc directly
into the kernel, binmiscctl can't find it, tries to load it, and errors
out with:
  Can't load imgact_binmisc kernel module: File exists

A quick search of other base commands shows that the correct procedure is to
call modfind(), and then try kldload() if that fails.

PR:		218593
Submitted by:	Dan Nelson <dnelson_1901@yahoo.com>
MFC after:	1 week
2017-07-28 18:11:53 +00:00
Don Lewis
fe579263e0 Another attempt at resolving CID 1305629. The test of cmd == -1
may make Coverity think that other negative values of cmd (used
as an index) are possible.  Testing < 0 is a more common idiom
in any case.

Reported by:	Coverity
CID:		1305629
2016-05-13 17:48:04 +00:00
Don Lewis
aa60f7a6de Revert r299584:
Mark usage() as __dead2 so that Coverity doesn't think that execution
  continues after the call and uses a negative array subscript.

Requested by:	bde
2016-05-13 05:39:29 +00:00
Don Lewis
e402dde82d Mark usage() as __dead2 so that Coverity doesn't think that execution
continues after the call and uses a negative array subscript.

Reported by:	Coverity
CID:		1305629
2016-05-13 01:14:38 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Sean Bruno
13087ee99f Add example for upcoming aarch64/arm64 targets. 2015-02-16 20:55:37 +00:00
Sean Bruno
b8fc9a86a8 If no arguments are passed to a subcommand that requires arguments,
error out before we deref a null pointer in the check for max length.

Thanks to otis in IRC for the bug report.

MFC after:	3 days
2015-02-15 23:58:57 +00:00
Sean Bruno
a142c86130 Check for invalid length or more than max length for the interpreter, instead
of the validity of the string pointer holding the interpreter.

Submitted by:	sson
Reviewed by:	dim
MFC after:	3 days
2015-01-28 20:22:48 +00:00
Warren Block
799c4f7325 Move the explanation for examples before the example itself. Add
numerous QEMU examples and explanations supplied by sbruno, with thanks
to Ingo Schwarze for help with the mdoc markup.  Code, text, testing,
proofreading, cinematography, stunts, and the haunting theme song
supplied by sbruno.

Submitted by:	sbruno
Reviewed by:	sbruno
MFC after:	1 week
2014-12-30 20:20:18 +00:00
Joel Dahl
f8d7aff9dd mdoc: kill EOL whitespace. 2014-07-29 19:49:27 +00:00
Joel Dahl
8052df21f6 mdoc: use display block in the beginning of the EXAMPLES section. 2014-06-15 10:31:50 +00:00
Christian Brueffer
796b4eb567 More mdoc/spelling/grammar cleanup. 2014-04-10 10:18:30 +00:00
Christian Brueffer
1f0283145c Quick mdoc/whitespace/spelling pass, this needs some more work. 2014-04-08 20:59:02 +00:00
Sean Bruno
6d75644981 Add Stacey Son's binary activation patches that allow remapping of
execution to a emumation program via parsing of ELF header information.

With this kernel module and userland tool, poudriere is able to build
ports packages via the QEMU userland tools (or another emulator program)
in a different architecture chroot, e.g. TARGET=mips TARGET_ARCH=mips

I'm not connecting this to GENERIC for obvious reasons, but this should
allow the kernel module to be built by default and enable the building
of the userland tool (which automatically loads the kernel module).

Submitted by:	sson@
Reviewed by:	jhb@
2014-04-08 20:10:22 +00:00