Esempio n. 1
0
    def copy_bootloaders(self):
        """
        Copy bootloaders to the configured tftpboot directory
        NOTE: we support different arch's if defined in
        /etc/cobbler/settings.
        """
        dst = self.bootloc
        grub_dst = os.path.join(dst, "grub")
        image_dst = os.path.join(dst, "images")

        # copy syslinux from one of two locations
        try:
            try:
                utils.copyfile_pattern('/var/lib/cobbler/loaders/pxelinux.0',
                        dst, api=self.api, cache=False, logger=self.logger)
                utils.copyfile_pattern('/var/lib/cobbler/loaders/menu.c32',
                        dst, api=self.api, cache=False, logger=self.logger)
            except:
                utils.copyfile_pattern('/usr/share/syslinux/pxelinux.0',
                        dst, api=self.api, cache=False, logger=self.logger)
                utils.copyfile_pattern('/usr/share/syslinux/menu.c32',
                        dst, api=self.api, cache=False, logger=self.logger)

        except:
            utils.copyfile_pattern('/usr/lib/syslinux/pxelinux.0',
                    dst, api=self.api, cache=False, logger=self.logger)
            utils.copyfile_pattern('/usr/lib/syslinux/menu.c32',
                    dst, api=self.api, cache=False, logger=self.logger)

        # copy memtest only if we find it
        utils.copyfile_pattern('/boot/memtest*', image_dst,
                require_match=False, api=self.api, cache=False, logger=self.logger)

        # copy elilo which we include for IA64 targets
        utils.copyfile_pattern('/var/lib/cobbler/loaders/elilo.efi', dst,
                require_match=False, api=self.api, cache=False, logger=self.logger)

        # copy yaboot which we include for PowerPC targets
        utils.copyfile_pattern('/var/lib/cobbler/loaders/yaboot', dst,
                require_match=False, api=self.api, cache=False, logger=self.logger)

        try:
            utils.copyfile_pattern('/usr/lib/syslinux/memdisk',
                    dst, api=self.api, cache=False, logger=self.logger)
        except:
            utils.copyfile_pattern('/usr/share/syslinux/memdisk', dst,
                    require_match=False, api=self.api, cache=False, logger=self.logger)

        # Copy gPXE/iPXE bootloader if it exists
        utils.copyfile_pattern('/usr/share/*pxe/undionly.kpxe', dst,
                require_match=False, api=self.api, cache=False, logger=self.logger)

        # Copy grub EFI bootloaders if possible:
        utils.copyfile_pattern('/var/lib/cobbler/loaders/grub*.efi', grub_dst,
                require_match=False, api=self.api, cache=False, logger=self.logger)
Esempio n. 2
0
    def copy_bootloaders(self):
        """
        Copy bootloaders to the configured tftpboot directory
        NOTE: we support different arch's if defined in
        /etc/cobbler/settings.
        """
        dst = self.bootloc
        grub_dst = os.path.join(dst, "grub")
        image_dst = os.path.join(dst, "images")

        # copy syslinux from one of two locations
        try:
            try:
                utils.copyfile_pattern(
                    '/var/lib/cobbler/loaders/pxelinux.0',
                    dst, api=self.api, cache=False, logger=self.logger)
                utils.copyfile_pattern(
                    '/var/lib/cobbler/loaders/menu.c32',
                    dst, api=self.api, cache=False, logger=self.logger)
            except:
                utils.copyfile_pattern(
                    '/usr/share/syslinux/pxelinux.0',
                    dst, api=self.api, cache=False, logger=self.logger)
                utils.copyfile_pattern(
                    '/usr/share/syslinux/menu.c32',
                    dst, api=self.api, cache=False, logger=self.logger)

        except:
            utils.copyfile_pattern(
                '/usr/lib/syslinux/pxelinux.0',
                dst, api=self.api, cache=False, logger=self.logger)
            utils.copyfile_pattern(
                '/usr/lib/syslinux/menu.c32',
                dst, api=self.api, cache=False, logger=self.logger)

        # copy memtest only if we find it
        utils.copyfile_pattern(
            '/boot/memtest*', image_dst,
            require_match=False, api=self.api, cache=False, logger=self.logger)

        # copy yaboot which we include for PowerPC targets
        utils.copyfile_pattern(
            '/var/lib/cobbler/loaders/yaboot', dst,
            require_match=False, api=self.api, cache=False, logger=self.logger)

        try:
            utils.copyfile_pattern(
                '/usr/lib/syslinux/memdisk',
                dst, api=self.api, cache=False, logger=self.logger)
        except:
            utils.copyfile_pattern(
                '/usr/share/syslinux/memdisk', dst,
                require_match=False, api=self.api, cache=False, logger=self.logger)

        # Copy gPXE/iPXE bootloader if it exists
        utils.copyfile_pattern(
            '/usr/share/*pxe/undionly.kpxe', dst,
            require_match=False, api=self.api, cache=False, logger=self.logger)

        # Copy grub EFI bootloaders if possible:
        utils.copyfile_pattern(
            '/var/lib/cobbler/loaders/grub*.efi', grub_dst,
            require_match=False, api=self.api, cache=False, logger=self.logger)

        pxegrub_imported = False
        if os.path.isdir(os.path.join(self.bootloc, 'boot')):
            shutil.rmtree(os.path.join(self.bootloc, 'boot'))
        for i in self.distros:
            if 'nexenta' == i.breed and not pxegrub_imported:
                # name_without_arch = i.name[:-7] # removing -x86_64 from the fin on the string.
                shutil.copytree(os.path.join('/var', 'www', 'cobbler', 'ks_mirror', i.name, 'boot'),
                                os.path.join(self.bootloc, 'boot'))
                pxegrub_imported = True
