Fix the creation of the dumpdir directory in stress_floppy Makefile
[ltp-debian.git] / testcases / pounder21 / test_scripts / build_kernel
blobccd66ead9b34eb830fbe771978e4c84cc0fbc0aa
1 #!/bin/bash
3 # Build Linux kernel
5 # Copyright (C) 2003-2006 IBM
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation; either version 2 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 # 02111-1307, USA.
23 CPUS=`grep processor /proc/cpuinfo | wc -l`
24 ARCH=`uname -m`
25 VERSION=2.6.18
26 # WARNING: If you update the kernel version that we use, be sure to
27 # update $POUNDER_SRCDIR/memtest.patch, $POUNDER_HOME/test_scripts/memtest,
28 # $POUNDER_HOME/test_scripts/build_kernel, and
29 # $POUNDER_HOME/build_scripts/build_kernel.
31 #LOG_ALL_MAKE=1
33 # Decompress tarball if necessary
34 cd "$POUNDER_TMPDIR"
35 if [ ! -d linux-$VERSION ]; then
36 tar -xzf "$POUNDER_OPTDIR/linux-$VERSION.tar.gz"
39 # Clean up the tree.
40 cd linux-$VERSION
41 make mrproper
43 # Create a config file
44 make allmodconfig
46 # Build system
47 if [ $LOG_ALL_MAKE ]; then
48 #Let all ouput flow to the external logging
49 make -j$CPUS oldconfig
50 time make -j$CPUS
51 else
52 #Just log std err
53 make -j$CPUS oldconfig > /dev/null
54 time make -j$CPUS > /dev/null
55 fi
57 # Did we get a kernel image?
58 RETCODE=1
59 if [ -f vmlinux ]; then
60 RETCODE=0
63 exit $RETCODE