about summary refs log tree commit diff
path: root/dracut
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2013-06-02 12:08:27 +0200
committerJuan RP <xtraeme@gmail.com>2013-06-02 12:08:27 +0200
commit699937efcac563a57e56d07c3d4976999b7cc90b (patch)
treec94666a38b20f0fc930f4836ea1438844ce717b9 /dracut
parent97f9b02fd7fe2d42a97d9d748b3e3527c82331dd (diff)
downloadhrmpf-699937efcac563a57e56d07c3d4976999b7cc90b.tar.gz
hrmpf-699937efcac563a57e56d07c3d4976999b7cc90b.tar.xz
hrmpf-699937efcac563a57e56d07c3d4976999b7cc90b.zip
mklive: force-add vmklive dracut module and generate a polkit rules file to bypass auth.
Diffstat (limited to 'dracut')
-rw-r--r--dracut/adduser.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/dracut/adduser.sh b/dracut/adduser.sh
index aa26d20..b49da6a 100644
--- a/dracut/adduser.sh
+++ b/dracut/adduser.sh
@@ -26,3 +26,19 @@ rm -f "${NEWROOT}/etc/systemd/system/getty.target.wants/getty@tty1.service"
 sed -e "s|/sbin/agetty --noclear|& -a ${USERNAME}|g" \
     "${NEWROOT}/usr/lib/systemd/system/getty@.service" > \
     "${NEWROOT}/etc/systemd/system/getty.target.wants/getty@tty1.service"
+
+if [ -d ${NEWROOT}/etc/polkit-1 ]; then
+    # If polkit is installed allow users in the wheel group to run anything.
+    cat > ${NEWROOT}/etc/polkit-1/rules.d/void-live.rules <<_EOF
+polkit.addAdminRule(function(action, subject) {
+    return ["unix-group:wheel"];
+});
+
+polkit.addRule(function(action, subject) {
+    if (subject.isInGroup("wheel")) {
+        return polkit.Result.YES;
+    }
+});
+_EOF
+    chown polkitd:polkitd ${NEWROOT}/etc/polkit-1/rules.d/10-void-live.rules
+fi