-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Llewellyn <daniel@bowlhat.net>
- Loading branch information
Daniel Llewellyn
committed
May 15, 2020
1 parent
d6dd589
commit d7622dc
Showing
4 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
#!/bin/bash -ex | ||
|
||
# copying the conf dir from real /etc into $SNAP_DATA | ||
mkdir -p "$SNAP_DATA/etc/ld.so.conf.d" | ||
cp -r /etc/ld.so.conf.d/* "$SNAP_DATA/etc/ld.so.conf.d" | ||
cp /etc/ld.so.conf "$SNAP_DATA/etc/ld.so.conf" | ||
#!/bin/bash -e | ||
|
||
# delete empty entries in the LD_LIBRARY_PATH | ||
# i.e. change "/a/b/c:/1/2/3::/other" into "/a/b/c:/1/2/3:/other" | ||
# if we don't do this, then ldconfig gets confused with "" as arguments of dirs | ||
# to add to the cache | ||
LD_LIBRARY_PATH="${LD_LIBRARY_PATH//::/:}" | ||
# Remove leading empty element if it exists | ||
LD_LIBRARY_PATH="${LD_LIBRARY_PATH#:}" | ||
# Remove trailing empty element if it exists | ||
LD_LIBRARY_PATH="${LD_LIBRARY_PATH%:}" | ||
|
||
# run ldconfig on our LD_LIBRARY_PATH lib dirs | ||
IFS=':' read -ra PATHS <<< "$LD_LIBRARY_PATH" | ||
# The fake-etc directory is to allow ldconfig to unlink the | ||
# ld.so.cache file without breaking the bind-file layout on | ||
# the real ld.so.cache file. | ||
mkdir -p "$SNAP_DATA/fake-etc" | ||
ldconfig -v -C "$SNAP_DATA/fake-etc/ld.so.cache" -f "$SNAP_DATA/etc/ld.so.conf" "${PATHS[@]}" | ||
|
||
# install the new ld.so.cache to the global location by just copying it | ||
cp "$SNAP_DATA/fake-etc/ld.so.cache" "$SNAP_DATA/etc/ld.so.cache" | ||
# install the new ld.so.cache to the global location by | ||
# copying it. We must not unlink the global file or the snap | ||
# 'layout' configuration will break. | ||
cp "$SNAP_DATA/fake-etc/ld.so.cache" "$SNAP_DATA/etc/ld.so.cache" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters