日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux kernel defconfig和.config

發布時間:2023/12/15 linux 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux kernel defconfig和.config 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在Linux內核里,編譯內核文件時,先要配置.config文件,然后Makefile在編譯時通過讀取.config文件的配置來選擇要編譯的文件,選擇驅動的加載方式。
  • xxx_defconfig 一般在arch/arm64/configs/目錄下,是一個沒有展開的內核配置,需要配合Kconfig展開成.config
  • 從defconfig到.config不是簡單的復制操作,而是make?ARCH=arm64?defconfig
  • .confg也不是直接拷貝成defconfig,而是使用make ARCH=arm64 savedefconfig
正確使用和保存deconfig的流程: 要修改在arch/arm/configs下的文件xxx_defconfig 2. make ARCH=arm64 xxx_defconfig 會生成.config文件 3. make ARCH=arm64 menuconfig 修改配置后保存 4. make ARCH=arm64 savedefconfig 生成defconfg文件 5. cp defconfig arch/arm/configs/xxx_defconfig 保存 這樣保存的defconfig文件,配置最小化,且日后能恢復成.config。 .config All config symbol values are saved in a special file called?.config. Every time you want to change a kernel compile configuration, you execute a make target, such as?menuconfig?or?xconfig. These read the?Kconfig?files to create the menus and update the config symbols' values using the values defined in the?.config?file. Additionally, these tools update the?.config?file with the new options you chose and also can generate one if it didn't exist before. Because the?.config?file is plain text, you also can change it without needing any specialized tool. It is very convenient for saving and restoring previous kernel compilation configurations as well. deconfig The?.config?file is not simply copied from your?defconfig?file. The motivation for storing?defconfig?in such a format is next: in?defconfig?we can only specify options with non-default values (i.e. options we changed for our board). This way we can keep it small and clear. Every new kernel version brings a bunch of new options, and this way we don't need to update our?defconfig?file each time the kernel releases. Also, it should be mentioned that kernel build system keeps very specific order of options in?defconfig?file, so it's better to avoid modifying it by hand. Instead you should use?make savedefconfig?rule. When?.config?file is being generated, kernel build system goes through all?Kconfig?files (from all subdirs), checking all options in those?Kconfig?files:
  • if option is mentioned in?defconfig, build system puts that option into?.config?with value chosen in?defconfig
  • if option isn't mentioned in?defconfig, build system puts that option into?.config?using its default value, specified in corresponding?Kconfig
根據上述描述,xxx_deconfig中只保存那些沒有默認值的option(但被用戶修改過的option除外,如config_xxx默認值為y,但是被用戶修改為n,那么config_xxx將被保存進deconfig),因為有默認值的option保存在Kconfig中,沒必要重復保存。 配置menuconfig后查看config變化 diff .config .config.old

總結

以上是生活随笔為你收集整理的linux kernel defconfig和.config的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。