Go to file
Dustin f2d6db5af1 Enable SELinux
Enabling SELinux on the target system needs build-time and run-time
configuration changes for ther kernel and userspace.  Additionally,
SELinux requires a policy that defines allowed operations.  Gentoo
provides a reasonable baseline for all of these changes, but some
modifications are required.

First and foremost, the Gentoo SELinux policy is missing several
necessary rules for systemd-based systems.  Notably, services that use
alternate namespaces will fail to start because the base policy does not
allow systemd components the necessary privileges, so these rules have
to be added.  Similarly, `systemd-journald` needs additional privileges
in order to be able to capture all metadata for processes generating
syslog messages.  Finally, additional rules are necessary in order to
allow systemd to create files and directories prior to launching
servies.

Besides patching the policy, we also do some hackery to avoid shipping
the Python runtime in SELinux-enabled builds.  Several SELinux-related
packages, including *libselinux* and *policycoreutils* have dependencies
on Python modules for some of their functionality.  Unfortunately, the
Python build system does NOT properly cross-compile native extension
modules, so this functionality is not available on the target system.
Fortunately, none of the features provided by these modules are actually
needed at runtime, so we can safely ignore them and thus omit the entire
Python runtime and all Python programs from the final image.

It is important to note that it is impossible to build an
SELinux-enabled image on a host that is itself SELinux-enabled.
Operations such as changing file labels are checked against the SELinux
policy in the running kernel, and may be denied if the target policy
differs significantly from the running policy.  The `setfiles` command
fails, for example, when run on a Fedora host.  As such, building an
SELinux-enabled system should be done in a virtual machine using a
kernel that does not have a loaded SELinux policy.  The `ocivm` script
can be used to create a suitable runtime from a container image.
2023-03-12 12:34:12 -05:00
host-portage Enable SELinux 2023-03-12 12:34:12 -05:00
overlay Enable SELinux 2023-03-12 12:34:12 -05:00
patches Initial commit 2023-02-13 23:24:36 -06:00
portage Enable SELinux 2023-03-12 12:34:12 -05:00
u-boot@62e2ad1cea Initial commit 2023-02-13 23:24:36 -06:00
.gitignore Improve handling of circular dependencies 2023-02-21 09:58:18 -06:00
.gitmodules Initial commit 2023-02-13 23:24:36 -06:00
Makefile Simplify specifying packages to build/install 2023-03-08 11:12:00 -06:00
README.md Initial commit 2023-02-13 23:24:36 -06:00
build-all.sh Initial commit 2023-02-13 23:24:36 -06:00
build-grub.sh Support external build directory 2023-03-03 12:36:15 -06:00
build-host-tools.sh Simplify specifying packages to build/install 2023-03-08 11:12:00 -06:00
build-kernel.sh Support external build directory 2023-03-03 12:36:15 -06:00
build-rootfs.sh Enable SELinux 2023-03-12 12:34:12 -05:00
build-squashfs.sh Support external build directory 2023-03-03 12:36:15 -06:00
build-uboot.sh Support external build directory 2023-03-03 12:36:15 -06:00
build-update.sh Support external build directory 2023-03-03 12:36:15 -06:00
build.packages Simplify specifying packages to build/install 2023-03-08 11:12:00 -06:00
build.sh Simplify specifying packages to build/install 2023-03-08 11:12:00 -06:00
busybox.symlinks Enable SELinux 2023-03-12 12:34:12 -05:00
config Enable SELinux 2023-03-12 12:34:12 -05:00
config-portage.sh Improve handling of circular dependencies 2023-02-21 09:58:18 -06:00
config.txt Initial commit 2023-02-13 23:24:36 -06:00
genimage.cfg Support external build directory 2023-03-03 12:36:15 -06:00
genimage.sh Support external build directory 2023-03-03 12:36:15 -06:00
grub.cfg Initial commit 2023-02-13 23:24:36 -06:00
host-tools.packages Enable SELinux 2023-03-12 12:34:12 -05:00
install-update.sh install-update: Fix error message in die function 2023-03-08 11:12:00 -06:00
install.packages Simplify specifying packages to build/install 2023-03-08 11:12:00 -06:00
installonly.packages Simplify specifying packages to build/install 2023-03-08 11:12:00 -06:00
linux.config Enable SELinux 2023-03-12 12:34:12 -05:00
ocivm.sh vm-build: Add script to build in a microvm 2023-03-08 11:12:00 -06:00
patch-uboot.sh uboot: Apply patches outside container 2023-02-13 23:24:36 -06:00
podman-build.sh Add start-container.sh script 2023-02-21 09:58:18 -06:00
post-build.sh Support external build directory 2023-03-03 12:36:15 -06:00
prepare.sh prepare: Fix binpkg build for libcap 2023-03-06 15:02:46 -06:00
setup-local-repo.sh Initial commit 2023-02-13 23:24:36 -06:00
squashfs.exclude Enable SELinux 2023-03-12 12:34:12 -05:00
start-container.sh Add start-container.sh script 2023-02-21 09:58:18 -06:00
u-boot.config Initial commit 2023-02-13 23:24:36 -06:00
vm-build.sh vm-build: Add script to build in a microvm 2023-03-08 11:12:00 -06:00

README.md

Errors

SWIOTLB Buffer

OF: reserved mem: failed to allocate memory for node … Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer

Ensure start_x=1 is in config.txt and start_file/fixup_file are not specified.

U-Boot: Overwrite Reserved Memory

** Reading file would overwrite reserved memory **

Set CONFIG_LMB_MAX_REGIONS=16 in u-boot/.config