在ububtu 18.04製作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-xxx-x

接下來的操作在 firmware-nonfree 目錄下進行
cd firmware-nonfree

修改內核版本號文件:
debian/rules.defs

KERNELVERSION := xxx-x

檢查在 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
...
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]
...
像以上的錯誤,發現 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
...

出現這樣的提示,表示 control 正確生成。

生成最新的 changelog 日誌:
PYTHONPATH=/usr/share/linux-support-xxx-x/lib/python/ debian/bin/release-update ../linux-firmware 20200329

按原有格式,修改更新相應的 debian/config/×/defines 文件

構建軟件包:
dpkg-buildpackage -b
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章