AppArmor Ubuntu 24.04 conflict building custom image?

I ran updates on my build computer recently, and I can’t seem to get bitbake to build the image. The following output is from a completely stock build following the instructions exactly:

workstation:/code/torizon/aquila-am69$ mkdir oe-core-7.x.y.20251106.stock
workstation:/code/torizon/aquila-am69$ cd oe-core-7.x.y.20251106.stock/
workstation:/code/torizon/aquila-am69/oe-core-7.x.y.20251106.stock$ ls
workstation:/code/torizon/aquila-am69/oe-core-7.x.y.20251106.stock$ repo init -u git://git.toradex.com/toradex-manifest.git -b scarthgap-7.x.y -m torizon/default.xml
Downloading Repo source from /code/torizon/aquila-am69/oe-core-7.x.y.20251106/.repo/repo/.git
remote: Enumerating objects: 9423, done.
remote: Counting objects: 100% (9423/9423), done.
remote: Compressing objects: 100% (4323/4323), done.
remote: Total 9423 (delta 5017), reused 9423 (delta 5017), pack-reused 0

Your identity is: <@users.noreply.github.com>
If you want to change this, please re-run ‘repo init’ with --config-name

repo has been initialized in /code/torizon/aquila-am69/oe-core-7.x.y.20251106.stock
workstation:/code/torizon/aquila-am69/oe-core-7.x.y.20251106.stock$ repo sync --no-clone-bundle
Syncing: 94% (18/19), done in 41.625s
Syncing: 100% (19/19) 0:43 | 1 job | 0:01 bitbake.git @ layers/openembedded-core/bitbakerepo sync has finished successfully.
workstation:/code/torizon/aquila-am69/oe-core-7.x.y.20251106.stock$ MACHINE=aquila-am69 source setup-environment

Welcome to Toradex Torizon OS

For more information about OpenEmbedded see their website:

http://www.openembedded.org/

Your build environment has been configured with:

MACHINE = aquila-am69
SDKMACHINE = x86_64
DISTRO = torizon

You can now run ‘bitbake ’

Some of common targets are:

torizon-docker
torizon-minimal
torizon-podman

workstation:/code/torizon/aquila-am69/oe-core-7.x.y.20251106.stock/build-torizon$ bitbake torizon-docker
ERROR: User namespaces are not usable by BitBake, possibly due to AppArmor.
See Ubuntu 24.04 LTS (Noble Numbat) Release Notes - Release - Ubuntu Community Hub for more information.

Summary: There was 1 ERROR message, returning a non-zero exit code.

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I notice you mentioned encountering bitbake build issues after running updates on your build computer, but I don’t see the specific error output in your message. However, I can help you troubleshoot common bitbake build problems that occur after system updates.

Common Solutions for Post-Update Build Issues

1. Clean Build Environment

If your build fails after system updates, try cleaning the build environment first (1):

$ bitbake -c clean python-native  
$ bitbake <image>  

(2)

For more thorough cleaning, you can also use cleansstate and cleanall commands (2).

2. Locale Configuration Issues

A common problem after system updates is locale configuration errors (3). Set your locale properly:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

(3)

You may also need to generate the locale:

sudo locale-gen en_US.UTF-8
sudo update-locale

(3)

3. Memory and Threading Configuration

If builds fail due to lack of RAM, configure parallel processing (1):

$ PARALLEL_MAKE="-j 4" BB_NUMBER_THREADS="6" bitbake <image>  

(1)

4. Handle Corrupted Files

If a build fails due to lack of RAM, some files could be corrupted (1). In this situation:

  1. Delete the corrupted package state (1)
  2. Delete all temporary files (1)
  3. Attempt to build the image again (1)

Debugging Steps

For detailed troubleshooting, you can use these bitbake commands (2):

  • bitbake virtual/kernel : Build only the Linux kernel for your machine (2)
  • bitbake -e <recipe> : Output the environment variables and settings for your build (2)
  • bitbake -c listtasks <recipe> : List all tasks for a given recipe (2)

Additional Considerations

If you’re working with custom layers, ensure they are properly configured in your bblayers.conf file (4). The layers should be listed correctly for bitbake to find all necessary resources (4).

Could you please share the specific error output you’re encountering? This will help me provide more targeted troubleshooting steps for your particular situation.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

I’m running the linux kernel from ubuntu:

linux-image-6.14.0-35-generic

I believe this latest kernel may make it where you can’t turn on user namespaces in app armor. It’s not an option I can change right now.

Greetings @TxSpace,

Yeah on quick search this seems to be an issue others are experiencing in Yocto. At least according to this thread here: https://lists.yoctoproject.org/g/poky/topic/problem_run_bitbake_on/111656575

Not sure if any of the workarounds in this thread are usable by you.

Best Regards,
Jeremias