Commit 16239493 authored by Kristian Klausen's avatar Kristian Klausen 🎉
Browse files

Only install polkit in the vagrant images

I'm not sure polkit is needed in the vagrant images, but it is
definitely not needed in the cloud-image.
parent 9698fe4c
......@@ -73,7 +73,7 @@ EOF
echo "Server = ${MIRROR}" >mirrorlist
# We use the hosts package cache
pacstrap -c -C pacman.conf -M "${MOUNT}" base linux grub openssh sudo polkit haveged btrfs-progs reflector
pacstrap -c -C pacman.conf -M "${MOUNT}" base linux grub openssh sudo haveged btrfs-progs reflector
cp mirrorlist "${MOUNT}/etc/pacman.d/"
}
......@@ -180,9 +180,17 @@ function cloud_image_post() {
rm "${1}"
}
function vagrant_qemu() {
function vagrant_common() {
arch-chroot "${MOUNT}" /bin/bash < <(cat "${ORIG_PWD}"/http/install-{vagrant,common}.sh)
arch-chroot "${MOUNT}" /usr/bin/pacman -S --noconfirm netctl
arch-chroot "${MOUNT}" /usr/bin/pacman -S --noconfirm netctl polkit
# setting automatic authentication for any action requiring admin rights via Polkit
cat <<EOF >"${MOUNT}/etc/polkit-1/rules.d/49-nopasswd_global.rules"
polkit.addRule(function(action, subject) {
if (subject.isInGroup("vagrant")) {
return polkit.Result.YES;
}
});
EOF
}
function vagrant_qemu_post() {
......@@ -205,8 +213,8 @@ EOF
}
function vagrant_virtualbox() {
arch-chroot "${MOUNT}" /bin/bash < <(cat "${ORIG_PWD}"/http/install-{vagrant,common}.sh)
arch-chroot "${MOUNT}" /usr/bin/pacman -S --noconfirm netctl virtualbox-guest-utils-nox
vagrant_common
arch-chroot "${MOUNT}" /usr/bin/pacman -S --noconfirm virtualbox-guest-utils-nox
arch-chroot "${MOUNT}" /usr/bin/systemctl enable vboxservice
}
......@@ -260,7 +268,7 @@ function main() {
build_version="${1}"
fi
create_image "Arch-Linux-x86_64-cloudimg-${build_version}.qcow2" cloud_image cloud_image_post
create_image "Arch-Linux-x86_64-libvirt-${build_version}.box" vagrant_qemu vagrant_qemu_post
create_image "Arch-Linux-x86_64-libvirt-${build_version}.box" vagrant_common vagrant_qemu_post
create_image "Arch-Linux-x86_64-virtualbox-${build_version}.box" vagrant_virtualbox vagrant_virtualbox_post
}
main "$@"
......@@ -7,15 +7,6 @@ set -x
useradd -m -U "${NEWUSER}"
echo -e "${NEWUSER}\n${NEWUSER}" | passwd "${NEWUSER}"
# setting automatic authentication for any action requiring admin rights via Polkit
cat <<EOF >/etc/polkit-1/rules.d/49-nopasswd_global.rules
polkit.addRule(function(action, subject) {
if (subject.isInGroup("${NEWUSER}")) {
return polkit.Result.YES;
}
});
EOF
# setting sudo for the user
cat <<EOF >"/etc/sudoers.d/${NEWUSER}"
Defaults:${NEWUSER} !requiretty
......
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