Skip to content

Commit 0dce520

Browse files
Josnowwalexborro
andcommitted
CES-3114: Add led-driver to initramfs
This commit adds the LED driver module to the initramfs and ensures the kernel modules are loaded. Co-authored-by: alexborro <[email protected]>
1 parent 4ab2721 commit 0dce520

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

build.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ DEBIAN_DIR="${BUILD_DIR}/debian"
4848
BOOT_FILE_OUTPUT_DIR="${DEBIAN_DIR}/boot"
4949

5050
# Init RAM FS definitions
51-
INITRAMFS_MODULES_REQUIRED="loop.ko"
51+
INITRAMFS_MODULES_REQUIRED="loop.ko leds-pca963x.ko"
5252
INITRAMFS_SRC_DIR="${SRC_DIR}/initramfs"
5353
INITRAMFS_DST_DIR="${KERNEL_BUILD_DIR}/initramfs"
5454
INITRAMFS_MODULES_DIR="${KERNEL_BUILD_DIR}/initramfs/lib/modules"
@@ -261,7 +261,7 @@ kernel_build()
261261
initramfs_add_modules
262262
# Here we need to rebuild the kernel Image to include the updated initramfs with kernel modules
263263
kernel_build_command LOADADDR=0x40480000 Image
264-
264+
265265
# Install Kernel image
266266

267267
if [ -d "${BOOT_FILE_OUTPUT_DIR}" ] && [ -z "${BOOT_FILE_OUTPUT_DIR##*_build*}" ]; then
@@ -357,7 +357,7 @@ copy_dma_firmware()
357357

358358
# Copy all directories and files under proprietary_firmware to the output directory
359359
rsync -av --exclude 'Readme.md' "${PROPRIETARY_FIRMWARE_DIR}/" "${PROPRIETARY_FIRMWARE_OUTPUT_DIR}/"
360-
360+
361361
# Copy specific proprietary firmware to the initramfs dir too
362362
cp "${PROPRIETARY_FIRMWARE_DIR}/imx/sdma/sdma-imx7d.bin" "${INITRAMFS_DST_DIR}"
363363
cp "${PROPRIETARY_FIRMWARE_DIR}/imx/sdma/sdma-imx6q.bin" "${INITRAMFS_DST_DIR}"
@@ -399,7 +399,7 @@ create_debian_package()
399399
-e 's|@PACKAGE_NAME@|'"${PACKAGE_NAME}"'|g' \
400400
-e 's|@RELEASE_VERSION@|'"${RELEASE_VERSION}"'|g' \
401401
"${SRC_DIR}/debian/control.in" > "${DEBIAN_DIR}/DEBIAN/control"
402-
402+
403403
cp "${SRC_DIR}/debian/preinst" "${DEBIAN_DIR}/DEBIAN/"
404404
cp "${SRC_DIR}/debian/postinst" "${DEBIAN_DIR}/DEBIAN/"
405405

@@ -472,7 +472,7 @@ case "${1-}" in
472472
;;
473473
dtbs)
474474
dtb_build
475-
;;
475+
;;
476476
kernel)
477477
kernel_build
478478
;;

initramfs/init.sh

+10
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,22 @@ busybox_setup()
467467
"${BB_BIN}" --install -s
468468
}
469469

470+
load_kernel_modules()
471+
{
472+
for file in /lib/modules/*/*.ko; do
473+
basename="${file##*/}"; # Remove the full path
474+
filename="${basename%.*}"; # Remove the extension.
475+
modprobe "${filename}";
476+
done;
477+
}
478+
470479
trap critical_error EXIT
471480

472481
busybox_setup
473482
toolcheck
474483
kernel_mount
475484
parse_cmdline
485+
load_kernel_modules
476486
if [ "${RESCUE_SHELL}" = "yes" ]; then
477487
rescue_shell
478488
fi

0 commit comments

Comments
 (0)