Skip to content

Commit

Permalink
update apparmor git version. BROKEN.
Browse files Browse the repository at this point in the history
  • Loading branch information
LordGrimmauld committed Dec 20, 2024
1 parent d0865ad commit 1c8b00f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/apparmor-sources.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ stdenv.mkDerivation {
src = fetchFromGitLab {
owner = "apparmor";
repo = "apparmor";
rev = "6d7b5df94757b0d93d195f8789e3eb81bf0fdf4e";
hash = "sha256-O+4a4qZQ1Xv/lNC3b91SsGHE6rD2XSMUUNABkk+vvoA=";
rev = "8e431ebcd915216a03ebc8d01e72b1741bb2f855";
hash = "sha256-Pzyuw5Fd7MWYAWwPII4EUnZTwKoll+1KKo6UQI2nawk=";
};

patches =
[
./patches/store-lib-path.patch
./patches/overlayfs-reg-test-fix.patch
]
++ lib.optionals stdenv.hostPlatform.isMusl [
(fetchpatch {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/check/regression-test-src.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ stdenv.mkDerivation {
--replace-fail "/sbin/losetup" "${lib.getExe' util-linux "losetup"}"
substituteInPlace ./tests/regression/apparmor/mount.sh \
--replace-fail "/sbin/losetup" "${lib.getExe' util-linux "losetup"}"
substituteInPlace ./tests/regression/apparmor/file_unbindable_mount.sh \
--replace-fail "/sbin/losetup" "${lib.getExe' util-linux "losetup"}"
substituteInPlace ./tests/regression/apparmor/overlayfs.sh \
--replace-fail "/sbin/losetup" "${lib.getExe' util-linux "losetup"}"
substituteInPlace ./tests/regression/apparmor/pivot_root.sh \
--replace-fail "/sbin/init" "${lib.getExe' systemd "init"}"
Expand Down
31 changes: 31 additions & 0 deletions pkgs/patches/overlayfs-reg-test-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/tests/regression/apparmor/overlayfs.sh b/tests/regression/apparmor/overlayfs.sh
index e342ef5f..90a339cf 100644
--- a/tests/regression/apparmor/overlayfs.sh
+++ b/tests/regression/apparmor/overlayfs.sh
@@ -32,9 +32,9 @@ mkdir "${mount_target}"
mkdir "${overlayfs_lower}"
mkdir "${overlayfs_other}"

-fallocate -l 512K "${backing_file_lower}"
+fallocate -l 8M "${backing_file_lower}"
mkfs.ext4 -F "${backing_file_lower}" > /dev/null 2> /dev/null
-fallocate -l 512K "${backing_file_upper}"
+fallocate -l 8M "${backing_file_upper}"
mkfs.ext4 -F "${backing_file_upper}" > /dev/null 2> /dev/null

losetup -f "${backing_file_lower}" || fatalerror 'Unable to set up lower loop device'
@@ -51,11 +51,11 @@ mkdir "${overlayfs_workdir}"

mount -t overlay -o lowerdir="${overlayfs_lower}",upperdir="${overlayfs_upper}",workdir="${overlayfs_workdir}" none "${mount_target}"|| fatalerror 'Unable to set up overlayfs'

-fallocate -l 16K "${overlayfs_lower}/lower_file"
+fallocate -l 2M "${overlayfs_lower}/lower_file"
touch "${overlayfs_lower}/lower_file_2"
-fallocate -l 16K "${overlayfs_upper}/upper_file"
+fallocate -l 2M "${overlayfs_upper}/upper_file"
touch "${overlayfs_upper}/upper_file_2"
-fallocate -l 16K "${mount_target}/overlay_file"
+fallocate -l 2M "${mount_target}/overlay_file"
# echo is also a builtin, making things a bit more complicated
cp "$(type -P echo)" "${overlayfs_lower}/lower_echo"
cp "$(type -P echo)" "${overlayfs_upper}/upper_echo"

0 comments on commit 1c8b00f

Please sign in to comment.