mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-05 05:02:22 +00:00
Allow installing developer-friendly PolicyKit rules from setup
This commit is contained in:
parent
98855ab712
commit
d1dff82803
@ -38,6 +38,14 @@ setup_run_dev()
|
||||
fi
|
||||
}
|
||||
|
||||
setup_unsafe_polkit_rules()
|
||||
{
|
||||
read -p "Install developer-friendly **unsafe** PolicyKit rules into /etc/polkit-1/rules.d? (y/n) " question
|
||||
if [ "$question" = "y" ]; then
|
||||
sudo cp ./policy/org.freedesktop.fwupd-unsafe.rules /etc/polkit-1/rules.d/
|
||||
fi
|
||||
}
|
||||
|
||||
setup_vscode()
|
||||
{
|
||||
# Add default vscode settings if not existing
|
||||
@ -131,6 +139,7 @@ if [ -t 2 ]; then
|
||||
setup_deps
|
||||
;;
|
||||
esac
|
||||
setup_unsafe_polkit_rules
|
||||
check_markdown
|
||||
setup_vscode
|
||||
rename_branch
|
||||
|
6
policy/org.freedesktop.fwupd-unsafe.rules
Normal file
6
policy/org.freedesktop.fwupd-unsafe.rules
Normal file
@ -0,0 +1,6 @@
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (action.id.startsWith("org.freedesktop.fwupd.") &&
|
||||
subject.isInGroup("wheel")) {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user