netgod / rpms / anaconda

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