我正在尝试linux-5.12
在我的 ubuntu 20.04.1 上编译最新的内核。我已经安装了必要的依赖项sudo apt install build-essential rsync gcc bc bison libssl-dev libncurses5-dev libelf-dev
并将配置文件复制cp /boot/config - $(uname -r) ./.config
到我的位置。
执行此命令时make deb-pkg
,我收到以下错误,即使我尝试了在线解决方案,也无济于事。请帮我解决这个问题。
谢谢
make clean
CLEAN arch/x86/tools
sh ./scripts/package/mkdebian
TAR linux-5.12.0.tar.gz
origversion=$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$//');\
mv linux-5.12.0.tar.gz ../linux-5.12.0_${origversion}.orig.tar.gz
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch) -i.git -us -uc
dpkg-buildpackage: info: source package linux-5.12.0
dpkg-buildpackage: info: source version 5.12.0-1
dpkg-buildpackage: info: source distribution focal
dpkg-buildpackage: info: source changed by amulbhatia <amulbhatia@amulbhatia>
dpkg-buildpackage: info: host architecture amd64
dpkg-source -i.git --before-build .
debian/rules clean
rm -rf debian/*tmp debian/files
make clean
dpkg-source -i.git -b .
dpkg-source: info: using source format '1.0'
dpkg-source: warning: source directory 'linux-5.12' is not <sourcepackage>-<upstreamversion> 'linux-5.12.0-5.12.0'
dpkg-source: warning: .orig directory name linux-5.12.orig is not <package>-<upstreamversion> (wanted linux-5.12.0-5.12.0.orig)
dpkg-source: info: building linux-5.12.0 using existing linux-5.12.0_5.12.0.orig.tar.gz
dpkg-source: info: building linux-5.12.0 in linux-5.12.0_5.12.0-1.diff.gz
dpkg-source: warning: ignoring deletion of file .scmversion
dpkg-source: warning: the diff modifies the following upstream files:
.clang-format
.cocciconfig
.config.old
.get_maintainer.ignore
.mailmap
CREDITS
MAINTAINERS
README
dpkg-source: info: use the '3.0 (quilt)' format to have separate and documented changes to upstream files, see dpkg-source(1)
dpkg-source: info: building linux-5.12.0 in linux-5.12.0_5.12.0-1.dsc
dpkg-source: warning: missing information for output field Standards-Version
debian/rules binary
make KERNELRELEASE=5.12.0 ARCH=x86 KBUILD_BUILD_VERSION=1 -f ./Makefile
SYSHDR arch/x86/include/generated/uapi/asm/unistd_32.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_64.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_x32.h
SYSTBL arch/x86/include/generated/asm/syscalls_32.h
SYSHDR arch/x86/include/generated/asm/unistd_32_ia32.h
SYSHDR arch/x86/include/generated/asm/unistd_64_x32.h
SYSTBL arch/x86/include/generated/asm/syscalls_64.h
HYPERCALLS arch/x86/include/generated/asm/xen-hypercalls.h
HOSTCC scripts/basic/fixdep
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
HOSTLD arch/x86/tools/relocs
HOSTCC scripts/genksyms/genksyms.o
YACC scripts/genksyms/parse.tab.[ch]
HOSTCC scripts/genksyms/parse.tab.o
LEX scripts/genksyms/lex.lex.c
HOSTCC scripts/genksyms/lex.lex.o
HOSTLD scripts/genksyms/genksyms
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/bin2c
HOSTCC scripts/kallsyms
HOSTCC scripts/sorttable
HOSTCC scripts/asn1_compiler
HOSTCC scripts/sign-file
HOSTCC scripts/extract-cert
HOSTCC scripts/insert-sys-cert
GEN include/generated/autoksyms.h
ERROR: '/home/amulbhatia/Desktop/linux_kernel/linux-5.12/y' whitelist file not found
make[3]: *** [Makefile:1189: include/generated/autoksyms.h] Error 1
make[2]: *** [debian/rules:7: build-arch] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make[1]: *** [scripts/Makefile.package:77: deb-pkg] Error 2
make: *** [Makefile:1579: deb-pkg] Error 2
答案1
我正在发布上述问题的可能答案。尽管答案可能不是直接答案。
linux-5.11.6
我从中获取了稳定版本kernel.org
并成功编译。
linux-5.12
是主线版本,可能缺少一些文件,因为它不是当天的稳定版本。
- 如果您发现与此问题更相关的内容,请建议我更新答案。
答案2
您的答案是正确的,但操作系统遗漏了一些东西,请尝试卸载这些软件包并重新安装它们。我的系统上也遇到了同样的问题,我执行了“sudo apt install build-essential rsync gcc bc bison libssl-dev libncurses5-dev libelf-dev”,它修复了这个问题,所以可能是缺少了一个软件包。希望这对您有所帮助。