Made genkernel accept some different commands so you can include executable files in your kernel.
This commit is contained in:
parent
45d0b85887
commit
292ced2368
@ -4,14 +4,29 @@ function genkernel(modlistf,kname)
|
|||||||
nk=nk.."_BD=\""..os.date("%Y/%m/%d %H:%M %z").."\"\n"
|
nk=nk.."_BD=\""..os.date("%Y/%m/%d %H:%M %z").."\"\n"
|
||||||
local c=f:read("*a")
|
local c=f:read("*a")
|
||||||
f:close()
|
f:close()
|
||||||
n=1
|
local n=1
|
||||||
for line in c:gmatch("[^\r\n]+") do
|
local function apfile(fp)
|
||||||
n=n+1
|
local f=io.open(fp,"rb")
|
||||||
f=io.open(line,"rb")
|
|
||||||
if f then
|
if f then
|
||||||
nk=nk..f:read("*a")
|
nk=nk..f:read("*a")
|
||||||
f:close()
|
f:close()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
for line in c:gmatch("[^\r\n]+") do
|
||||||
|
local tw = {}
|
||||||
|
for w in line:gmatch("%S+") do
|
||||||
|
tw[#tw+1] = w
|
||||||
|
end
|
||||||
|
n=n+1
|
||||||
|
if tw[1] == "fwrap" then
|
||||||
|
nk=nk.."function "..tw[2].."(...)\n"
|
||||||
|
apfile(tw[3])
|
||||||
|
nk=nk.."\nend\n"
|
||||||
|
elseif tw[1] == "include" then
|
||||||
|
apfile(tw[2])
|
||||||
|
else
|
||||||
|
apfile(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
return nk
|
return nk
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user