#!/bin/sh # my script to build my current kernel from scratch source # # start with kernel-source package installed in /usr/src # hint: # upgradepkg --reinstall kernel-source-2.4.22-noarch-3.tgz # mv xfs-2.4.22 patches-2.4.22-not-applied # gzip -9 2.4.22.nat.diff; mv 2.4.22.nat.diff.gz patches-2.4.22 KVER=2.4.22 PLVL=ac2 cd /usr/src if [ "$1" != "--package-only" ]; then \ shift # patch kernel up to alan cox-2 (shouldn't be an old ac2 directory here) (cd linux-$KVER; zcat ../patches-$KVER/patch-$KVER-$PLVL.gz \ | patch -p1) mv linux-$KVER linux-$KVER-$PLVL # cp ACPI dsdt.hex into /tmp and apply Mike Hardy's Dell D-800 patch zcat patches-$KVER/dsdt.hex.gz > /tmp/dsdt.hex (cd linux-$KVER-$PLVL; zcat ../patches-$KVER/osl.diff.gz |patch -p2) # apply slackware patch (only one except xfs filesystem stuff) # -- This appears to have been already patched by ac2 ? -- #(cd linux-$KVER-$PLVL; \ # zcat ../patches-$KVER/2.4.22.nat.diff.gz |patch -p1) # apply patch to orinoco_cs modules that allows scanning # (makefile patch will fail, but it looks like all they did was add # -fno-strict-aliasing to CFLAGS and this appears to be on already (cd linux-$KVER-$PLVL/drivers/net/wireless; \ zcat ../../../../patches-$KVER/scanning-0.13d-v3.diff.gz|patch ) # apply patch for hostap drivers (allow prism card to act as access point) (cd linux-$KVER-$PLVL; \ zcat ../patches-$KVER/hostap-linux-2.4.20.patch.gz |patch -p1 ) (cd linux-$KVER-$PLVL; \ tar zxvf ../drivers/hostap/hostap-drivers-0.0.4.tgz ) # copy last config into this dir cp config linux-$KVER-$PLVL/.config (cd linux-$KVER-$PLVL; make oldconfig) # make dependencies (cd linux-$KVER-$PLVL; make dep) # Question: what are good CFLAGS for compiling kernel? # seems like arch=i686 would be good (current looks like -O2 -march=i586) # ready to rock and roll (cd linux-$KVER-$PLVL; make clean) (cd linux-$KVER-$PLVL; make bzImage > make.log 2>&1) (cd linux-$KVER-$PLVL; make modules > make-modules.log 2>&1) # make broadcomm module ln -fs linux-$KVER-$PLVL linux (cd /usr/src/drivers/bcm5700/6.2.17/Server/Linux/Driver/src; make ) fi # make kernel package in temp directory rm -fr tmp1 mkdir -p tmp1/boot/$KVER-$PLVL cp linux-$KVER-$PLVL/arch/i386/boot/bzImage tmp1/boot/$KVER-$PLVL cp linux-$KVER-$PLVL/System.map tmp1/boot/$KVER-$PLVL gzip -9 tmp1/boot/$KVER-$PLVL/System.map cp linux-$KVER-$PLVL/.config tmp1/boot/$KVER-$PLVL/config mkdir -p tmp1/install thisuser=`whoami` thishost=`hostname` thisdate=`date` thisgcc=`gcc -v 2>&1 |tail -1` cat > tmp1/install/slack-desc < tmp2/install/slack-desc < tmp2/install/doinst.sh < bootsector.hint < nvidia.hint <