[molecule] add support for outer_chroot_script_after (to be executed after inner chroot script)
This commit is contained in:
@@ -42,6 +42,10 @@ destination_chroot: /sabayon
|
||||
# - kmerge.sh - setup kernel bins
|
||||
inner_chroot_script: /sabayon/scripts/inner_chroot_script.sh
|
||||
|
||||
# Outer chroot script command, to be executed outside destination chroot before
|
||||
# before entering it (and AFTER inner_chroot_script)
|
||||
# outer_chroot_script_after: /path/to/script/to/be/executed/outside/after
|
||||
|
||||
# Destination LiveCD root directory, where files are placed before getting mkisofs'ed
|
||||
# NOTE: data will be stored inside an auto-generated subdir
|
||||
destination_livecd_root: /sabayon
|
||||
|
||||
@@ -42,6 +42,10 @@ destination_chroot: /sabayon
|
||||
# - kmerge.sh - setup kernel bins
|
||||
inner_chroot_script: /sabayon/scripts/inner_chroot_script.sh
|
||||
|
||||
# Outer chroot script command, to be executed outside destination chroot before
|
||||
# before entering it (and AFTER inner_chroot_script)
|
||||
# outer_chroot_script_after: /path/to/script/to/be/executed/outside/after
|
||||
|
||||
# Destination LiveCD root directory, where files are placed before getting mkisofs'ed
|
||||
# NOTE: data will be stored inside an auto-generated subdir
|
||||
destination_livecd_root: /sabayon
|
||||
|
||||
@@ -15,14 +15,18 @@ prechroot: linux32
|
||||
# Path to source ISO file (MANDATORY)
|
||||
source_iso: /sabayon/iso_images/Sabayon_5.0_G.iso
|
||||
|
||||
# Outer chroot script command, to be executed outside destination chroot before packing it
|
||||
# - x86-archscript.sh - setup kernel bins
|
||||
# Outer chroot script command, to be executed outside destination chroot before
|
||||
# before entering it (and before inner_chroot_script)
|
||||
# outer_chroot_script: /path/to/script/to/be/executed/outside
|
||||
|
||||
# Inner chroot script command, to be executed inside destination chroot before packing it
|
||||
# - kmerge.sh - setup kernel bins
|
||||
# inner_chroot_script: /sabayon/scripts/inner_chroot_script.sh
|
||||
|
||||
# Outer chroot script command, to be executed outside destination chroot before
|
||||
# before entering it (and AFTER inner_chroot_script)
|
||||
# outer_chroot_script_after: /path/to/script/to/be/executed/outside/after
|
||||
|
||||
# Extra mkisofs parameters, perhaps something to include/use your bootloader
|
||||
extra_mkisofs_parameters: -b isolinux/isolinux.bin -c isolinux/boot.cat
|
||||
|
||||
|
||||
@@ -42,6 +42,10 @@ destination_chroot: /sabayon
|
||||
# - kmerge.sh - setup kernel bins
|
||||
inner_chroot_script: /sabayon/scripts/inner_chroot_script.sh
|
||||
|
||||
# Outer chroot script command, to be executed outside destination chroot before
|
||||
# before entering it (and AFTER inner_chroot_script)
|
||||
# outer_chroot_script_after: /path/to/script/to/be/executed/outside/after
|
||||
|
||||
# Destination LiveCD root directory, where files are placed before getting mkisofs'ed
|
||||
# NOTE: data will be stored inside an auto-generated subdir
|
||||
destination_livecd_root: /sabayon
|
||||
|
||||
@@ -42,6 +42,10 @@ destination_chroot: /sabayon
|
||||
# - kmerge.sh - setup kernel bins
|
||||
inner_chroot_script: /sabayon/scripts/inner_chroot_script.sh
|
||||
|
||||
# Outer chroot script command, to be executed outside destination chroot before
|
||||
# before entering it (and AFTER inner_chroot_script)
|
||||
# outer_chroot_script_after: /path/to/script/to/be/executed/outside/after
|
||||
|
||||
# Destination LiveCD root directory, where files are placed before getting mkisofs'ed
|
||||
# NOTE: data will be stored inside an auto-generated subdir
|
||||
destination_livecd_root: /sabayon
|
||||
|
||||
@@ -209,6 +209,24 @@ class ChrootHandler(GenericExecutionStep):
|
||||
)
|
||||
)
|
||||
|
||||
# run outer chroot script
|
||||
exec_script = self.metadata.get('outer_chroot_script')
|
||||
if exec_script:
|
||||
os.environ['CHROOT_DIR'] = self.source_dir
|
||||
self.Output.updateProgress("[%s|%s] %s: %s" % (
|
||||
blue("ChrootHandler"),darkred(self.spec_name),
|
||||
_("spawning"),[exec_script],
|
||||
)
|
||||
)
|
||||
rc = molecule.utils.exec_cmd([exec_script])
|
||||
if rc != 0:
|
||||
self.Output.updateProgress("[%s|%s] %s: %s" % (
|
||||
blue("ChrootHandler"),darkred(self.spec_name),
|
||||
_("outer chroot hook failed"),rc,
|
||||
)
|
||||
)
|
||||
return rc
|
||||
|
||||
# run inner chroot script
|
||||
exec_script = self.metadata.get('inner_chroot_script')
|
||||
if exec_script:
|
||||
@@ -241,8 +259,8 @@ class ChrootHandler(GenericExecutionStep):
|
||||
)
|
||||
return rc
|
||||
|
||||
# run outer chroot script
|
||||
exec_script = self.metadata.get('outer_chroot_script')
|
||||
# run outer chroot script after
|
||||
exec_script = self.metadata.get('outer_chroot_script_after')
|
||||
if exec_script:
|
||||
os.environ['CHROOT_DIR'] = self.source_dir
|
||||
self.Output.updateProgress("[%s|%s] %s: %s" % (
|
||||
@@ -254,7 +272,7 @@ class ChrootHandler(GenericExecutionStep):
|
||||
if rc != 0:
|
||||
self.Output.updateProgress("[%s|%s] %s: %s" % (
|
||||
blue("ChrootHandler"),darkred(self.spec_name),
|
||||
_("outer chroot hook failed"),rc,
|
||||
_("outer chroot hook (after inner) failed"),rc,
|
||||
)
|
||||
)
|
||||
return rc
|
||||
@@ -563,6 +581,10 @@ class LivecdSpec(GenericSpec):
|
||||
'cb': self.valid_path_string,
|
||||
've': self.ve_string_stripper,
|
||||
},
|
||||
'outer_chroot_script_after': {
|
||||
'cb': self.valid_path_string,
|
||||
've': self.ve_string_stripper,
|
||||
},
|
||||
'destination_livecd_root': {
|
||||
'cb': self.valid_path_string,
|
||||
've': self.ve_string_stripper,
|
||||
|
||||
@@ -342,6 +342,10 @@ class RemasterSpec(GenericSpec):
|
||||
'cb': self.valid_path_string,
|
||||
've': self.ve_string_stripper,
|
||||
},
|
||||
'outer_chroot_script_after': {
|
||||
'cb': self.valid_path_string,
|
||||
've': self.ve_string_stripper,
|
||||
},
|
||||
'extra_mkisofs_parameters': {
|
||||
'cb': self.always_valid,
|
||||
've': self.ve_string_splitter,
|
||||
|
||||
Reference in New Issue
Block a user