From 2061445ecbd9762e7c114a7767243eb448d663f6 Mon Sep 17 00:00:00 2001
From: Morten Linderud <morten@linderud.pw>
Date: Thu, 30 Apr 2026 00:10:27 +0200
Subject: [PATCH] install/{systemd,udev}: check if the hwdb.bin exists before
 adding to image

Signed-off-by: Morten Linderud <morten@linderud.pw>
---
 install/systemd | 8 +++++---
 install/udev    | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/install/systemd b/install/systemd
index c40f0a02..e85a5f6a 100644
--- a/install/systemd
+++ b/install/systemd
@@ -193,9 +193,11 @@ build() {
     add_file "/usr/lib/tmpfiles.d/20-systemd-stub.conf"
 
     # add hwdb binaries to the initramfs
-    map add_file \
-        /usr/lib/udev/hwdb.bin \
-        /etc/udev/hwdb.bin
+    for f in /usr/lib/udev/hwdb.bin /etc/udev/hwdb.bin; do
+        if [[  -f "$f" ]]; then
+            add_file "$f"
+        fi
+    done
 
     # Include nvpcr files
     for nvpcr in /usr/lib/nvpcr/*.nvpcr; do
diff --git a/install/udev b/install/udev
index 33ed07be..9e1fb74e 100644
--- a/install/udev
+++ b/install/udev
@@ -21,9 +21,11 @@ build() {
         '80-drivers.rules'
 
     # add hwdb binaries to the initramfs
-    map add_file \
-        /usr/lib/udev/hwdb.bin \
-        /etc/udev/hwdb.bin
+    for f in /usr/lib/udev/hwdb.bin /etc/udev/hwdb.bin; do
+        if [[  -f "$f" ]]; then
+            add_file "$f"
+        fi
+    done
 
     add_runscript
 }
-- 
GitLab

