diff options
author | Simon Rettberg | 2021-07-16 11:38:51 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-07-16 11:38:51 +0200 |
commit | d5ee66fecc5a577dfe8af5c67fe271cef6ec446a (patch) | |
tree | 4c041a82115a02aad3fdd09ff0173bf841c1adde /core/modules/libvirt/module.build | |
parent | [nvidia-libs/nvidia-kernel] Add module_init hook, rename load hook (diff) | |
download | mltk-d5ee66fecc5a577dfe8af5c67fe271cef6ec446a.tar.gz mltk-d5ee66fecc5a577dfe8af5c67fe271cef6ec446a.tar.xz mltk-d5ee66fecc5a577dfe8af5c67fe271cef6ec446a.zip |
[libvirt/libvirt-users] Move libvirt-qemu user to main module
Diffstat (limited to 'core/modules/libvirt/module.build')
-rw-r--r-- | core/modules/libvirt/module.build | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/modules/libvirt/module.build b/core/modules/libvirt/module.build index 730af022..3672b4c2 100644 --- a/core/modules/libvirt/module.build +++ b/core/modules/libvirt/module.build @@ -1,4 +1,16 @@ #!/bin/bash + +module_init() { + local uid gid + # TODO theye functions suck, make thin wrappers around useradd et al. + gid="$( add_system_group "kvm" )" + uid="$( USER="libvirt-qemu" \ + GROUPID="$gid" \ + add_system_user )" + [ -z "$uid" ] && perror "Could not create libvirt-qemu user" + (( uid >= 1000 )) && perror "libvirt-qemu user has uid >= 1000" +} + fetch_source() { : } @@ -9,6 +21,8 @@ build() { post_copy() { # remove default network configuration + # TODO: Some REQUIRED_DELETIONS var that handles this? This would not + # do the right thing in MiniLinux mode. rm "/etc/libvirt/qemu/networks/default.xml" rm "/etc/libvirt/qemu/networks/autostart/default.xml" } |