@fredx181
Hi
I have another suggestions to improve initrd
/usr/local/cr-initrd/mkinitrd
Code: Select all
-copy_including_deps /$LMK/kernel/fs/nls
+#copy_including_deps /$LMK/kernel/fs/nls
+copy_including_deps /$LMK/kernel/fs/nls/nls_ascii.*
+copy_including_deps /$LMK/kernel/fs/nls/nls_cp437.*
+copy_including_deps /$LMK/kernel/fs/nls/nls_iso8859-1.*
+copy_including_deps /$LMK/kernel/fs/nls/nls_utf8.*
Pick only nls_
modules mentioned in modlist
Code: Select all
-copy_including_deps /$LMK/kernel/drivers/staging/zsmalloc # needed by zram
-copy_including_deps /$LMK/kernel/drivers/block/zram
+#copy_including_deps /$LMK/kernel/drivers/staging/zsmalloc # needed by zram
+#copy_including_deps /$LMK/kernel/drivers/block/zram
Remove zram
module, currently it is not used, not have in modlist
Code: Select all
-copy_including_deps /$LMK/kernel/drivers/ata
-copy_including_deps /$LMK/kernel/drivers/nvme
+#copy_including_deps /$LMK/kernel/drivers/ata
+copy_including_deps /$LMK/kernel/drivers/ata/ahci.*
+copy_including_deps /$LMK/kernel/drivers/ata/ata_*.*
+copy_including_deps /$LMK/kernel/drivers/ata/sata_*.*
+copy_including_deps /$LMK/kernel/drivers/nvme/host/nvme.*
copy_including_deps /$LMK/kernel/drivers/mmc
-copy_including_deps /$LMK/kernel/drivers/md
+copy_including_deps /$LMK/kernel/drivers/md/md-mod.*
copy_including_deps /$LMK/kernel/drivers/pci/controller/vmd.*
+#copy_including_deps /$LMK/kernel/drivers/ata/pata_*.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_amd.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_atiixp.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_jmicron.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_marvell.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_mpiix.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_pcmcia.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_pata_sil680.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_pata_sis.*
+copy_including_deps /$LMK/kernel/drivers/ata/pata_pata_via.*
Remove unused modules from kernel/drivers/nvme/
and kernel/drivers/md/
folders.
Pick only selected modules from kernel/drivers/ata/
On modern desktops/laptops only ahci
module used. But i include ata_piix
and all sata_*.*
modules.
Copy only selected pata_
modules for old PATA (IDE) CD/DVD Drives support.
I already do tests. Boot fine from SATA and NVMe SSD. And from QEMU virtual drive used ata_piix
module.
I do not test boot from CD/DVD.
/usr/local/cr-initrd/initramfs/linuxrc
Code: Select all
## Let's start!
echo $i"loading kernel modules..."
+MODPBLST=`value modprobe.blacklist | sed 's/,/|/g'`
+
+if [ -n "$MODPBLST" ]; then
+ sed -E "s/($MODPBLST) //g" -i modlist
+ MODPBLST=`value modprobe.blacklist | sed 's/,/ /g;s/[_-]/?/g'`
+ for MODULE in $MODPBLST; do
+ find /lib/modules/$(uname -r)/kernel/ -name "$MODULE"'.*' -delete 2>/dev/null
+ done
+fi
+
+if param nocd || [ $IP ]; then
+sed 's/pata_[0-9a-z]\{3,\} //g' -i modlist
+fi
+
for MODULE in $(cat modlist)
do
modprobe $MODULE 2> /dev/null
Support of modprobe.blacklist= kernel boot param. It is need in case of hardware problems.
For example modprobe.blacklist=radeon,amdgpu prevent to load AMD GPU drivers.
But before linuxrc
ignore it and modprobe modules from modlist
anyway.
Now it accept modprobe.blacklist=ahci,nvme It is need when operate with failure NVMe/SATA SSD/HDD. To prevent linuxrc
to mount partitions from it.
After linuxrc
finished - modules can be modprobed.
pata_
modules nowadays primary need only for old PATA (IDE) CD/DVD Drives support.
Disable loading it: if used boot param nocd or in case of PXE network boot.
Code: Select all
# ln -sf /mnt/live/mnt/$x /union/mnt/$x
#done
+for MODULE in `sed 's/ /\n/g' modlist | grep ata_`
+do modprobe -r $MODULE 2>/dev/null
+done
+
#cp -r /etc/porteus /union/etc 2>/dev/null
umount -n /lib/modules 2>/dev/null
Unload unused ata_* sata_* pata_*
modules.
I already do tests. Boot fine from SATA SSD (used ahci
module). And from QEMU virtual drive used ata_piix
module.
/usr/local/cr-initrd/initramfs/modlist
I found lack of space between zstd_decompress pata_acpi
. Have same in previous version upgrade-kernel_1.15.0_all.deb
I remove libata nvme_core - not need in modlist - loaded fine as dependencies.
I remove grace lockd nfs nfsv3 nfsv4 sunrpc
it is need only for nfs and used in case of PXE network boot.
I do test PXE boot. It is loaded fine, not need in modlist
Remove other unneeded in initrd drm drm_kms_helper kms_helper kvm soundcore thermal pdc_adma pppox
pdc_adma i think not need in initrd: This option enables support for Pacific Digital ADMA controllers. If unsure, say N.
These modules currently not copied to initrd by mkinitrd
. I remove it from modlist
.
drm and kms modules not needed and not have in initrd.
kvm module not have and not need in initrd.
pppox for PPPoE over Ethernet support not have and not need in initrd.
soundcore module not have and not need in initrd.
thermal in current bookworm kernel compiled in, not as a module. And anyway i think not need in initrd.