When you see this error in ubuntu 24.04 OS.
Errno 1 Operation not permitted" when disable_network (from bitbake/lib/bb/utils.py) attempts to write to the file /proc/self/uid_map .
Use this workaround to build PetaLinux project on UBUNTU 24.04 release:
- echo 0 > /proc/sys/kernel/apparmor_restrict_unprivileged_userns