zengxyz / rpms / anaconda

Forked from rpms/anaconda 4 months ago
Clone
Blob Blame History Raw
From 887a288bb2b021571033148b5468042ce7b5b75e Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa@centosproject.org>
Date: Sun, 27 Jun 2021 21:01:07 -0400
Subject: [PATCH 20003/20005] Add support for detecting the Hyperscale variant
 in liveinst

Anaconda does not rely on os-release(5) data directly to determine
which product data to load, but instead needs either a /.buildstamp
file or logic to populate environment variables to have Anaconda
select the right configuration.

This change adds logic to set the ANACONDA_PRODUCTVARIANT variable
when the Hyperscale variant is detected on the system.
---
 data/liveinst/liveinst | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/data/liveinst/liveinst b/data/liveinst/liveinst
index 5cf32ec..cc5872c 100755
--- a/data/liveinst/liveinst
+++ b/data/liveinst/liveinst
@@ -46,6 +46,14 @@ if [ -f /etc/system-release ]; then
     export ANACONDA_PRODUCTVERSION=$( cat /etc/system-release | sed -r -e 's/^.* ([0-9\.]+).*$/\1/' )
 fi
 
+# set PRODUCTVARIANT if this is a CentOS Stream Hyperscale live image
+if [ -f /etc/os-release ]; then
+    variantid=$( grep VARIANT_ID /etc/os-release | tail -1 | cut -d= -f2)
+    if [ "$variantid" = "hyperscale" ]; then
+        export ANACONDA_PRODUCTVARIANT="Hyperscale"
+    fi
+fi
+
 # set PRODUCTVARIANT if this is a Fedora Workstation live image
 # FIXME really, livemedia-creator should include .buildstamp in live
 # images, if it did, we could remove this:
-- 
2.43.0