45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
version = "7.0.9"
|
|
revision = 1
|
|
metadata = meta(
|
|
description = "Linux kernel",
|
|
license = "GPL-2.0-only",
|
|
)
|
|
|
|
source = tarball_source(
|
|
url = f"https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-{version}.tar.xz",
|
|
sha256 = "ac07acdf76cf4621cc5187a2670270a1a699533c8a6b225e4878c416ad83f1c4",
|
|
strip_components = 1,
|
|
)
|
|
|
|
host_deps = ["binutils", "gcc"]
|
|
|
|
def make_args(ctx, *args):
|
|
# Translate arch name
|
|
if options.target_arch == "aarch64":
|
|
linux_arch = "arm64"
|
|
else:
|
|
linux_arch = options.target_arch
|
|
|
|
result = [
|
|
"make",
|
|
"ARCH=" + linux_arch,
|
|
"CROSS_COMPILE=" + options.target_triple + "-",
|
|
"-j" + str(ctx.jobs),
|
|
]
|
|
result.extend(args)
|
|
return result
|
|
|
|
def configure(ctx):
|
|
ctx.run(["cp", "-rp", ctx.source_dir / ".", ctx.build_dir])
|
|
ctx.run(["cp", ctx.files / "config." + options.target_arch, ctx.build_dir / ".config"])
|
|
ctx.run(make_args(ctx, "olddefconfig"))
|
|
|
|
def build(ctx):
|
|
ctx.run(make_args(ctx))
|
|
|
|
def install(ctx, pkg):
|
|
ctx.install(
|
|
ctx.build_dir + "/arch/x86/boot/bzImage",
|
|
pkg.destdir + "/boot/vmlinuz-" + version,
|
|
)
|