cloud init interactive parted
From stx-config 710f17701c33e37be6166694dd188243238760e6 patches/cloud-init-interactive-parted.patch
This commit is contained in:
parent
b42d6eee90
commit
f568b2ffed
5
recipes-extended/cloud-init/cloud-init_0.7.6.bbappend
Normal file
5
recipes-extended/cloud-init/cloud-init_0.7.6.bbappend
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||||
|
|
||||||
|
SRC_URI += " \
|
||||||
|
file://cloud-init-interactive-parted.patch \
|
||||||
|
"
|
@ -0,0 +1,25 @@
|
|||||||
|
From 70b90db2364256fe8ba7e368cbd96cd53b246cb3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: rpm-build <rpm-build>
|
||||||
|
Date: Wed, 8 Nov 2017 11:02:42 -0500
|
||||||
|
Subject: [PATCH] cloud-init-interactive-parted
|
||||||
|
|
||||||
|
---
|
||||||
|
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 832bb3f..71c4f7f 100644
|
||||||
|
--- a/cloudinit/config/cc_growpart.py
|
||||||
|
+++ b/cloudinit/config/cc_growpart.py
|
||||||
|
@@ -182,7 +182,7 @@ class ResizeGpart(object):
|
||||||
|
|
||||||
|
before = get_size(partdev)
|
||||||
|
try:
|
||||||
|
- util.subp(["gpart", "resize", "-i", partnum, diskdev])
|
||||||
|
+ util.subp(["resizepart.sh", diskdev, partnum])
|
||||||
|
except util.ProcessExecutionError as e:
|
||||||
|
util.logexc(LOG, "Failed: gpart resize -i %s %s", partnum, diskdev)
|
||||||
|
raise ResizeFailedException(e)
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
35
recipes-extended/cloud-init/files/first_boot.patch
Normal file
35
recipes-extended/cloud-init/files/first_boot.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
cloudinit/sources/DataSourceConfigDrive.py | 13 +++++++------
|
||||||
|
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
--- a/cloudinit/sources/DataSourceConfigDrive.py
|
||||||
|
+++ b/cloudinit/sources/DataSourceConfigDrive.py
|
||||||
|
@@ -52,12 +52,13 @@ class ConfigDriveHelper(object):
|
||||||
|
def __init__(self, distro):
|
||||||
|
self.distro = distro
|
||||||
|
|
||||||
|
- def on_first_boot(self, data):
|
||||||
|
+ def on_first_boot(self, data, dsmode="local"):
|
||||||
|
if not data:
|
||||||
|
data = {}
|
||||||
|
- if 'network_config' in data:
|
||||||
|
- LOG.debug("Updating network interfaces from config drive")
|
||||||
|
- self.distro.apply_network(data['network_config'])
|
||||||
|
+ if dsmode == "local":
|
||||||
|
+ if 'network_config' in data:
|
||||||
|
+ LOG.debug("Updating network interfaces from config drive")
|
||||||
|
+ self.distro.apply_network(data['network_config'])
|
||||||
|
files = data.get('files')
|
||||||
|
if files:
|
||||||
|
LOG.debug("Writing %s injected files", len(files))
|
||||||
|
@@ -214,8 +215,8 @@ class DataSourceConfigDrive(sources.Data
|
||||||
|
# instance-id
|
||||||
|
prev_iid = get_previous_iid(self.paths)
|
||||||
|
cur_iid = md['instance-id']
|
||||||
|
- if prev_iid != cur_iid and self.dsmode == "local":
|
||||||
|
- self.helper.on_first_boot(results)
|
||||||
|
+ if prev_iid != cur_iid:
|
||||||
|
+ self.helper.on_first_boot(results, dsmode=self.dsmode)
|
||||||
|
|
||||||
|
# dsmode != self.dsmode here if:
|
||||||
|
# * dsmode = "pass", pass means it should only copy files and then
|
Loading…
Reference in New Issue
Block a user