# Embedded resources
%.inc: %.lua
- @$(call quiet,XXD_LUA,$<) $< > $@
+ @$(call quiet,LUA,$<) $< $@
ifeq ($(AMALG), yes)
kresd.amalg.c: daemon/lua/sandbox.inc daemon/lua/config.inc
else
lua_pop(engine->L, 1);
}
/* Init environment */
- static const char sandbox_bytecode[] = {
- #include "daemon/lua/sandbox.inc"
- };
- if (l_dobytecode(engine->L, sandbox_bytecode, sizeof(sandbox_bytecode), "init") != 0) {
+ #include "daemon/lua/sandbox.inc"
+ if (l_dobytecode(engine->L, luaJIT_BC_sandbox,
+ sizeof(luaJIT_BC_sandbox), "init") != 0) {
fprintf(stderr, "[system] error %s\n", lua_tostring(engine->L, -1));
lua_pop(engine->L, 1);
return kr_error(ENOEXEC);
}
if (ret == 0) {
/* Load defaults */
- static const char config_bytecode[] = {
- #include "daemon/lua/config.inc"
- };
- ret = l_dobytecode(engine->L, config_bytecode, sizeof(config_bytecode), "config");
+ #include "daemon/lua/config.inc"
+ ret = l_dobytecode(engine->L, luaJIT_BC_config,
+ sizeof(luaJIT_BC_config), "config");
}
/* Evaluate */
+++ /dev/null
-#!/bin/sh
-set -e
-# Clean unnecessary stuff from the lua file; note the significant tabulator.
-alias strip="sed -e 's/^[ ]*//g; s/ */ /g; /^--/d; /^$/d'"
-if command -v xxd > /dev/null 2>&1; then
- strip < "$1" | xxd -i -
-else
- strip < "$1" | hexdump -v -e '/1 "0x%02X, " " "'
-fi
-exit $?