cc_growpart: respect /etc/growroot-disabled
cloud-initramfs-growroot is an initramfs module in cloud-initramfs-tools that resizes the root partition before the root is pivoted over. growroot was used in Ubuntu up to and including 12.10. The file /etc/growroot-disabled on the root filesystem was the only way of disabling the growing of the root partition. In cloud-init 0.7.2 cloud-init began resizing the root partition as growpart gained the ability to utilize 'ptupdate' in kernels > 3.8. This was a big improvement as now the user could disable or enable the growing of the root partition via user-data. In order to let users disable growing of / very simplistically cloud-init will now respect the presense of /etc/growroot-disabled unless config specifically tells it to ignore that file.
This commit is contained in:
parent
db0fc22e12
commit
90d2f96d37
@ -26,6 +26,7 @@
|
|||||||
- config/cloud.cfg: add 'sudo' to list groups for the default user
|
- config/cloud.cfg: add 'sudo' to list groups for the default user
|
||||||
(LP: #1228228)
|
(LP: #1228228)
|
||||||
- documentation fix for use of 'mkpasswd' [Eric Nordlund]
|
- documentation fix for use of 'mkpasswd' [Eric Nordlund]
|
||||||
|
- respect /etc/growroot-disabled file (LP: #1234331)
|
||||||
0.7.2:
|
0.7.2:
|
||||||
- add a debian watch file
|
- add a debian watch file
|
||||||
- add 'sudo' entry to ubuntu's default user (LP: #1080717)
|
- add 'sudo' entry to ubuntu's default user (LP: #1080717)
|
||||||
|
@ -32,6 +32,7 @@ frequency = PER_ALWAYS
|
|||||||
DEFAULT_CONFIG = {
|
DEFAULT_CONFIG = {
|
||||||
'mode': 'auto',
|
'mode': 'auto',
|
||||||
'devices': ['/'],
|
'devices': ['/'],
|
||||||
|
'ignore_growroot_disabled': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -251,6 +252,12 @@ def handle(_name, cfg, _cloud, log, _args):
|
|||||||
log.debug("growpart disabled: mode=%s" % mode)
|
log.debug("growpart disabled: mode=%s" % mode)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if util.is_false(mycfg.get('ignore_growroot_disabled', False)):
|
||||||
|
if os.path.isfile("/etc/growroot-disabled"):
|
||||||
|
log.debug("growpart disabled: /etc/growroot-disabled exists")
|
||||||
|
log.debug("use ignore_growroot_disabled to ignore")
|
||||||
|
return
|
||||||
|
|
||||||
devices = util.get_cfg_option_list(cfg, "devices", ["/"])
|
devices = util.get_cfg_option_list(cfg, "devices", ["/"])
|
||||||
if not len(devices):
|
if not len(devices):
|
||||||
log.debug("growpart: empty device list")
|
log.debug("growpart: empty device list")
|
||||||
|
@ -19,6 +19,15 @@
|
|||||||
# examples:
|
# examples:
|
||||||
# devices: [/, /dev/vdb1]
|
# devices: [/, /dev/vdb1]
|
||||||
#
|
#
|
||||||
|
# ignore_growroot_disabled:
|
||||||
|
# a boolean, default is false.
|
||||||
|
# if the file /etc/growroot-disabled exists, then cloud-init will not grow
|
||||||
|
# the root partition. This is to allow a single file to disable both
|
||||||
|
# cloud-initramfs-growroot and cloud-init's growroot support.
|
||||||
|
#
|
||||||
|
# true indicates that /etc/growroot-disabled should be ignored
|
||||||
|
#
|
||||||
growpart:
|
growpart:
|
||||||
mode: auto
|
mode: auto
|
||||||
devices: ['/']
|
devices: ['/']
|
||||||
|
ignore_growroot_disabled: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user