2 Commits

Author SHA1 Message Date
c1fe3c1c9b Move mullvad-exclude into suid subpackage 2026-04-23 11:42:17 +02:00
Joakim Hulthe
7af09af8d1 Fix install-scripts, and bundle relay list 2026-04-23 11:42:08 +02:00
8 changed files with 10 additions and 39 deletions

View File

@@ -2,7 +2,7 @@
# Maintainer: Joakim Hulthe <joakim@hulthe.net> # Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-daemon pkgname=mullvad-vpn-daemon
pkgver=2026.1_git pkgver=2026.1_git
pkgrel=4 pkgrel=5
pkgdesc="Mullvad VPN system service" pkgdesc="Mullvad VPN system service"
url="https://mullvad.net/" url="https://mullvad.net/"
arch="all" arch="all"
@@ -33,7 +33,10 @@ install="
$pkgname-systemd.post-install $pkgname-systemd.post-install
$pkgname-systemd.post-upgrade $pkgname-systemd.post-upgrade
" "
subpackages="$pkgname-systemd" subpackages="
$pkgname-systemd
$pkgname-suid
"
source="" source=""
builddir="$srcdir/" builddir="$srcdir/"
options="net suid" options="net suid"
@@ -81,10 +84,6 @@ package() {
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-daemon" \ install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-daemon" \
"$pkgdir"/usr/bin/mullvad-daemon "$pkgdir"/usr/bin/mullvad-daemon
# mullvad-exclude requires setuid
install -m4755 -D "$_cargo_target_dir/$CHOST/release/mullvad-exclude" \
"$pkgdir"/usr/bin/mullvad-exclude
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-problem-report" \ install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-problem-report" \
"$pkgdir"/usr/bin/mullvad-problem-report "$pkgdir"/usr/bin/mullvad-problem-report
@@ -103,3 +102,8 @@ systemd() {
install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-early-boot-blocking.service" \ install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-early-boot-blocking.service" \
"$subpkgdir"/usr/lib/systemd/system/mullvad-early-boot-blocking.service "$subpkgdir"/usr/lib/systemd/system/mullvad-early-boot-blocking.service
} }
suid() {
install -m4755 -D "$_cargo_target_dir/$CHOST/release/mullvad-exclude" \
"$subpkgdir"/usr/bin/mullvad-exclude
}

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad-systemd post-install"
# Are we running systemd? # Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
# Does `mullvad-daemon.service` exist? # Does `mullvad-daemon.service` exist?

View File

@@ -1,25 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad-systemd post-upgrade"
# Are we running systemd? # Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
echo "systemctl exists and is running"
# Does `mullvad-daemon.service` exist? # Does `mullvad-daemon.service` exist?
if systemctl list-unit-files mullvad-daemon.service &> /dev/null; then if systemctl list-unit-files mullvad-daemon.service &> /dev/null; then
echo "enable mullvad-daemon"
systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service" systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service"
echo "start mullvad-daemon"
systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service" systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service"
echo "enable mullvad-early-boot-blocking"
systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service" systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service"
else
echo "mullvad-daemon.service does not exist!!"
systemctl list-unit-files mullvad-daemon.service
fi fi
else
echo "systemctl does not exit!"
fi fi
echo "sleep 5"
sleep 5

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad post-deinstall"
rm -r --interactive=never /var/log/mullvad-vpn/ || \ rm -r --interactive=never /var/log/mullvad-vpn/ || \
echo "Failed to remove mullvad-vpn logs" echo "Failed to remove mullvad-vpn logs"
rm -r --interactive=never /var/cache/mullvad-vpn/ || \ rm -r --interactive=never /var/cache/mullvad-vpn/ || \

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad post-install"
# Overwrite the cached relay list with the one embedded in the package. # Overwrite the cached relay list with the one embedded in the package.
mkdir -p /var/cache/mullvad-vpn \ mkdir -p /var/cache/mullvad-vpn \
&& cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \ && cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad post-upgrade"
# Overwrite the cached relay list with the one embedded in the package. # Overwrite the cached relay list with the one embedded in the package.
mkdir /var/cache/mullvad-vpn mkdir /var/cache/mullvad-vpn
cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json

View File

@@ -1,18 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad pre-deinstall"
is_number_re='^[0-9]+$'
# Check if we're running during an upgrade step on Fedora
# https://fedoraproject.org/wiki/Packaging:Scriptlets#Syntax
if [[ "$1" =~ $is_number_re ]] && [ "$1" -gt 0 ]; then
exit 0;
fi
if [[ "$1" == "upgrade" ]]; then
exit 0;
fi
# the user might've disabled or stopped the service themselves already # the user might've disabled or stopped the service themselves already
systemctl stop mullvad-daemon.service || true systemctl stop mullvad-daemon.service || true
systemctl disable mullvad-daemon.service || true systemctl disable mullvad-daemon.service || true

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "mullvad pre-upgrade"
# Are we running systemd? # Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
# Is `mullvad-daemon.service` running? # Is `mullvad-daemon.service` running?