Esempio n. 1
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(
         parent=self, job=self.job, parameters=parameters
     )
     self.internal_pipeline.add_action(
         ExtractNfsRootfs()
     )  # idempotent, checks for nfsrootfs parameter
     self.internal_pipeline.add_action(
         OverlayAction()
     )  # idempotent, includes testdef
     self.internal_pipeline.add_action(
         ExtractRamdisk()
     )  # idempotent, checks for a ramdisk parameter
     self.internal_pipeline.add_action(
         ExtractModules()
     )  # idempotent, checks for a modules parameter
     self.internal_pipeline.add_action(ApplyOverlayTftp())
     if "kernel" in parameters and "type" in parameters["kernel"]:
         self.internal_pipeline.add_action(PrepareKernelAction())
     self.internal_pipeline.add_action(
         ConfigurePreseedFile()
     )  # idempotent, checks for a preseed parameter
     self.internal_pipeline.add_action(
         CompressRamdisk()
     )  # idempotent, checks for a ramdisk parameter
     if "depthcharge" in self.job.device["actions"]["boot"]["methods"]:
         self.internal_pipeline.add_action(PrepareKernelAction())
Esempio n. 2
0
File: nbd.py Progetto: slawr/lava
    def populate(self, parameters):
        self.tftp_dir = self.mkdtemp(override=filesystem.tftpd_dir())
        self.pipeline = Pipeline(parent=self,
                                 job=self.job,
                                 parameters=parameters)
        self.set_namespace_data(
            action=self.name,
            label="tftp",
            key="tftp_dir",
            value=self.tftp_dir,
            parameters=parameters,
        )

        for key in ["initrd", "kernel", "dtb", "nbdroot"]:
            if key in parameters:
                download = DownloaderAction(key,
                                            path=self.tftp_dir,
                                            params=parameters[key])
                download.max_retries = (
                    3  # overridden by failure_retry in the parameters, if set.
                )
                self.pipeline.add_action(download)
                if key == "initrd":
                    self.set_namespace_data(
                        action="tftp-deploy",
                        label="tftp",
                        key="ramdisk",
                        value=True,
                        parameters=parameters,
                    )
                    self.set_namespace_data(
                        action=self.name,
                        label="nbd",
                        key="initrd",
                        value=True,
                        parameters=parameters,
                    )

        # prepare overlay
        self.pipeline.add_action(OverlayAction())
        if "kernel" in parameters and "type" in parameters["kernel"]:
            self.pipeline.add_action(PrepareKernelAction())
        # setup values for protocol and later steps
        self.set_namespace_data(
            action=self.name,
            label="nbd",
            key="initrd",
            value=True,
            parameters=parameters,
        )
        # store in parameters for protocol 'xnbd' to tear-down xnbd-server
        # and store in namespace for boot action
        # ip
        parameters["lava-xnbd"] = {}
        # handle XnbdAction next - bring-up xnbd-server
        self.pipeline.add_action(XnbdAction())