From 63be4f95dd1dd63cd7eb6cf39997b6f254cf6044 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 5 Feb 2025 13:17:44 +0100 Subject: [PATCH] Adding patch to create /dev/shm in haveged itself if it is not existing (Closes: #1087324). Signed-off-by: Daniel Baumann --- .../patches/debian/0001-shm-directory.patch | 19 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 20 insertions(+) create mode 100644 debian/patches/debian/0001-shm-directory.patch create mode 100644 debian/patches/series diff --git a/debian/patches/debian/0001-shm-directory.patch b/debian/patches/debian/0001-shm-directory.patch new file mode 100644 index 0000000..07a4402 --- /dev/null +++ b/debian/patches/debian/0001-shm-directory.patch @@ -0,0 +1,19 @@ +Author: Daniel Baumann +Description: Creating /dev/shm if its not existing (Closes: #1087324). + +diff -Naurp haveged.orig/src/haveged.c haveged/src/haveged.c +--- haveged.orig/src/haveged.c 2025-01-14 18:44:32.651852997 +0100 ++++ haveged/src/haveged.c 2025-01-14 19:30:07.495863674 +0100 +@@ -490,6 +490,12 @@ int main(int argc, char **argv) + } + } + /* Initilize named semaphore to synchronize command isntances */ ++ if (mkdir("/dev/shm", 0755) != 0) { ++ if (errno != EEXIST) { ++ error_exit("Couldn't create /dev/shm directory: %s", strerror(errno)); ++ } ++ } ++ + sem = sem_open(SEM_NAME, O_CREAT, 0644, 1); + if (sem == NULL) { + error_exit("Couldn't create nammed semaphore " SEM_NAME" error: %s", strerror(errno)); diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..89d2846 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +debian/0001-shm-directory.patch