Add 'projects/rdc/' from commit '5ae7eeb3550d4cb14cbc31d3022e545b054f1ad1'

git-subtree-dir: projects/rdc
git-subtree-mainline: a68afa42a1
git-subtree-split: 5ae7eeb355
Bu işleme şunda yer alıyor:
systems-assistant[bot]
2025-07-22 22:52:37 +00:00
işleme c2312be1a2
393 değiştirilmiş dosya ile 49849 ekleme ve 0 silme
Çalıştırılabilir dosya
+116
Dosyayı Görüntüle
@@ -0,0 +1,116 @@
#!/bin/bash
do_update_alternatives(){
# skip update if program doesn't exist
command -v update-alternatives >/dev/null || return 0
local binaries altscore now
now=$(date -u +%s) # Number of seconds since 1 Jan 1970
# The reason for this approach rather than using the build number
# is to allow for jobs from different builds. In one build job the
# job number might be at 1200, whilst in a release job the number
# may be only 1. This approach assums that if you install a build
# with a different semantic version then the highest is the
# desired one, but if you install two with the same semver then
# the newest is the desired version.
# Build up a score. It needs to fit in 32 bits
altscore=$((@VERSION_MAJOR@ - 3))
altscore=$((altscore * 14 + @VERSION_MINOR@)) # Allow up to 14 minor
altscore=$((altscore * 14 + @VERSION_PATCH@)) # Allow up to 14 patch
# So far if the version is less than 9 we have a number (altscore)
# that is less than 1175. 2**31/1175 is about 1.8 million. So
# multiply altscore by 1,000,000 and add in a factor of how many
# minutes have passed from an arbitary point in time (1,600,000,000
# seconds after 1 Jan 1970 or Sep 13 12:26:40 2020) on the
# basis that no one is going to be installing a new version more
# often than every minute. This does get things wrong if a million
# minutes pass and you are downgrading, but the chances of someone
# waiting almost 2 years between installing a version and the
# previous patch level is small.
altscore=$((altscore*1000000+(now-1600000000)/60))
binaries=(
rdcd
rdci
)
for i in "${binaries[@]}"
do
# No obvious recover strategy if things fail
# No manual or other slave pages to install
if [ -e @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/"$i" ]
then
update-alternatives --install /usr/bin/"$i" "$i" \
@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/"$i" "$altscore"
else
echo "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/$i not found, but that is OK" >&2
fi
done
true
}
# This will return 0 if an id is created and non-zero if
# it already exists
# https://www.debian.org/doc/debian-policy/ch-opersys.html#users-and-groups
do_create_rdc_user() {
# create rdc group
if ! getent group rdc > /dev/null 2>&1 ; then
addgroup --system rdc
fi
# create rdc user
if ! getent passwd rdc > /dev/null 2>&1 ; then
adduser \
--system \
--quiet \
--home /nonexistent \
--no-create-home \
--disabled-password \
--ingroup rdc \
rdc
fi
# only add render if it exists
if getent group render > /dev/null 2>&1 ; then
usermod -a -G render rdc
fi
# add video always
usermod -a -G video rdc
# Make sure this doesn't return non-zero if an id already exists
return 0
}
create_rdc_service() {
#Symlink RDC Service
if [ -d /run/systemd/system ]; then
ln -s -f -r @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/rdc/rdc.service /lib/systemd/system/rdc.service
fi
}
reload_systemd() {
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
return 0
}
case "$1" in
configure)
do_update_alternatives
do_create_rdc_user
create_rdc_service
reload_systemd
exit 0
;;
abort-upgrade|abort-remove|abort-deconfigure)
echo "$1"
;;
*)
exit 0
;;
esac
+58
Dosyayı Görüntüle
@@ -0,0 +1,58 @@
#!/bin/bash
do_update_alternatives(){
# skip update if program doesn't exist
command -v update-alternatives >/dev/null || return 0
binaries=(
rdcd
rdci
)
for i in "${binaries[@]}"
do
update-alternatives --remove $i @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/$i
done
}
stop_rdc() {
#stop RDC service if systemd exists and service is running
if [ -d /run/systemd/system ] && $( systemctl is-active --quiet rdc ); then
systemctl stop rdc
fi
return 0
}
rm_rdc_service() {
local LINK=/lib/systemd/system/rdc.service
if [ -L $LINK ]; then
unlink $LINK
fi
return 0
}
reload_systemd() {
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
return 0
}
rm_pyc() {
# remove pyc file generated by python
rm -rf /@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/@RDC@/python_binding/__pycache__
}
case "$1" in
remove | upgrade )
stop_rdc
rm_rdc_service
reload_systemd
rm_pyc
do_update_alternatives
;;
purge)
;;
*)
exit 0
;;
esac
Çalıştırılabilir dosya
+45
Dosyayı Görüntüle
@@ -0,0 +1,45 @@
#!/bin/bash
do_update_alternatives(){
# skip update if program doesn't exist
command -v update-alternatives >/dev/null || return 0
binaries=(
rdcd
rdci
)
for i in "${binaries[@]}"
do
update-alternatives --remove "$i" $RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_BINDIR@/$i
done
}
stop_rdc() {
#stop RDC service if systemd exists and service is running
if [ -d /run/systemd/system ] && $( systemctl is-active --quiet rdc ); then
systemctl stop rdc
fi
return 0
}
rm_rdc_service() {
local LINK=@DISTRO_ROOT@/rdc.service
if [ -L $LINK ]; then
unlink $LINK
fi
return 0
}
reload_systemd() {
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
return 0
}
if [ "$1" -le 1 ]; then
# perform the below actions for rpm remove($1=0) or upgrade($1=1) operations
stop_rdc
rm_rdc_service
reload_systemd
do_update_alternatives
fi
+7
Dosyayı Görüntüle
@@ -0,0 +1,7 @@
#!/bin/bash
if [ $1 -le 1 ]; then
# perform the below actions for rpm remove($1=0) or upgrade($1=1) operations
# remove pyc file generated by python
rm -rf /$RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_LIBEXECDIR@/@RDC@/python_binding/__pycache__
fi
Çalıştırılabilir dosya
+100
Dosyayı Görüntüle
@@ -0,0 +1,100 @@
#!/bin/bash
do_update_alternatives(){
# skip update if program doesn't exist
command -v update-alternatives >/dev/null || return 0
local binaries altscore now
now=$(date -u +%s) # Number of seconds since 1 Jan 1970
# The reason for this approach rather than using the build number
# is to allow for jobs from different builds. In one build job the
# job number might be at 1200, whilst in a release job the number
# may be only 1. This approach assums that if you install a build
# with a different semantic version then the highest is the
# desired one, but if you install two with the same semver then
# the newest is the desired version.
# Build up a score. It needs to fit in 32 bits
altscore=$((@VERSION_MAJOR@ - 3))
altscore=$((altscore * 14 + @VERSION_MINOR@)) # Allow up to 14 minor
altscore=$((altscore * 14 + @VERSION_PATCH@)) # Allow up to 14 patch
# So far if the version is less than 9 we have a number (altscore)
# that is less than 1175. 2**31/1175 is about 1.8 million. So
# multiply altscore by 1,000,000 and add in a factor of how many
# minutes have passed from an arbitary point in time (1,600,000,000
# seconds after 1 Jan 1970 or Sep 13 12:26:40 2020) on the
# basis that no one is going to be installing a new version more
# often than every minute. This does get things wrong if a million
# minutes pass and you are downgrading, but the chances of someone
# waiting almost 2 years between installing a version and the
# previous patch level is small.
altscore=$((altscore*1000000+(now-1600000000)/60))
binaries=(
rdcd
rdci
)
for i in "${binaries[@]}"
do
# No obvious recover strategy if things fail
# No manual or other slave pages to install
if [ -e $RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_BINDIR@/"$i" ]
then
update-alternatives --install /usr/bin/"$i" "$i" \
$RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_BINDIR@/"$i" "$altscore"
else
echo "$RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_BINDIR@/$i not found, but that is OK" >&2
fi
done
true
}
# https://fedoraproject.org/wiki/Packaging%3aUsersAndGroups
do_create_rdc_user() {
# create rdc group
if ! getent group rdc > /dev/null 2>&1 ; then
groupadd --system rdc
fi
# create rdc user
if ! getent passwd rdc > /dev/null 2>&1 ; then
useradd -r -g rdc -s /sbin/nologin rdc
fi
# only add render if it exists
if getent group render > /dev/null 2>&1 ; then
usermod -a -G render rdc
fi
# add video always
usermod -a -G video rdc
# Make sure this doesn't return non-zero if an id already exists
return 0
}
create_rdc_service() {
if [ -d /run/systemd/system ]; then
ln -s -f -r $RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_LIBEXECDIR@/rdc/rdc.service @DISTRO_ROOT@/rdc.service
fi
}
reload_systemd() {
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
return 0
}
do_update_alternatives
do_create_rdc_user
#Symlink RDC Service
create_rdc_service
#Request systemctl to reload file since RDC is adding new file/service
reload_systemd
Çalıştırılabilir dosya
+34
Dosyayı Görüntüle
@@ -0,0 +1,34 @@
/*
Copyright (c) 2019 - present Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef INCLUDE_RDC_RDC64CONFIG_H_
#define INCLUDE_RDC_RDC64CONFIG_H_
// This file is generated on build.
#define amd_smi_VERSION_MAJOR @amd_smi_VERSION_MAJOR@
#define amd_smi_VERSION_MINOR @amd_smi_VERSION_MINOR@
#define amd_smi_VERSION_PATCH @amd_smi_VERSION_PATCH@
#define amd_smi_VERSION_BUILD "@amd_smi_VERSION_BUILD@"
#endif // INCLUDE_RDC_RDC64CONFIG_H_