Bug 580072 - 'cobbler sync' fails on s390(x) due missing pxelinux.0 file
Summary: 'cobbler sync' fails on s390(x) due missing pxelinux.0 file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning
Version: 530
Hardware: s390
OS: Linux
high
high
Target Milestone: ---
Assignee: Jan Pazdziora (Red Hat)
QA Contact: Garik Khachikyan
URL:
Whiteboard:
: 505186 523432 (view as bug list)
Depends On:
Blocks: 581474 sat54-errata
TreeView+ depends on / blocked
 
Reported: 2010-04-07 12:31 UTC by Jiri Kastner
Modified: 2018-11-14 16:06 UTC (History)
12 users (show)

Fixed In Version: cobbler-2.0.7-5.el5sat
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-08 11:23:08 UTC
Target Upstream Version:
Embargoed:


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 08:58 UTC, Brad Hinson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0952 0 normal SHIPPED_LIVE Red Hat Network Satellite bug fix update 2010-12-08 11:23:03 UTC

Description Jiri Kastner 2010-04-07 12:31:06 UTC
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 18:39:38 UTC
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 06:48:11 UTC
So maybe just add this to the docs?

Comment 5 Brad Hinson 2010-08-26 08:55:52 UTC
*** Bug 505186 has been marked as a duplicate of this bug. ***

Comment 6 Brad Hinson 2010-08-26 08:56:01 UTC
*** Bug 523432 has been marked as a duplicate of this bug. ***

Comment 7 Brad Hinson 2010-08-26 08:58:33 UTC
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 22:21:25 UTC
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 11:36:11 UTC
taking QE contact for verification

Comment 17 Petr Sklenar 2010-10-11 14:26:03 UTC
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 12:37:00 UTC
#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 12:38:20 UTC
# 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 12:42:12 UTC
I bet the patch was lost when we rebased cobbler ...

Comment 25 Jan Pazdziora (Red Hat) 2010-11-23 15:28:59 UTC
Taking.

Comment 26 Jan Pazdziora (Red Hat) 2010-11-24 07:49:18 UTC
Note to self: the cobbler version on 5.4.0 ISO is cobbler-2.0.7-2.el5sat.noarch.rpm.

Comment 27 Jan Pazdziora (Red Hat) 2010-11-24 08:34:14 UTC
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 (Red Hat) 2010-11-24 10:19:35 UTC
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 19:57:08 UTC
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 (Red Hat) 2010-11-30 20:22:13 UTC
(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 (Red Hat) 2010-12-02 11:40:14 UTC
The patch from comment 28 is now in cobbler-2.0.7-5.el5sat.

Comment 34 Garik Khachikyan 2010-12-07 12:22:51 UTC
# 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 11:23:08 UTC
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.