Skip to content

Commit

Permalink
Prevent redis from trying to access clocksource
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dhelonious committed Jul 11, 2024
1 parent 0e1ccb9 commit 326c07e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 326c07e

Please sign in to comment.