Fixes to prepare for boot testing
This commit is contained in:
parent
26f1805fa4
commit
746e459795
@ -4,6 +4,7 @@ set -eo pipefail
|
|||||||
|
|
||||||
NPROC=$(nproc)
|
NPROC=$(nproc)
|
||||||
VERSION=$(date +%Y%m%d)$MINOR
|
VERSION=$(date +%Y%m%d)$MINOR
|
||||||
|
export VERSION="$VERSION"
|
||||||
|
|
||||||
# This variable gets unset if any security-critical elements are disabled
|
# This variable gets unset if any security-critical elements are disabled
|
||||||
SECURESYS=true
|
SECURESYS=true
|
||||||
@ -31,7 +32,7 @@ echo "=============================="
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
export $DISTPATH
|
export DISTPATH=$DISTPATH
|
||||||
mkdir -p "$DISTPATH"
|
mkdir -p "$DISTPATH"
|
||||||
|
|
||||||
# Gentoo setup
|
# Gentoo setup
|
||||||
@ -49,7 +50,9 @@ emerge --quiet squashfs-tools gentoolkit
|
|||||||
# Copy in package list
|
# Copy in package list
|
||||||
mkdir -p /etc/portage/sets
|
mkdir -p /etc/portage/sets
|
||||||
cp /build/emerge/packages.txt /etc/portage/sets/halogenos
|
cp /build/emerge/packages.txt /etc/portage/sets/halogenos
|
||||||
|
if [ -d /build/emerge/package.use ]; then
|
||||||
cp -r /build/emerge/package.use /etc/portage/
|
cp -r /build/emerge/package.use /etc/portage/
|
||||||
|
fi
|
||||||
|
|
||||||
# We have to ensure use.disable contains at least one flag
|
# We have to ensure use.disable contains at least one flag
|
||||||
# Otherwise euse -D will disable all global use flags
|
# Otherwise euse -D will disable all global use flags
|
||||||
@ -57,27 +60,33 @@ if [[ "$(cat /build/emerge/use.disable)" = *[![:space:]]* ]]; then
|
|||||||
euse -D "$(cat /build/emerge/use.disable)"
|
euse -D "$(cat /build/emerge/use.disable)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Copy in any patch sets
|
||||||
|
cp -r /build/emerge/patches /etc/portage/
|
||||||
|
|
||||||
# Set install location
|
# Set install location
|
||||||
export ROOT="$DISTPATH"
|
export ROOT="$DISTPATH"
|
||||||
|
|
||||||
# Update any existing packages
|
# Update any existing packages
|
||||||
emerge -j "$NPROC" --quiet --update --deep --newuse @world
|
#emerge -j "$NPROC" --quiet --update --deep --newuse @world
|
||||||
|
|
||||||
# Emerge all packages
|
# Emerge all packages
|
||||||
|
emerge dev-python/setuptools
|
||||||
emerge -j "$NPROC" --quiet @halogenos
|
emerge -j "$NPROC" --quiet @halogenos
|
||||||
|
|
||||||
# Fix directory locations
|
|
||||||
mv "$DISTPATH"/bin "$DISTPATH"/usr/bin
|
|
||||||
mv "$DISTPATH"/lib "$DISTPATH"/usr/lib
|
|
||||||
mv "$DISTPATH"/sbin "$DISTPATH"/usr/sbin
|
|
||||||
|
|
||||||
# Include any additional files
|
# Include any additional files
|
||||||
mkdir -p "$DISTPATH"/usr/share/halogenos
|
mkdir -p "$DISTPATH"/usr/share/halogenos
|
||||||
mkdir "$DISTPATH"/usr/share/halogenos/keys
|
mkdir "$DISTPATH"/usr/share/halogenos/keys
|
||||||
mkdir "$DISTPATH"/usr/share/halogenos/bin
|
mkdir "$DISTPATH"/usr/share/halogenos/bin
|
||||||
|
|
||||||
|
# Fix directory locations
|
||||||
|
for dir in bin sbin etc lib; do
|
||||||
|
mv "$DISTPATH"/"$dir" "$DISTPATH"/usr/
|
||||||
|
done
|
||||||
|
|
||||||
cp -r /build/include/* "$DISTPATH"/
|
cp -r /build/include/* "$DISTPATH"/
|
||||||
|
|
||||||
|
echo "IMAGE_VERSION="$VERSION"" >> "$DISTPATH"/usr/lib/os-release
|
||||||
|
|
||||||
# Install gvisor OCI runtime
|
# Install gvisor OCI runtime
|
||||||
/build/external/gvisor.sh
|
/build/external/gvisor.sh
|
||||||
|
|
||||||
@ -108,7 +117,7 @@ SECURESYS=$SECURESYS" > "$DISTPATH"/usr/share/halogenos/release.meta
|
|||||||
mkdir -p /build/images
|
mkdir -p /build/images
|
||||||
cp "$DISTPATH"/usr/share/halogenos/release.meta /build/images/
|
cp "$DISTPATH"/usr/share/halogenos/release.meta /build/images/
|
||||||
dd if=/dev/zero of=/build/images/usr.img bs=1 count=0 seek=2G
|
dd if=/dev/zero of=/build/images/usr.img bs=1 count=0 seek=2G
|
||||||
mkfs.ext4 /build/images/usr.img
|
mkfs.btrfs /build/images/usr.img
|
||||||
dd if=/dev/zero of=/build/images/verity.img bs=1 count=0 seek=2000M
|
dd if=/dev/zero of=/build/images/verity.img bs=1 count=0 seek=2000M
|
||||||
|
|
||||||
# Create squashfs
|
# Create squashfs
|
||||||
@ -122,4 +131,4 @@ umount /mnt/usr
|
|||||||
|
|
||||||
# Build verity
|
# Build verity
|
||||||
|
|
||||||
tar -czf /build/images/usr.img /build/images/verity.img /build/images/
|
tar -czf "$VERSION".tar.gz /build/images/
|
2
build/emerge/package.use/fix-python
Normal file
2
build/emerge/package.use/fix-python
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*/* PYTHON_TARGETS: -* python3_12
|
||||||
|
*/* PYTHON_SINGLE_TARGET: -* python3_12
|
1
build/emerge/package.use/fwupd
Normal file
1
build/emerge/package.use/fwupd
Normal file
@ -0,0 +1 @@
|
|||||||
|
sys-apps/fwupd elogind
|
@ -1,11 +1,7 @@
|
|||||||
app-containers/distrobox
|
app-containers/distrobox
|
||||||
app-containers/podman
|
app-containers/docker
|
||||||
app-crypt/gnupg
|
app-crypt/gnupg
|
||||||
app-shells/bash
|
app-shells/bash
|
||||||
app-misc/hyfetch
|
|
||||||
kde-plasma/flatpak-kcm
|
|
||||||
kde-plasma/plasma-desktop
|
|
||||||
kde-plasma/plasma-vault
|
|
||||||
sys-apps/bubblewrap
|
sys-apps/bubblewrap
|
||||||
sys-apps/flatpak
|
sys-apps/flatpak
|
||||||
sys-apps/fwupd
|
sys-apps/fwupd
|
||||||
|
20
build/emerge/patches/sys-libs/libsemanage/fix-musl.patch
Normal file
20
build/emerge/patches/sys-libs/libsemanage/fix-musl.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
--- a/src/direct_api.c
|
||||||
|
+++ b/src/direct_api.c
|
||||||
|
@@ -38,6 +38,7 @@
|
||||||
|
#include <limits.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
+#include <libgen.h>
|
||||||
|
|
||||||
|
#include "user_internal.h"
|
||||||
|
#include "seuser_internal.h"
|
||||||
|
--- a/src/conf-parse.y
|
||||||
|
+++ b/src/conf-parse.y
|
||||||
|
@@ -30,6 +30,7 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
+#include <libgen.h>
|
||||||
|
|
||||||
|
extern int semanage_lex(void); /* defined in conf-scan.c */
|
||||||
|
extern int semanage_lex_destroy(void); /* defined in conf-scan.c */
|
@ -1,29 +0,0 @@
|
|||||||
[containers]
|
|
||||||
|
|
||||||
cgroupns = "private"
|
|
||||||
cgroups = "enabled"
|
|
||||||
|
|
||||||
default_capabilities = []
|
|
||||||
|
|
||||||
default_sysctls = [
|
|
||||||
"net.ipv4.ping_group_range=0 0",
|
|
||||||
]
|
|
||||||
|
|
||||||
label = true
|
|
||||||
label_users = true
|
|
||||||
|
|
||||||
ipcns = "private"
|
|
||||||
netns = "private"
|
|
||||||
pidns = "private"
|
|
||||||
userns = "auto"
|
|
||||||
utsns = "private"
|
|
||||||
|
|
||||||
privileged = false
|
|
||||||
|
|
||||||
[engine]
|
|
||||||
runtime = "runsc"
|
|
||||||
|
|
||||||
[engine.runtimes]
|
|
||||||
runsc = [
|
|
||||||
"/usr/local/bin/runsc",
|
|
||||||
]
|
|
8
build/include/usr/etc/docker/daemon.json
Normal file
8
build/include/usr/etc/docker/daemon.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"default-runtime": "gvisor",
|
||||||
|
"runtimes": {
|
||||||
|
"gvisor": {
|
||||||
|
"path": "/usr/local/bin/runsc"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
build/include/usr/lib/os-release
Normal file
9
build/include/usr/lib/os-release
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
NAME=HalogenOS
|
||||||
|
ID=halogen
|
||||||
|
PRETTY_NAME="HalogenOS"
|
||||||
|
ANSI_COLOR="36;46"
|
||||||
|
HOME_URL="https://git.shibedrill.site/HalogenOS"
|
||||||
|
SUPPORT_URL="https://git.shibedrill.site/HalogenOS/image-builder/issues"
|
||||||
|
BUG_REPORT_URL="https://git.shibedrill.site/HalogenOS/image-builder/issues"
|
||||||
|
DOCUMENTATION_URL="https://git.shibedrill.site/HalogenOS/image-builder/wiki"
|
||||||
|
VERSION_ID="0.1"
|
Loading…
Reference in New Issue
Block a user