From a1c561ae8fb636e82a9c93863a74c1b423966527 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 9 Feb 2013 15:45:36 -0500 Subject: [PATCH] generic_stage_target: Split ._copy_initramfs_overlay() from ._build_kernel() _copy_initramfs_overlay() is long enough that it makes reading _build_kernel() difficult. Reviewed-by: Matt Turner --- modules/generic_stage_target.py | 41 ++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 337ab165..e741fcd7 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1452,25 +1452,7 @@ class generic_stage_target(generic_target): self.settings["boot/kernel/"+kname+\ "/extraversion"] - if "boot/kernel/"+kname+"/initramfs_overlay" in self.settings: - if os.path.exists(self.settings["boot/kernel/"+\ - kname+"/initramfs_overlay"]): - print "Copying initramfs_overlay dir "+\ - self.settings["boot/kernel/"+kname+\ - "/initramfs_overlay"] - - cmd("mkdir -p "+\ - self.settings["chroot_path"]+\ - "/tmp/initramfs_overlay/"+\ - self.settings["boot/kernel/"+kname+\ - "/initramfs_overlay"],env=self.env) - - cmd("cp -R "+self.settings["boot/kernel/"+\ - kname+"/initramfs_overlay"]+"/* "+\ - self.settings["chroot_path"]+\ - "/tmp/initramfs_overlay/"+\ - self.settings["boot/kernel/"+kname+\ - "/initramfs_overlay"],env=self.env) + self._copy_initramfs_overlay(kname=kname) """ Execute the script that builds the kernel """ cmd("/bin/bash "+self.settings["controller_file"]+\ @@ -1520,6 +1502,27 @@ class generic_stage_target(generic_target): except CatalystError: self.unbind() + def _copy_initramfs_overlay(self, kname): + if "boot/kernel/"+kname+"/initramfs_overlay" in self.settings: + if os.path.exists(self.settings["boot/kernel/"+\ + kname+"/initramfs_overlay"]): + print "Copying initramfs_overlay dir "+\ + self.settings["boot/kernel/"+kname+\ + "/initramfs_overlay"] + + cmd("mkdir -p "+\ + self.settings["chroot_path"]+\ + "/tmp/initramfs_overlay/"+\ + self.settings["boot/kernel/"+kname+\ + "/initramfs_overlay"],env=self.env) + + cmd("cp -R "+self.settings["boot/kernel/"+\ + kname+"/initramfs_overlay"]+"/* "+\ + self.settings["chroot_path"]+\ + "/tmp/initramfs_overlay/"+\ + self.settings["boot/kernel/"+kname+\ + "/initramfs_overlay"],env=self.env) + def bootloader(self): if "AUTORESUME" in self.settings \ and os.path.exists(self.settings["autoresume_path"]+"bootloader"): -- 2.26.2