Skip to content

Commit

Permalink
UBUNTU: [Debian] Fix warnings when checking for modules signatures
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1853843

When detecting module signatures, the current approach causes
this warning for modules lacking a signature:

 /bin/bash: line 5: warning: command substitution: ignored null byte in input

My original approach used read, which works well, but for unknown
reasons causes an error from bash when by itself as the first
line in the if clause. Putting it in a no-op while loop prevents
the error, but it has the advantage of working without flooding
the build logs with warnings.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
  • Loading branch information
Seth Forshee committed Dec 5, 2019
1 parent bd72bd1 commit 287cd09
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions debian/rules.d/2-binary-arch.mk
Original file line number Diff line number Diff line change
@@ -413,12 +413,14 @@ ifneq ($(skipdbg),true)
-name '*.ko' | while read path_module ; do \
module="/lib/modules/$${path_module#*/lib/modules/}"; \
if [[ -f "$(dbgpkgdir)/usr/lib/debug/$$module" ]] ; then \
signature=$$(tail -c 28 "$$path_module"); \
while IFS= read -r -d '' signature < <(tail -c 28 "$$path_module"); do \
break; \
done; \
$(CROSS_COMPILE)objcopy \
--add-gnu-debuglink=$(dbgpkgdir)/usr/lib/debug/$$module \
$$path_module; \
if grep -q CONFIG_MODULE_SIG=y $(builddir)/build-$*/.config && \
[ "$$signature" = "~Module signature appended~" ]; then \
[ "$$signature" = $$'~Module signature appended~\n' ]; then \
$(builddir)/build-$*/scripts/sign-file $(MODHASHALGO) \
$(MODSECKEY) \
$(MODPUBKEY) \

0 comments on commit 287cd09

Please sign in to comment.