fix: resolve kernel module installation and packaging issues

- Fixed resolve-module-dependencies.sh to handle missing modules gracefully
- Removed destructive 'set -e' behavior that caused immediate exit on missing modules
- Enhanced install-firmware-minimal.sh to handle partial success scenarios
- Fixed install-packages.sh to preserve installed kernel modules (was deleting them)
- Improved setup-initramfs.sh to ensure modules directory always exists
- Now successfully installs 43 essential kernel modules in final initramfs
- Fixes 'depmod: ERROR: could not open directory /lib/modules' boot issue

All kernel modules (.ko files) are now properly included in the final cpio archive.
This commit is contained in:
2025-08-22 16:39:11 +02:00
parent 56c3813609
commit 91d20b9226
4 changed files with 120 additions and 32 deletions

View File

@@ -159,8 +159,11 @@ if [ "$MINIMAL_MODE" = "true" ]; then
rm -rf var/lib/apk/db/installed var/lib/apk/db/lock
rm -rf etc/apk/cache/* 2>/dev/null || true
# Remove unneeded kernel modules (we only need firmware)
rm -rf lib/modules/* 2>/dev/null || true
# Note: Keep kernel modules - they were installed by install-firmware-minimal.sh
# Only remove unnecessary kernel module development files if they exist
find lib/modules -name "*.mod" -delete 2>/dev/null || true
find lib/modules -name "build" -type l -delete 2>/dev/null || true
find lib/modules -name "source" -type l -delete 2>/dev/null || true
# Strip binaries aggressively to reduce size
echo " Stripping binaries..."