Esempio n. 3
0
    def copy_bootloaders(self):
        """
        Copy bootloaders to the configured tftpboot directory
        NOTE: we support different arch's if defined in
        /etc/cobbler/settings.
        """
        dst = self.bootloc

        # copy syslinux from one of two locations
        try:
            try:
                utils.copyfile_pattern('/var/lib/cobbler/loaders/pxelinux.0', dst, api=self.api, logger=self.logger)
                utils.copyfile_pattern('/var/lib/cobbler/loaders/menu.c32', dst, api=self.api, logger=self.logger)
            except:
                utils.copyfile_pattern('/usr/share/syslinux/pxelinux.0', dst, api=self.api, logger=self.logger)
                utils.copyfile_pattern('/usr/share/syslinux/menu.c32', dst, api=self.api, logger=self.logger)

        except:
            utils.copyfile_pattern('/usr/lib/syslinux/pxelinux.0',   dst, api=self.api, logger=self.logger)
            utils.copyfile_pattern('/usr/lib/syslinux/menu.c32',   dst, api=self.api, logger=self.logger)
 
        # copy memtest only if we find it
        utils.copyfile_pattern('/boot/memtest*', dst, require_match=False, api=self.api, logger=self.logger)
  
        # copy elilo which we include for IA64 targets
        utils.copyfile_pattern('/var/lib/cobbler/loaders/elilo.efi', dst, require_match=False, api=self.api, logger=self.logger)

        # copy yaboot which we include for PowerPC targets
        utils.copyfile_pattern('/var/lib/cobbler/loaders/yaboot', dst, require_match=False, api=self.api, logger=self.logger)

        try:
            utils.copyfile_pattern('/usr/lib/syslinux/memdisk',   dst, api=self.api, logger=self.logger)
        except:
            utils.copyfile_pattern('/usr/share/syslinux/memdisk', dst, require_match=False, api=self.api, logger=self.logger)
Esempio n. 4
0
    def copy_bootloaders(self):
        """
        Copy bootloaders to the configured tftpboot directory
        NOTE: we support different arch's if defined in
        /etc/cobbler/settings.
        """
        dst = self.bootloc

        # copy syslinux from one of two locations
        try:
            utils.copyfile_pattern('/usr/lib/syslinux/pxelinux.0',   dst, api=self.api, verbose=self.verbose)
        except:
            utils.copyfile_pattern('/usr/share/syslinux/pxelinux.0', dst, api=self.api, verbose=self.verbose)
 
        # copy memtest only if we find it
        utils.copyfile_pattern('/boot/memtest*', dst, require_match=False, api=self.api, verbose=self.verbose)
  
        # copy elilo which we include for IA64 targets
        utils.copyfile_pattern('/var/lib/cobbler/elilo-3.8-ia64.efi', dst, api=self.api, verbose=self.verbose)
 
        # copy menu.c32 as the older one has some bugs on certain RHEL
        utils.copyfile_pattern('/var/lib/cobbler/menu.c32', dst, api=self.api, verbose=self.verbose)

        # copy yaboot which we include for PowerPC targets
        utils.copyfile_pattern('/var/lib/cobbler/yaboot-1.3.14', dst, api=self.api, verbose=self.verbose)

        # copy memdisk as we need it to boot ISOs
        try:
            utils.copyfile_pattern('/usr/lib/syslinux/memdisk',   dst, api=self.api, verbose=self.verbose)
        except:
            utils.copyfile_pattern('/usr/share/syslinux/memdisk', dst, api=self.api, verbose=self.verbose)
