Skip to content

Commit

Permalink
fix: just dx-group append group entry from /usr/lib/group (#1767)
Browse files Browse the repository at this point in the history
Co-authored-by: m2 <[email protected]>
  • Loading branch information
obispobruno and m2Giles authored Oct 12, 2024
1 parent 7852931 commit 4729268
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
16 changes: 15 additions & 1 deletion just/bluefin-system.just
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,25 @@ ptyxis-transparency opacity="0.95":
# Configure docker,incus-admin,lxd,libvirt container manager permissions
dx-group:
#!/usr/bin/env bash
append_group() {
local group_name="$1"
if ! grep -q "^$group_name:" /etc/group; then
echo "Appending $group_name to /etc/group"
grep "^$group_name:" /usr/lib/group | sudo tee -a /etc/group > /dev/null
fi
}
append_group docker
append_group incus-admin
append_group lxd
append_group libvirt

sudo usermod -aG docker $USER
sudo usermod -aG incus-admin $USER
sudo usermod -aG lxd $USER
sudo usermod -aG libvirt $USER
@echo "Logout to use docker, incus-admin, lxd, libvirt"
echo "Logout to use docker, incus-admin, lxd, libvirt"

# Configure system to use vfio and kvmfr
configure-vfio ACTION="":
Expand Down
14 changes: 14 additions & 0 deletions system_files/dx/usr/libexec/bluefin-dx-groups
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,21 @@ if [[ -f $GROUP_SETUP_VER_FILE && "$GROUP_SETUP_VER" = "$GROUP_SETUP_VER_RAN" ]]
exit 0
fi

# Function to append a group entry to /etc/group
append_group() {
local group_name="$1"
if ! grep -q "^$group_name:" /etc/group; then
echo "Appending $group_name to /etc/group"
grep "^$group_name:" /usr/lib/group | tee -a /etc/group > /dev/null
fi
}

# Setup Groups
append_group docker
append_group incus-admin
append_group lxd
append_group libvirt

wheelarray=($(getent group wheel | cut -d ":" -f 4 | tr ',' '\n'))
for user in $wheelarray
do
Expand Down

0 comments on commit 4729268

Please sign in to comment.