From 1f75f7f2c0d074b77133686e2c75255638868b2d0fe1627b23c4938de4ce8d8e Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.com>
Date: Wed, 2 Dec 2020 14:24:47 +0000
Subject: [PATCH 1/2] Accepting request 852634 from
 home:Guillaume_G:branches:openSUSE:Factory:ARM

- Add aarch64 support for kvm-and-xen image
- Add aarch64 support for MS-HyperV

OBS-URL: https://build.opensuse.org/request/show/852634
OBS-URL: https://build.opensuse.org/package/show/Virtualization:Appliances:Images:openSUSE-Tumbleweed/kiwi-templates-JeOS?expand=0&rev=47
---
 JeOS.kiwi                   | 90 +++++++++++++++++++++++++++++++++++--
 kiwi-templates-JeOS.changes | 10 +++++
 kiwi-templates-JeOS.spec    | 12 +++--
 3 files changed, 101 insertions(+), 11 deletions(-)

diff --git a/JeOS.kiwi b/JeOS.kiwi
index d2350eb..ef2e5c3 100644
--- a/JeOS.kiwi
+++ b/JeOS.kiwi
@@ -9,13 +9,29 @@
         <specification>openSUSE Tumbleweed JeOS</specification>
     </description>
     <profiles>
-        <profile name="kvm-and-xen" description="JeOS for KVM and HVM Xen" arch="x86_64"/>
+        <!-- Those two are only used as deps -->
+        <profile name="kvm-and-xen.x86_64" description="JeOS for KVM and HVM Xen" arch="x86_64"/>
+        <profile name="kvm-and-xen.aarch64" description="JeOS for KVM and HVM Xen" arch="aarch64"/>
+        <profile name="kvm-and-xen" description="JeOS for KVM and HVM Xen" arch="x86_64">
+            <requires profile="kvm-and-xen.x86_64"/>
+        </profile>
+        <profile name="kvm-and-xen" description="JeOS for KVM and HVM Xen" arch="aarch64">
+            <requires profile="kvm-and-xen.aarch64"/>
+        </profile>
         <profile name="VMware" description="JeOS for VMware" arch="x86_64"/>
-        <profile name="MS-HyperV" description="JeOS for Hyper-V" arch="x86_64"/>
+        <!-- Those two are only used as deps -->
+        <profile name="MS-HyperV.x86_64" description="JeOS for Hyper-V" arch="x86_64"/>
+        <profile name="MS-HyperV.aarch64" description="JeOS for Hyper-V" arch="aarch64"/>
+        <profile name="MS-HyperV" description="JeOS for Hyper-V" arch="x86_64">
+            <requires profile="MS-HyperV.x86_64"/>
+        </profile>
+        <profile name="MS-HyperV" description="JeOS for Hyper-V" arch="aarch64">
+            <requires profile="MS-HyperV.aarch64"/>
+        </profile>
         <profile name="OpenStack-Cloud" description="JeOS for OpenStack Cloud" arch="x86_64"/>
         <profile name="RaspberryPi" description="JeOS for the Raspberry Pi" arch="aarch64"/>
     </profiles>
-    <preferences profiles="kvm-and-xen">
+    <preferences profiles="kvm-and-xen.x86_64">
         <version>15.1.0</version>
         <packagemanager>zypper</packagemanager>
         <bootloader-theme>openSUSE</bootloader-theme>
@@ -48,6 +64,38 @@
         </type>
     </preferences>
 
+    <preferences profiles="kvm-and-xen.aarch64">
+        <version>15.1.0</version>
+        <packagemanager>zypper</packagemanager>
+        <bootloader-theme>openSUSE</bootloader-theme>
+        <rpm-excludedocs>true</rpm-excludedocs>
+        <type
+            image="vmx"
+            filesystem="btrfs"
+            format="qcow2"
+            bootloader="grub2"
+            firmware="uefi"
+            efipartsize="33"
+            kernelcmdline="quiet plymouth.enable=0 console=ttyS0,115200 console=tty0"
+            bootpartition="false"
+            bootkernel="custom"
+            devicepersistency="by-uuid"
+            btrfs_quota_groups="true"
+            btrfs_root_is_snapshot="true"
+        >
+            <systemdisk>
+                <volume name="home"/>
+                <volume name="root"/>
+                <volume name="opt"/>
+                <volume name="srv"/>
+                <volume name="boot/grub2/arm64-efi" mountpoint="boot/grub2/arm64-efi"/>
+                <volume name="usr/local"/>
+                <volume name="var" copy_on_write="false"/>
+            </systemdisk>
+            <size unit="G">24</size>
+        </type>
+    </preferences>
+
     <preferences profiles="VMware">
         <version>15.1.0</version>
         <packagemanager>zypper</packagemanager>
@@ -104,7 +152,7 @@
         </type>
     </preferences>
 
-    <preferences profiles="MS-HyperV">
+    <preferences profiles="MS-HyperV.x86_64">
         <version>15.1.0</version>
         <packagemanager>zypper</packagemanager>
         <bootloader-theme>openSUSE</bootloader-theme>
@@ -138,6 +186,40 @@
         </type>
     </preferences>
 
