From ad0975c01ec5783f5fce8cfc1320a161e46d8093 Mon Sep 17 00:00:00 2001
From: Wang Ziming <wangziming.huawei.com>
Date: Thu, 7 May 2020 16:53:20 +0800
Subject: [PATCH 16/28] openEuler: add openEuler 20.03 support

Introduce support to openEuler 20.03. It comes with a download asset file,
and the file will be updated continuously.

Signed-off-by: Wang Ziming <wangziming.huawei.com>
---
 shared/cfg/guest-os/Linux/openEuler.cfg       |  8 +++
 shared/cfg/guest-os/Linux/openEuler/20.03.cfg | 54 +++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 shared/cfg/guest-os/Linux/openEuler.cfg
 create mode 100644 shared/cfg/guest-os/Linux/openEuler/20.03.cfg

diff --git a/shared/cfg/guest-os/Linux/openEuler.cfg b/shared/cfg/guest-os/Linux/openEuler.cfg
new file mode 100644
index 00000000..49911f96
--- /dev/null
+++ b/shared/cfg/guest-os/Linux/openEuler.cfg
@@ -0,0 +1,8 @@
+- openEuler:
+    no setup
+    shell_prompt = "^\[.*\][\#\$]\s*$"
+    os_variant = openEuler20.03
+    unattended_install, svirt_install:
+        boot_path = "images/pxeboot"
+        kernel_params = "ks=cdrom nicdelay=60 console=ttyS0,115200 console=tty0"
+        anaconda_log = "yes"
diff --git a/shared/cfg/guest-os/Linux/openEuler/20.03.cfg b/shared/cfg/guest-os/Linux/openEuler/20.03.cfg
new file mode 100644
index 00000000..ee44d48b
--- /dev/null
+++ b/shared/cfg/guest-os/Linux/openEuler/20.03.cfg
@@ -0,0 +1,54 @@
+- 20.03:
+    variants:
+        - aarch64:
+            vm_arch_name = aarch64
+        - x86_64:
+            vm_arch_name = x86_64
+    image_name = images/openEuler-20.03-${vm_arch_name}
+    os_variant = openEuler20.03
+    # default boot path is set in ../openEuler.cfg: boot_path = "images/pxeboot"
+    no unattended_install..floppy_ks
+    unattended_install, svirt_install:
+        kernel = images/openEuler-20.03-${vm_arch_name}}/vmlinuz
+        initrd = images/openEuler-20.03-${vm_arch_name}/initrd.img
+        # Unattended-file does not require any changes
+        unattended_file = unattended/openEuler-20.03.ks
+        unattended_install.url:
+            # Installation works fine with mem=1024 on methods such as cdrom
+            # but fails ("No space left on device") with methods such as url.
+            mem = 2048
+            # Unless overridden use secondary url, because it's the most common one
+            url = https://repo.openeuler.org/openEuler-20.03-LTS/OS/${vm_arch_name}/
+        # ARCH dependent things
+        aarch64:
+            arm64-mmio:
+                # Only latest updates contain virtio driver
+                inactivity_watcher = none
+                take_regular_screendumps = no
+            kernel_params = "console=ttyAMA0 console=ttyS0 serial"
+            unattended_install.cdrom:
+                md5sum_cd1 = 92b07ba5f63ebdc558bf7dbd3cbc9cec
+                md5sum_1m_cd1 = 9b6ae2c918f815e534713db1ce1b4ad4
+            unattended_install.url:
+                url =  https://repo.openeuler.org/openEuler-20.03-LTS/OS/${vm_arch_name}/
+                sha1sum_vmlinuz = 07dd9f1f24803464a768ecaa9bab15d0
+                sha1sum_initrd = e38f7129f38e705f0e6a723a2c16fff9
+        x86_64:
+            kernel_params = "console=tty0 console=ttyS0"
+            unattended_install.cdrom:
+                md5sum_cd1 = 8bcd1d80ef7966b2f9ad510c3d3dc3b3
+                md5sum_1m_cd1 = 5ee47948e20dd3f9c1ab74654fab5c6d
+            unattended_install.url:
+                url = https://repo.openeuler.org/openEuler-20.03-LTS/OS/${vm_arch_name}/
+                sha1sum_vmlinuz = 5152015b2c9a90738bb9636a758d00aa
+                sha1sum_initrd = 993a79c3ac44973b474871de41ad3f94
+        # Shared specific setting
+        unattended_install.url:
+            kernel_params += " inst.repo=${url}"
+        unattended_install.cdrom:
+            cdrom_cd1 = isos/linux/openEuler-20.03-LTS-${vm_arch_name}-dvd.iso
+        extra_cdrom_ks:
+            kernel_params += " ks=cdrom"
+            cdrom_unattended = images/openEuler-20.03-${vm_arch_name}/ks.iso
+        syslog_server_proto = tcp
+        kernel_params += " nicdelay=60 inst.sshd ip=dhcp"
-- 
2.23.0

