diff options
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/flua/Makefile | 13 | ||||
-rw-r--r-- | libexec/flua/bootstrap.h | 6 | ||||
-rw-r--r-- | libexec/flua/lfbsd/Makefile | 5 | ||||
-rw-r--r-- | libexec/flua/lfbsd/Makefile.inc | 2 | ||||
-rw-r--r-- | libexec/flua/lfbsd/lfbsd.c (renamed from libexec/flua/modules/lfbsd.c) | 4 | ||||
-rw-r--r-- | libexec/flua/lfbsd/lfbsd.h (renamed from libexec/flua/modules/lfbsd.h) | 0 | ||||
-rw-r--r-- | libexec/flua/lfs/Makefile | 5 | ||||
-rw-r--r-- | libexec/flua/lfs/Makefile.inc | 2 | ||||
-rw-r--r-- | libexec/flua/lfs/lfs.c (renamed from libexec/flua/modules/lfs.c) | 7 | ||||
-rw-r--r-- | libexec/flua/lfs/lfs.h (renamed from libexec/flua/modules/lfs.h) | 0 | ||||
-rw-r--r-- | libexec/flua/libhash/lhash.c | 2 | ||||
-rw-r--r-- | libexec/flua/linit_flua.c | 6 | ||||
-rwxr-xr-x | libexec/nuageinit/nuageinit | 1 | ||||
-rw-r--r-- | libexec/rc/rc.conf | 3 | ||||
-rwxr-xr-x | libexec/rc/rc.d/netwait | 10 |
15 files changed, 50 insertions, 16 deletions
diff --git a/libexec/flua/Makefile b/libexec/flua/Makefile index 231abe5dafa2..23de404710d0 100644 --- a/libexec/flua/Makefile +++ b/libexec/flua/Makefile @@ -6,14 +6,21 @@ # than mucking about with the infrastructure to make them linkable -- thus, why # these are all structured to have a Makefile that describes what we want # *installed*, and a Makefile.inc that describes what we need to *build*. +FLUA_MODULES+= lfbsd +FLUA_MODULES+= lfs FLUA_MODULES+= libhash +.ifndef BOOTSTRAPPING +# Bootstrap flua can't usefully do anything with libjail anyways, because it +# can't assume it's being run on a system that even supports jails. FLUA_MODULES+= libjail +.endif FLUA_MODULES+= libucl FLUA_MODULES+= liblyaml .ifdef BOOTSTRAPPING -FLUA_MODULES+= libfreebsd/sys/linker -FLUA_MODULES+= libfreebsd/kenv +# libfreebsd is generally omitted from the bootstrap flua because its +# functionality largely assumes a FreeBSD kernel/system headers, so it doesn't +# really offer functionality that we can use in bootstrap. CFLAGS+= -I${.CURDIR} -DBOOTSTRAPPING SHAREDIR= ${WORLDTMP}/legacy/usr/share/flua @@ -47,7 +54,7 @@ SRCS+= lua.c # FreeBSD Extensions .PATH: ${.CURDIR}/modules SRCS+= linit_flua.c -SRCS+= lfs.c lposix.c lfbsd.c +SRCS+= lposix.c CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC} CFLAGS+= -DLUA_PROGNAME="\"${PROG}\"" diff --git a/libexec/flua/bootstrap.h b/libexec/flua/bootstrap.h index 74356d8677b3..caf00518c1e0 100644 --- a/libexec/flua/bootstrap.h +++ b/libexec/flua/bootstrap.h @@ -12,10 +12,12 @@ #include <lauxlib.h> -SET_DECLARE(flua_module_set, const luaL_Reg); +#define FLUA_MODULE_SETNAME flua_modules + +SET_DECLARE(FLUA_MODULE_SETNAME, const luaL_Reg); #define FLUA_MODULE_DEF(ident, modname, openfn) \ static const luaL_Reg ident = { modname, openfn }; \ - DATA_SET(flua_module_set, ident) + DATA_SET(FLUA_MODULE_SETNAME, ident) #define FLUA_MODULE_NAMED(mod, name) \ FLUA_MODULE_DEF(module_ ## mod, name, luaopen_ ## mod) diff --git a/libexec/flua/lfbsd/Makefile b/libexec/flua/lfbsd/Makefile new file mode 100644 index 000000000000..e2a4aae14bcd --- /dev/null +++ b/libexec/flua/lfbsd/Makefile @@ -0,0 +1,5 @@ +SHLIB_NAME= fbsd.so +WARNS?= 3 + +.include "Makefile.inc" +.include <bsd.lib.mk> diff --git a/libexec/flua/lfbsd/Makefile.inc b/libexec/flua/lfbsd/Makefile.inc new file mode 100644 index 000000000000..7a78ef82e0fc --- /dev/null +++ b/libexec/flua/lfbsd/Makefile.inc @@ -0,0 +1,2 @@ +.PATH: ${.PARSEDIR} +SRCS+= lfbsd.c diff --git a/libexec/flua/modules/lfbsd.c b/libexec/flua/lfbsd/lfbsd.c index ef660ba9fd77..541b6c9611df 100644 --- a/libexec/flua/modules/lfbsd.c +++ b/libexec/flua/lfbsd/lfbsd.c @@ -40,6 +40,8 @@ #include "lauxlib.h" #include "lfbsd.h" +#include "bootstrap.h" + #define FBSD_PROCESSHANDLE "fbsd_process_t*" struct fbsd_process { @@ -283,3 +285,5 @@ luaopen_fbsd(lua_State *L) return (1); } + +FLUA_MODULE(fbsd); diff --git a/libexec/flua/modules/lfbsd.h b/libexec/flua/lfbsd/lfbsd.h index 01034a3ad7cd..01034a3ad7cd 100644 --- a/libexec/flua/modules/lfbsd.h +++ b/libexec/flua/lfbsd/lfbsd.h diff --git a/libexec/flua/lfs/Makefile b/libexec/flua/lfs/Makefile new file mode 100644 index 000000000000..3df83d6d2fc1 --- /dev/null +++ b/libexec/flua/lfs/Makefile @@ -0,0 +1,5 @@ +SHLIB_NAME= lfs.so +WARNS?= 3 + +.include "Makefile.inc" +.include <bsd.lib.mk> diff --git a/libexec/flua/lfs/Makefile.inc b/libexec/flua/lfs/Makefile.inc new file mode 100644 index 000000000000..9d40c42dc0e6 --- /dev/null +++ b/libexec/flua/lfs/Makefile.inc @@ -0,0 +1,2 @@ +.PATH: ${.PARSEDIR} +SRCS+= lfs.c diff --git a/libexec/flua/modules/lfs.c b/libexec/flua/lfs/lfs.c index 8cb8d6fc9fed..517e16ae65c8 100644 --- a/libexec/flua/modules/lfs.c +++ b/libexec/flua/lfs/lfs.c @@ -66,9 +66,10 @@ #ifdef _STANDALONE #include "lstd.h" #include "lutils.h" -#include "bootstrap.h" #endif +#include "bootstrap.h" + #ifndef nitems #define nitems(x) (sizeof((x)) / sizeof((x)[0])) #endif @@ -446,3 +447,7 @@ luaopen_lfs(lua_State *L) #endif return 1; } + +#ifndef _STANDALONE +FLUA_MODULE(lfs); +#endif diff --git a/libexec/flua/modules/lfs.h b/libexec/flua/lfs/lfs.h index a99e66d7f601..a99e66d7f601 100644 --- a/libexec/flua/modules/lfs.h +++ b/libexec/flua/lfs/lfs.h diff --git a/libexec/flua/libhash/lhash.c b/libexec/flua/libhash/lhash.c index 7127ddc1d530..f455f006bf27 100644 --- a/libexec/flua/libhash/lhash.c +++ b/libexec/flua/libhash/lhash.c @@ -178,4 +178,6 @@ luaopen_hash(lua_State *L) return 1; } +#ifndef _STANDALONE FLUA_MODULE(hash); +#endif diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 027f1b305d09..65356c938671 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -33,9 +33,7 @@ #include "lualib.h" #include "lauxlib.h" -#include "lfs.h" #include "lposix.h" -#include "lfbsd.h" #include "bootstrap.h" @@ -58,9 +56,7 @@ static const luaL_Reg loadedlibs[] = { {LUA_BITLIBNAME, luaopen_bit32}, #endif /* FreeBSD Extensions */ - {"lfs", luaopen_lfs}, {"posix", luaopen_posix}, - {"fbsd", luaopen_fbsd}, {NULL, NULL} }; @@ -79,7 +75,7 @@ static void __attribute__((constructor)) flua_init_env(void) { static void flua_setup_mods (lua_State *L) { const luaL_Reg **flib; - SET_FOREACH(flib, flua_module_set) { + SET_FOREACH(flib, FLUA_MODULE_SETNAME) { luaL_requiref(L, (*flib)->name, (*flib)->func, 1); lua_pop(L, 1); /* remove lib */ } diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 29340a3d91ea..f29fa8ba1bac 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -6,6 +6,7 @@ -- Copyright(c) 2025 Jesús Daniel Colmenares Oviedo <dtxdf@FreeBSD.org> local nuage = require("nuage") +local lfs = require("lfs") local ucl = require("ucl") local yaml = require("lyaml") diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 2589e2614c35..c776a815003c 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -501,7 +501,8 @@ netwait_timeout="60" # Total number of seconds to perform pings. #netwait_if="" # Wait for active link on each intf in this list. netwait_if_timeout="30" # Total number of seconds to monitor link state. netwait_dad="NO" # Wait for DAD to complete -netwait_dad_timeout="10" # Total number of seconds to wait for DAD. +netwait_dad_timeout="" # Total number of seconds to wait for DAD, zero + # or unset to autodetect ### Miscellaneous network options: ### icmp_bmcastecho="NO" # respond to broadcast ping packets diff --git a/libexec/rc/rc.d/netwait b/libexec/rc/rc.d/netwait index b609440a2e4e..05874552cf1c 100755 --- a/libexec/rc/rc.d/netwait +++ b/libexec/rc/rc.d/netwait @@ -36,13 +36,15 @@ netwait_start() err 1 "Nothing to wait for" fi - if ! [ "${netwait_if_timeout}" -ge 1 ]; then + if ! [ "${netwait_if_timeout:=0}" -ge 1 ]; then err 1 "netwait_if_timeout must be >= 1" fi - if ! [ "${netwait_dad_timeout}" -ge 1 ]; then - err 1 "netwait_dad_timeout must be >= 1" + if ! check_kern_features inet6; then + netwait_dad="NO" + elif ! [ "${netwait_dad_timeout:=0}" -ge 1 ]; then + netwait_dad_timeout=$(($(sysctl -n net.inet6.ip6.dad_count)+1)) fi - if ! [ "${netwait_timeout}" -ge 1 ]; then + if ! [ "${netwait_timeout:=0}" -ge 1 ]; then err 1 "netwait_timeout must be >= 1" fi |