ubuntu 使用 git 构建内核并更改源代码,如何忽略“无法表示的源代码更改”错误

ubuntu 使用 git 构建内核并更改源代码,如何忽略“无法表示的源代码更改”错误

我修改了 i915 源代码中的一个源文件。我刚刚编辑了该文件并对其中一行进行了更改。

我没有制作补丁文件,因为我不知道该怎么做。当我用

make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-custom

make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-custom -i

我明白了

 update-version-dkms
dpkg-source: info: use the '3.0 (quilt)' format to have separate and documented changes to upstream files, see dpkg-source(1)
dpkg-source: error: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -i.git -b ubuntu-bionic subprocess returned exit status 1
scripts/package/Makefile:71: recipe for target 'deb-pkg' failed
make[1]: [deb-pkg] Error 1 (ignored)

然后我将该更改提交到新分支并签出标准标记(标准上游版本)。之前它可以构建。现在不行,同样的错误。

这里的答案暗示了一些坏文件(例如 vim 交换文件),但我无法弄清楚问题可能是什么:尝试解构已修改的软件包时出现“dpkg-source:无法表示的源更改” 对我没有帮助。

答案1

啊,我的本地更改是一个转移注意力的手段。不知何故,在源代码树的一部分中添加了一个 Python 脚本,某种调试助手。

修复方法:1 按照此处的说明从工作树中删除所有未跟踪的文件

https://koukia.ca/how-to-remove-local-untracked-files-from-the-current-git-branch- 571c6ce9b6b1

我做到了

To remove ignored and non-ignored files, run git clean -f -x or git clean -fx
  1. 返回此处的说明: https://wiki.ubuntu.com/KernelTeam/GitKernelBuild

在步骤4中,复制配置。

然后它就构建好了。

这些是我完整的笔记。其中一些步骤是不必要的,但它们不会造成任何伤害。显然,忽略那些挑挑拣拣的。

fakeroot debian/rules clean
cp /boot/config-`uname -r` .config
yes '' | make oldconfig
make clean
#remove the non git files
git clean -f
rm vmlinux-gdb.py
#make sure there is no linux*.tar too
rm ../linux*.gz

#cherry pick RC6 hack
git cherry-pick 0c6b6fa52c6ad54332eed64acb6aebc59f75e0b2

#
make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-custom
cd ..

相关内容