下载官网的最新Linux内核版本,Linux虚拟机中Ubuntu 下载速度慢,更换镜像源后使下载速度正常。这是一个.tar.xz文件,我们要先来解压它。下面是下载内核解压文件编译内核配置内核的全过程。由于我们并没有正确的写好相关配置文件,我们的内核编译是失败的。
First,we would like to download the latest Linux kernel from Linux website .It seems that we could choose some old versions with smaller size but we prefer to using the latest one firstly.
xz -d linux-5.7.tar.xz
tar -xvf linux-5.7.tar
After decompressing the file, we would like to explore it.
cd linux-5.7/
ls
Here we have met a problem after entering make menuconfig
in the terminal .We can not open the Linux kernel configuration window.
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ make menuconfig
HOSTCC scripts/basic/fixdep
UPD scripts/kconfig/mconf-cfg
HOSTCC scripts/kconfig/mconf.o
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
/bin/sh: 1: flex: not found
scripts/Makefile.host:9: recipe for target 'scripts/kconfig/lexer.lex.c' failed
make[1]: *** [scripts/kconfig/lexer.lex.c] Error 127
Makefile:588: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2
We should compile successfully before configuring.
We have met several menu before and we are worried that we might change something important so we have not modified them.
先把问题放在这里,我们的内核配置选项特别多,我们先来学习相关内容然后再回头解决编译出错的问题。在学习之前,我们可以探索一下相应的内容。
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ ls
arch CREDITS fs Kbuild LICENSES net security virt
block crypto include Kconfig MAINTAINERS README sound
certs Documentation init kernel Makefile samples tools
COPYING drivers ipc lib mm scripts usr
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ cd boot
bash: cd: boot: 没有那个文件或目录
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ cd tools
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/tools$ ls
accounting cgroup gpio kvm memory-model perf thermal wmi
arch debugging hv laptop nfsd power time
bootconfig edid iio leds objtool scripts usb
bpf firewire include lib pci spi virtio
build firmware io_uring Makefile pcmcia testing vm
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/tools$ cd ..
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ cd arch
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/arch$ ls
alpha arm64 h8300 Kconfig mips openrisc riscv sparc x86
arc c6x hexagon m68k nds32 parisc s390 um xtensa
arm csky ia64 microblaze nios2 powerpc sh unicore32
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/arch$ cd bootconfig
bash: cd: bootconfig: 没有那个文件或目录
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/arch$ cd ..
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ cd arch
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/arch$ ls
alpha arm64 h8300 Kconfig mips openrisc riscv sparc x86
arc c6x hexagon m68k nds32 parisc s390 um xtensa
arm csky ia64 microblaze nios2 powerpc sh unicore32
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/arch$ cd ..
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ ls
arch CREDITS fs Kbuild LICENSES net security virt
block crypto include Kconfig MAINTAINERS README sound
certs Documentation init kernel Makefile samples tools
COPYING drivers ipc lib mm scripts usr
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ cd drivers
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/drivers$ ls
accessibility dio iio mtd ps3 tc
acpi dma infiniband mux ptp tee
amba dma-buf input net pwm thermal
android edac interconnect nfc rapidio thunderbolt
ata eisa iommu ntb ras tty
atm extcon ipack nubus regulator uio
auxdisplay firewire irqchip nvdimm remoteproc usb
base firmware isdn nvme reset vdpa
bcma fpga Kconfig nvmem rpmsg vfio
block fsi leds of rtc vhost
bluetooth gnss lightnvm opp s390 video
bus gpio macintosh oprofile sbus virt
cdrom gpu mailbox parisc scsi virtio
char greybus Makefile parport sfi visorbus
clk hid mcb pci sh vlynq
clocksource hsi md pcmcia siox vme
connector hv media perf slimbus w1
counter hwmon memory phy soc watchdog
cpufreq hwspinlock memstick pinctrl soundwire xen
cpuidle hwtracing message platform spi zorro
crypto i2c mfd pnp spmi
dax i3c misc power ssb
dca ide mmc powercap staging
devfreq idle most pps target
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/drivers$ cd ..
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7$ cd fs
(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~/下载/linux-5.7/fs$ ls
9p d_path.c iomap posix_acl.c
adfs drop_caches.c io_uring.c proc
affs ecryptfs io-wq.c proc_namespace.c
afs efivarfs io-wq.h pstore
aio.c efs isofs qnx4
anon_inodes.c erofs jbd2 qnx6
attr.c eventfd.c jffs2 quota
autofs eventpoll.c jfs ramfs
bad_inode.c exec.c Kconfig readdir.c
befs exfat Kconfig.binfmt read_write.c
bfs exportfs kernfs reiserfs
binfmt_aout.c ext2 libfs.c romfs
binfmt_elf.c ext4 lockd select.c
binfmt_elf_fdpic.c f2fs locks.c seq_file.c
binfmt_em86.c fat Makefile signalfd.c
binfmt_flat.c fcntl.c mbcache.c splice.c
binfmt_misc.c fhandle.c minix squashfs
binfmt_script.c file.c mount.h stack.c
block_dev.c filesystems.c mpage.c stat.c
btrfs file_table.c namei.c statfs.c
buffer.c freevxfs namespace.c super.c
cachefiles fscache nfs sync.c
ceph fs_context.c nfs_common sysfs
char_dev.c fsopen.c nfsd sysv
cifs fs_parser.c nilfs2 timerfd.c
coda fs_pin.c nls tracefs
compat_binfmt_elf.c fs_struct.c no-block.c ubifs
compat.c fs_types.c notify udf
configfs fs-writeback.c nsfs.c ufs
coredump.c fuse ntfs unicode
cramfs gfs2 ocfs2 userfaultfd.c
crypto hfs omfs utimes.c
dax.c hfsplus open.c vboxsf
dcache.c hostfs openpromfs verity
dcookies.c hpfs orangefs xattr.c
debugfs hugetlbfs overlayfs xfs
devpts inode.c pipe.c zonefs
direct-io.c internal.h pnode.c
dlm ioctl.c pnode.h
- 常规设置
- 模块和快设备选项
- 处理器类型及特性
- 网络协议相关选项
- 设备驱动选项
- 文件系统类型选项
今日写文背景音乐《悦神》
一场盛世繁华 若指尖沙 似传说的话
庙堂高墙的画 吹落的刹那
雨中红伞探白花 华服金面高楼下
一念间 桃源已成飞沙
上元灯火漫天 千山万水潋滟
白衣蹁跹 仗剑执花 天下妄言
从此他这一眼
犹记了千百年
沧海变 桑田间 而今 再相见
红莲赤焰 莫问 是鬼 还是仙
芳心只一剑如何能救万千
彼时 金枝玉叶 斜冠散发问苍天
身在无间 心亦在无间
褪去华服金面 这人间已换了多少家
红叶吹落轻纱 看落日残霞
雨中红伞探白花 华服金面高楼下
一念间 桃源已成飞沙
月夕言笑晏晏 悦神明灯三千
布衣草笠 白绫双枷 天下未言
回首梦已阑珊 众生尽皆漠然
万世千秋 不如他 一眼经年
红莲赤焰 莫问 是鬼 还是仙
芳心只一剑如何能救万千
彼时 金枝玉叶 斜冠散发问苍天
身在无间 心亦在无间
神窟千面 是爱是恨 还是怜
岁岁复年年 谁在耳边轻言
红叶苍山 方见花开满城 一念间
千灯观前 与君话桃源