#!/bin/sh printf "You built the new kernel first, right?\nPress \"Enter\" to continue...\n\n" read _junk if [ -z "$1" ]; then printf "Usage: $0 \$VERSION \n" exit 1 fi VERSION="$1" set -e TMP=${TMP:-/root/tmp} PKG=${PKG:-$TMP/package-kernel} rm -rf $PKG mkdir -p $PKG/boot $PKG/lib/modules $PKG/usr/src $PKG/install printf "Generating initrd... \n" mkinitrd -c -k $VERSION -F -o /boot/initrd-$VERSION.gz printf "Copying kernel image, System.map, config, and initrd into package... \n" cp /usr/src/linux-$VERSION/arch/x86_64/boot/bzImage $PKG/boot/vmlinuz-generic-$VERSION cp /usr/src/linux-$VERSION/System.map $PKG/boot/System.map-generic-$VERSION cp /usr/src/linux-$VERSION/.config $PKG/boot/config-generic-$VERSION cp /boot/initrd-$VERSION.gz $PKG/boot/initrd-$VERSION.gz # printf "Copying module tree into package... \n" cp -a /lib/modules/$VERSION $PKG/lib/modules printf "NOT Copying kernel source into package... \n" printf "#commented# cp -a /usr/src/linux-$VERSION $PKG/usr/src \n" cat << EOF > $PKG/install/slack-desc kernel-custom$(printf $VERSION | tr -d .): kernel-custom (linux kernel for SBo virtual machines) kernel-custom$(printf $VERSION | tr -d .): kernel-custom$(printf $VERSION | tr -d .): This package contains the custom-compiled kernel for kernel-custom$(printf $VERSION | tr -d .): the SBo virtual machines. It includes the kernel image, kernel-custom$(printf $VERSION | tr -d .): modules, and initrd files - the only needed changes to kernel-custom$(printf $VERSION | tr -d .): boot this kernel are a lilo stanza and invocation of lilo. kernel-custom$(printf $VERSION | tr -d .): kernel-custom$(printf $VERSION | tr -d .): kernel-custom$(printf $VERSION | tr -d .): kernel-custom$(printf $VERSION | tr -d .): kernel-custom$(printf $VERSION | tr -d .): EOF cd $PKG /sbin/makepkg -c n -l y $TMP/kernel-custom$(printf $VERSION | tr -d .)-$VERSION-x86_64-1_SBo.txz