The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7401

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From ffe56f7c1cd46c9a7a5e073baa42665c66555167 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 20 May 2020 12:10:22 -0400
Subject: [PATCH] shared/simplestreams: Support uefi1.img
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 shared/simplestreams/products.go | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/shared/simplestreams/products.go b/shared/simplestreams/products.go
index 46c4e1255b..c882f58d95 100644
--- a/shared/simplestreams/products.go
+++ b/shared/simplestreams/products.go
@@ -43,17 +43,18 @@ type ProductVersion struct {
 
 // ProductVersionItem represents a file/item of a particular ProductVersion
 type ProductVersionItem struct {
-       LXDHashSha256DiskImg    string 
`json:"combined_disk1-img_sha256,omitempty"`
-       LXDHashSha256DiskKvmImg string 
`json:"combined_disk-kvm-img_sha256,omitempty"`
-       LXDHashSha256RootXz     string `json:"combined_rootxz_sha256,omitempty"`
-       LXDHashSha256           string `json:"combined_sha256,omitempty"`
-       LXDHashSha256SquashFs   string 
`json:"combined_squashfs_sha256,omitempty"`
-       FileType                string `json:"ftype"`
-       HashMd5                 string `json:"md5,omitempty"`
-       Path                    string `json:"path"`
-       HashSha256              string `json:"sha256,omitempty"`
-       Size                    int64  `json:"size"`
-       DeltaBase               string `json:"delta_base,omitempty"`
+       LXDHashSha256DiskImg     string 
`json:"combined_disk1-img_sha256,omitempty"`
+       LXDHashSha256DiskKvmImg  string 
`json:"combined_disk-kvm-img_sha256,omitempty"`
+       LXDHashSha256DiskUefiImg string 
`json:"combined_uefi1-img_sha256,omitempty"`
+       LXDHashSha256RootXz      string 
`json:"combined_rootxz_sha256,omitempty"`
+       LXDHashSha256            string `json:"combined_sha256,omitempty"`
+       LXDHashSha256SquashFs    string 
`json:"combined_squashfs_sha256,omitempty"`
+       FileType                 string `json:"ftype"`
+       HashMd5                  string `json:"md5,omitempty"`
+       Path                     string `json:"path"`
+       HashSha256               string `json:"sha256,omitempty"`
+       Size                     int64  `json:"size"`
+       DeltaBase                string `json:"delta_base,omitempty"`
 }
 
 // ToLXD converts the products data into a list of LXD images and associated 
downloadable files
@@ -114,6 +115,8 @@ func (s *Products) ToLXD() ([]api.Image, 
map[string][][]string) {
                                                fingerprint = 
meta.LXDHashSha256DiskKvmImg
                                        } else if root.FileType == "disk1.img" {
                                                fingerprint = 
meta.LXDHashSha256DiskImg
+                                       } else if root.FileType == "uefi1.img" {
+                                               fingerprint = 
meta.LXDHashSha256DiskUefiImg
                                        }
                                } else {
                                        fingerprint = meta.HashSha256
@@ -165,7 +168,7 @@ func (s *Products) ToLXD() ([]api.Image, 
map[string][][]string) {
 
                                if root != nil {
                                        image.Properties["type"] = root.FileType
-                                       if root.FileType == "disk1.img" || 
root.FileType == "disk-kvm.img" {
+                                       if root.FileType == "disk1.img" || 
root.FileType == "disk-kvm.img" || root.FileType == "uefi1.img" {
                                                image.Type = "virtual-machine"
                                        }
                                } else {
@@ -257,7 +260,7 @@ func (s *Products) ToLXD() ([]api.Image, 
map[string][][]string) {
                                if item.FileType == "lxd.tar.xz" {
                                        // Locate the root files
                                        for _, subItem := range version.Items {
-                                               if 
shared.StringInSlice(subItem.FileType, []string{"disk1.img", "disk-kvm.img", 
"root.tar.xz", "squashfs"}) {
+                                               if 
shared.StringInSlice(subItem.FileType, []string{"disk1.img", "disk-kvm.img", 
"uefi1.img", "root.tar.xz", "squashfs"}) {
                                                        err := addImage(&item, 
&subItem)
                                                        if err != nil {
                                                                continue
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to