From 6d1244bda94fafc5817aec1848d86ed48f259ca5 Mon Sep 17 00:00:00 2001 From: Leonardo Fagundes Luz Serrano Date: Mon, 22 Nov 2021 10:45:58 -0300 Subject: [PATCH] Add debian package for virt/cloud-init Add debian packaging infrastructure for virt/cloud-init to build a debian package. Verification: - Built package - Built image Story: 2009101 Task: 44025 Signed-off-by: Leonardo Fagundes Luz Serrano Change-Id: Ifaacdc067812503113fc52c81bcd3be68a17ae3e --- virt/cloud-init/debian/meta_data.yaml | 9 +++++ ...ted-w-o-handling-cmd-prompts-interac.patch | 33 +++++++++++++++++++ virt/cloud-init/debian/patches/series | 1 + 3 files changed, 43 insertions(+) create mode 100644 virt/cloud-init/debian/meta_data.yaml create mode 100644 virt/cloud-init/debian/patches/0001-For-invoking-parted-w-o-handling-cmd-prompts-interac.patch create mode 100644 virt/cloud-init/debian/patches/series diff --git a/virt/cloud-init/debian/meta_data.yaml b/virt/cloud-init/debian/meta_data.yaml new file mode 100644 index 000000000..b268ada4b --- /dev/null +++ b/virt/cloud-init/debian/meta_data.yaml @@ -0,0 +1,9 @@ +debname: cloud-init +debver: 20.4.1-2+deb11u1 +dl_path: + name: cloud-init-debian-20.4.1-2+deb11u1.tar.gz + url: https://salsa.debian.org/cloud-team/cloud-init/-/archive/debian/20.4.1-2+deb11u1/cloud-init-debian-20.4.1-2+deb11u1.tar.gz + md5sum: e125f0b7651386430cbf6a5e80789b8e +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/virt/cloud-init/debian/patches/0001-For-invoking-parted-w-o-handling-cmd-prompts-interac.patch b/virt/cloud-init/debian/patches/0001-For-invoking-parted-w-o-handling-cmd-prompts-interac.patch new file mode 100644 index 000000000..6129ab894 --- /dev/null +++ b/virt/cloud-init/debian/patches/0001-For-invoking-parted-w-o-handling-cmd-prompts-interac.patch @@ -0,0 +1,33 @@ +From 5cb0a79cadabe8659ba36c9ac794cd49fc4f41c1 Mon Sep 17 00:00:00 2001 +From: Leonardo Fagundes Luz Serrano + +Date: Wed, 5 Jan 2022 10:36:18 -0300 +Subject: [PATCH] For invoking parted w/o handling cmd prompts interactively + +From resizepart.sh: +"This is a workaround to allow cloud-init to invoke parted +without needing to handle command prompts interactively. +Support for non-interactive parted commands +are not supported on mounted partitions." + +Signed-off-by: Leonardo Fagundes Luz Serrano +--- + cloudinit/config/cc_growpart.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cloudinit/config/cc_growpart.py b/cloudinit/config/cc_growpart.py +index 9f338ad1..e70b0d1e 100644 +--- a/cloudinit/config/cc_growpart.py ++++ b/cloudinit/config/cc_growpart.py +@@ -192,7 +192,7 @@ class ResizeGpart(object): + + before = get_size(partdev) + try: +- subp.subp(["gpart", "resize", "-i", partnum, diskdev]) ++ subp.subp(["resizepart.sh", diskdev, partnum]) + except subp.ProcessExecutionError as e: + util.logexc(LOG, "Failed: gpart resize -i %s %s", partnum, diskdev) + raise ResizeFailedException(e) from e +-- +2.17.1 + diff --git a/virt/cloud-init/debian/patches/series b/virt/cloud-init/debian/patches/series new file mode 100644 index 000000000..d1801e79f --- /dev/null +++ b/virt/cloud-init/debian/patches/series @@ -0,0 +1 @@ +0001-For-invoking-parted-w-o-handling-cmd-prompts-interac.patch