Esempio n. 5
0
    def copy_bootloaders(self):
        """
        Copy bootloaders to the configured tftpboot directory
        NOTE: we support different arch's if defined in
        /etc/cobbler/settings.
        """
        dst = self.bootloc
        grub_dst = os.path.join(dst, "grub")
        image_dst = os.path.join(dst, "images")

        # copy syslinux from one of two locations
        try:
            try:
                utils.copyfile_pattern(
                    '/var/lib/cobbler/loaders/pxelinux.0',
                    dst, api=self.api, cache=False, logger=self.logger)
                utils.copyfile_pattern(
                    '/var/lib/cobbler/loaders/menu.c32',
                    dst, api=self.api, cache=False, logger=self.logger)
            except:
                utils.copyfile_pattern(
                    '/usr/share/syslinux/pxelinux.0',
                    dst, api=self.api, cache=False, logger=self.logger)
                utils.copyfile_pattern(
                    '/usr/share/syslinux/menu.c32',
                    dst, api=self.api, cache=False, logger=self.logger)

        except:
            utils.copyfile_pattern(
                '/usr/lib/syslinux/pxelinux.0',
                dst, api=self.api, cache=False, logger=self.logger)
            utils.copyfile_pattern(
                '/usr/lib/syslinux/menu.c32',
                dst, api=self.api, cache=False, logger=self.logger)

        # copy memtest only if we find it
        utils.copyfile_pattern(
            '/boot/memtest*', image_dst,
            require_match=False, api=self.api, cache=False, logger=self.logger)

        # copy yaboot which we include for PowerPC targets
        utils.copyfile_pattern(
            '/var/lib/cobbler/loaders/yaboot', dst,
            require_match=False, api=self.api, cache=False, logger=self.logger)

        try:
            utils.copyfile_pattern(
                '/usr/lib/syslinux/memdisk',
                dst, api=self.api, cache=False, logger=self.logger)
        except:
            utils.copyfile_pattern(
                '/usr/share/syslinux/memdisk', dst,
                require_match=False, api=self.api, cache=False, logger=self.logger)

        # Copy gPXE/iPXE bootloader if it exists
        utils.copyfile_pattern(
            '/usr/share/*pxe/undionly.kpxe', dst,
            require_match=False, api=self.api, cache=False, logger=self.logger)

        # Copy grub EFI bootloaders if possible:
        utils.copyfile_pattern(
            '/var/lib/cobbler/loaders/grub*.efi', grub_dst,
            require_match=False, api=self.api, cache=False, logger=self.logger)

        pxegrub_imported = False
        if os.path.isdir(os.path.join(self.bootloc, 'boot')):
            shutil.rmtree(os.path.join(self.bootloc, 'boot'))
        for i in self.distros:
            if 'nexenta' == i.breed and not pxegrub_imported:
                # name_without_arch = i.name[:-7] # removing -x86_64 from the fin on the string.
                shutil.copytree(os.path.join('/var', 'www', 'cobbler', 'ks_mirror', i.name, 'boot'),
                                os.path.join(self.bootloc, 'boot'))
                pxegrub_imported = True
Esempio n. 6
0
    def copy_bootloaders(self):
        """
        Copy bootloaders to the configured tftpboot directory
        NOTE: we support different arch's if defined in
        /etc/cobbler/settings.
        """
        dst = self.bootloc

        # copy syslinux from one of two locations
        try:
            try:
                utils.copyfile_pattern('/var/lib/cobbler/loaders/pxelinux.0',
                                       dst,
                                       api=self.api,
                                       logger=self.logger)
                utils.copyfile_pattern('/var/lib/cobbler/loaders/menu.c32',
                                       dst,
                                       api=self.api,
                                       logger=self.logger)
            except:
                utils.copyfile_pattern('/usr/share/syslinux/pxelinux.0',
                                       dst,
                                       api=self.api,
                                       logger=self.logger)
                utils.copyfile_pattern('/usr/share/syslinux/menu.c32',
                                       dst,
                                       api=self.api,
                                       logger=self.logger)

        except:
            utils.copyfile_pattern('/usr/lib/syslinux/pxelinux.0',
                                   dst,
                                   api=self.api,
                                   logger=self.logger)
            utils.copyfile_pattern('/usr/lib/syslinux/menu.c32',
                                   dst,
                                   api=self.api,
                                   logger=self.logger)

        # copy memtest only if we find it
        utils.copyfile_pattern('/boot/memtest*',
                               dst,
                               require_match=False,
                               api=self.api,
                               logger=self.logger)

        # copy elilo which we include for IA64 targets
        utils.copyfile_pattern('/var/lib/cobbler/loaders/elilo.efi',
                               dst,
                               require_match=False,
                               api=self.api,
                               logger=self.logger)

        # copy yaboot which we include for PowerPC targets
        utils.copyfile_pattern('/var/lib/cobbler/loaders/yaboot',
                               dst,
                               require_match=False,
                               api=self.api,
                               logger=self.logger)

        try:
            utils.copyfile_pattern('/usr/lib/syslinux/memdisk',
                                   dst,
                                   api=self.api,
                                   logger=self.logger)
        except:
            utils.copyfile_pattern('/usr/share/syslinux/memdisk',
                                   dst,
                                   require_match=False,
                                   api=self.api,
                                   logger=self.logger)