From: Leo Famulari <leo@famulari.name>
To: Marius Bakke <marius@gnu.org>
Cc: 42129@debbugs.gnu.org
Subject: bug#42129: guix-install.sh does not add build users to kvm group
Date: Thu, 8 Apr 2021 18:38:59 -0400 [thread overview]
Message-ID: <YG+GA/0KSRuqnbM2@jasmine.lan> (raw)
In-Reply-To: <875zb91w0d.fsf@gnu.org>
[-- Attachment #1.1: Type: text/plain, Size: 299 bytes --]
On Mon, Jun 29, 2020 at 10:01:54PM +0200, Marius Bakke wrote:
> guix-install.sh should add the build users to the 'kvm' group if present
> so that commands that require use of KVM can succeed.
Here is a patch (untested) that makes sure a 'kvm' group exists and adds
it to the guixbuilders' groups.
[-- Attachment #1.2: 0001-guix-install.sh-Add-the-build-users-to-the-kvm-group.patch --]
[-- Type: text/plain, Size: 1643 bytes --]
From 929102f7b52d00f731a9f61fb2fe32bad441f1dd Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Thu, 8 Apr 2021 18:34:43 -0400
Subject: [PATCH] guix-install.sh: Add the build users to the 'kvm' group.
* etc/guix-install.sh (sys_create_build_user): Ensure that a 'kvm' group exists,
and add it to the guixbuilders' lists of supplementary groups.
---
etc/guix-install.sh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index c84e7b7577..15fa44f1e2 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -330,15 +330,22 @@ sys_create_build_user()
_msg "${PAS}group <guixbuild> created"
fi
+ if [ $(getent group kvm) ]; then
+ _msg "${INF}group kvm exists"
+ else
+ groupadd --system kvm
+ _msg "${PAS}group <kvm> created"
+ fi
+
for i in $(seq -w 1 10); do
if id "guixbuilder${i}" &>/dev/null; then
_msg "${INF}user is already in the system, reset"
- usermod -g guixbuild -G guixbuild \
+ usermod -g guixbuild -G guixbuild,kvm \
-d /var/empty -s "$(which nologin)" \
-c "Guix build user $i" \
"guixbuilder${i}";
else
- useradd -g guixbuild -G guixbuild \
+ useradd -g guixbuild -G guixbuild,kvm \
-d /var/empty -s "$(which nologin)" \
-c "Guix build user $i" --system \
"guixbuilder${i}";
--
2.31.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-04-08 22:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-29 20:01 bug#42129: guix-install.sh does not add build users to kvm group Marius Bakke
2021-04-08 22:38 ` Leo Famulari [this message]
2021-04-08 23:03 ` Leo Famulari
2021-04-14 19:33 ` Leo Famulari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YG+GA/0KSRuqnbM2@jasmine.lan \
--to=leo@famulari.name \
--cc=42129@debbugs.gnu.org \
--cc=marius@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.