+    <preferences profiles="MS-HyperV.aarch64">
+        <version>15.1.0</version>
+        <packagemanager>zypper</packagemanager>
+        <bootloader-theme>openSUSE</bootloader-theme>
+        <rpm-excludedocs>true</rpm-excludedocs>
+        <type
+            image="vmx"
+            filesystem="btrfs"
+            format="vhdx"
+            boottimeout="10"
+            bootloader="grub2"
+            firmware="uefi"
+            efipartsize="33"
+            kernelcmdline="quiet plymouth.enable=0 rootdelay=300 console=ttyS0,115200 console=tty0 earlyprintk=ttyS0,115200"
+            bootpartition="false"
+            bootkernel="custom"
+            devicepersistency="by-uuid"
+            btrfs_quota_groups="true"
+            btrfs_root_is_snapshot="true"
+        >
+            <systemdisk>
+                <volume name="home"/>
+                <volume name="root"/>
+                <volume name="tmp"/>
+                <volume name="opt"/>
+                <volume name="srv"/>
+                <volume name="boot/grub2/arm64-efi" mountpoint="boot/grub2/arm64-efi"/>
+                <volume name="usr/local"/>
+                <volume name="var" copy_on_write="false"/>
+            </systemdisk>
+            <size unit="G">24</size>
+        </type>
+    </preferences>
+
     <preferences profiles="RaspberryPi">
         <version>15.1.0</version>
         <packagemanager>zypper</packagemanager>
diff --git a/kiwi-templates-JeOS.changes b/kiwi-templates-JeOS.changes
index 0445468..3de3fa6 100644
--- a/kiwi-templates-JeOS.changes
+++ b/kiwi-templates-JeOS.changes
@@ -1,3 +1,13 @@
+-------------------------------------------------------------------
+Wed Dec  2 13:58:56 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
+
+- Add aarch64 support for kvm-and-xen image
+
+-------------------------------------------------------------------
+Wed Dec  2 13:36:23 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
+
+- Add aarch64 support for MS-HyperV
+
 -------------------------------------------------------------------
 Fri Sep 11 07:34:51 UTC 2020 - Fabian Vogt <fvogt@suse.com>
 
diff --git a/kiwi-templates-JeOS.spec b/kiwi-templates-JeOS.spec
index 5fd7845..36b8d4d 100644
--- a/kiwi-templates-JeOS.spec
+++ b/kiwi-templates-JeOS.spec
@@ -17,15 +17,9 @@
 
 
 %define dest %_datadir/kiwi/image/openSUSE-Tumbleweed-JeOS
-
-%if "@BUILD_FLAVOR@" != ""
-ExclusiveArch:  do_not_build
-%endif
-
 Name:           kiwi-templates-JeOS
 Version:        84.87
 Release:        0
-BuildArch:      noarch
 Summary:        KIWI - openSUSE Tumbleweed JeOS image templates
 License:        MIT
 Group:          System/Management
@@ -37,6 +31,10 @@ Source03:       editbootinstall_rpi.sh
 Source99:       LICENSE
 Requires:       python3-kiwi
 Supplements:    kiwi-templates
+BuildArch:      noarch
+%if "@BUILD_FLAVOR@" != ""
+ExclusiveArch:  do_not_build
+%endif
 
 %description
 This package contains system image templates to easily build
@@ -44,7 +42,7 @@ a openSUSE Tumbleweed based operating system image with
 kiwi.
 
 %prep
-%setup -cT
+%setup -q -cT
 cp "%SOURCE99" .
 
 %build

From 24e9f84df83110b73e2b55df414756b9231c7da4a165146b1ab39bcff4d34f6e Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.com>
Date: Wed, 2 Dec 2020 14:39:26 +0000
Subject: [PATCH 2/2] Accepting request 852645 from
 home:Guillaume_G:branches:openSUSE:Factory:ARM

- Include xen and qemu-guest packages for aarch64 too

OBS-URL: https://build.opensuse.org/request/show/852645
OBS-URL: https://build.opensuse.org/package/show/Virtualization:Appliances:Images:openSUSE-Tumbleweed/kiwi-templates-JeOS?expand=0&rev=48
---
 JeOS.kiwi                   | 6 +++---
 kiwi-templates-JeOS.changes | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/JeOS.kiwi b/JeOS.kiwi
index ef2e5c3..ead2d83 100644
--- a/JeOS.kiwi
+++ b/JeOS.kiwi
@@ -316,12 +316,12 @@
     </packages>
 
     <packages type="image" profiles="kvm-and-xen">
-        <package name="xen-tools-domU" arch="x86_64"/>
-        <package name="xen-libs" arch="x86_64"/>
+        <package name="xen-tools-domU"/>
+        <package name="xen-libs"/>
         <package name="kernel-default-base"/>
     </packages>
     <packages type="image" profiles="kvm-and-xen,OpenStack-Cloud">
-        <package name="qemu-guest-agent" arch="x86_64"/>
+        <package name="qemu-guest-agent"/>
     </packages>
     <packages type="image" profiles="VMware">
         <package name="open-vm-tools" arch="x86_64"/>
diff --git a/kiwi-templates-JeOS.changes b/kiwi-templates-JeOS.changes
index 3de3fa6..88ebdda 100644
--- a/kiwi-templates-JeOS.changes
+++ b/kiwi-templates-JeOS.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Wed Dec  2 14:28:44 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
+
+- Include xen and qemu-guest packages for aarch64 too
+
 -------------------------------------------------------------------
 Wed Dec  2 13:58:56 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>