Egbert Eich 199ba0de24 Initial import
Signed-off-by: Egbert Eich <eich@suse.com>
2025-09-01 12:49:11 +02:00
2025-09-01 12:49:11 +02:00
2025-09-01 12:49:11 +02:00
2025-09-01 12:49:11 +02:00
2025-09-01 12:49:11 +02:00
2025-09-01 12:49:11 +02:00
2025-09-01 12:49:11 +02:00

ROCm Packaging on SUSE

Motivations

To achieve an more or less identical 'look and feel' between Tumbleweed and Fedora, we strive to the same spec files on both. A set of ROCm packages has been available on Fedora for a while already, so it is best to continue to develop packages there. The burden on packagers at SUSE is slightly higher when submitting updates, but the hope is that this will help to reduce the overall burden considerably.

Caveats

Since Fedora has been using Git as their SCM for packages for a while already and SUSE is currently switching to Git, this appears to be straight forward. Unfortunately it is not quite like this: SUSE uses sha256 to identify commits, while Fedora still uses sha1. Also, the Fedora packaging format is different from SUSE's standard - most notibly, SUSE maintains the changelog in a separate file. So there are some conversions required to get from a Fedora package to a package that will be accetible in openSUSE Factory. Luckily, this entire process can be scripted.

Theory of Operation

The process involves: Fetch updates from Fedora -> Test build with Factory -> Convert to SUSE standard -> Add to devel project. For this, we need to maintain two git repositories for each package locally:

  1. a clone of the 'upstream' source in Fedora at https://src.fedoraproject.org/rpms/<rocm_package>
  2. a clone of the SUSE ROCm devel project repository: gitea@src.opensuse.org:ROCm/<rocm_package>.git A fill list of packages can be found in the file 'packagelist'

High Level Script

  1. convert_package_to_suse.sh Converts 'upstream' packages sha256 pushes them to the correspondig devel package and converts the spec file into a SUSE compliant format1 .

Plumbing

These are used by the tools above, normally you don't have to call them directly. They are listed here as a reference.

  1. git_to_256 Takes the latest current state of the 'origin/rawhide' branch from the ingress package converts the object format from sha1 to sha256 and imports it into the devel project.
  2. susefy-package.sh converts the spec file format, generates a changelog, downloads the sources and creates a commit that can subsequently be submitted to openSUSE Factory1 .

Workflow

For the following, we assume that the devel project clone will be in the directory $BASEDIR/ROCm while the ingress project will be in the directory$BASEDIR/ROCmUpstream. While the directory containing this readme is located at $SCRIPTDIR. For this to work, you will need recent versions of osc, obs-service-download_files, obs-service-format_spec_file and obs-git-init from openSUSE:Tools installed.

Getting Started - 1st Time Setup

This typically needs to be done only once to populate the directories ROCm and ROCmUpstream with package Git repositories.

  1. Copy the file packagelist from this repo to either directory.
    cp $SCRIPTDIR/packagelist $BASEDIR/ROCmUpstream
    
  2. Enter the directory ROCmUpstream and clone the upstream packages:
    cd $BASEDIR/ROCmUpstream
    $SCRIPTDIR/initialize_rocm.sh
    
  3. Enter the directory ROCm and clone the devel project:
    cd $BASEDIR/ROCm
    $SCRIPTDIR/initialize_rocm_suse.sh
    cd ..
    

Now you should be all set.

Pull latest updates into the local copy from the upstream project:

To pull the latest updates you may run a command like this:

cd $BASEDIR/ROCmUpstream
for i in `cat packagelist`; do
  cd $i
  git fetch
  cd - &>/dev/null
done

Migration to Devel Project

Once the packages have been updated, you can migrate them to the devel project:

cd $BASEDIR/ROCmUpstream
$SCRIPTDIR/convert_package_to_suse.sh -u rawhide -t main $BASEDIR/ROCm

  1. Currently, you will need patches to the packages build and obs-service_download_spec_files that have not been released, yet. ↩︎

Description
No description provided
Readme 36 KiB
Languages
Shell 100%