Skip to content
Snippets Groups Projects
Unverified Commit 04635dcb authored by Caleb Connolly's avatar Caleb Connolly :recycle: Committed by Oliver Smith
Browse files

build: envkernel: cleanup behaviour (MR 2491)


recent changes to the kernels build infra in -next seem to have exposed
some issues with "pmbootstrap build --envkernel", specifically in the
case where the APKBUILD doesn't build out-of-tree.

We used to rely on the fact that the kernel output directory contains a
Makefile which points to the source directory, however this Makefile
now(?) contains an absolute path on the host, which won't match what's
in the chroot.

As a result, it's now necessary to build with the same output directory
as the APKBUILD.

We probably need some smarter code here... and/or more consistent
APKBUILDs.

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
parent 60da4023
No related branches found
No related tags found
1 merge request!2491build: envkernel: cleanup behaviour
Pipeline #210682 passed
......@@ -132,7 +132,7 @@ def run_abuild(
"""
chroot = Chroot.native()
build_path = Path("/home/pmos/build")
kbuild_out_source = "/mnt/linux/.output"
kbuild_out_source = f"/mnt/linux/{kbuild_out}"
# If the kernel was cross-compiled on the host rather than with the envkernel
# helper, we can still use the envkernel logic to package the artifacts for
......@@ -180,13 +180,7 @@ def run_abuild(
)
# Create symlink from abuild working directory to envkernel build directory
if kbuild_out != "":
if os.path.islink(chroot / "mnt/linux" / kbuild_out) and os.path.lexists(
chroot / "mnt/linux" / kbuild_out
):
pmb.chroot.root(["rm", Path("/mnt/linux", kbuild_out)])
pmb.chroot.root(["ln", "-s", "/mnt/linux", build_path / "src"])
pmb.chroot.root(["ln", "-s", kbuild_out_source, build_path / "src" / kbuild_out])
pmb.chroot.root(["ln", "-sf", "/mnt/linux", build_path / "src"])
cmd: list[PathString] = ["cp", apkbuild_path, chroot / build_path / "APKBUILD"]
pmb.helpers.run.root(cmd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment