3. lkcd 的安装

3.1. 从源代码安装

获取lkcdutils-xxx.src.rpm并使用 rpm -i kcdutils-xxx.src.rpm 安装它。这将在lkcdutils-xxx.tar.gz放在/usr/src/redhat/SOURCES目录下。该文件是 lkcd 源代码树的压缩 tar 镜像。将源代码解压到您选择的目录中,例如 "/usr/src",使用 tar -zxvf kcdutils-xxx.src.rpm 。这将创建一个名为 "kcdutils-xxx" 的目录,其中将包含 LKCD 实用程序源代码。

3.2. 构建和安装 LKCD 实用程序

LKCD 使用标准的 GCC 编译器和 make 文件。要构建套件,请 cd 到 LKCD src 目录并运行 ./configure 来构建配置文件。下一步是运行 make 来构建实用程序,最后运行 make install 来安装实用程序和 man 手册。

3.3. 安装的内容

  /etc/sysconfig/dump             # Configuration file for dump
  /sbin/lcrash                    # The crash utility
  /sbin/lkcd                      # Script to configure and save a crash
  /sbin/lkcd_config               # Configuration utility for dump
  /sbin/lkcd_ksyms                # Utility for reconstructing kernel symbols 
  /usr/include/sial_api.h         # Header file for the SIAL API
  /usr/lib/libsial.a              # Simple Image Access Language library
  /usr/man/man1/lcrash.1          # man page for lcrash
  /usr/man/man1/lkcd_config.1     # man page for lkcd_config
  /usr/man/man1/lkcd_ksyms.1      # man page for lkcd_ksyms
  /usr/share/sial/lcrash/ps.sial  # ps command implementation of SIAL
      

3.4. 从 RPM 安装 LKCD 实用程序

您可以通过运行 rpm -i kcdutils-xxx.rpm 从 rpm 安装预构建的实用程序。您仍然需要修补内核并安装启动脚本补丁。但是您可以绕过构建实用程序的步骤。

3.5. 修补内核

下一步是修补和重建内核。您需要使用lkcd-xxx.diff文件修补内核源代码,该文件您可以从 http://lkcd.sourceforge.net/ 下载。将补丁复制到与内核相同的目录中,并运行 patch -p0 < lkcd-kernelxxx.diff 。确保您使用的补丁版本与您正在修补的内核版本相同。接下来,您需要配置内核以启用崩溃转储支持。默认情况下,应用补丁后,崩溃支持处于关闭状态。如果您使用 make menuconfigmake xconfig,则 "LKCD support" 选项位于 kernel hacking 下。您还需要启用您可能需要的其他内核功能。有关更多详细信息,请参见 The Linux Kernel HOWTO

3.6. 构建和安装内核

下一步是构建和安装启用崩溃功能的内核。在内核源代码目录中,按顺序运行以下命令。

 
  make depend 
  make install 
  make modules
  make modules_install
      

这将构建并安装新内核,您还需要将Kerntypes文件从内核源复制到/boot目录。您可能还需要编辑lilo.conf文件以指向您新的内核。有关构建和安装内核的更多信息,请参见 http://www.linuxdoc.org/HOWTO/Kernel-HOWTO.html