Search This Blog

Showing posts with label Kernel. Show all posts
Showing posts with label Kernel. Show all posts

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

Wednesday, February 5, 2014

How to Lock down the RHEL CentOS OEL version

For some product, they require the specific RHEH/CentOS/OEL Version.

Here is a example on How I lock down OEL to 5.8:


[ol5_u8_base]
name=Oracle Linux $releasever Update 8 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/8/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol5_UEK_base]
name=Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/UEK/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol5_UEK_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/UEK/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

Thursday, January 30, 2014

Oracle Linux: Maximize Performance / Minimize Downtime

Oracle Linux: Maximize Performance / Minimize Downtime
http://medianetwork.oracle.com/video/player/2921003278001

Oracle’s Greg Marsden provides a large number of specific tips and tricks for getting the most from Oracle Linux.
Really helpful information about Large Memory Linux system.
Example for 1TB RAM system.

Key Note:
NUMA
Swap Tuning
Kernel UEK
kdump
Serial console
HugePages
...


Highly Recommend!

Wednesday, October 2, 2013

Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers, Images and Modules

First do upgrade to the latest kernel and reboot with the new kernel, make sure everything works!

$ uname -a
Linux MDS 3.2.0-54-generic #82-Ubuntu SMP Tue Sep 10 20:09:12 UTC 2013 i686 i686 i386 GNU/Linux

Then check all the linux kernel installed:

$ dpkg -l 'linux-*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=========================================-=========================================-==================================================================================================
un linux-doc-3.2.0 (no description available)
ii linux-firmware 1.79.6 Firmware for Linux kernel drivers
ii linux-generic 3.2.0.54.64 Complete Generic Linux kernel
un linux-headers (no description available)
un linux-headers-3 (no description available)
un linux-headers-3.0 (no description available)
un linux-headers-3.2.0-23 (no description available)
un linux-headers-3.2.0-23-generic (no description available)
ii linux-headers-3.2.0-52 3.2.0-52.78 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-52-generic 3.2.0-52.78 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP
ii linux-headers-3.2.0-54 3.2.0-54.82 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-54-generic 3.2.0-54.82 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP
ii linux-headers-generic 3.2.0.54.64 Generic Linux kernel headers
un linux-image (no description available)
un linux-image-3.0 (no description available)
ii linux-image-3.2.0-52-generic 3.2.0-52.78 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-54-generic 3.2.0-54.82 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-generic 3.2.0.54.64 Generic Linux kernel image
un linux-initramfs-tool (no description available)
un linux-kernel-headers (no description available)
un linux-kernel-log-daemon (no description available)
ii linux-libc-dev 3.2.0-54.82 Linux Kernel Headers for development
un linux-restricted-common (no description available)
ii linux-sound-base 1.0.25+dfsg-0ubuntu1.1 base package for ALSA and OSS sound systems
un linux-source-3.2.0 (no description available)
un linux-tools (no description available)


List all old kernels:


$ dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.*)-([^0-9]+)/1/")"'/d;s/^[^ ]* [^ ]* ([^ ]*).*/1/;/[0-9]/!d'

linux-headers-3.2.0-52
linux-headers-3.2.0-52-generic
linux-image-3.2.0-52-generic


Run this command to clean the old kernel:


$ dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.*)-([^0-9]+)/1/")"'/d;s/^[^ ]* [^ ]* ([^ ]*).*/1/;/[0-9]/!d' | xargs sudo apt-get -y purge



Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-headers-3.2.0-52* linux-headers-3.2.0-52-generic* linux-image-3.2.0-52-generic*
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 181 MB disk space will be freed.
(Reading database ... 152425 files and directories currently installed.)
Removing linux-headers-3.2.0-52-generic ...
Removing linux-headers-3.2.0-52 ...
Removing linux-image-3.2.0-52-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-52-generic /boot/vmlinuz-3.2.0-52-generic
update-initramfs: Deleting /boot/initrd.img-3.2.0-52-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-52-generic /boot/vmlinuz-3.2.0-52-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-54-generic
Found initrd image: /boot/initrd.img-3.2.0-54-generic
Found memtest86+ image: /boot/memtest86+.bin
done
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
you may need to re-run your boot loader[grub]
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old
you may need to re-run your boot loader[grub]
Purging configuration files for linux-image-3.2.0-52-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-52-generic /boot/vmlinuz-3.2.0-52-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-52-generic /boot/vmlinuz-3.2.0-52-generic


This will generate a new GRUB menu, and when you reboot, you’ll see only the current kernel is listed.