Monday, April 7, 2025

Disable Kernel modules in Alpine Linux Cloud image for Oracle Cloud

Download Alpine Linux Cloud Image from: https://www.alpinelinux.org/cloud/
Upload the image to OCI and create an instance from it.

I disabled some Kernel modules for security and saving memory.

Remove old drivers from: /etc/mkinitfs/mkinitfs.conf
From:
features="ata base ide scsi usb virtio ext4 nvme"
To:
features="base scsi virtio ext4"


Add 'blacklist drm' to /etc/modprobe.d/blacklist.conf
echo 'blacklist drm' >> /etc/modprobe.d/blacklist.conf
mkinitfs -c /etc/mkinitfs/mkinitfs.conf -b / 
reboot
The grub modprobe.blacklist=drm, does not work either.
updating /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash modprobe.blacklist=drm"


I will try [cloud-init] Bootstrap image next time.

Reference:
https://dev.alpinelinux.org/~clandmeter/other/forum.alpinelinux.org/forum/kernel-and-hardware/blacklist-drivers-builtin-kernel.html
https://wiki.alpinelinux.org/wiki/Initramfs_init
https://wiki.alpinelinux.org/wiki/Xen_PCI_Passthrough

No comments:

Post a Comment