Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AppArmor profile to fix Brioche builds on Ubuntu 24.04 #2

Merged
merged 3 commits into from
Dec 23, 2024

Conversation

kylewlacy
Copy link
Member

This PR updates the setup-brioche action with a new install-apparmor input value, which will optionally install an AppArmor profile during setup. When set to auto (the default), it will try and determine if the AppArmor profile is needed.

This Ubuntu blog post provides more context, but the TL;DR is that Ubuntu 23.10+ restricts unprivileged user namespaces by default, unless enabled with an AppArmor profile. Brioche uses unprivileged user namespaces for Linux builds currently (see brioche-dev/brioche#152). So, we need an AppArmor profile to use Brioche on Ubuntu 24.04.

To detect if we need an AppArmor profile, we check if AppArmor is enabled (with the aa-enabled command), then check if the file /etc/apparmor.d/abi/4.0 exists. This file is used for the AppArmor 4.0 ABI, which is when the restricted user namespace feature was added.

@kylewlacy kylewlacy requested a review from asheliahut December 23, 2024 07:54
@asheliahut asheliahut added this pull request to the merge queue Dec 23, 2024
@asheliahut asheliahut removed this pull request from the merge queue due to a manual request Dec 23, 2024
@asheliahut asheliahut merged commit c71550d into main Dec 23, 2024
3 checks passed
@asheliahut asheliahut deleted the add-apparmor-profile-for-ubuntu-24-04 branch December 23, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants