Exemplo n.º 1
0
    def prepare(self, cr, cr_workdir, oe_builddir, rootfs_dir, bootimg_dir,
                kernel_dir, native_sysroot):
        """
        Prepare content for individual partitions, depending on
        partition command parameters.
        """
        if not self.source:
            if self.fstype and self.fstype == "swap":
                self.prepare_swap_partition(cr_workdir, oe_builddir,
                                            native_sysroot)
            elif self.fstype:
                self.prepare_empty_partition(cr_workdir, oe_builddir,
                                             native_sysroot)
            return

        if self.source.startswith("rootfs"):
            self.prepare_rootfs(cr_workdir, oe_builddir, rootfs_dir,
                                native_sysroot)
        else:
            self._source_methods = pluginmgr.get_source_plugin_methods(self.source, partition_methods)
            self._source_methods["do_configure_partition"](self, cr, cr_workdir,
                                                           oe_builddir,
                                                           bootimg_dir,
                                                           kernel_dir,
                                                           native_sysroot)
            self._source_methods["do_stage_partition"](self, cr, cr_workdir,
                                                       oe_builddir,
                                                       bootimg_dir, kernel_dir,
                                                       native_sysroot)
            self._source_methods["do_prepare_partition"](self, cr, cr_workdir,
                                                         oe_builddir,
                                                         bootimg_dir, kernel_dir,
                                                         native_sysroot)
Exemplo n.º 2
0
    def prepare(self, cr, cr_workdir, oe_builddir, rootfs_dir, bootimg_dir,
                kernel_dir, native_sysroot):
        """
        Prepare content for individual partitions, depending on
        partition command parameters.
        """
        if not self.source:
            if self.fstype and self.fstype == "swap":
                self.prepare_swap_partition(cr_workdir, oe_builddir,
                                            native_sysroot)
            elif self.fstype:
                self.prepare_empty_partition(cr_workdir, oe_builddir,
                                             native_sysroot)
            return

        plugins = pluginmgr.get_source_plugins()

        if self.source not in plugins:
            msger.error("The '%s' --source specified for %s doesn't exist.\n\tSee 'wic list source-plugins' for a list of available --sources.\n\tSee 'wic help source-plugins' for details on adding a new source plugin." % (self.source, self.mountpoint))

        self._source_methods = pluginmgr.get_source_plugin_methods(self.source, partition_methods)
        self._source_methods["do_configure_partition"](self, cr, cr_workdir,
                                                       oe_builddir,
                                                       bootimg_dir,
                                                       kernel_dir,
                                                       native_sysroot)
        self._source_methods["do_stage_partition"](self, cr, cr_workdir,
                                                   oe_builddir,
                                                   bootimg_dir, kernel_dir,
                                                   native_sysroot)
        self._source_methods["do_prepare_partition"](self, cr, cr_workdir,
                                                     oe_builddir,
                                                     bootimg_dir, kernel_dir, rootfs_dir,
                                                     native_sysroot)
Exemplo n.º 3
0
    def configure(self, repodata=None):
        """
        Configure the system image according to kickstart.

        For now, it just prepares the image to be bootable by e.g.
        creating and installing a bootloader configuration.
        """
        source_plugin = self.get_default_source_plugin()
        if source_plugin:
            self._source_methods = pluginmgr.get_source_plugin_methods(
                source_plugin, disk_methods)
            for disk_name, disk in self.__instimage.disks.items():
                self._source_methods["do_install_disk"](
                    disk, disk_name, self, self.workdir, self.oe_builddir,
                    self.bootimg_dir, self.kernel_dir, self.native_sysroot)
Exemplo n.º 4
0
    def configure(self, repodata = None):
        """
        Configure the system image according to kickstart.

        For now, it just prepares the image to be bootable by e.g.
        creating and installing a bootloader configuration.
        """
        source_plugin = self.get_default_source_plugin()
        if source_plugin:
            self._source_methods = pluginmgr.get_source_plugin_methods(source_plugin, disk_methods)
            for disk_name, disk in self.__instimage.disks.items():
                self._source_methods["do_install_disk"](disk, disk_name, self,
                                                        self.workdir,
                                                        self.oe_builddir,
                                                        self.bootimg_dir,
                                                        self.kernel_dir,
                                                        self.native_sysroot)
Exemplo n.º 5
0
    def prepare(self, cr, cr_workdir, oe_builddir, rootfs_dir, bootimg_dir,
                kernel_dir, native_sysroot):
        """
        Prepare content for individual partitions, depending on
        partition command parameters.
        """
        if not self.source:
            if not self.size:
                msger.error(
                    "The %s partition has a size of zero.  Please specify a non-zero --size for that partition."
                    % self.mountpoint)
            if self.fstype and self.fstype == "swap":
                self.prepare_swap_partition(cr_workdir, oe_builddir,
                                            native_sysroot)
            elif self.fstype:
                self.prepare_empty_partition(cr_workdir, oe_builddir,
                                             native_sysroot)
            return

        plugins = pluginmgr.get_source_plugins()

        if self.source not in plugins:
            msger.error(
                "The '%s' --source specified for %s doesn't exist.\n\tSee 'wic list source-plugins' for a list of available --sources.\n\tSee 'wic help source-plugins' for details on adding a new source plugin."
                % (self.source, self.mountpoint))

        self._source_methods = pluginmgr.get_source_plugin_methods(
            self.source, partition_methods)
        self._source_methods["do_configure_partition"](self, cr, cr_workdir,
                                                       oe_builddir,
                                                       bootimg_dir, kernel_dir,
                                                       native_sysroot)
        self._source_methods["do_stage_partition"](self, cr, cr_workdir,
                                                   oe_builddir, bootimg_dir,
                                                   kernel_dir, native_sysroot)
        self._source_methods["do_prepare_partition"](self, cr, cr_workdir,
                                                     oe_builddir, bootimg_dir,
                                                     kernel_dir, rootfs_dir,
                                                     native_sysroot)