Apply these patches to a clean 2.4.20 kernel tree.

eg.

tar zxvf linux-2.4.20.tar.gz
cd linux
cat /tmp/2.4.20-dm-10/*.patch | patch -p1

Select device-mapper in the config options and build.