From 1cba07c2b1e08e60bdf4c6063b82bccd5321b143 Mon Sep 17 00:00:00 2001 From: madelen-axis Date: Thu, 30 Nov 2023 14:46:33 +0100 Subject: [PATCH] review fixes --- README.md | 1 - app/postinstallscript.sh | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a421777..4964341 100644 --- a/README.md +++ b/README.md @@ -349,7 +349,6 @@ of the groups need to be used. At the moment of writing this the mappings are | ------------ | ------------------ | | datacache | "1" | | sdk | "2" | -| sdk | "2" | | storage | "3" | | vdo | "4" | | optics | "5" | diff --git a/app/postinstallscript.sh b/app/postinstallscript.sh index a31fc31..dd39c46 100644 --- a/app/postinstallscript.sh +++ b/app/postinstallscript.sh @@ -9,10 +9,10 @@ fi _appname=dockerdwrapperwithcompose _appdirectory=/usr/local/packages/$_appname _uname="$(stat -c '%U' "$_appdirectory")" -_uid="$(id "$_uname" -u)" -_gid="$(id "$_uname" -g)" -_gname="$(id "$_uname" -gn)" -_grpsid="$(id "$_uname" -G)" +_uid="$(id "$_uname" -u)" # user id +_gid="$(id "$_uname" -g)" # user group id +_gname="$(id "$_uname" -gn)" # user group name +_all_gids="$(id "$_uname" -G)" # user sub-group ids # If the device supports cgroups v2 we need to start the user.service if [ ! -d /sys/fs/cgroup/unified ]; then @@ -29,11 +29,11 @@ Wants=acap-user@$_uid.service" >> /etc/systemd/system/sdkdockerdwrapperwithcompo fi -# Create mapping for subuid and subgid - both shall use user id! +# Create mapping for subuid and subgid - both shall use user id as first value! echo "$_uid:100000:65536" >> /etc/subuid -for gid in $_grpsid ; do - if [ "$gid" -ne "$_gid" ]; then - echo "$_uid:$gid:1" >> /etc/subgid +for sub_group_id in $_all_gids ; do + if [ "$sub_group_id" -ne "$_gid" ]; then + echo "$_uid:$sub_group_id:1" >> /etc/subgid fi done echo "$_uid:100000:65536" >> /etc/subgid