Commit graph

9 commits

Author SHA1 Message Date
Baptiste Daroussin 1f31e00e19 flua: add fbsd module
This module is bundled into flua, it only provides for now the exec
function. The point of the function is to be able to execute a program
without actually executing a shell.

to use it:
fbsd.exec({"id", "bapt"})

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D41840
2023-09-27 16:00:00 +02:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh 2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Baptiste Daroussin 280f11f1be flua: chown(2) binding, fix bad copy/paste 2022-11-25 09:05:40 +01:00
Baptiste Daroussin a1ab15abe2 flua: add a chown(2) binding
The main difference with the chown in luaposix, is that it checks
and reports if a user or a group do exist when a string is passed
as arguments

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D37479
2022-11-25 08:49:58 +01:00
Kyle Evans e25ee296c9 stand: lua: enhance lfs.dir() to speed up kernels_autodetect
This eliminates a lot of stat() calls that happen when lualoader renders the
menu with the default settings, and greatly speeds up rendering on my
laptop.

ftype is nil if loader/loader.efi hasn't been updated yet, falling back to
lfs.attributes() to test.

This is technically incompatible with lfs, but not in a particularly
terrible way.

Reviewed-by:	cem
MFC-after:	4 days
Differential Revision:	https://reviews.freebsd.org/D27542
2021-01-29 12:47:29 -06:00
Ed Maste 405e3338ac flua: implement chmod
Lua does not provide a native way to change the permission of a file.

Submitted by:	Yang Wang <2333@outlook.jp>
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24036
2020-03-13 15:40:35 +00:00
Kyle Evans 506f364029 Add flua to the base system, install to /usr/libexec
FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever
extensions we need for base system operations. We currently support a subset
of lfs and lposix that are used in the rewrite of makesyscall.sh into lua,
added in r354786.

flua is intentionally written such that one can install standard lua and
some set of lua modules from ports and achieve the same effect.

linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added
in. This is similar to what we do in stand/. linit.c has been renamed to
make it clear that this has flua-specific bits.

luaconf has been slightly obfuscated to make extensions more difficult. Part
of the problem is that flua is already hard enough to use as a bootstrap
tool because it's not in PATH- attempting to do extension loading would
require a special bootstrap version of flua with paths changed to protect
the innocent.

src.lua.mk has been added to make it easy for in-tree stuff to find flua,
whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1.

Reviewed by:	brooks, emaste (both earlier version), imp
Differential Revision:	https://reviews.freebsd.org/D21893
2019-11-18 23:21:13 +00:00