Well it's been a year almost... so I revisited this page to see if it would still work.
So I downloaded the img and started following the steps I had done. A couple things are needed now that weren't before.

1. cmake - needs to be upgraded. I had to get it from experimental, as kde requires cmake 2.6.2 now.
Code:
sudo apt-get -update
sudo apt-get install -t experimental cmake
Here was the symptom:
I found this error in the log directory
Code:
CMake Error: ERROR: Could not find KDE4 kde4-config
Very illumiinating...!
I was long on questions and short on answers until I checked the kdesupport directory.
There it told me I need to upgrade cmake. The rest just complained about kde4-config being missing.

After you install the latest cmake, you may want to include, or at least be made aware of them, some additional variables:
CMAKE_INSTALL_PREFIX
CMAKE_PREFIX_PATH

The environment variable CMAKE_INSTALL_PREFIX, is supposed to point to where cmake itself is installed... should be of a minor importance unless you had to install it to a non root account.
The environment variable CMAKE_PREFIX_PATH, is intended to be a list of directories that are searched before the directories in the shell's PATH variable. Each directory in that list, is a top level directory that may also have bin/ include/ and lib/ directories.

There is now a KDEDIRS environment variable... which I just point to whatever KDEDIR is. It can hold more than one directory.
It must have been needed by some.

Code:
KDEDIRS="${KDEDIR}"
CMAKE_PREFIX_PATH="${KDEDIR}:${QTDIR}"
XDG_DATA_DIRS="${KDEDIR}/share:${XDG_DATA_DIRS}"
Some other things I noticed...
  • esfsck - After I extracted the knoppix.img to a drive... before resize2fs would allow it to be resized, it complained that I should run e2fsck -f knoppix.img. That went quickly.

    /etc/sysconfig - On a completely different system, the files in the knoppix.img's /etc/sysconfig will not agree with the new machine's hardware. I needed to boot Knoppix without the Persistant $HOME mounted... and copy /etc/sysconfig to a thumbdrive. Once I booted back into the persistant home... copying /etc/sysconfig from the thumbdrive got the correct files in place. Then run mkxorgconfig to update /etc/X11/xorg.conf to the new hardware.
    Now X would start on this new machine.


Ordinarily, you could tell knoppix-image to "Overwrite/update stored system configuration" but that feature had a bug in 5.3.1.
Someone tried to discuss it here, but noone seemed to address the issue there.

Okay... let's look at the knoppix-image script that does the overwrite of those system settings... at the very bottom I found...
Code:
case "$SELECTION" in *overwrite*)
 [ -z "$OLDHOMEDIR" ] && rsync --update --exclude /ramdisk/etc/mtab -Ha /ramdisk/etc/ /UNIONFS/etc
;;
esac
So maybe I could have just looked in /ramdisk for the new /etc/sysconfig

Ok... that's about all I can remember for now. I'll post my .bashrc with the new values for building KDE 4.2 from trunk, after my build finishes.

Oh look, more errors...
I'll be editing this later.

Edit1: It seems that there is some discrepancy about phonon as there are a few versions... one is called a trunk version, and another is in kdesupport. So maybe this fixes it. Edit and comment out the whole phonon module in .kdesvn-buildrc. Then add
in the kdesupport module
Code:
module kdesupport
        cmake-options -DBUILD_phonon=ON
end module
Edit2: Well... they say you should not build from trunks pulled on the weekend, and maybe mondays are the worst day of all but... hey, I had time. But for me, phonon had a problem, so I just cheated. I didn't need multimedia to get a basic debug build so I removed the multimedia. Here's how I did that. (By the time you read this... it may not even be needed.)
Code:
module kdebase
        cmake-options -DKDE4_DISABLE_MULTIMEDIA=ON
end module
It sure is sweet looking!
I can't wait till Klaus puts out a Knoppix DVD with this on it!