#!/bin/sh # # build_alpha_kernels.sh (based on compile_kern.sh by Patrick Volkerding) # version 1.0 (Tue Oct 24 23:44:44 PDT 2000) # by Chris Lumens # # Rebuilds a tree of directories containing a System.map, .config (renamed # config), and kernel (vmlinux). The input is a tree of directories # beneath the current one with names matching the wildcard *.? # (in Slackware, these will typically be *.s for IDE/SCSI kernels). At the # minimum, each directory must contain the file 'config', which is the # .config to start with when building the kernel. ### global variables CWD=`pwd` KERNEL=2.2.26 KERNELSRC=$CWD/../source/k/linux/linux-${KERNEL}.tar.bz2 TMP=/tmp OUTPUT=$TMP/output ### extract the kernel source if [ ! -d $TMP/linux-${KERNEL} ] then ( cd $TMP tar -xjf $KERNELSRC mv $TMP/linux $TMP/linux-${KERNEL} ) fi ### make our output directory if [ ! -d $OUTPUT ] then mkdir -p $OUTPUT fi ### build the kernels for d in `find . -type d -maxdepth 1 -name "*.?"` do if [ ! -r $d/config ] then continue fi if [ -r $OUTPUT/$d/vmlinuz ] then echo "kernel found in $OUTPUT/$d... skipping." continue fi echo echo "------------------------------------------" echo " BUILDING: $d" echo "------------------------------------------" echo sleep 1 cd $TMP/linux-${KERNEL} cp $CWD/$d/config .config make oldconfig make dep make clean make boot if [ $? = 0 ] then echo echo "------------------------------------------" echo "Saving output in $OUTPUT/$d" echo "------------------------------------------" echo mkdir -p $OUTPUT/$d cp arch/alpha/boot/vmlinux.gz $OUTPUT/$d cp System.map $OUTPUT/$d cp .config $OUTPUT/$d/config echo "Cleaning up..." make mrproper fi cd $CWD done