#!/bin/bash # # by: Sebastian 'gonX' Jensen # contact: gonX@overclocked.net # # kernel26-customed PKGBUILD helper # # version: 0.02 # # It gets these args: # $1 - kernel version (ie. 2.6.32-zen2) # $2 - kernel image file (bzImage) # $3 - kernel map file (System.map) # $4 - default install path (usually /boot) # # instead of $4 we change the path here. i couldn't figure out how to change it in 'make install'. # if you just want to use $4 as the path, uncomment the line below and comment the other _path line below. #_path=$4 _path=/root/pkgbuilds/kernel26-customized # preliminary checks if [ -e $1 ]; then echo " You need to run this from 'make install' in a kernel dir " exit -1 fi if [ $EUID != 0 ]; then echo " -- You need to be root " exit -1 fi if [ ! -e /etc/arch-release ]; then if [ -e /usr/bin/pacman ]; then echo " -- This is only compatible with Arch Linux " exit -1 fi fi echo " ------------------------------ " echo " INSTALLING $1 " echo " ------------------------------ " echo " " _kversion=2. _kversion=$_kversion`grep "PATCHLEVEL = " Makefile | sed s/PATCHLEVEL\ =\ //`. _kversion=$_kversion`grep "SUBLEVEL = " Makefile | sed s/SUBLEVEL\ =\ //` echo " -- removing lock " if [ -e $_path/installed ]; then rm $_path/installed fi echo $_kversion > $_path/kernelversion # used to determine real pkgbuild pkgver echo $1 > $_path/fullversion # used for the symlinks, ma echo " -- installing modules" make modules_install > /dev/null echo " -- copying $3 to $_path/" cp $3 $_path/ echo " -- copying $2 to $_path/vmlinuz26-gonx" cp $2 $_path/vmlinuz26-gonx echo " -- depmod -a " depmod -a echo " -- regenerating initcpio " mkinitcpio -k $1 -g $_path/kernel26-gonx.img > /tmp/wat 2>&1 echo " -- updating source " cd $_path && yes | makepkg --asroot --skipinteg -f -i -p $_path/PKGBUILD >> /tmp/wat 2>&1 echo " -- finished! "