Linux kernel 在18.04.1-Ubuntu下的VirtualBox中构建最新linux内核时出错
我正在尝试使用Oracel VM和18.04.1-Ubuntu映像构建最新的Linux内核() 我安装了需要的软件包,可能还有更多。以下是我安装的软件包的一部分:Linux kernel 在18.04.1-Ubuntu下的VirtualBox中构建最新linux内核时出错,linux-kernel,virtualbox,building,Linux Kernel,Virtualbox,Building,我正在尝试使用Oracel VM和18.04.1-Ubuntu映像构建最新的Linux内核() 我安装了需要的软件包,可能还有更多。以下是我安装的软件包的一部分: sudo apt-get update sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc bison flex libelf-def kernel-package 可以找到完整的列表 从GitHub克隆存储库后,我
sudo apt-get update
sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc bison flex libelf-def kernel-package
可以找到完整的列表
从GitHub克隆存储库后,我在linux
文件夹中运行了以下命令
$ cp /boot/config-$(uname -r) .config
$ make menuconfig
scripts/kconfig/mconf Kconfig
.config:1118:warning: symbol value 'm' invalid for NF_CT_PROTO_GRE
.config:1923:warning: symbol value 'm' invalid for NET_DEVLINK
.config:7865:warning: symbol value 'm' invalid for ASHMEM
.config:8724:warning: symbol value 'm' invalid for ANDROID_BINDER_IPC
.config:8725:warning: symbol value 'm' invalid for ANDROID_BINDERFS
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
我保存并退出menuconfig
。并最终导致以下错误
$ make -j2
Makefile:608: include/config/auto.conf: No such file or directory
Makefile:660: include/config/auto.conf.cmd: No such file or directory
HOSTCC scripts/kconfig/conf.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --syncconfig Kconfig
*** Error during sync of the configuration.
scripts/kconfig/Makefile:73: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Error 1
Makefile:562: recipe for target 'syncconfig' failed
make[1]: *** [syncconfig] Error 2
Makefile:678: recipe for target 'include/config/auto.conf.cmd' failed
make: *** [include/config/auto.conf.cmd] Error 2
make: *** Deleting file 'include/config/auto.conf.cmd'
看起来make需要一些额外的配置文件include/config/auto.conf
。有人能给我一个线索吗
谢谢 试图将内核5.6.3编译为非根目录,我遇到了这个问题。 根据奥迪的评论提出建议
git clean -xdf
发现我的源代码树中有root所有的文件,无法删除。看看我的历史我发现
sudo make localmodconfig # DO NOT DO THIS
在include/config/*
和include/generated/autoconf.h
中以root用户身份安装了文件
要查看是否存在相同的问题,请运行
sudo find . -uid 0
或者只需查看git clean-xdf的错误消息(应该没有)
删除root拥有的所有文件和目录后,我通过以下操作从死锁中恢复:
unset ARCH
cp .config ../config.backup # If you still have this.
git clean -xdf # No errors (this also deletes .config)
cp ../config.backup .config # Or generate a new one *).
make olddefconfig # Printed at the end: 'No change to .config'
请注意,我需要从我的环境中清除ARCH
在这之后我像往常一样继续
VERSION=5.6.3 # I have checked out tag v5.6.3 **)
FLAVOUR=lowlatlocxhci # Or whatever you want to call your kernel.
make -j8 deb-pkg LOCALVERSION=-$FLAVOUR
sudo dpkg -i ../linux-headers-$VERSION-${FLAVOUR}_$VERSION-$FLAVOUR-1_amd64.deb ../linux-image-$VERSION-${FLAVOUR}_$VERSION-${FLAVOUR}-1_amd64.deb
最后一个命令目前无法编译virtualbox内核模块,但我不关心这些,这些错误可以忽略(只要不使用virtual box)
*)所使用的.config是通过引导到包含所有内容的内核(即dist.kernel),将其配置从/boot复制到源代码树,并在确保所有需要的内核模块都已加载(通过运行导致加载此类模块的应用程序)后运行makelocalmodconfig
来准备的。最后运行makemenuconfig
关闭这个内核中的CONFIG\u DEBUG\u INFO
,并将一些通常内置到内核中的东西也转换成模块(出于某种原因我需要这些模块)
**)我的git树已准备好:
VERSION=5.6.3
FLAVOUR=lowlatlocxhci
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-$VERSION-$FLAVOUR-$VERSION-$FLAVOUR
cd linux-$VERSION-$FLAVOUR-$VERSION-$FLAVOUR
git checkout -b test_$FLAVOUR v$VERSION
# Make manual changes here, and commit as usual.
git-clean-xdf;出口拱=。。。;cp/boot/config-$(uname-r).config;制作olddefconfig;make-j2
Nope,不工作$make olddefconfig Makefile:555:arch/../Makefile:没有这样的文件或目录make:**没有规则使目标为'arch/../Makefile'。停下来。
当然可以。您必须应用要为其构建的体系结构,而不是。
。因此,我使用export ARCH=x86_64
尝试了所描述的过程,这仍然导致Makefile:608:include/config/auto.conf:在同步配置期间没有这样的文件或目录脚本/kconfig/conf--syncconfig kconfig***错误
export ARCH=ia64
也不起作用,但我在make olddefconfig
过程中已经出现错误。