chore: add optfix
Some checks are pending
build-ublue-custom / Build and push image (push) Waiting to run
Some checks are pending
build-ublue-custom / Build and push image (push) Waiting to run
This commit is contained in:
parent
c4eea47af9
commit
5e0648947d
3 changed files with 48 additions and 0 deletions
10
build.sh
10
build.sh
|
@ -38,6 +38,16 @@ bash ./1password.sh
|
||||||
|
|
||||||
rm 1password.sh
|
rm 1password.sh
|
||||||
|
|
||||||
|
### Fix for packages that install into /opt
|
||||||
|
|
||||||
|
mkdir -p /var/opt
|
||||||
|
ln -sf /var/opt /opt
|
||||||
|
|
||||||
|
mkdir -p /usr/lib/opt/zen
|
||||||
|
ln -sf /usr/lib/opt/zen /var/opt/zen
|
||||||
|
|
||||||
|
systemctl enable azure-optfix
|
||||||
|
|
||||||
### Install packages
|
### Install packages
|
||||||
|
|
||||||
grep -v '^#' /tmp/packages | xargs rpm-ostree install
|
grep -v '^#' /tmp/packages | xargs rpm-ostree install
|
||||||
|
|
11
files/usr/lib/systemd/system/azure-optfix.service
Normal file
11
files/usr/lib/systemd/system/azure-optfix.service
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Create symbolic links for directories in /usr/lib/opt/ to /var/opt/
|
||||||
|
After=multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/libexec/azure-optfix
|
||||||
|
RemainAfterExit=no
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
27
files/usr/libexec/azure-optfix
Executable file
27
files/usr/libexec/azure-optfix
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SOURCE_DIR="/usr/lib/opt/"
|
||||||
|
TARGET_DIR="/var/opt/"
|
||||||
|
|
||||||
|
# Ensure the target directory exists
|
||||||
|
mkdir -p "$TARGET_DIR"
|
||||||
|
|
||||||
|
# Loop through directories in the source directory
|
||||||
|
for dir in "$SOURCE_DIR"*/; do
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
# Get the base name of the directory
|
||||||
|
dir_name=$(basename "$dir")
|
||||||
|
|
||||||
|
# Check if the symlink already exists in the target directory
|
||||||
|
if [ -L "$TARGET_DIR/$dir_name" ]; then
|
||||||
|
echo "Symlink already exists for $dir_name, skipping."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create the symlink
|
||||||
|
ln -s "$dir" "$TARGET_DIR/$dir_name"
|
||||||
|
echo "Created symlink for $dir_name"
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue