mklive: force-add vmklive dracut module and generate a polkit rules file to bypass auth.

This commit is contained in:
Juan RP
2013-06-02 12:08:27 +02:00
parent 97f9b02fd7
commit 699937efca
2 changed files with 18 additions and 3 deletions

View File

@@ -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