Loading
The issue:
- It’s been 20 years since:
- I last wrote >1K of C code
- compiled anything >10K source lines
- My current Distro’s support (Ubuntu 16.04) for an
0cf3:e300 Atheros Communications, Inc.
WiFi driver is abysmal: 8-12Mbps is the best I get.
What I know about kernel version priorities:
- Use your own distro’s kernel (out of the question: just too slow)
- Use the latest stable kernel
- Use the latest LTS kernel
What I’ve tried:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
git checkout -b stable v5.1.2
cp /boot/config-`uname -r` .config
yes '' | make oldconfig
make -j `getconf _NPROCESSORS_ONLN\' deb-pkg LOCALVERSION=-fab
Which gives me the following error:
dpkg-source: error: cannot represent change to vmlinux-gdb.py:
dpkg-source: error: new version is symlink to /home/fab-user/Documents/Source/linux/scripts/gdb/vmlinux-gdb.py
dpkg-source: error: old version is nonexistent
in the following full output:
make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-fab
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
YACC scripts/kconfig/parser.tab.h
YACC scripts/kconfig/parser.tab.c
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --syncconfig Kconfig
UPD include/config/kernel.release
make clean
/bin/bash ./scripts/package/mkdebian
TAR linux-5.1.2-fab.tar.gz
origversion=$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$//');\
mv linux-5.1.2-fab.tar.gz ../linux-5.1.2-fab_${origversion}.orig.tar.gz
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch) -i.git -us -uc
dpkg-buildpackage: source package linux-5.1.2-fab
dpkg-buildpackage: source version 5.1.2-fab-1
dpkg-buildpackage: source distribution xenial
dpkg-buildpackage: source changed by fab-user <fab-user@fab-ux-predator>
dpkg-buildpackage: host architecture amd64
dpkg-source -i.git --before-build linux
fakeroot -u debian/rules clean
rm -rf debian/*tmp debian/files
make clean
dpkg-source -i.git -b linux
dpkg-source: info: using source format '1.0'
dpkg-source: warning: source directory 'linux' is not <sourcepackage>-<upstreamversion> 'linux-5.1.2-fab-5.1.2-fab'
dpkg-source: warning: .orig directory name linux.orig is not <package>-<upstreamversion> (wanted linux-5.1.2-fab-5.1.2-fab.orig)
dpkg-source: info: building linux-5.1.2-fab using existing linux-5.1.2-fab_5.1.2-fab.orig.tar.gz
dpkg-source: info: building linux-5.1.2-fab in linux-5.1.2-fab_5.1.2-fab-1.diff.gz
dpkg-source: error: cannot represent change to vmlinux-gdb.py:
dpkg-source: error: new version is symlink to /home/fab-user/Documents/Source/linux/scripts/gdb/vmlinux-gdb.py
dpkg-source: error: old version is nonexistent
dpkg-source: warning: ignoring deletion of file .scmversion, use --include-removal to override
dpkg-source: error: cannot represent change to linux-5.1.1-fab.tar.gz: binary file contents changed
dpkg-source: warning: the diff modifies the following upstream files:
.clang-format
.cocciconfig
.config.old
.get_maintainer.ignore
.mailmap
.version
CREDITS
LICENSES/exceptions/GCC-exception-2.0
LICENSES/exceptions/Linux-syscall-note
LICENSES/other/Apache-2.0
LICENSES/other/CDDL-1.0
LICENSES/other/GPL-1.0
LICENSES/other/ISC
LICENSES/other/Linux-OpenIB
LICENSES/other/MPL-1.1
LICENSES/other/X11
LICENSES/preferred/BSD-2-Clause
LICENSES/preferred/BSD-3-Clause
LICENSES/preferred/BSD-3-Clause-Clear
LICENSES/preferred/GPL-2.0
LICENSES/preferred/LGPL-2.0
LICENSES/preferred/LGPL-2.1
LICENSES/preferred/MIT
MAINTAINERS
Module.symvers
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: error: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -i.git -b linux gave error exit status 1
scripts/package/Makefile:70: recipe for target 'deb-pkg' failed
make[1]: *** [deb-pkg] Error 1
Makefile:1396: recipe for target 'deb-pkg' failed
make: *** [deb-pkg] Error 2
so I ended up doing:
git checkout -b v4.19.38 v4.19.38
which gives me up to 10MB/S instead of my distro’s standard kernel’s 12Mbps, and works great, but I need to reboot my machine every 24 hours if I want to keep the full speed of the WiFi Driver.
The question:
Am I doomed to stay on 4.19.38?
Is there a way to get the 4.19.39-5.12 versions working permanently?
Поэтому я тоже хочу создать файл.deb. Я сейчас блокирую эту ошибку:
dh_installdeb
dpkg-genbuildinfo
dpkg-genbuildinfo: error: binary build with no binary artifacts found; .buildinfo is meaningless
Для чего мне трудно найти информацию.
Конечно, мои рецепты могут быть неправильными, поэтому я буду благодарен за любой отзыв!
Я строю.deb из источников.
в debian/
папка у меня есть:
- Compat до 10
- авторское право
- изменения
- контроль
- правила
Мой контрольный файл:
Source: foo
Maintainer: foo developers
Section: Web Software
Priority: extra
Version: 1.3.1
Standards-Version: 1.3.1
Build-Depends: debhelper (>= 8.0.0)
Package: foo
Architecture: any
Priority: extra
Homepage: http://foo.com
Depends: sbcl (>= 1.3),
${shlibs:Depends},
libwebkit2gtk-4.0-dev (>= 2.24),
default-dbus-session-bus | dbus-session-bus,
glib-networking,
sqlite,
gsettings-desktop-schemas,
libfixposix,
gstreamer,
gst-plugins-base-1.0,
xclip,
${misc:Depends}
Description: foo
foo is foo.
Мой файл правил:
#!/usr/bin/make -f
DH_VERBOSE = 1
%:
dh $@
NAME=foo
VERSION=1.3.1
DESTDIR=$(CURDIR)/debian/$(NAME)/
build:
dh_testdir
dh_testroot
dh_prep
make all
# I quickly tried this
# override_dh_auto_build:
# dh_auto_build -- all
# with no apparent effect
# (I want to call `make all` of my Makefile).
binary:
dh_testdir
dh_testroot
dh_installchangelogs
dh_prep
echo $(DESTDIR)
make install DESTDIR=$(DESTDIR)
dh_installdeb
# dh_gencontrol
# dh_md5sums
# dh_builddeb # only for binary packages ?
# override_dh_auto_binary:
# make install
clean:
dh_testdir
dh_testroot
# make clean DESTDIR=$(DESTDIR)
# dh_clean
(обратите внимание, что я пытался использовать override_dh_auto_build
без видимого успеха. Я хочу позвонить make all
моего Makefile).
Я бегу все с
sudo debuild -us -uc
Я вижу шаги компиляции, пока не появится сообщение об ошибке.
Я вижу свой бинарный файл под debian/foo/usr/local/bin
,
Есть каталог debian/foo/DEBIAN/
, но пусто.
Обратите внимание, что когда я запускаю двоичную цель только с
sudo fakeroot debian/rules binary
это заканчивается хорошо:
for i in 16 32 128 256 512; do \
mkdir -p "/home/vince/work/foo/debian/foo//usr/local/share/icons/hicolor/${i}x${i}/apps/" ; \
cp -f assets/foo_${i}x${i}.png "/home/vince/work/foo/debian/foo//usr/local/share/icons/hicolor/${i}x${i}/apps/foo.png" ; \
done
make[1]: Leaving directory '/home/vince/work/foo'
dh_installdeb
# dh_gencontrol
# dh_md5sums
# dh_builddeb # only binary packages ?
# make install
Благодарность!
Документация, на которую я смотрю:
- https://www.debian.org/doc/manuals/developers-reference/ch06.en.html
- https://www.debian.org/doc/debian-policy/ch-controlfields.html
I downloaded the source to a package using:
$ apt-get source gkrellweather
I also made sure I had the compile dependencies:
$ sudo apt-get build-dep gkrellweather
And I tested that it could build fine:
$ cd gkrellweather-2.0.8
$ debuild
It built a .deb
package in the folder above, which I could install using:
$ sudo dpkg -i ../gkrellweather*.deb
OK so everything is in place. Let’s get started!
I opened up the source code in Vim and made some changes I wanted. Then I tried to rebuild:
$ debuild
But I got the following error:
...
dh_clean: Compatibility levels before 5 are deprecated (level 4 in use)
dpkg-source -b gkrellweather-2.0.8
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)
dpkg-source: info: using source format `1.0'
dpkg-source: info: building gkrellweather using existing gkrellweather_2.0.8.orig.tar.gz
dpkg-source: info: building gkrellweather in gkrellweather_2.0.8-2.diff.gz
dpkg-source: error: cannot represent change to gkrellweather-2.0.8/.gkrellweather.c.swp: binary file contents changed
dpkg-source: warning: the diff modifies the following upstream files:
GrabWeather
Makefile
gkrellweather.c
dpkg-source: info: use the '3.0 (quilt)' format to have separate and documented changes to upstream files, see dpkg-source(1)
dpkg-source: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -b gkrellweather-2.0.8 gave error exit status 1
debuild: fatal error at line 1357:
dpkg-buildpackage -rfakeroot -D -us -uc failed
Why?
После многих чтений, проб и ошибок, я понял, что было не так. Я запустил
dpkg-source -b create-launcher_0.1.2+alpha
И по какой-то причине ему не удалось удалить распакованный файл файл-launcher_0.1.2 + alpha.orig.tar.gz, который выглядит примерно как create-launcher-0.1.2 + alpha.orig.6h0gQo. Я заглянул в нее, и это началось с папки: share, а не usr, как это должно быть так, как я упомянул в вышеупомянутом вопросе. Это заставило меня начать думать о том, как я, возможно, испортил строительство смолы. Конечно, я построил его с помощью usr в качестве верхней папки, и он «отбивает» это, чтобы выполнить сравнение. Мне нужно было создать tar, используя create-launcher_0.1.2 + alpha/в качестве верхнего каталога. Таким образом, он обрезается, позволяя различать «usr» dir на каждом дереве.
Он все еще не строился правильно. Мне нужна эта команда:
dpkg-source --include-binaries -b create-launcher_0.1.2+alpha
Я нашел, что вы это делаете с параметром «-source-option», например:
debuild -uc -us --source-option=--include-binaries
Это все еще не удалось, потому что мой файл сеанса vim в каталоге /bin показал изменение (я не знаю почему, но мне нужно было его игнорировать). dpkg-source имеет некоторые опции игнорирования. Эта последняя команда сделала трюк:
debuild -uc -us --source-option=--include-binaries --source-option=-isession
Мне удалось свернуть deb успешно.
Надеюсь, что это поможет кому-то. Глупая ошибка с моей стороны. Я должен научиться использовать мои старые сценарии (чтобы создать tar) вместо того, чтобы каждый раз создавать его. Извлеченный урок.