I am trying to build a RPM kernel but having no success with it. First off the kernel im building I can build from source so I have some kernel experience but making an RPM I do not. This kernel goes on different servers with the same hardware pretty much so except for a SMP setting its pretty much all the same. The difference is I dont have loadable module support settings or install modules however you call it, everything is either set to (*) or () nothing at all and their OS's are all Fedora Core 1 or CentOS 3/4x versions.
This is a spec file I got from a friend
Here is the output after rpmbuild -ba kernel-2.6.17.13.spec 1>/tmp/std.out 2>stdout1.errCode:Summary: The 2.6.17.13 kernel.
Name: linux
Version: 2.6.17.13
Release: UP_100megs_1.0
Copyright: GPL
Group: System Environment/Kernel
Source http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.13.tar.gz
BuildRoot: /usr/src/redhat/BUILD/%{name}-%{version}
%description
This is the Linux %{version} kernel compiled to work on most systems.
%prep
%setup
# Check to see if the config file is present and copy it to .config
if [ -f $RPM_BUILD_ROOT/%{version}-%{release} ]; then
cp -f $RPM_BUILD_ROOT/%{version}-%{release} $RPM_BUILD_ROOT/.config
else
echo "No config file found. Exiting"
# rm -rf $RPM_BUILD_ROOT
exit 1;
fi
%build
make dep;make bzImage
%install
mkdir $RPM_BUILD_ROOT/boot
cp $RPM_BUILD_ROOT/arch/i386/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{version}-%{release}
cp $RPM_BUILD_ROOT/System.map $RPM_BUILD_ROOT/boot/System.map-%{version}-%{release}
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%post
# If /etc/grub.conf is there, have grubby add the config
if [ -f /etc/grub.conf ]; then
# Backup the grub config
cp -u /etc/grub.conf /etc/grub.conf.rpmsave
# Use grubby to build new config
/sbin/grubby --add-kernel=/boot/vmlinuz-%{version}-%{release} --title="Red Hat Linux (%{version}-%{release})" --copy-default --make-default -c /etc/grub.conf --args="ro root=/dev/`cat /etc/grub.conf |perl -e 'while (my $line = <STDIN>) { if ($line =~ /^#.* root=\/dev\/(.*)$/) { print $1 . "\n"; }}'`" -o /tmp/%{version}-%{release}.grub.conf
# Copy the tmp file to /etc/grub.conf
cp -u /tmp/%{version}-%{release}.grub.conf /etc/grub.conf
ln -sf /boot/System.map-%{version}-%{release} /boot/System.map
fi
# If there is a lilo.conf (and no grub.conf) Add the entry
if [ -f /etc/lilo.conf ]; then
/usr/bin/env perl<<EOF
open(LILO,'/etc/lilo.conf');
while (\$line = <LILO>) {
\$line =~ /.*root=(.*)\$/;
\$hd = \$1;
}
close(LILO);
system('cp -f /etc/lilo.conf /etc/lilo.conf.rpmsave');
system('echo "image=/boot/vmlinuz-%{version}-%{release}
label=%{version}
read-only
root=' . \$hd . '" >> /etc/lilo.conf');
EOF
ln -sf /boot/System.map-%{version}-%{release} /boot/System.map
fi
# Udev foo for CentOS and RHES
if [ ! -d /tmp/udevcheck ]; then
mkdir /tmp/udevcheck
fi
mount --bind / /tmp/udevcheck
if [ ! -c /tmp/udevcheck/dev/console ]; then
mknod -m 660 /tmp/udevcheck/dev/console c 5 1
fi
if [ ! -c /tmp/udevcheck/dev/null ]; then
mknod -m 660 /tmp/udevcheck/dev/null c 1 3
fi
umount /tmp/udevcheck
%preun
%postun
if [ -f /boot/grub/grub.conf ]; then
sed "/title Red Hat Linux (%{version}-%{release})/{N;N;d;}" /boot/grub/grub.conf > /tmp/grub.conf.tmp
mv -f /boot/grub/grub.conf /boot/grub/grub.conf.rpmsave
mv /tmp/grub.conf.tmp /boot/grub/grub.conf
fi
if [ -f /etc/lilo.conf ]; then
sed "/image=\/boot\/vmlinuz-%{version}-%{release}/{N;N;N;d;}" /etc/lilo.conf > /tmp/lilo.conf.tmp
mv -f /etc/lilo.conf /etc/lilo.rpmsave
mv /tmp/lilo.conf.tmp /etc/lilo.conf
fi
%files
/boot/vmlinuz-%{version}-%{release}
/boot/System.map-%{version}-%{release}
http://stlhosting.com/stdout1.err
What am I doing wrong? Why does it not create an RPM?
