嵌入式Linux應用與開發——內核配置選項含Linux最新版本kernel下載後續操作

下載官網的最新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

  1. 常規設置
  2. 模塊和快設備選項
  3. 處理器類型及特性
  4. 網絡協議相關選項
  5. 設備驅動選項
  6. 文件系統類型選項

今日寫文背景音樂《悅神》

一場盛世繁華 若指尖沙 似傳說的話
廟堂高牆的畫 吹落的剎那
雨中紅傘探白花 華服金面高樓下
一念間 桃源已成飛沙
上元燈火漫天 千山萬水瀲灩
白衣蹁躚 仗劍執花 天下妄言
從此他這一眼
猶記了千百年
滄海變 桑田間 而今 再相見
紅蓮赤焰 莫問 是鬼 還是仙
芳心只一劍如何能救萬千
彼時 金枝玉葉 斜冠散發問蒼天
身在無間 心亦在無間
褪去華服金面 這人間已換了多少家
紅葉吹落輕紗 看落日殘霞
雨中紅傘探白花 華服金面高樓下
一念間 桃源已成飛沙
月夕言笑晏晏 悅神明燈三千
布衣草笠 白綾雙枷 天下未言
回首夢已闌珊 衆生盡皆漠然
萬世千秋 不如他 一眼經年
紅蓮赤焰 莫問 是鬼 還是仙
芳心只一劍如何能救萬千
彼時 金枝玉葉 斜冠散發問蒼天
身在無間 心亦在無間
神窟千面 是愛是恨 還是憐
歲歲復年年 誰在耳邊輕言
紅葉蒼山 方見花開滿城 一念間
千燈觀前 與君話桃源

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章