Subject: [PATCH 6/6] d/rules: copy DKMS files instead of moving them

From: Igor Krpanic <[email-masked]>
Date: Sun, 9 Aug 2026 13:18:00 +0200

A repeated binary build (dpkg-buildpackage -nc) fails because the
first run empties the dist directory.

Signed-off-by: Igor Krpanic <[email-masked]>
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index a827ddec..b8adb2d1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -98,7 +98,7 @@ override_dh_auto_install:
 		'$(CURDIR)/scripts/dkms.postbuild'
 	install -D -t '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts' \
 		'$(CURDIR)/scripts/objtool-wrapper.in'
-	$(foreach file,$(DKMSFILES),mv '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)' || exit 1;)
+	$(foreach file,$(DKMSFILES),cp -a '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)' || exit 1;)
 
 	@# Do not include FreeBSD kernel sources in the Linux DKMS package
 	$(foreach file,$(DKMSFILESEXCLUDE),rm -r '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' || exit 1;)
-- 
2.47.3