Open
Conversation
Author
|
A simpler implementation is reverting 6a37404, which would look like this: From d9dadb254cc2fede48942bdfb883a4bab3430160 Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Thu, 5 Jun 2025 14:38:07 -0400
Subject: [PATCH] Only run builds in bublewrap sandbox when using overlayfs
Reverts 6a3740411f7d7c515250261225483b67959b799b by only setting
`--sandbox` variable when `build_root` is set, which is set only when
overlayfs is used.
This fixes using `akms` in chroot environment, as bubblewrap breaks in
that context due to lack of namespace.
diff --git a/akms b/akms
index ffa92ad..77b04d7 100755
--- a/akms
+++ b/akms
@@ -593,8 +593,7 @@ build_module() {
chown -R "$BUILD_USER" "$builddir" || return 1
runas "$BUILD_USER" \
- --sandbox "${build_root:-/}" \
- --bind "$builddir" "$builddir" \
+ ${build_root:+--sandbox "${build_root:-/}" --bind "$builddir" "$builddir"} \
srcdir="$srcdir" \
builddir="$builddir" \
kernel_ver="$kernel" \
--
2.49.0This approach thus implicitely disables sandboxing when overlayfs is disabled. If this is a preferred approach, I can change the PR accordingly. |
dea6d94 to
d35f038
Compare
Author
|
I've tested with and without sandbox, and it works. Ready for review. |
Some environments does not support bubblewrap (i.e. chroot). To address this limitations, this adds `use_sandbox` boolean and `--[no]-sandbox` option to AKMS to disable sandboxing. AKMS kernel hooks is also modified to automatically disable sandboxing and overlay when in chroot environment.
… of apk When building AKMS module without sandbox, and via kernel hooks, using `apk` to check if `build-base` is installed won't work if it was added via the same install transaction. Thus, following the approach of `linux-*dev` package, we check if `build-base` is installed by looking for key files (i.e gcc, patch, make). If those key files don't exist, `build-base` is added to `makedepends` variable.
d35f038 to
c0ae7fb
Compare
github-actions bot
pushed a commit
to dpkg123/pmaports
that referenced
this pull request
Jun 16, 2025
AKMS builds modules in a sandbox using bubblewrap. Bubblewrap unfortunately does not work in chroot environment, thus breaking pmbootstrap. While a PR has been proposed upstream, history shows that upstream takes a while to consider PRs. Thus, to unblock usage of AKMS, this adds a patched version that allows disabling of sandbox using `--no-sandbox` argument or by adding `use_sandbox=false` to `/etc/akms.conf`. When building in chroot environment, sandboxing is automatically disabled. The aport handles conflicts with akms by setting `pkgver=9999$_pkgver`, thus always overriding Alpine's package. Upstream PR: jirutka/akms#19 Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6604
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18
When building AKMS packages in chroot or LXC, sandboxing isn't always possible. This adds
use_sandboxboolean and--[no]-sandboxoption to AKMS to disable sandboxing.