Linux kernel configuration được biên dịch ở dạng module rời gắn vào Linux kernel được trên Ubuntu Server 22.04

Đời người tưởng dài nhưng rất ngắn ngủi nếu tính ra trong cuộc đời mỗi con người làm được gì.

Chúng tôi không muốn các bạn mất quá nhiều thời gian trong việc compile linux kernel theo các hướng dẫn trên mạng Internet đang có.


Các bạn cứ tìm với các từ như bên dưới và làm theo sau đó reboot Linux server để chạy được với Linux kernel mới trên VirtualBox và VMware Workstation xem tốn bao nhiêu thời gian.

Biên dịch nhân Linux

Biên dịch Linux kernel

How To Build Linux Kernel Step By Step

How to compile and install Linux Kernel 5.16.9 from source code

Kernel Build System

How to Compile a Linux Kernel

Compiling the Linux kernel and creating a bootable ISO from it

How to compile a custom Linux kernel


Chúng tôi tiếp tục mở rộng khóa học lập trình Bash shell thực chiến với nội dung dưới.

Lập trình bash shell chuyên sâu tự động 100% việc biên dịch Linux kernel.

LAB biên dịch Linux kernel có chức năng Linux kernel configuration ở dạng module rời gắn vào Linux kernel được trên Ubuntu Server 22.04

Thời gian biên dịch Linux kernel là dưới 5 phút kể cả khi máy tính bạn chậm hơn máy tính chúng tôi.

Linux kernel là file vmlinuz trong trường hợp này có dung lượng lớn hơn vmlinuz của Ubuntu Server 22.04 tại seo lại zậy? Xem như là bài tập Linux cho các bạn á.

CayTreOS là tên của hệ điều hành Linux do chúng tôi đặt ra với mong muốn chúng ta sớm làm ra các sản phẩm công nghệ thông tin như viết ra phần mềm, hổng phải viết app nha, đóng gói hệ điều hành Linux riêng chứ không phải là RHEL clones hay RHEL derivatives hay Debian derivatives hay Ubuntu Derivatives.

uname -a
CayTreOS DevSecOps-Edu-VN 6.6.7 #1 SMP PREEMPT_DYNAMIC Fri Dec 22 17:32:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Nếu bạn có học Linux thì hãy học Linux 1 cách chuyên sâu, đi vào tâm bão của Linux là Linux kernel chứ không phải mấy cái lệnh Linux có đầy trên mạng hay Linux LPI có vỏ mà không có ruột.

Học Linux chuyên sâu giúp bạn tự học được DevOps 1 cách dễ dàng vì làm DevOps dễ hơn học Linux chuyên sâu nhiều lần.

ll /proc/config.gz
ls: cannot access '/proc/config.gz': No such file or directory

modprobe -v configs
insmod /lib/modules/6.6.7/kernel/kernel/configs.ko

ll /proc/config.gz
-r--r--r-- 1 root root 31509 Dec 22 17:47 /proc/config.gz

zcat /proc/config.gz > config.txt

head config.txt
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.6.7 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110400
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23800
root@DevSecOps-Edu-VN:~# zgrep IKCONFIG /proc/config.gz
CONFIG_IKCONFIG=m
CONFIG_IKCONFIG_PROC=y

modprobe -rv configs
rmmod configs

ll /proc/config.gz
ls: cannot access '/proc/config.gz': No such file or directory

modinfo configs
filename:       /lib/modules/6.6.7/kernel/kernel/configs.ko
description:    Echo the kernel .config file used to build the kernel
author:         Randy Dunlap
license:        GPL
depends:
retpoline:      Y
intree:         Y
name:           configs
vermagic:       6.6.7 SMP preempt mod_unload