made the build system capable of self-hosting
This commit is contained in:
parent
838ed0fcc2
commit
0fe7982c45
16
build.cfg
Executable file
16
build.cfg
Executable file
@ -0,0 +1,16 @@
|
||||
modules/debug/log.lua
|
||||
modules/base/header.lua
|
||||
modules/base/component.lua
|
||||
modules/lib/fs.lua
|
||||
modules/lib/buffer.lua
|
||||
modules/lib/io.lua
|
||||
modules/drivers/tty.lua
|
||||
modules/lib/print.lua
|
||||
modules/drivers/kbd.lua
|
||||
modules/drivers/net.lua
|
||||
modules/lib/readline.lua
|
||||
modules/applications/luash.lua
|
||||
modules/applications/genkernel.lua
|
||||
modules/setup.lua
|
||||
modules/base/footer.lua
|
||||
|
3
genkernel.lua
Executable file
3
genkernel.lua
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env lua
|
||||
require "modules/applications/genkernel"
|
||||
print(genkernel(...))
|
@ -1,4 +1,2 @@
|
||||
#!/bin/bash
|
||||
echo "_OSVERSION=\"PsychOS $(git rev-parse HEAD | head -c 8)\""
|
||||
echo "_BD=\"$(date '+%Y/%m/%d %H:%M %z')\""
|
||||
cat modules/debug/log.lua modules/base/header.lua modules/base/component.lua modules/lib/fs.lua modules/lib/buffer.lua modules/lib/io.lua modules/drivers/tty.lua modules/lib/print.lua modules/drivers/kbd.lua modules/drivers/net.lua modules/lib/readline.lua modules/applications/luash.lua modules/setup.lua modules/base/footer.lua
|
||||
./genkernel.lua build.cfg "$(git rev-parse --short HEAD)" > kernel.lua
|
||||
|
17
modules/applications/genkernel.lua
Normal file
17
modules/applications/genkernel.lua
Normal file
@ -0,0 +1,17 @@
|
||||
function genkernel(modlistf,kname)
|
||||
local nk,f = "",io.open(modlistf,"rb")
|
||||
nk=nk.."_OSVERSION=\"PsychOS "..(kname or "unknown").."\"\n"
|
||||
nk=nk.."_BD=\""..os.date("%Y/%m/%d %H:%M %z").."\"\n"
|
||||
local c=f:read("*a")
|
||||
f:close()
|
||||
n=1
|
||||
for line in c:gmatch("[^\r\n]+") do
|
||||
n=n+1
|
||||
f=io.open(line,"rb")
|
||||
if f then
|
||||
nk=nk..f:read("*a")
|
||||
f:close()
|
||||
end
|
||||
end
|
||||
return nk
|
||||
end
|
Loading…
Reference in New Issue
Block a user