Skip to content

Commit

Permalink
Debian fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hack3ric committed Nov 23, 2024
1 parent c177632 commit 3bf24d5
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
5 changes: 3 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Build-Depends:
libffi-dev,
linux-source,
linux-headers-generic
Standards-Version: 4.5.1
Standards-Version: 4.7.0
Homepage: https://github.com/hack3ric/mimic
Rules-Requires-Root: no
Vcs-Git: https://github.com/hack3ric/mimic.git
Expand All @@ -36,6 +36,7 @@ Description: eBPF UDP -> TCP obfuscator
This package contains the Mimic CLI and eBPF packet handler.

Package: mimic-dkms
Section: kernel
Architecture: any
Provides: mimic-modules (= ${binary:Version})
Conflicts: mimic-modules
Expand All @@ -52,7 +53,7 @@ Recommends:
lzop,
lz4,
zstd
Description: eBPF UDP -> TCP obfuscator
Description: eBPF UDP -> TCP obfuscator (DKMS kernel module)
Mimic is an experimental UDP to TCP obfuscator designed to bypass UDP
QoS and port blocking. Based on eBPF, it directly mangles data inside
Traffic Control (TC) subsystem in the kernel space and restores data
Expand Down
5 changes: 5 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: mimic
Upstream-Contact: Eric Long <[email protected]>
Source: https://github.com/hack3ric/mimic

Files: *
Copyright: 2024 Eric Long <[email protected]>
License: GPL-2.0-only

Files: debian/*
Copyright: 2024 Eric Long <[email protected]>
License: GPL-2.0-only

License: GPL-2.0-only
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
1 change: 1 addition & 0 deletions debian/mimic-dkms.dkms
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kmod/dkms.conf
5 changes: 5 additions & 0 deletions debian/mimic-dkms.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# gzip here, along with other compression packages, is needed to extract
# BTF from compressed kernel image (with respective algorithm) inside
# /boot. I don't think version is necessary here, since it's only
# accessed through CLI.
mimic-dkms: depends-on-essential-package-without-using-version Recommends: gzip
9 changes: 6 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@ override_dh_auto_configure:
-e 's|@@MIMIC_CONFIG_PATH@@|/etc/mimic|' \
-e 's|@@MIMIC_RUNTIME_DIR@@|mimic|' \
> debian/[email protected]
sed kmod/dkms.conf.in \
-e 's|@@EXTRA_OPTS@@|CHECKSUM_HACK=$(CHECKSUM_HACK)|' \
> kmod/dkms.conf

override_dh_auto_build:
tar xf `bash -c '_tarballs=(/usr/src/linux-source-*.tar.*); echo $${_tarballs[0]}'`
ifeq ($(IS_UBUNTU), 0)
# Ubuntu's bpftool relies on current kernel, which is both inconsistent
# with Debian and sbuild-unfriendly. Build from kernel source instead.
make -C linux-source-*/tools/bpf/bpftool
dh_auto_build -- build-cli build-tools generate-dkms generate-manpage \
dh_auto_build -- build-cli build-tools generate-manpage \
MODE= \
BPF_CC=clang-16 \
BPFTOOL=linux-source-*/tools/bpf/bpftool/bpftool
else
dh_auto_build -- build-cli build-tools generate-dkms generate-manpage \
dh_auto_build -- build-cli build-tools generate-manpage \
MODE= \
BPF_CC=clang-16
endif
Expand All @@ -38,7 +41,7 @@ endif
override_dh_auto_test:

override_dh_dkms:
dh_dkms -pmimic-dkms -- kmod/dkms.conf
dh_dkms -pmimic-dkms -V$(DEB_VERSION_UPSTREAM)

override_dh_auto_clean:
dh_auto_clean
Expand Down
4 changes: 3 additions & 1 deletion kmod/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ clean:
[ ! -d $(SYSTEM_BUILD_DIR) ] || $(MAKE) -C $(SYSTEM_BUILD_DIR) M=$(CURDIR) clean

dkms.conf: dkms.conf.in
sed 's|@@EXTRA_OPTS@@|CHECKSUM_HACK=$(CHECKSUM_HACK)|' $^ > $@
sed $^ \
-e 's|@@EXTRA_OPTS@@|CHECKSUM_HACK=$(CHECKSUM_HACK)|' \
-e 's|#MODULE_VERSION#|0.6.0|'> $@
AKMBUILD: AKMBUILD.in
sed 's|@@EXTRA_OPTS@@|CHECKSUM_HACK=$(CHECKSUM_HACK)|' $^ > $@
2 changes: 1 addition & 1 deletion kmod/dkms.conf.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME="mimic"
PACKAGE_VERSION="0.6.0"
PACKAGE_VERSION="#MODULE_VERSION#"
MAKE[0]="make KERNEL_UNAME=$kernelver @@EXTRA_OPTS@@"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="mimic"
Expand Down

0 comments on commit 3bf24d5

Please sign in to comment.