我在使用 Trusty 的 Linux 3.13 时遇到了困难,但这是另一个话题(http://www.mail-archive.com/[电子邮件保护]/msg06775.html),因此,我决定从 Utopic 反向移植 Linux 3.16。
另外,我需要用我的 GPG 密钥签署我的 Linux 版本,然后将其上传到我的 PPA,但首先,我无法将 +1 提升到 Linuxrevision
版本...有人可以帮我吗?!
以下是手动反向移植的过程(按原样工作,无需将revision
版本提升 +1):
指示来自:https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
1-将 Utopic 的 deb-src 添加到 Trusty 的 sources.list:
deb-src http://us.archive.ubuntu.com/ubuntu/ utopic main restricted universe multiverse
2-运行以下命令:
mkdir ~/linux/source -p
cd ~/linux/source
sudo apt-get install fakeroot
sudo apt-get build-dep linux
apt-get source linux
cd linux-3.16.0/
debuild -uc -us
cd ..
sudo dpkg -i linux-headers-3.16.0-4_3.16.0-4.9_all.deb linux-headers-3.16.0-4-generic_3.16.0-4.9_amd64.deb linux-image-3.16.0-4-generic_3.16.0-4.9_amd64.deb linux-image-extra-3.16.0-4-generic_3.16.0-4.9_amd64.deb
3- 完成!Utopic 的 Linux 3.16 已编译并安装到 Trusty 中!第一阶段完成...
但是现在,我需要将其revision
版本升级到类似这样的版本:“3.16.0-5.0”。使用我的 GPG 对其进行签名并将其上传到我的 PPA。
然后,为了实现这一点,在编译和打包之前,我编辑了“debian changelog”文件:
cd linux-3.16.0/
vi debian.master/changelog
...加上:
linux (3.16.0-5.0) trusty; urgency=low
[ Thiago Martins ]
* Backporting it to Trusty
-- Thiago Martins <[email protected]> Sat, 19 Jul 2014 20:42:13 -0300
现在,该命令debuild
无法打包,在过程接近尾声时出现以下错误:
debuild
...
Use of uninitialized value $filename in concatenation (.) or string at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 410.
dh_systemd_start
Can't stat debian/linux-tools-3.16.0-5: No such file or directory
at /usr/bin/dh_systemd_start line 127.
Can't stat debian/linux-cloud-tools-3.16.0-5: No such file or directory
at /usr/bin/dh_systemd_start line 127.
Can't stat debian/linux-image-3.16.0-5-generic: No such file or directory
at /usr/bin/dh_systemd_start line 127.
Can't stat debian/linux-image-extra-3.16.0-5-generic: No such file or directory
...
...
Can't stat debian/vlan-modules-3.16.0-5-generic-di: No such file or directory
at /usr/bin/dh_systemd_start line 127.
Can't stat debian/ipmi-modules-3.16.0-5-generic-di: No such file or directory
at /usr/bin/dh_systemd_start line 127.
Debug: install-indep
Debug: binary-indep
dh_installchangelogs -i
dh_installdocs -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
flock -w 60 /home/tmartins/linux/source/linux-3.16.0/debian/.LOCK dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
dpkg-deb: building package `linux-source-3.16.0' in `../linux-source-3.16.0_3.16.0-5.0_all.deb'.
dpkg-deb: building package `linux-doc' in `../linux-doc_3.16.0-5.0_all.deb'.
dpkg-deb: building package `linux-headers-3.16.0-5' in `../linux-headers-3.16.0-5_3.16.0-5.0_all.deb'.
dpkg-deb: building package `linux-tools-common' in `../linux-tools-common_3.16.0-5.0_all.deb'.
dpkg-deb: building package `linux-cloud-tools-common' in `../linux-cloud-tools-common_3.16.0-5.0_all.deb'.
Debug: install-perarch
# Add the tools.
...
...
dpkg-deb: building package `linux-tools-3.16.0-5' in `../linux-tools-3.16.0-5_3.16.0-5.0_amd64.deb'.
dh_strip -plinux-cloud-tools-3.16.0-5
dh_installchangelogs -plinux-cloud-tools-3.16.0-5
dh_installdocs -plinux-cloud-tools-3.16.0-5
dh_compress -plinux-cloud-tools-3.16.0-5
dh_fixperms -plinux-cloud-tools-3.16.0-5
dh_shlibdeps -plinux-cloud-tools-3.16.0-5
dh_installdeb -plinux-cloud-tools-3.16.0-5
flock -w 60 /home/tmartins/linux/source/linux-3.16.0/debian/.LOCK dh_gencontrol -plinux-cloud-tools-3.16.0-5
dh_md5sums -plinux-cloud-tools-3.16.0-5
dh_builddeb -plinux-cloud-tools-3.16.0-5
dpkg-deb: building package `linux-cloud-tools-3.16.0-5' in `../linux-cloud-tools-3.16.0-5_3.16.0-5.0_amd64.deb'.
Debug: module-check-generic
install -d /home/tmartins/linux/source/linux-3.16.0/debian.master/abi/3.16.0-5.0/amd64
find /home/tmartins/linux/source/linux-3.16.0/debian/build/build-generic/ -name \*.ko | \
sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > /home/tmartins/linux/source/linux-3.16.0/debian.master/abi/3.16.0-5.0/amd64/generic.modules
II: Checking modules for generic...previous or current modules file missing!
/home/tmartins/linux/source/linux-3.16.0/debian.master/abi/3.16.0-5.0/amd64/generic.modules
/home/tmartins/linux/source/linux-3.16.0/debian.master/abi/3.16.0-4.9/amd64/generic.modules
make: *** [module-check-generic] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc failed
我还需要做哪些更改才能将我的 Linux 发行版本提升为 +1(从 4.9 到 5.0)?所以,debuild
过程会顺利完成...我认为这与某些事情有关abi
,但我不是 Ubuntu Linux 内核维护者(或程序员),所以,我不知道如何从这里继续...
我非常感谢您的帮助!
提前致谢!
答案1
构建在模块检查时失败,我认为这是因为/home/tmartins/linux/source/linux-3.16.0/debian.master/abi/3.16.0-4.9
不存在。您可以使用skipmodule=true
参数跳过检查。当我使用构建时fakeroot debian/rules
,我将执行以下操作:
$ fakeroot debian/rules binary-headers binary-generic skipmodule=true
此参数也应适用于debuild
。
但在后期,构建可能会在 ABI 检查时再次失败,因此您也必须使用skipabi=true
,因此完整命令将变成:
$ fakeroot debian/rules binary-headers binary-generic skipmodule=true skipabi=true
答案2
当我尝试构建自己的 Ubuntu 内核时遇到了同样的错误。
我已将 debian.master/changelog 更新为:
linux (3.13.0-107.154+studog-01) trusty; urgency=low
构建失败(解释一下,我丢失了原始输出):
find /home/studog/linux-3.16.0/debian/build/build-generic/ -name \*.ko | \
sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > /home/studog/linux-3.16.0/debian.master/abi/3.16.0-studog-0.0/amd64/generic.modules
II: Checking modules for generic...previous or current modules file missing!
请注意,尝试的路径引用中的外版本不太正确,尽管正确的路径(debian.master/abi/3.13.0-107.154+studog-01)确实存在。我将变更日志改为
linux (3.13.0-107.154+studog01) trusty; urgency=low
并且成功了。看来构建系统不喜欢包含破折号的额外版本。
Anthony Wong 使用 skipmodule 和 skipabi 的解决方法也成功解决了该问题,但我更喜欢更换额外版本。