summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hill <ahill@breadpudding.dev>2025-04-15 22:53:42 -0400
committerAlexander Hill <ahill@breadpudding.dev>2025-04-15 22:53:42 -0400
commit2c1bf51a9134b2e40a28c23ef9a0a42d5f923995 (patch)
treeacb1a05748cc4e125c60bc257510b129f02c196d
parent6a9c9665a693a6922909f5aecb65f683a2447448 (diff)
Fixed OpenRC and booted into /sbin/init
-rwxr-xr-xbuild-chroot.sh6
-rw-r--r--configure-image.sh15
2 files changed, 21 insertions, 0 deletions
diff --git a/build-chroot.sh b/build-chroot.sh
index 3c9880d..57b33e8 100755
--- a/build-chroot.sh
+++ b/build-chroot.sh
@@ -1,4 +1,6 @@
#!/bin/sh -e
+CFLAGS="-O3 -march=skylake -pipe"
+CXXFLAGS="$CFLAGS"
THREADS=$(nproc)
mkdir -p build
@@ -252,6 +254,10 @@ sed -i "/^install.*\/src\/shared\/version\".*/d" ./tools/meson_final.sh
# NOTE: One of the shell scripts OpenRC uses to install requires a DESTDIR, so
# we simply say the root is / in this case. ~ahill
DESTDIR=/ muon -C build install
+# FIXME: Not sure why, but OpenRC doesn't take over /sbin/init like it should.
+# As a workaround, let's create the symlinks manually. ~ahill
+ln -s openrc-init /sbin/init
+ln -s openrc-shutdown /sbin/shutdown
cd ..
# nasm Build
diff --git a/configure-image.sh b/configure-image.sh
new file mode 100644
index 0000000..3f9f254
--- /dev/null
+++ b/configure-image.sh
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+mkdir -p /etc/tinyramfs
+echo "root=/dev/vda2" > /etc/tinyramfs/config
+echo "root_type=xfs" >> /etc/tinyramfs/config
+# FIXME: Setting monolith to true is a workaround since tinyramfs searches for
+# /sbin/kmod, which doesn't work since kmod is installed under /bin.
+# While kmod *should* be moved under /sbin, tinyramfs also shouldn't
+# hard-code paths like that, so we need a way to patch this going
+# forward. Without a proper patch, kernel modules cannot be added to the
+# initramfs, which will cause issues with drivers later on. ~ahill
+echo "monolith=true" >> /etc/tinyramfs/config
+# TODO: This is a terrible way to detect the kernel version, since anything
+# else under /lib/modules will cause this to break, such as having
+# multiple kernel versions present. ~ahill
+tinyramfs -k $(ls /lib/modules) /boot/initramfs \ No newline at end of file