From d54c5715f0f56218f75be145197169560eb95ef2 Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Wed, 23 Mar 2022 10:19:36 -0400 Subject: [PATCH] Add user rdc to render or video group Add user rdc to render or video group to access KFD for diagnostic. Change-Id: Ie9b4ea65402319a2aae255063f8c79e56979a47f --- src/DEBIAN_postinst.in | 5 +++++ src/RPM_rpm_post.in | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/DEBIAN_postinst.in b/src/DEBIAN_postinst.in index e29c770c10..a878cf688b 100755 --- a/src/DEBIAN_postinst.in +++ b/src/DEBIAN_postinst.in @@ -4,6 +4,11 @@ # it already exists do_create_rdc_user() { useradd -r -s /bin/nologin rdc + if [ $(getent group render) ]; then + usermod -a -G render rdc + else + usermod -a -G video rdc + fi # Make sure this doesn't return non-zero if an id already exists return 0 } diff --git a/src/RPM_rpm_post.in b/src/RPM_rpm_post.in index f99611e85e..3e535e6b39 100755 --- a/src/RPM_rpm_post.in +++ b/src/RPM_rpm_post.in @@ -2,6 +2,12 @@ do_create_rdc_user() { useradd -r -s /bin/nologin rdc + if [ $(getent group render) ]; then + usermod -a -G render rdc + else + usermod -a -G video rdc + fi + # Make sure this doesn't return non-zero if an id already exists return 0 }