“original filename unknown” warning in using crash

On my SuSE with Xen, executing crash command outputs:

# crash
......  
crash: /boot/symtypes-3.12.49-6-xen.gz: original filename unknown
    Use "-f /boot/symtypes-3.12.49-6-xen.gz" on command line to prevent this message.

crash: /boot/symtypes-3.12.49-6-default.gz: original filename unknown
    Use "-f /boot/symtypes-3.12.49-6-default.gz" on command line to prevent this message.

crash: /boot/xen-4.5.1_10-1.gz: original filename unknown
    Use "-f /boot/xen-4.5.1_10-1.gz" on command line to prevent this message.
......

In this post, Dave refers the cause of original filename unknown is “the original filename of the compressed file was not stored in the file's header.“. To verify it, I check the source code ofcrash:

(1) This message is printed from is_compressed_kernel function:

is_compressed_kernel(char *file, char **tmp)
{
    ......
    #define FNAME (1 << 3)
    ......
    if ((header[0] == 0x1f) && (header[1] == 0x8b) && (header[2] == 8)) {
            if (!(header[3] & FNAME)) {
                    if (!(st->flags & FORCE_DEBUGINFO)) {
                    error(INFO, "%s: "
                        "original filename unknown\n",
                        file);
                    error(CONT, 
                            "Use \"-f %s\" on command line to prevent this message.\n\n",
                        file);
                }
            } else if
    ......
}

(2) From gzip spec:

     ID1 (IDentification 1)
     ID2 (IDentification 2)
        These have the fixed values ID1 = 31 (0x1f, \037), ID2 = 139
        (0x8b, \213), to identify the file as being in gzip format.

     CM (Compression Method)
        This identifies the compression method used in the file.  CM
        = 0-7 are reserved.  CM = 8 denotes the "deflate"
        compression method, which is the one customarily used by
        gzip and which is documented elsewhere.

     FLG (FLaGs)
        This flag byte is divided into individual bits as follows:

           bit 0   FTEXT
           bit 1   FHCRC
           bit 2   FEXTRA
           bit 3   FNAME
           bit 4   FCOMMENT
           bit 5   reserved
           bit 6   reserved
           bit 7   reserved
        ......
        If FNAME is set, an original file name is present,
        terminated by a zero byte.  The name must consist of ISO
        8859-1 (LATIN-1) characters; on operating systems using
        EBCDIC or any other character set for file names, the name
        must be translated to the ISO LATIN-1 character set.  This
        is the original name of the file being compressed, with any
        directory components removed, and, if the file being
        compressed is on a file system with case insensitive names,
        forced to lower case. There is no original file name if the
        data was compressed from a source other than a named file;
        for example, if the source was stdin on a Unix system, there
        is no file name.

As expected, after comparing the code with spec, the warning message is printed when the “original name isn’t present”.

 

Fix “autoreconf: failed to run autopoint: No such file or directory” issue on Suse

On Suse, when executing “autoreconf -i” command in some repository, it prompts following error:

# autoreconf -i
Can't exec "autopoint": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 345.
autoreconf: failed to run autopoint: No such file or directory
autoreconf: autopoint is needed because this package uses Gettext

The solution is installing gettext-tools:

# zypper in gettext-tools
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  gettext-tools

1 new package to install.
Overall download size: 1.8 MiB. Already cached: 0 B. After the operation, additional 7.9 MiB will be used.
Continue? [y/n/? shows all options] (y): y
Retrieving package gettext-tools-0.19.2-1.103.x86_64                                                   (1/1),   1.8 MiB (  7.9 MiB unpacked)
Checking for file conflicts: .........................................................................................................[done]
(1/1) Installing: gettext-tools-0.19.2-1.103 .........................................................................................[done] 

Then “autoreconf -i” works!

 

Get SLES needed RPM from OpenSuse

When you build software on SLES, if there is no need RPM provided, you can try to download it from OpenSuse website:https://software.opensuse.org/search . E.g.:

# rpmbuild -bp xen.spec
error: Failed build dependencies:
    figlet is needed by xen-4.5.1_10-1.9.x86_64

When build Xen source code, the SLES doesn’t provide figlet RPM. Download and install this RPM from this link:http://download.opensuse.org/repositories/openSUSE:/13.2/standard/x8664/figlet-2.2.4-12.1.5.x8664.rpm. Then it works!

 

Install right “kernel-debuginfo” package on RHEL

You need to install right “kernel-debuginfo” package on RHEL. E.g.:

# rpm -q kernel
kernel-3.10.0-229.el7.x86_64

# uname -r
3.10.0-229.el7.x86_64

# rpm -q kernel-debuginfo
package kernel-debuginfo is not installed

# rpm -ivh kernel-debuginfo-common-x86_64-3.10.0-229.el7.x86_64.rpm

# rpm -ivh kernel-debuginfo-3.10.0-229.el7.x86_64.rpm

# rpm -q kernel-debuginfo
kernel-debuginfo-3.10.0-229.el7.x86_64

If kernel is debug version, you also need to install kernel-debug-debuginfo package:

# uname -r
3.10.0-229.el7.x86_64.debug

# rpm -ivh kernel-debuginfo-common-x86_64-3.10.0-229.el7.x86_64.rpm

# rpm -ivh kernel-debug-debuginfo-3.10.0-229.el7.x86_64.rpm

Reference:

[Crash-utility] How does crash find booted kernel?.