Provisioning: Fix bitbake with apparmor on Ubuntu 24.04

Ubuntu 23.10 introduced new apparmor features and those prevent bitbake
to work correctly until a apparmor configuration file is installed.

Task-number: QTBUG-137321
Change-Id: Ib3f5faae07ea116012b1c66554211c53ca0e77e7
Reviewed-by: Toni Saario <toni.saario@qt.io>
This commit is contained in:
Samuli Piippo
2025-10-06 12:48:36 +03:00
parent 92242641ac
commit 3571545c28
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#Copyright (C) 2024 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#p-99950-unprivileged-user-namespace-restrictions
# https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2056555/comments/34
sudo bash -c 'cat > /etc/apparmor.d/bitbake' << EOF
abi <abi/4.0>,
include <tunables/global>
profile bitbake /**/bitbake/bin/bitbake* flags=(unconfined) {
userns,
}
EOF
sudo apparmor_parser -r /etc/apparmor.d/bitbake

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# shellcheck source=../common/linux/fix-bitbake-apparmor.sh
source "${BASH_SOURCE%/*}/../common/linux/fix-bitbake-apparmor.sh"