Independent ALSA and linux audio support site


From the ALSA wiki

Jump to: navigation, search



This script is now superceded by aabuild.


This script is well and truly out of date and only remains here as a guide. If you try this script out then you will have to look around for current kernels and patches, and if you have any success then please consider updating this script and adding your own attribution.


This script builds a late model preemptable 2.4 kernel with ALSA direct from it's CVS repository. Here is the AlsaBuildConfig kernel config file for building the AlsaKernel tarball and here is the associated AlsaRemove script, also, AlsaModules may be useful. First time users may want to put comments "#" and and "exit" early on in the script to see how it works in your case. - MarkConstable 20020803

Suggestions, improvements, comments ?

2.4.20-pre1-ac1 The preempt patch probably only just applies against this patched kernel by using fuzzy logic but there are no rejects and I am running on it right now and my ALSA/SBlive plays oggs. That is the limit of my testing though. There are a bunch of ugly warnings when depmod gets called after build the non-ALSA kernel modules and AlsaBuild will stop at that point so the easiest remedy is to manually cd into the /usr/src/alsa dir and simply type "make" to finish off the build... perhaps consider rebooting at this stage (I did so) before continuing with the ALSA build part.

Previous note...

Some people might need this kludge when doing an ALSA make: when the stock CVS Makefile invokes configure it then checks for the current running kernel version and looks up the /lib/modules/`uname -r`/build link which will point to the kernel source of the current running kernel, not the new one you may have just compiled. It used to work up till 2.4.19 because the kernel source was always placed in /usr/src/linux but with 2.4.19 the kernel source unwinds into /usr/src/linux-2.4.19 so this build link problem just got real. The solution is to either reboot after building the kernel and before proceeding to build ALSA or stop the build just before make'ing ALSA and manually diddle with that build link in /lib/modules/2.4.*/build and point it to the /usr/src/linux-2.4.19 source dir. - Mark Constable 20020805


# AlsaBuild v0.1.2 8-Aug-2002 [email protected]
# Copyright: Public Domain
# License: GNU GPL
# Homepage:
# Please send any modifications or suggestions to [email protected]
set -e
set -x

[ -d $SCRDIR ] || mkdir -p $SCRDIR
[ -d $CVSDIR/alsa ] || mkdir -p $CVSDIR/alsa


if [ ! -f $KERNEL ]; then
    wget http://$MIRROR/pub/linux/kernel/v2.4/$KERNEL

if [ ! -f ${PATCH1%.bz2} ]; then
    wget http://$MIRROR/pub/linux/kernel/v2.4/testing/$PATCH1
    bunzip2 $PATCH1

if [ ! -f ${PATCH2%.bz2} ]; then
    wget http://$MIRROR/pub/linux/kernel/people/alan/linux-2.4/2.4.20/$PATCH2
    bunzip2 $PATCH2

if [ ! -f ${PATCH3} ]; then
    wget http://$MIRROR/pub/linux/kernel/people/rml/preempt-kernel/v2.4/$PATCH3

if [ -f ${KERNEL%.tar.bz2}/.config ]; then
    cp ${KERNEL%.tar.bz2}/.config config

rm -rf ${KERNEL%.tar.bz2}

tar xjf $KERNEL

cd $SRCDIR/${KERNEL%.tar.bz2}

patch -p1 < ../${PATCH1%.bz2}
patch -p1 < ../${PATCH2%.bz2}
patch -p1 < ../$PATCH3

cd $CVSDIR/alsa

if [ -d ./CVS ]; then
    cvs up -P -d
    echo "Just hit the enter key at the login prompt"
    cvs -d ':pserver:[email protected]:/cvsroot/alsa' login
    cvs -z3 -d ':pserver:[email protected]:/cvsroot/alsa' co -P .


rm -rf alsa
mkdir alsa
cp -a $CVSDIR/alsa .

#exit # uncomment this until the above works smoothly

cd $SRCDIR/${KERNEL%.tar.bz2}

if [ -f ../config ]; then
    cp ../config .config
    make oldconfig
    # substitute oldconfig for config or menuconfig or xconfig
    # if you need to add more modules for your hardware
    #make config
    #make menuconfig
    make xconfig

time make dep clean bzlilo modules modules_install

cd $SRCDIR/alsa
time make

# rm -rf /vmlinuz / /lib/modules/2.4.20-pre1-ac1 # before a 2nd build attempt
# tar czf alsa-kernel-`date +%Y%m%d`.tgz /vmlinuz / /lib/modules/2.4.20-pre1-ac1

See also


Retrieved from ""

Category: Installation