【 以下文字转载自 KernelTech 讨论区 】
发信人: atzlinux (atzlinux), 信区: KernelTech
标 题: 制作最新的 linux-firmware deb 包 《铜豌豆 Linux》原创
发信站: 水木社区 (Sat Mar 21 11:01:27 2020), 转信
最近遇到一个安装内核报缺少 firmware 固件问题,详情见:
https://gitee.com/atzlinux/debian-cn/issues/I1BVNN
整理的制作最新版 linux-firmware deb 包的笔记如下:
clone 如下两个 git 仓库:
git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
https://salsa.debian.org/kernel-team/firmware-nonfree.git安装编译相关包:
apt -y install linux-support-4.19.0-8
接下来的操作在 firmware-nonfree 目录下进行
cd firmware-nonfree
修改内核版本号文件:
debian/rules.defs
KERNELVERSION := 4.19.0-8
检查在 linux-firmware.git 里面,有哪些 fw 是新添加的:
debian/bin/check_upstream.py ../linux-firmware
拷贝文件:
cp -rpv ../linux-firmware/* ./
更新本地文件和符号链接:
./copy-firmware.sh ./
生成制作 deb 包所需要的 control 文件:
debian/rules debian/control
由于版本更新,执行该命令可能有报错输出,如:
/usr/bin/make -f debian/rules debian/control-real
make[1]: 进入目录“/home/atzlinux/devel/firmware-nonfree”
debian/bin/gencontrol.py /usr/src/linux-support-4.19.0-8
W: iwlwifi: unused files: iwlwifi-7260-14.ucode-25.30.14.0 iwlwifi-7265-14.ucode-25.30.14.0 iwlwifi-8000C-14.ucode-25.30.14.0 iwlwifi-3160-14.ucode-25.30.14.0 iwlwifi-7265D-14.ucode-25.30.14.0
Traceback (most recent call last):
File "debian/bin/gencontrol.py", line 391, in <module>
GenControl()()
File "debian/bin/gencontrol.py", line 150, in __call__
self.do_main(packages, makefile)
File "debian/bin/gencontrol.py", line 189, in do_main
self.do_package(packages, makefile, package, vars.copy(), makeflags.copy())
File "debian/bin/gencontrol.py", line 288, in do_package
f, f_real, version = files_real[f]
KeyError: 'cxgb4/t4fw-1.23.4.0.bin'
make[1]: *** [debian/rules:49:debian/control-real] 错误 1
make[1]: 离开目录“/home/atzlinux/devel/firmware-nonfree”
make: *** [debian/rules:42:debian/control] 错误 2
像以上的错误,发现 cxgb4 目录下,并没有 t4fw-1.23.4.0.bin 文件,但有更新的 t4fw-1.24.11.0.bin 文件。需要修改 debian/config/misc-nonfree/defines 文件,更新相应条目。
然后重新运行 debian/rules debian/control
This target is made to fail intentionally, to make sure
that it is NEVER run during the automated build. Please
ignore the following error, the debian/control file has
been generated SUCCESSFULLY.
exit 1
make[1]: *** [debian/rules:57:debian/control-real] 错误 1
make[1]: 离开目录“/home/atzlinux/devel/firmware-nonfree”
make: *** [debian/rules:42:debian/control] 错误 2
出现这样的提示,表示 control 正确生成。
生成最新的 changelog 日志:
PYTHONPATH=/usr/share/linux-support-4.19.0-8/lib/python/ debian/bin/release-update ../linux-firmware 20200316
按原有格式,修改更新相应的 debian/config/×/defines 文件
构建软件包:
dpkg-buildpackage -b
--
FROM 112.97.53.*