summaryrefslogtreecommitdiffstats
path: root/core/rootfs
diff options
context:
space:
mode:
authorJonathan Bauer2021-07-09 16:58:13 +0200
committerJonathan Bauer2021-07-09 16:58:13 +0200
commit0f1099eb295c87dccf6c5133b0049eadf794d180 (patch)
tree3690479852db302730dc40740932a9180745f3cf /core/rootfs
parent[vmware-common] always activate 3D in vmware (diff)
downloadmltk-0f1099eb295c87dccf6c5133b0049eadf794d180.tar.gz
mltk-0f1099eb295c87dccf6c5133b0049eadf794d180.tar.xz
mltk-0f1099eb295c87dccf6c5133b0049eadf794d180.zip
[rootfs-kernel] kernel module/firmware installer
Diffstat (limited to 'core/rootfs')
-rw-r--r--core/rootfs/rootfs-kernel/README1
-rw-r--r--core/rootfs/rootfs-kernel/module.build31
-rw-r--r--core/rootfs/rootfs-kernel/module.conf1
3 files changed, 33 insertions, 0 deletions
diff --git a/core/rootfs/rootfs-kernel/README b/core/rootfs/rootfs-kernel/README
new file mode 100644
index 00000000..87cb6c88
--- /dev/null
+++ b/core/rootfs/rootfs-kernel/README
@@ -0,0 +1 @@
+-- This module is mostly for the install mode --
diff --git a/core/rootfs/rootfs-kernel/module.build b/core/rootfs/rootfs-kernel/module.build
new file mode 100644
index 00000000..0ac57b6f
--- /dev/null
+++ b/core/rootfs/rootfs-kernel/module.build
@@ -0,0 +1,31 @@
+#!/bin/bash
+fetch_source() {
+ :
+}
+
+build() {
+ :
+}
+
+post_copy() {
+ # first copy kernel
+ copy_kernel
+
+ # now copy all the firmware and kernel modules
+ # to preserve the build environment, we copy instead of moving
+ mkdir -p "${TARGET_BUILD_DIR}/lib"
+ rsync -aAXv "${KERNEL_BASE_DIR}/lib/firmware" "${TARGET_BUILD_DIR}/lib" || \
+ perror "Failed to copy firmware to '${TARGET_BUILD_DIR}/lib'."
+ rsync -aAXv "${KERNEL_BASE_DIR}/lib/modules" "${TARGET_BUILD_DIR}/lib" || \
+ perror "Failed to copy kernel modules to '${TARGET_BUILD_DIR}/lib'."
+
+ # NOTE: if symlinks are present in ./lib/modules/<version>/kernel, they
+ # are likely pointing to mltk's kernel work dir, thus unusable in live
+ # systems. We just delete those for now.
+ for LINK in "${TARGET_BUILD_DIR}/lib/modules/${TARGET_KERNEL_LONG}/"{build,source}; do
+ if [ -h "${LINK}" ]; then
+ pinfo "Removing '${LINK}' as it won't point to a valid path on live systems."
+ unlink "${LINK}" || perror "Failed to unlink '${LINK}'."
+ fi
+ done
+}
diff --git a/core/rootfs/rootfs-kernel/module.conf b/core/rootfs/rootfs-kernel/module.conf
new file mode 100644
index 00000000..ce993cdd
--- /dev/null
+++ b/core/rootfs/rootfs-kernel/module.conf
@@ -0,0 +1 @@
+REQUIRED_MODULES="kernel"