Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 688700

Summary: File does not correctly identify a linux kernel image on s/390x
Product: Red Hat Enterprise Linux 6 Reporter: Mike Gahagan <mgahagan>
Component: fileAssignee: Jan Kaluža <jkaluza>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: ksrot, ovasik, pkovar
Target Milestone: rc   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: file-5.04-8.el6 Doc Type: Bug Fix
Doc Text:
Prior to this update, the file utility did not correctly recognized the IBM System z kernel images. This problem has been corrected so that the IBM System z kernel images are now correctly recognized as expected.
Story Points: ---
Clone Of:
: 751030 (view as bug list) Environment:
Last Closed: 2011-07-13 08:48:50 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:
Attachments:
Description Flags
proposed patch none

Description Mike Gahagan 2011-03-17 18:39:41 UTC
Description of problem:

.qa.[root@s390x-6s-v1 boot]# file vmlinuz-2.6.32-71.18.2.el6.s390x
vmlinuz-2.6.32-71.18.2.el6.s390x: data
.qa.[root@s390x-6s-v1 boot]# file vmlinuz-2.6.32-71.18.2.el6.s390x.debug
vmlinuz-2.6.32-71.18.2.el6.s390x.debug: data


Version-Release number of selected component (if applicable):
file-5.04-6.el6.s390x

How reproducible:

always

Steps to Reproduce:
1. run file on s390x vmlinuz file (compressed kernel image)
2.
3.
  
Actual results:
on s/390x:
file vmlinuz-2.6.32-71.18.2.el6.s390x
vmlinuz-2.6.32-71.18.2.el6.s390x: data

on x86_64:

file /boot/vmlinuz-2.6.32-71.el6.x86_64 
/boot/vmlinuz-2.6.32-71.el6.x86_64: Linux kernel x86 boot executable bzImage, version 2.6.32-71.el6.x86_64 (mockbuild, RO-rootFS, root_dev 0x901, swap_dev 0x3, Normal VGA


Expected results:

something similar to output present on x86_64

Additional info:

This issue seems to be limited to s/390x

Comment 1 Jan Kaluža 2011-03-22 08:24:42 UTC
Created attachment 486749 [details]
proposed patch

Comment 2 Jan Kaluža 2011-03-22 08:26:29 UTC
This patch adds basic support for s390x kernel detection. I think it's not possible to print kernel version easily, because there's no pointer to version string in s390x kernel header. This is example output with the patch applied:

file ~/vmlinuz-2.6.38-1.fc15.s390x -m linux
/home/hanzz/vmlinuz-2.6.38-1.fc15.s390x: Linux S390 Z9-109 64bit kernel

Comment 5 Petr Kovar 2011-06-24 11:44:22 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, the file utility did not correctly recognized the IBM System z kernel images. This problem has been corrected so that the IBM System z kernel images are now correctly recognized as expected.

Comment 7 Karel Srot 2011-07-01 10:07:22 UTC
There seems to be a regression intruduces by this patch (or any other patch applied after file-5.04-6.el6).

# rpm -q file
file-5.04-6.el6.s390x
# file /boot/vmlinuz*
/boot/vmlinuz-2.6.32-131.4.1.el6.s390x:       data
/boot/vmlinuz-2.6.32-131.4.1.el6.s390x.debug: data
/boot/vmlinuz-2.6.32-131.4.1.el6.s390x.kdump: data
/boot/vmlinuz-2.6.32-71.el6.s390x:            data
/boot/vmlinuz-2.6.32-71.el6.s390x.debug:      data
/boot/vmlinuz-2.6.32-71.el6.s390x.kdump:      data

# rpm -q file
file-5.04-9.el6.s390x
# file /boot/vmlinuz*
/boot/vmlinuz-2.6.32-131.4.1.el6.s390x:       Linux S390 Z9-109 64bit kernel
/boot/vmlinuz-2.6.32-131.4.1.el6.s390x.debug: Linux S390 Z9-109 64bit kernel
/boot/vmlinuz-2.6.32-131.4.1.el6.s390x.kdump: Applesoft BASIC program data
/boot/vmlinuz-2.6.32-71.el6.s390x:            Linux S390 Z9-109 64bit kernel
/boot/vmlinuz-2.6.32-71.el6.s390x.debug:      Linux S390 Z9-109 64bit kernel
/boot/vmlinuz-2.6.32-71.el6.s390x.kdump:      Applesoft BASIC program data

# dd if=/boot/vmlinuz-2.6.32-71.el6.s390x.kdump of=vmlinuz_kdump.head bs=1 count=4
4+0 records in
4+0 records out
4 bytes (4 B) copied, 0.00192344 s, 2.1 kB/s
# file vmlinuz_kdump.head 
vmlinuz_kdump.head: Applesoft BASIC program data
# hexdump vmlinuz_kdump.head 
0000000 0008 0000                              
0000004




Btw, pppc64 kernel is also not detected as a Linux kernel, just as ELF binary

# file /boot/vmlinuz-2.6.32-*
/boot/vmlinuz-2.6.32-131.2.1.el6.ppc64:       ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
/boot/vmlinuz-2.6.32-131.2.1.el6.ppc64.debug: ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
/boot/vmlinuz-2.6.32-131.4.1.el6.ppc64:       ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
/boot/vmlinuz-2.6.32-131.4.1.el6.ppc64.debug: ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
/boot/vmlinuz-2.6.32-71.el6.ppc64:            ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped

Comment 11 errata-xmlrpc 2011-07-13 08:48:50 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-2011-0934.html