@@ -35,6 +35,7 @@ Build-Depends:
uuid-dev <!stage1>,
libnuma-dev [amd64 arm64 ppc64el s390x] <!stage1>,
dkms <!stage1>,
+ dh-modaliases <!stage1>,
curl <!stage1>,
zstd [amd64 s390x] <!stage1>,
pahole [amd64 arm64 armhf ppc64el s390x riscv64] | dwarves (>= 1.21) [amd64 arm64 armhf ppc64el s390x riscv64] <!stage1>,
@@ -7,6 +7,7 @@ Priority: optional
Depends:
${misc:Depends},
linux-image-PKGVER-ABINUM-FLAVOUR | linux-image-unsigned-PKGVER-ABINUM-FLAVOUR,
+XB-Modaliases: ${modaliases}
Built-Using: ${linux:BuiltUsing}
Description: Linux kernel MODULE modules for version PKGVER-ABINUM
This package provides the Linux kernel MODULE modules for version
@@ -152,6 +152,7 @@ clean: debian/control debian/canonical-certs.pem debian/canonical-revoked-certs.
# Remove generated intermediate files
rm -f $(DROOT)/control.stub $(DEBIAN)/control.stub
rm -f $(DROOT)/scripts/fix-filenames
+ rm -f $(DROOT)/*.modaliases
.PHONY: distclean
distclean: clean
@@ -451,6 +451,9 @@ endif
$(foreach _m,$(all_dkms_modules), \
$(if $(enable_$(_m)), \
$(call build_dkms,$(dkms_$(_m)_pkg_name)-$*,$(dkms_$(_m)_pkgdir)/lib/modules/$(abi_release)-$*/$(dkms_$(_m)_subdir),$(dbgpkgdir_dkms),$(_m),$(dkms_$(_m)_debpath)); \
+ $(if $(filter $(_m),$(all_standalone_dkms_modules)), \
+ if [ -f "$(dkms_dir)/$(_m).modaliases" ]; then cp "$(dkms_dir)/$(_m).modaliases" "$(CURDIR)/debian/$(dkms_$(_m)_pkg_name)-$*.modaliases"; fi; \
+ ) \
) \
)
@@ -672,7 +675,12 @@ ifeq ($(do_extras_package),true)
endif
$(foreach _m,$(all_standalone_dkms_modules), \
- $(if $(enable_$(_m)),$(call dh_all,$(dkms_$(_m)_pkg_name)-$*);)\
+ $(if $(enable_$(_m)), \
+ if [ -f "$(CURDIR)/debian/$(dkms_$(_m)_pkg_name)-$*.modaliases" ]; then \
+ dh_modaliases -p$(dkms_$(_m)_pkg_name)-$*; \
+ fi; \
+ $(call dh_all,$(dkms_$(_m)_pkg_name)-$*); \
+ )\
)
$(call dh_all,$(pkgbldinfo))
@@ -91,6 +91,15 @@ do
fi
dpkg -x "$lpackage"_*.deb "$package"
+ if [ -n "$(dpkg-deb -f "$lpackage"_*.deb Modaliases)" ]; then
+ echo "II: dkms-build $package modaliases:"
+ dpkg-deb -f "$lpackage"_*.deb Modaliases | \
+ sed -e 's/\([^(]\+\)(\([^)]\+\))\(, \)\?/\1 \2\n/g' | \
+ sed -e '/,/bx' -e 's/\([^ ]\+\) \([^ ]\+\)/alias \2 \1/' \
+ -e 'bend' -e ':x' -e 's/\([^ ]\+\) \([^ ]\+\), \(.*\)/alias \2 \1\n\1 \3/' -e 'P;D' -e ':end' | \
+ grep -v '^$' | \
+ sort | tee "$package".modaliases
+ fi
lversion=$( echo "$lpackage_path" | sed -e 's@.*/@@' -e 's@_[^_]*$@@' -e 's@.*_@@')
#built_using_record "$srcdir/debian/$pkgname.substvars" "$built_using$lpackage (= $lversion)"
BugLink: https://bugs.launchpad.net/bugs/2021740 Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> --- debian.master/control.stub.in | 1 + debian/control.d/flavour-module.stub | 1 + debian/rules | 1 + debian/rules.d/2-binary-arch.mk | 10 +++++++++- debian/scripts/dkms-build | 9 +++++++++ 5 files changed, 21 insertions(+), 1 deletion(-)