mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 13:58:15 -05:00
guix-install.sh: Install SELinux policy only if tools are present.
* etc/guix-install.sh (sys_maybe_setup_selinux): Silently return if the ‘semodule’ or ‘restorecon’ commands are missing.
This commit is contained in:
parent
445a035908
commit
c89e0b4d20
1 changed files with 18 additions and 7 deletions
|
@ -600,15 +600,26 @@ fi
|
||||||
|
|
||||||
sys_maybe_setup_selinux()
|
sys_maybe_setup_selinux()
|
||||||
{
|
{
|
||||||
if [ -f /sys/fs/selinux/policy ]
|
if ! [ -f /sys/fs/selinux/policy ]
|
||||||
then
|
then
|
||||||
prompt_yes_no "Install SELinux policy required to run guix-daemon?" \
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local c
|
||||||
|
for c in semodule restorecon
|
||||||
|
do
|
||||||
|
if ! command -v "$c" &>/dev/null
|
||||||
|
then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
prompt_yes_no "Install SELinux policy that might be required to run guix-daemon?" \
|
||||||
|| return
|
|| return
|
||||||
|
|
||||||
local var_guix=/var/guix/profiles/per-user/root/current-guix
|
local var_guix=/var/guix/profiles/per-user/root/current-guix
|
||||||
semodule -i "${var_guix}/share/selinux/guix-daemon.cil"
|
semodule -i "${var_guix}/share/selinux/guix-daemon.cil"
|
||||||
restorecon -R /gnu /var/guix
|
restorecon -R /gnu /var/guix
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
welcome()
|
welcome()
|
||||||
|
|
Loading…
Reference in a new issue