From ad47334f059b186a54ed55f46825e9d614695af2 Mon Sep 17 00:00:00 2001 From: no92 Date: Wed, 5 Feb 2025 13:16:04 +0100 Subject: [PATCH] scripts/update-image: preserve udev's hwdb --- scripts/update-image.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/update-image.py b/scripts/update-image.py index f425e0057..b48dae676 100755 --- a/scripts/update-image.py +++ b/scripts/update-image.py @@ -456,7 +456,7 @@ def generate_plan(arch, root_uuid, scriptdir): yield FsAction.RSYNC, "sbin" yield FsAction.RSYNC, "root/" yield FsAction.RSYNC, "usr/" - yield FsAction.RSYNC, "etc/" + yield FsAction.RSYNC, "etc/", ["udev/hwdb.bin"] yield FsAction.RSYNC, "var/" yield FsAction.RSYNC, "home/" @@ -554,10 +554,14 @@ def plan_install(source, dest, ignore_sysroot=False): steps.append(["install", source, target]) - def plan_rsync(dir): + def plan_rsync(dir, exclude_files=[]): source = os.path.join(self.sysroot, dir) target = os.path.join(target_mntpoint, dir) - steps.append(["rsync", "-a", "--delete", source, target]) + command = ["rsync", "-a", "--delete", source, target] + if exclude_files: + for f in exclude_files: + command.append(f"--exclude={os.path.join(f)}") + steps.append(command) def plan_cp(source, dest): target = os.path.join(target_mntpoint, dest)