This service will be undergoing maintenance at 03:30 UTC, 2016-05-27. It is expected to last about 2 hours
Bug 580072 - 'cobbler sync' fails on s390(x) due missing pxelinux.0 file
'cobbler sync' fails on s390(x) due missing pxelinux.0 file
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning (Show other bugs)
530
s390 Linux
high Severity high
: ---
: ---
Assigned To: Jan Pazdziora
Garik Khachikyan
: Reopened
: 505186 523432 (view as bug list)
Depends On:
Blocks: 581474 sat54-errata
  Show dependency treegraph
 
Reported: 2010-04-07 08:31 EDT by Jiri Kastner
Modified: 2015-01-04 16:57 EST (History)
12 users (show)

See Also:
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 06:23:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to cobbler: Don't require pxelinux.0 or memdisk for architectures that don't support syslinux (1.69 KB, patch)
2010-08-26 04:58 EDT, Brad Hinson
no flags Details | Diff

  None (edit)
Description Jiri Kastner 2010-04-07 08:31:06 EDT
Description of problem:
cobbler can't create pxelinux.cfg/default due missing pxelinux.0 file
Could not find files matching /usr/share/syslinux/pxelinux.0


Version-Release number of selected component (if applicable):


How reproducible:
on s390(x)

Steps to Reproduce:
1. install on s390(x) satellite
2. create kickstart profile
3. list cobbler profiles and one of them add as default - 'cobbler system add --name=default --profile=PROFILE_NAME'
4. run 'cobbler sync'
  
Actual results:
'cobbler sync' fails, because required files are available only on i386, x86_64 platforms, where syslinux if shipped

Expected results:
'cobbler sync' will pass without errors

Additional info:
Comment 3 Clifford Perry 2010-04-12 14:39:38 EDT
PXE is not supported on s390(x) due to the fact that we do not have this file within syslinux. 

Cliff
Comment 4 Jan Hutař 2010-04-14 02:48:11 EDT
So maybe just add this to the docs?
Comment 5 Brad Hinson 2010-08-26 04:55:52 EDT
*** Bug 505186 has been marked as a duplicate of this bug. ***
Comment 6 Brad Hinson 2010-08-26 04:56:01 EDT
*** Bug 523432 has been marked as a duplicate of this bug. ***
Comment 7 Brad Hinson 2010-08-26 04:58:33 EDT
Created attachment 441145 [details]
Patch to cobbler: Don't require pxelinux.0 or memdisk for architectures that don't support syslinux
Comment 13 Justin Sherrill 2010-09-20 18:21:25 EDT
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
Comment 16 Petr Sklenar 2010-10-11 07:36:11 EDT
taking QE contact for verification
Comment 17 Petr Sklenar 2010-10-11 10:26:03 EDT
test procedure up to Comment 1 and command "cobbler sync" works well in sat540 on s390x. There is no checking of pxelinux.0 there.
Comment 19 Garik Khachikyan 2010-10-22 08:37:00 EDT
#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
---
Comment 20 Garik Khachikyan 2010-10-22 08:38:20 EDT
# 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 !!!
---
Comment 21 Justin Sherrill 2010-10-22 08:42:12 EDT
I bet the patch was lost when we rebased cobbler ...
Comment 25 Jan Pazdziora 2010-11-23 10:28:59 EST
Taking.
Comment 26 Jan Pazdziora 2010-11-24 02:49:18 EST
Note to self: the cobbler version on 5.4.0 ISO is cobbler-2.0.7-2.el5sat.noarch.rpm.
Comment 27 Jan Pazdziora 2010-11-24 03:34:14 EST
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)
Comment 28 Jan Pazdziora 2010-11-24 05:19:35 EST
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?
Comment 29 Brad Hinson 2010-11-30 14:57:08 EST
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.
Comment 30 Jan Pazdziora 2010-11-30 15:22:13 EST
(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.
Comment 31 Jan Pazdziora 2010-12-02 06:40:14 EST
The patch from comment 28 is now in cobbler-2.0.7-5.el5sat.
Comment 34 Garik Khachikyan 2010-12-07 07:22:51 EST
# 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 ***
---
Comment 36 errata-xmlrpc 2010-12-08 06:23:08 EST
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

Note You need to log in before you can comment on or make changes to this bug.