[lxc-devel] [lxd/master] shared/simplestreams: Support uefi1.img
stgraber on Github
lxc-bot at linuxcontainers.org
Wed May 20 16:10:38 UTC 2020
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200520/3022e8e0/attachment-0001.bin>
-------------- next part --------------
From ffe56f7c1cd46c9a7a5e073baa42665c66555167 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at 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 <stgraber at 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
More information about the lxc-devel
mailing list