netgod / rpms / anaconda

Forked from rpms/anaconda 2 years ago
Clone
c454ca
From d7f5ce82a98b66831edaf6afd194ea43ce107c84 Mon Sep 17 00:00:00 2001
c454ca
From: Neal Gompa <ngompa@centosproject.org>
c454ca
Date: Sun, 27 Jun 2021 21:01:07 -0400
c454ca
Subject: [PATCH 20003/20004] Add support for detecting the Hyperscale variant
c454ca
 in liveinst
c454ca
c454ca
Anaconda does not rely on os-release(5) data directly to determine
c454ca
which product data to load, but instead needs either a /.buildstamp
c454ca
file or logic to populate environment variables to have Anaconda
c454ca
select the right configuration.
c454ca
c454ca
This change adds logic to set the ANACONDA_PRODUCTVARIANT variable
c454ca
when the Hyperscale variant is detected on the system.
c454ca
---
c454ca
 data/liveinst/liveinst | 8 ++++++++
c454ca
 1 file changed, 8 insertions(+)
c454ca
c454ca
diff --git a/data/liveinst/liveinst b/data/liveinst/liveinst
c454ca
index 5cf32ecccf..cc5872c0ff 100755
c454ca
--- a/data/liveinst/liveinst
c454ca
+++ b/data/liveinst/liveinst
c454ca
@@ -46,6 +46,14 @@ if [ -f /etc/system-release ]; then
c454ca
     export ANACONDA_PRODUCTVERSION=$( cat /etc/system-release | sed -r -e 's/^.* ([0-9\.]+).*$/\1/' )
c454ca
 fi
c454ca
 
c454ca
+# set PRODUCTVARIANT if this is a CentOS Stream Hyperscale live image
c454ca
+if [ -f /etc/os-release ]; then
c454ca
+    variantid=$( grep VARIANT_ID /etc/os-release | tail -1 | cut -d= -f2)
c454ca
+    if [ "$variantid" = "hyperscale" ]; then
c454ca
+        export ANACONDA_PRODUCTVARIANT="Hyperscale"
c454ca
+    fi
c454ca
+fi
c454ca
+
c454ca
 # set PRODUCTVARIANT if this is a Fedora Workstation live image
c454ca
 # FIXME really, livemedia-creator should include .buildstamp in live
c454ca
 # images, if it did, we could remove this:
c454ca
-- 
c454ca
2.31.1
c454ca