Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
madelen-axis committed Nov 30, 2023
1 parent 9924862 commit 1cba07c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" |
Expand Down
16 changes: 8 additions & 8 deletions app/postinstallscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1cba07c

Please sign in to comment.