fix: add btrfs support using magic (#5)

* Use old GPL release from https://github.com/fabianishere/udm-kernel/tree/master to build and steal it's btrfs kernel module + depends.
* Can't use full kernel, NIC issues everywhere, so we will just use it for btrfs for OMV. Will move to our own kernel fully if I can get an updated GPL release from Ui.
* BONUS: Fixup issue where system would reboot when shutdown from touch screen
This commit is contained in:
Chris Blake 2024-05-30 17:42:12 -05:00 committed by GitHub
parent be235b00ac
commit f399e13958
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 495 additions and 8 deletions

View file

@ -19,10 +19,15 @@ debootstrap --no-check-gpg --foreign --arch=${deb_arch} --include=apt-transport-
cp /usr/bin/qemu-aarch64-static usr/bin/
chroot ${build_path}/rootfs /debootstrap/debootstrap --second-stage
# Copy over our kernel modules and kernel
mv -f "${build_path}/fw-extract/rootfs/lib/modules" ${build_path}/rootfs/lib
# Copy over our kernel modules and kernel from the FS image
# Note that in the future, we wanna use our own kernel, but the current GPL is way too old!!!!!
mv -f "${build_path}/fw-extract/rootfs/lib/modules" "${build_path}/rootfs/lib"
cp "${build_path}/fw-extract/kernel.bin" "${build_path}/rootfs/boot/uImage"
# Now, for the old kernel we built, pull in btrfs + depends modules (we do depmod in bootstrap)
cp "${build_path}/kernel/kernel-modules/lib/modules/4.19.152-alpine-unvr/kernel/lib/zstd/zstd_compress.ko" "${build_path}/rootfs/lib/modules/4.19.152-alpine-unvr/extra/"
cp "${build_path}/kernel/kernel-modules/lib/modules/4.19.152-alpine-unvr/kernel/fs/btrfs/btrfs.ko" "${build_path}/rootfs/lib/modules/4.19.152-alpine-unvr/extra/"
# Copy over our overlay if we have one
if [[ -d ${root_path}/overlay/${fs_overlay_dir}/ ]]; then
echo "Applying ${fs_overlay_dir} overlay"