Whamcloud - gitweb
Move README.kernel-source to lustre-build
[fs/lustre-release.git] / build / README.kernel-source
diff --git a/build/README.kernel-source b/build/README.kernel-source
new file mode 100644 (file)
index 0000000..0b88efe
--- /dev/null
@@ -0,0 +1,74 @@
+Lustre can currently build against Red Hat 2.4-style kernel-source
+RPMs.  All other kernel-source RPMs are *unsupported* at this time.
+
+Note that a Lustre-patched kernel is required for building Lustre; in
+most cases a kernel-source RPM from your Linux vendor will not contain
+the necessary patches.
+
+1.  kernel.h
+
+Building against a kernel-source RPM requires a special header.  On
+Red Hat systems, this file should be automatically created at boot
+time, and saved in /boot/kernel.h.
+
+ *** If you are not running Red Hat Linux, or are not booted into the
+ *** kernel you are trying to build against, you need to create this
+ *** file manually.
+
+ *** If you do not, the Lustre build may fail, or may fail to build
+ *** modules that work with your kernel.
+
+Here is an example /boot/kernel.h file.  If you are building on
+x86_64, the first defines should be __MODULE_KERNEL_x86_64, etc.  The
+other defines should be simple to figure out.
+
+/* This file is automatically generated at boot time. */
+#ifndef __BOOT_KERNEL_H_
+#define __BOOT_KERNEL_H_
+
+/* Kernel type i686-smp */
+
+#ifndef __MODULE_KERNEL_i686
+#define __MODULE_KERNEL_i686 1
+#endif
+
+#ifndef __BOOT_KERNEL_ENTERPRISE
+#define __BOOT_KERNEL_ENTERPRISE 0
+#endif
+
+#ifndef __BOOT_KERNEL_BIGMEM
+#define __BOOT_KERNEL_BIGMEM 0
+#endif
+
+#ifndef __BOOT_KERNEL_HUGEMEM
+#define __BOOT_KERNEL_HUGEMEM 0
+#endif
+
+#ifndef __BOOT_KERNEL_SMP
+#define __BOOT_KERNEL_SMP 1
+#endif
+
+#ifndef __BOOT_KERNEL_UP
+#define __BOOT_KERNEL_UP 0
+#endif
+
+#endif
+
+You should save this somewhere, and pass the location of this file to
+./configure using the --with-kernel-source-header option.
+
+2.  .config
+
+You will also need to tell Lustre about the .config file for your
+kernel.  The two likely locations of this file are
+/boot/config-$(uname -r), and /usr/src/linux-2.4/configs/.  You should
+pass the location of this file to Lustre using the --with-linux-config
+option.
+
+3.  An Example
+
+Here is an example for configuring Lustre:
+
+./configure --with-linux=/usr/src/linux-2.4.20-28.9_lustre.1.0.3 \
+--with-kernel-source-header=/boot/kernel.h \
+--with-linux-config=/boot/config-2.4.20-28.9_lustre.1.0.3smp