File kernel.spec of Package ccur-kernel

Name: ccur-kernel
Summary: The Linux Kernel
Version: 2.6.16.27SLERT10
Release: 13
License: GPL
Group: System Environment/Kernel
Vendor: Novell Inc. / Concurrent Computer Corp.
URL: http://www.ccur.com
Source: ccur-kernel-2.6.16.27SLERT10.tar.gz
BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-%{release}-root
Provides:  kernel-2.6.16.27-0.6-SLERT-10-13
Requires: grubby


%define __spec_install_post /usr/lib/rpm/brp-compress || :
%define debug_package %{nil}

%description
The Linux Kernel, the operating system core itself with Realtime extensions for better Desktop and Server Performance


%package -n ccur-vmlinux
Group: System Environment/Kernel
Summary: The Linux Kernel vmlinux (Raw & Uncut)
%description -n ccur-vmlinux
The Linux Kernel vmlinux file, useful for kernel debugging.

%prep
%setup -q


%build
make clean && make oldconfig && make  %{_smp_mflags} all

%install
mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules
INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install
#cp arch/x86_64/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-2.6.16.27-0.6-SLERT-10-13
cp System.map $RPM_BUILD_ROOT/boot/System.map-2.6.16.27-0.6-SLERT-10-13
cp .config $RPM_BUILD_ROOT/boot/config-2.6.16.27-0.6-SLERT-10-13
cp init/kerntypes.o $RPM_BUILD_ROOT/boot/Kerntypes-2.6.16.27-0.6-SLERT-10-13
mkdir -p $RPM_BUILD_ROOT/var/vmlinux
cp vmlinux $RPM_BUILD_ROOT/var/vmlinux/vmlinux-2.6.16.27-0.6-SLERT-10-13

%clean
#echo -rf $RPM_BUILD_ROOT



%preun
if [ -x /sbin/grubby ]; then
   /sbin/grubby --config-file=/boot/grub/menu.lst --remove-kernel=/boot/vmlinuz-2.6.16.27-0.6-SLERT-10-13
fi
rm -f /boot/initrd-2.6.16.27-0.6-SLERT-10-13

%preun -n ccur-vmlinux
rm -f /boot/vmlinux-2.6.16.27-0.6-SLERT-10-13

%post -n ccur-vmlinux
ln -sf /var/vmlinux/vmlinux-2.6.16.27-0.6-SLERT-10-13 /boot/vmlinux-2.6.16.27-0.6-SLERT-10-13


%post
echo -n "Creating initrd..."
/sbin/mkinitrd -k /boot/vmlinuz-2.6.16.27-0.6-SLERT-10-13 -i /boot/initrd-2.6.16.27-0.6-SLERT-10-13 >/dev/null 2>&1
echo "done"make
if [ -x /sbin/grubby ]; then
   echo -n "Modifying bootloader..."
   # first, make sure that default in menu.lst is not messed up
   if /usr/bin/grep -e '^default$' /boot/grub/menu.lst >/dev/null; then
      /usr/bin/sed 's/^default$/default 0/' /boot/grub/menu.lst > /tmp/menu.lst.ccur-mod
      /bin/cp -f /boot/grub/menu.lst /boot/grub/menu.lst.ccur-backup
      /bin/mv -f /tmp/menu.lst.ccur-mod /boot/grub/menu.lst
   fi
   # now, add new kernel using grubby
   root=`/bin/mount | /usr/bin/awk '$3 == "/" { print $1 }'`
   /sbin/grubby --add-kernel=/boot/vmlinuz-2.6.16.27-0.6-SLERT-10-13       --config-file=/boot/grub/menu.lst       --title "SUSE Linux Enterprise Real Time 10-13 (Trace=No, Debug=No)"       --initrd=/boot/initrd-2.6.16.27-0.6-SLERT-10-13       --args="root=$root" --copy-default --make-default       --remove-kernel="TITLE=SUSE Linux Enterprise Real Time 10-13 (Trace=No, Debug=No)" > /dev/null 2>&1
   echo "done"
fi


%files
%defattr (-, root, root)
%dir /lib/modules
%dir /boot/*

%files -n ccur-vmlinux
%defattr (-, root, root)
%dir /var/vmlinux
%dir /var/vmlinux/*
openSUSE Build Service is sponsored by