Commit c28d5a16 authored by Boris Yumankulov's avatar Boris Yumankulov Committed by Vitaly Lipatov

epm play: move bwrap-fix to separate prescription

parent 664e0040
#!/bin/sh
[ "$1" != "--run" ] && echo "Enable unprivileged bubblewrap mode" && exit
. $(dirname $0)/common.sh
assure_root
[ "$(epm print info -s)" = "alt" ] || fatal "Only ALTLinux is supported"
epm install --skip-installed sysctl-conf-userns
# https://bugzilla.altlinux.org/46690 and https://github.com/flatpak/flatpak/wiki/User-namespace-requirements
cat <<EOL > /etc/systemd/system/check-bwrap.service
[Unit]
Description=Check and fix permissions for bwrap
Wants=check-bwrap.path
[Service]
Type=oneshot
ExecStart=/bin/bash -c "CURRENT_PERMISSIONS=\$(stat -c '%a' /usr/bin/bwrap); if [ '\$CURRENT_PERMISSIONS' != '775' ]; then chmod 0755 /usr/bin/bwrap; fi"
EOL
cat <<EOL > /etc/systemd/system/check-bwrap.path
[Unit]
Description=Watch /usr/bin/bwrap for changes
[Path]
PathModified=/usr/bin/bwrap
[Install]
WantedBy=multi-user.target
EOL
serv on check-bwrap.path
serv start check-bwrap.service
......@@ -41,29 +41,7 @@ fi
# Без перезагрузки dbus, порталы не заработают
serv dbus reload
# https://bugzilla.altlinux.org/46690
cat <<EOL > /etc/systemd/system/check-bwrap.service
[Unit]
Description=Check and fix permissions for bwrap
Wants=check-bwrap.path
[Service]
Type=oneshot
ExecStart=/bin/bash -c "CURRENT_PERMISSIONS=\$(stat -c '%a' /usr/bin/bwrap); if [ '\$CURRENT_PERMISSIONS' != '775' ]; then chmod 0755 /usr/bin/bwrap; fi"
EOL
cat <<EOL > /etc/systemd/system/check-bwrap.path
[Unit]
Description=Watch /usr/bin/bwrap for changes
[Path]
PathModified=/usr/bin/bwrap
[Install]
WantedBy=multi-user.target
EOL
serv on check-bwrap.path
serv start check-bwrap.service
# https://bugzilla.altlinux.org/46690 and https://github.com/flatpak/flatpak/wiki/User-namespace-requirements
epm play bwrap-fix
echo "You need to log out of the session for flatpak to work."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment