pkgman updates to simplify distribution with different kernels

This commit is contained in:
Izaya 2023-08-05 16:22:59 +10:00
parent ae41cc48dd
commit 82decfabf9
2 changed files with 3 additions and 2 deletions

View File

@ -1 +0,0 @@
{enabled={"getty","minitel","fsmanager"}}

View File

@ -10,6 +10,8 @@ if not w then lz16 = nil end
fs.makeDirectory("/boot/pkg")
fs.makeDirectory("/boot/cfg/pkg")
require "pkgfs"
local kver,kvar = _OSVERSION:match("(%x+)%-([^-]-)$")
kver,kvar = kver or "unknown", kvar or "base"
local function getSources()
local f = io.open(pkg.sourcePath,"rb")
@ -27,7 +29,7 @@ end
local function getInstalled()
local f = io.open(pkg.installedPath,"rb")
if not f then return {} end
if not f then return {psychos={version=kver},["kernel-"..kvar]={version=kver}} end
local c = f:read("*a")
f:close()
return serial.unserialize(c)