zengxyz / rpms / anaconda

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