config/acct-group: provide userdb group record

this is required when loading the sysext image to dynamically load /
unload the groups provided by the image.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
This commit is contained in:
Mathieu Tortuyaux 2024-03-27 17:48:21 +01:00
parent df4b910323
commit 0355630109
No known key found for this signature in database
GPG Key ID: AC5CCFB52545D9B8
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# This is used to convert regular user / group entries to
# userdb entries (in JSON format) to later be consumed by userdbd
# when loading the sysext image on the instance.
# The user / groups will be created dynamically and if the sysext image is
# removed the entries will be removed as well.
cros_post_src_install_add_userdb_record(){
insinto /usr/lib/userdb
newins - ${ACCT_GROUP_NAME}.group < <(
printf '{"groupName":"%q","gid":%q}\n' \
"${ACCT_GROUP_NAME}" \
"${_ACCT_GROUP_ID/#-*/-}"
)
}

View File

@ -0,0 +1,13 @@
# This is used to convert regular user / group entries to
# userdb entries (in JSON format) to later be consumed by userdbd
# when loading the sysext image on the instance.
# The user / groups will be created dynamically and if the sysext image is
# removed the entries will be removed as well.
cros_post_src_install_add_userdb_record(){
insinto /usr/lib/userdb
newins - ${ACCT_GROUP_NAME}.group < <(
printf '{"groupName":"%q","gid":%q}\n' \
"${ACCT_GROUP_NAME}" \
"${_ACCT_GROUP_ID/#-*/-}"
)
}

View File

@ -0,0 +1,13 @@
# This is used to convert regular user / group entries to
# userdb entries (in JSON format) to later be consumed by userdbd
# when loading the sysext image on the instance.
# The user / groups will be created dynamically and if the sysext image is
# removed the entries will be removed as well.
cros_post_src_install_add_userdb_record(){
insinto /usr/lib/userdb
newins - ${ACCT_GROUP_NAME}.group < <(
printf '{"groupName":"%q","gid":%q}\n' \
"${ACCT_GROUP_NAME}" \
"${_ACCT_GROUP_ID/#-*/-}"
)
}