From 326c07e2ff38864fb323386b314a68c258aaac5c Mon Sep 17 00:00:00 2001 From: Daniel Dizdarevic Date: Thu, 11 Jul 2024 12:23:05 +0200 Subject: [PATCH] Prevent redis from trying to access clocksource Redis checks the current_clocksource file to make sure that the xen clocksource is not being used. However, snap does not have access to these files. Therefore, these checks are disabled by replacing current_clocksource/available_clocksource with /dev/null. --- snap/snapcraft.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index e912b79..28b856e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -403,6 +403,7 @@ parts: source-checksum: sha256/5981179706f8391f03be91d951acafaeda91af7fac56beffb2701963103e423d plugin: make override-build: | + sed -ri "s,/sys/devices/system/clocksource/clocksource0/(current|available)_clocksource,/dev/null," $SNAPCRAFT_PART_SRC/src/syscheck.c make -j"$(nproc)" make install PREFIX=$SNAPCRAFT_PART_INSTALL/redis cp $SNAPCRAFT_PART_SRC/COPYING $SNAPCRAFT_PART_INSTALL/redis/ @@ -573,10 +574,10 @@ parts: cp $SNAPCRAFT_PART_SRC/LEGAL $SNAPCRAFT_PART_INSTALL/ruby/ override-stage: | snapcraftctl stage - find $SNAPCRAFT_STAGE/ruby/bin -type f -exec grep -Iq . {} \; -and -exec sed -i -e "s|^#!//bin/ruby$|#!$SNAPCRAFT_STAGE/ruby/bin/ruby|" {} \; + find $SNAPCRAFT_STAGE/ruby/bin -type f -exec grep -Iq . {} \; -and -exec sed -ie "s|^#!//bin/ruby$|#!$SNAPCRAFT_STAGE/ruby/bin/ruby|" {} \; override-prime: | snapcraftctl prime - find $SNAPCRAFT_PRIME/ruby/bin -type f -exec grep -Iq . {} \; -and -exec sed -i -e "s|^#!$SNAPCRAFT_STAGE/ruby/bin/ruby$|#!/snap/mastodon-server/current/ruby/bin/ruby|" {} \; + find $SNAPCRAFT_PRIME/ruby/bin -type f -exec grep -Iq . {} \; -and -exec sed -ie "s|^#!$SNAPCRAFT_STAGE/ruby/bin/ruby$|#!/snap/mastodon-server/current/ruby/bin/ruby|" {} \; stage: - -ruby/share/doc - -ruby/share/man