Bug 580072
| Summary: | 'cobbler sync' fails on s390(x) due missing pxelinux.0 file | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite 5 | Reporter: | Jiri Kastner <jkastner> | ||||
| Component: | Provisioning | Assignee: | Jan Pazdziora (Red Hat) <jpazdziora> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Garik Khachikyan <gkhachik> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 530 | CC: | bhinson, cperry, dgoodwin, gkhachik, jhutar, jpazdziora, kdmasary, mdavis, mkoci, mosvald, pmutha, psklenar | ||||
| Target Milestone: | --- | Keywords: | Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | s390 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | cobbler-2.0.7-5.el5sat | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2010-12-08 11:23:08 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 581474, 646488 | ||||||
| Attachments: | 
            
  | 
      ||||||
| 
 
        
          Description
        
        
          Jiri Kastner
        
        
        
        
        
          2010-04-07 12:31:06 UTC
        
       
      
      
      
    PXE is not supported on s390(x) due to the fact that we do not have this file within syslinux. Cliff So maybe just add this to the docs? *** Bug 505186 has been marked as a duplicate of this bug. *** *** Bug 523432 has been marked as a duplicate of this bug. *** Created attachment 441145 [details]
Patch to cobbler: Don't require pxelinux.0 or memdisk for architectures that don't support syslinux
    Applied a modified version of brad's patch to cobbler. Will submit upstream once QA is able to test this bug. cobbler-2.0.3.1-9 taking QE contact for verification test procedure up to Comment 1 and command "cobbler sync" works well in sat540 on s390x. There is no checking of pxelinux.0 there. #VERIFIED against stage signed Satellite iso: satellite-5.4.0-20101019-rhel-5-s390x.iso Procedure output: mount nfs.englab.brq.redhat.com:/pub/fedora/linux/releases/13/Fedora/x86_64/os/ /tmp/fedora13-x86_64/ then prepare custom channel and make ks distribution and then profile based on this mounted ks tree. After run the commands below: --- [root@ibm-z10-10 ~]# cobbler system add --name=default --profile=ks-profile-fedora13-x86_64:1:RedHat [root@ibm-z10-10 ~]# echo $? 0 [root@ibm-z10-10 ~]# rpm -q cobbler cobbler-2.0.7-2.el5sat --- # REOPEN
Err, sorry forget to run cobbler sync: it actually fails with:
---
cobbler sync
task started: 2010-10-22_084125_sync
task started (id=Sync, time=Fri Oct 22 08:41:25 2010)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/pub
removing: /var/www/cobbler/images/ks-distrib-fedora13-x86_64:1:RedHat
removing: /tftpboot/pxelinux.cfg/default
removing: /tftpboot/images/ks-distrib-fedora13-x86_64:1:RedHat
removing: /tftpboot/s390x/profile_list
copying bootloaders
Exception occured: cobbler.cexceptions.CX
Exception value: 'Could not find files matching /usr/lib/syslinux/pxelinux.0'
Exception Info:
  File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 95, in run
    rc = self._run(self)
   File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 184, in runner
    return self.remote.api.sync(self.options.get("verbose",False),logger=self.logger)
   File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 610, in sync
    return sync.run()
   File "/usr/lib/python2.4/site-packages/cobbler/action_sync.py", line 112, in run
    self.pxegen.copy_bootloaders()
   File "/usr/lib/python2.4/site-packages/cobbler/pxegen.py", line 94, in copy_bootloaders
    utils.copyfile_pattern('/usr/lib/syslinux/pxelinux.0',   dst, api=self.api, logger=self.logger)
   File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 1170, in copyfile_pattern
    raise CX(_("Could not find files matching %s") % pattern)
!!! TASK FAILED !!!
---
    I bet the patch was lost when we rebased cobbler ... Taking. Note to self: the cobbler version on 5.4.0 ISO is cobbler-2.0.7-2.el5sat.noarch.rpm. The current code looks like this:
    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)
    I propose the following patch:
--- ./cobbler/pxegen.py.orig	2010-07-28 17:48:48.000000000 +0200
+++ ./cobbler/pxegen.py	2010-11-24 10:48:30.000000000 +0100
@@ -91,8 +91,9 @@
                 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)
+            if os.path.exists('/usr/lib/syslinux'):
+                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)
I didn't want to merely require_match=False it because on i386 and x86_64 the thing should fail if the copyfile_pattern fails. So I opted for a test of /usr/lib/syslinux -- if it exists, copy from it should succeed as well.
Brad, does it sound reasonable?
    Sounds good to me. From the way it looks, it will still succeed if pxelinux.0/menu.c32 are not found in either /usr/share/syslinux or /usr/lib/syslinux, which is good for s390x because it won't necessarily exist. (In reply to comment #29) > Sounds good to me. From the way it looks, it will still succeed if > pxelinux.0/menu.c32 are not found in either /usr/share/syslinux or > /usr/lib/syslinux, which is good for s390x because it won't necessarily exist. Right, that was the plan. Thank you for the review. The patch from comment 28 is now in cobbler-2.0.7-5.el5sat. # VERIFIED The scenario in: comment#19 works fine (+ cobbler sync afterwards). --- cobbler sync task started: 2010-12-07_072245_sync task started (id=Sync, time=Tue Dec 7 07:22:45 2010) running pre-sync triggers cleaning trees removing: /var/www/cobbler/pub copying bootloaders copying distros copying files for distro: ks-distrib-fedora13-x86_64:1:RedHat trying cachelink /tmp/fedora13-x86_64/images/pxeboot/vmlinuz -> /tftpboot/images/.link_cache/a03f18a45cda20e905b5cf06e26ae20f84bd601e -> /tftpboot/images/ks-distrib-fedora13-x86_64:1:RedHat/vmlinuz trying cachelink /tmp/fedora13-x86_64/images/pxeboot/initrd.img -> /tftpboot/images/.link_cache/f1c792bd22d9672c2311a202e56c524555568b87 -> /tftpboot/images/ks-distrib-fedora13-x86_64:1:RedHat/initrd.img trying symlink /tmp/fedora13-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/ks-distrib-fedora13-x86_64:1:RedHat/vmlinuz trying symlink /tmp/fedora13-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/ks-distrib-fedora13-x86_64:1:RedHat/initrd.img copying images generating PXE configuration files cleaning link caches running: find /tftpboot/.link_cache -maxdepth 1 -type f -links 1 -exec rm -f '{}' ';' received: running: find /var/www/cobbler/.link_cache -maxdepth 1 -type f -links 1 -exec rm -f '{}' ';' received: rendering Rsync files generating PXE menu structure running post-sync triggers running python triggers from /var/lib/cobbler/triggers/sync/post/* running python trigger cobbler.modules.sync_post_restart_services running shell triggers from /var/lib/cobbler/triggers/sync/post/* running python triggers from /var/lib/cobbler/triggers/change/* running python trigger cobbler.modules.scm_track running shell triggers from /var/lib/cobbler/triggers/change/* *** TASK COMPLETE *** --- An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0952.html  |