feat: add linux kernel initramfs and related tools

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
2026-09-07 03:13:55 +00:00
parent 5c89842dc0
commit 47ade913e2
10 changed files with 230 additions and 14 deletions
+32
View File
@@ -0,0 +1,32 @@
import os
from lib import arch
from lib.make import *
version("0.1.0-alpha.1")
description("AirBoot Linux initramfs generator.")
maintainer("sisungo <[email protected]>")
source_url("https://gitea.semilabs.org/semios/airboot-linux-stage2/archive/0.1.0-alpha.1.tar.gz")
def build():
os.system("./arch-support/build.sh")
on_build(build)
def pack_arch(composer):
composer.add(f"arch-support/target/{arch.get_target().split('-')[0]}", "data")
def pack_mkinitramfs(composer):
composer.makedir("bin")
composer.add("mkinitramfs.sh", "bin/mkinitramfs")
package("airboot-linux-stage2-arch")
on_pack(pack_arch)
package("airboot-linux-stage2-mkinitramfs")
dep("mksh")
arch_any()
on_pack(pack_mkinitramfs)
+1
View File
@@ -76,6 +76,7 @@ package("bash")
dep("semi-libc @same-arch")
dep("libncurses @same-arch")
on_pack(pack_bash)
link("bin/bash", "/bin/sh")
package("bash-dev")
dep("bash (same)")
+21 -5
View File
@@ -1,24 +1,31 @@
import os
import shutil
import subprocess
import lib.arch as arch
import lib.cpp as cpp
from lib import cpp, arch, packie
from lib.make import *
upstream_version = "6.18.45"
upstream_version = "7.2.3"
version(f"{upstream_version}")
description("the Linux operating system kernel")
maintainer("sisungo <[email protected]>")
source_url(
f"https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-{upstream_version}.tar.xz"
f"https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-{upstream_version}.tar.xz"
)
builddep("shortcut/c")
builddep("shortcut/autotools")
builddep("libncurses-dev")
builddep("aws-lc-dev")
builddep("aws-lc-dev @target")
builddep("aws-lc-tools")
builddep("airboot-linux-stage2-mkinitramfs")
builddep("airboot-linux-stage2-arch @target")
builddep("flex")
builddep("bison")
builddep("bc")
builddep("gzip")
def get_arch():
@@ -43,6 +50,14 @@ def build():
)
os.remove(f"../kmod_install/lib/modules/{upstream_version}/build")
asp_prefix = packie.prefix_of(f"airboot-linux-stage2-arch @{arch.get_target()}")
subprocess.run([
"mkinitramfs",
"-a", f"{asp_prefix}/data",
"-o", f"{os.getcwd()}/../initramfs.img",
"-m", f"{os.getcwd()}/../kmod_install",
"-k", upstream_version,
], check=True)
on_build(build)
@@ -78,6 +93,7 @@ def pack_linux(composer):
except Exception:
pass
composer.add_dir(f"../kmod_install/lib/modules/{upstream_version}", "modules")
composer.addfile("../initramfs.img", "initramfs.img")
package(f"{base_name}")
+74
View File
@@ -0,0 +1,74 @@
import os
from lib import rust
from lib.make import *
version("0.1.0-alpha.2")
description("Linux device userspace daemon.")
maintainer("sisungo <[email protected]>")
source_url("https://gitea.semilabs.org/semios/lxdeviced/archive/0.1.0-alpha.2.tar.gz")
builddep("shortcut/rust")
def build():
rust.build()
on_build(build)
PKGCONF_LIBUDEV="""
prefix=/
exec_prefix=/
libdir=
includedir=
Name: libudev
Description: Udev library -- compatible, powered by lxdeviced
Version: 260
Cflags: -I${includedir}
Libs: -L${libdir} -ludev
"""
def pack(composer):
composer.makedirs("share/device")
composer.add_dir("misc/rules", "share/device/rules")
oldpwd = os.getcwd()
os.chdir(rust.artifacts_dir())
composer.makedir("bin")
composer.addfile("lxdeviced", "bin/lxdeviced")
composer.addfile("device", "bin/device")
os.chdir(oldpwd)
def pack_libudev(composer):
oldpwd = os.getcwd()
os.chdir(rust.artifacts_dir())
composer.makedir("lib")
composer.addfile("libudev.so", "lib/libudev.so")
os.chdir(oldpwd)
def pack_libudev_dev(composer):
oldpwd = os.getcwd()
composer.makedir("include")
composer.addfile("libcompat/udev/include/libudev.h", "include/libudev.h")
composer.makedirs("lib/pkgconfig")
pkgconf = PKGCONF_LIBUDEV.replace("libdir=", f"libdir={get_prefix('lxdeviced-libudev')}/lib")
pkgconf = PKGCONF_LIBUDEV.replace("includedir=", f"includedir={get_prefix('lxdeviced-libudev-dev')}/include")
with open(f"{composer.workdir}/bundle/lib/pkgconfig/libudev.pc", "wt+") as file:
file.write(pkgconf)
os.chdir(oldpwd)
package("lxdeviced")
on_pack(pack)
dep("semi-libc @same-arch")
package("lxdeviced-libudev")
on_pack(pack_libudev)
dep("semi-libc @same-arch")
package("lxdeviced-libudev-dev")
on_pack(pack_libudev_dev)
dep("lxdeviced-libudev (same)")
+43
View File
@@ -0,0 +1,43 @@
import os
from lib import cpp
from lib.make import *
version("2.8")
description("A parallel implementation of gzip for modern multi-processor, multi-core machines")
maintainer("sisungo <[email protected]>")
source_url("http://zlib.net/pigz/pigz-2.8.tar.gz")
builddep("shortcut/c")
builddep("shortcut/autotools")
builddep("libz-ng-dev @target")
builddep("pkgconf")
def build():
cc=os.environ.get("CC", "cc")
cpp.make([f"CC={cc}"])
on_build(build)
def pack(composer):
composer.makedir("bin")
composer.add("pigz", "bin/pigz")
composer.add("unpigz", "bin/unpigz")
def pack_docs(composer):
composer.makedirs("share/man/man1")
composer.add("pigz.1", "share/man/man1")
package("pigz")
dep("semi-libc @same-arch")
dep("libz-ng @same-arch")
provide("gzip")
link("bin/pigz", "/bin/gzip")
link("bin/unpigz", "/bin/gunzip")
cpp.use_auto_pack(["bin"])
package("pigz-docs")
on_pack(pack_docs)
+26
View File
@@ -0,0 +1,26 @@
from lib import cpp
from lib.make import *
version("2026.6.4")
description("QuickJS is a small and embeddable Javascript engine. It supports the ES2025 specification.")
maintainer("sisungo <[email protected]>")
source_url("https://bellard.org/quickjs/quickjs-2026-06-04.tar.xz")
builddep("shortcut/c")
def build():
cpp.make()
cpp.make_install()
on_build(build)
package("quickjs")
dep("semi-libc @same-arch")
cpp.use_auto_pack(["bin"])
package("libquickjs-dev")
dep("semi-libc @same-arch")
cpp.use_auto_pack(["dev"])