Posted by: Anonymous Coward
on September 03, 2006 06:44 AM
Extra Help for Debian Users.
Although, Debian has worked hard to make the addition of pre-compiled packages easy, they have gone out of their way to make compiling your own programs, a nightmare.
Unlike SuSE or Mandriva, the Debian packagers have not included the kernel sources for the default kernel images (those automatically chosen when you install Debian).
For example, the kernel image chosen for me, was:
kernel-image-2.6.8-2-686 (2.6.8-16sarge1) Kernel image for PPro/Celeron/PII/PIII/P4.
However, the only kernel source packages are:
kernel-source-2.2.25 (2.2.25-4) Kernel source for 2.2.25
kernel-source-2.4.27 (2.4.27-10sarge3) Kernel source for 2.4.27 with Debian patches
kernel-source-2.6.8 (2.6.8-16sarge4) Kernel source for 2.6.8 with Debian patches
none of which match the kernel image. The closest source package is kernel-source-2.6.8, however, it has a different patch level (patch level four, instead of one). There are two ways around this, you can either roll back the patches to level one (hard) or choose a new kernel image which matches the available sources (easy). So, I chose the new kernel (which was a better fit than the automatically chosen kernel, anyway):
kernel-image-2.6.8-3-k7 (2.6.8-16sarge4) Kernel image for AMD K7.
After installing the new kernel image with synaptic, the<nobr> <wbr></nobr>/boot/grub/menu.lst file now has entries for each kernel version:
Choosing Debian GNU/Linux, kernel 2.6.8-3-k7 from the grub menu, boots the 2.6.8-3-k7 kernel.
Choosing Debian GNU/Linux, kernel 2.6.8-2-686 from the grub menu, boots the 2.6.8-2-686 kernel.
Unlike SuSE or Mandriva, the Debian packagers have split the kernel source into a number of separate pieces.
For the 2.6.8-16sarge4 kernel, the sources come in the following three pieces:
kernel-source-2.6.8 (2.6.8-16sarge4),
kernel-headers-2.6.8-3 (2.6.8-16sarge4),
kernel-headers-2.6.8-3-k7 (2.6.8-16sarge4).
The installation does not reintegrate the sources, even though it easily could have done so, but leaves you with one unopened tar archive and two separate directories containing header files. Never before, have I seen a package install, that does not even bother to unpack the archive. This is the Debian packagers, deliberately making it difficult for you to compile your own kernel.
I looked around for a README, or some help, and was not surprised when I didn't find any. I eventually found lots of documentation in the directories<nobr> <wbr></nobr>/usr/share/doc/kernel*. Unfortunately, most of it was for the 2.4 kernel and I could not find where it explained how to reassemble the kernel sources.
After installing the three, above mentioned, kernel packages with synaptic, you have the two directories of headers files:
kernel-headers-2.6.8-3
kernel-headers-2.6.8-3-k7
and the kernel-source-2.6.8.tar.bz2 archive in the directory<nobr> <wbr></nobr>/usr/src/.
To sort out the install mess, execute the following commands:
cd<nobr> <wbr></nobr>/usr/src/
mv kernel-headers-2.6.8-3 linux-2.6.8-3-k7
tar cf kernel-headers-2.6.8-3.tar linux-2.6.8-3-k7
rm -fr linux-2.6.8-3-k7
(go to the directory<nobr> <wbr></nobr>/usr/src/)
(the move ensures the tar archive will unpack into linux-2.6.8-3-k7)
(creates tar archive named kernel-headers-2.6.8-3.tar)
(removes unneeded directory and contents)
mv kernel-headers-2.6.8-3-k7 linux-2.6.8-3-k7
tar cf kernel-headers-2.6.8-3-k7.tar linux-2.6.8-3-k7
rm -fr linux-2.6.8-3-k7
(the move ensures the tar archive will unpack into linux-2.6.8-3-k7)
(creates tar archive named kernel-headers-2.6.8-3-k7.tar)
(removes unneeded directory and contents)
tar xjf kernel-source-2.6.8.tar.bz2
mv kernel-source-2.6.8 linux-2.6.8-k7
(unpacks main kernel source)
(move main kernel source to linux-2.6.8-k7)
tar xf kernel-headers-2.6.8-3.tar
tar xf kernel-headers-2.6.8-3-k7.tar
(unpack kernel-headers-2.6.8-3.tar into linux-2.6.8-k7)
(unpack kernel-headers-2.6.8-3-k7.tar into linux-2.6.8-k7)
In summary, the directories of header files are repacked so that they will unpack into linux-2.6.8-3-k7. The kernel-source-2.6.8.tar.bz2 package is unpacked and moved to linux-2.6.8-3-k7. The tarred kernel-header directories, also unpack into linux-2.6.8-3-k7 and the sources are reintegrated.
By the way, the name linux-2.6.8-3-k7 was chosen simply because the command uname -r returned 2.6.8-3-k7.
Well, fine and good, so far. But the nightmare is not quite over.
The Debian packagers have "accidentally" forgotten a necessary link and have another pointing to some random place. To fix these "oversights" do the following:
Now you can continue with the ATI driver installation as above (tested on Debian Sarge).
Of course, you will have to adjust the kernel versions in the above to reflect your situation. You may also ask some Debian person for the name of the script (assuming it exists) that reassembles the unnecessarily split kernel sources. Of course, this script should be automatically run, when the kernel sources are installed.
Remember, that with SuSE or Mandriva, the kernel-sources can be installed with one or two clicks.
You may wish to speculate, as to the reasons the Debian packagers are deliberately making things difficult for you.
From <a href="http://m.domaindlx.com/LinuxHelp/ati/ati.htm" title="domaindlx.com">http://m.domaindlx.com/LinuxHelp/ati/ati.htm</a domaindlx.com>
What the above linked to article says:
Posted by: Anonymous Coward on September 03, 2006 06:44 AMAlthough, Debian has worked hard to make the addition of pre-compiled packages easy, they have gone out of their way to make compiling your own programs, a nightmare.
Unlike SuSE or Mandriva, the Debian packagers have not included the kernel sources for the default kernel images (those automatically chosen when you install Debian).
For example, the kernel image chosen for me, was:
kernel-image-2.6.8-2-686 (2.6.8-16sarge1) Kernel image for PPro/Celeron/PII/PIII/P4.
However, the only kernel source packages are:
kernel-source-2.2.25 (2.2.25-4) Kernel source for 2.2.25
kernel-source-2.4.27 (2.4.27-10sarge3) Kernel source for 2.4.27 with Debian patches
kernel-source-2.6.8 (2.6.8-16sarge4) Kernel source for 2.6.8 with Debian patches
none of which match the kernel image. The closest source package is kernel-source-2.6.8, however, it has a different patch level (patch level four, instead of one). There are two ways around this, you can either roll back the patches to level one (hard) or choose a new kernel image which matches the available sources (easy). So, I chose the new kernel (which was a better fit than the automatically chosen kernel, anyway):
kernel-image-2.6.8-3-k7 (2.6.8-16sarge4) Kernel image for AMD K7.
After installing the new kernel image with synaptic, the<nobr> <wbr></nobr>/boot/grub/menu.lst file now has entries for each kernel version:
title Debian GNU/Linux, kernel 2.6.8-3-k7
root (hd0,5)
kernel<nobr> <wbr></nobr>/boot/vmlinuz-2.6.8-3-k7 root=/dev/hda6 ro
initrd<nobr> <wbr></nobr>/boot/initrd.img-2.6.8-3-k7
title Debian GNU/Linux, kernel 2.6.8-2-686
root (hd0,5)
kernel<nobr> <wbr></nobr>/boot/vmlinuz-2.6.8-2-686 root=/dev/hda6 ro
initrd<nobr> <wbr></nobr>/boot/initrd.img-2.6.8-2-686
Choosing Debian GNU/Linux, kernel 2.6.8-3-k7 from the grub menu, boots the 2.6.8-3-k7 kernel.
Choosing Debian GNU/Linux, kernel 2.6.8-2-686 from the grub menu, boots the 2.6.8-2-686 kernel.
Unlike SuSE or Mandriva, the Debian packagers have split the kernel source into a number of separate pieces.
For the 2.6.8-16sarge4 kernel, the sources come in the following three pieces:
kernel-source-2.6.8 (2.6.8-16sarge4),
kernel-headers-2.6.8-3 (2.6.8-16sarge4),
kernel-headers-2.6.8-3-k7 (2.6.8-16sarge4).
The installation does not reintegrate the sources, even though it easily could have done so, but leaves you with one unopened tar archive and two separate directories containing header files. Never before, have I seen a package install, that does not even bother to unpack the archive. This is the Debian packagers, deliberately making it difficult for you to compile your own kernel.
I looked around for a README, or some help, and was not surprised when I didn't find any. I eventually found lots of documentation in the directories<nobr> <wbr></nobr>/usr/share/doc/kernel*. Unfortunately, most of it was for the 2.4 kernel and I could not find where it explained how to reassemble the kernel sources.
After installing the three, above mentioned, kernel packages with synaptic, you have the two directories of headers files:
kernel-headers-2.6.8-3
kernel-headers-2.6.8-3-k7
and the kernel-source-2.6.8.tar.bz2 archive in the directory<nobr> <wbr></nobr>/usr/src/.
To sort out the install mess, execute the following commands:
cd<nobr> <wbr></nobr>/usr/src/
mv kernel-headers-2.6.8-3 linux-2.6.8-3-k7
tar cf kernel-headers-2.6.8-3.tar linux-2.6.8-3-k7
rm -fr linux-2.6.8-3-k7
(go to the directory<nobr> <wbr></nobr>/usr/src/)
(the move ensures the tar archive will unpack into linux-2.6.8-3-k7)
(creates tar archive named kernel-headers-2.6.8-3.tar)
(removes unneeded directory and contents)
mv kernel-headers-2.6.8-3-k7 linux-2.6.8-3-k7
tar cf kernel-headers-2.6.8-3-k7.tar linux-2.6.8-3-k7
rm -fr linux-2.6.8-3-k7
(the move ensures the tar archive will unpack into linux-2.6.8-3-k7)
(creates tar archive named kernel-headers-2.6.8-3-k7.tar)
(removes unneeded directory and contents)
tar xjf kernel-source-2.6.8.tar.bz2
mv kernel-source-2.6.8 linux-2.6.8-k7
(unpacks main kernel source)
(move main kernel source to linux-2.6.8-k7)
tar xf kernel-headers-2.6.8-3.tar
tar xf kernel-headers-2.6.8-3-k7.tar
(unpack kernel-headers-2.6.8-3.tar into linux-2.6.8-k7)
(unpack kernel-headers-2.6.8-3-k7.tar into linux-2.6.8-k7)
In summary, the directories of header files are repacked so that they will unpack into linux-2.6.8-3-k7. The kernel-source-2.6.8.tar.bz2 package is unpacked and moved to linux-2.6.8-3-k7. The tarred kernel-header directories, also unpack into linux-2.6.8-3-k7 and the sources are reintegrated.
By the way, the name linux-2.6.8-3-k7 was chosen simply because the command uname -r returned 2.6.8-3-k7.
Well, fine and good, so far. But the nightmare is not quite over.
The Debian packagers have "accidentally" forgotten a necessary link and have another pointing to some random place. To fix these "oversights" do the following:
cd<nobr> <wbr></nobr>/lib/modules/2.6.8-2-k7
rm -fr boot source
ln -s<nobr> <wbr></nobr>/usr/src/linux-2.6.8-2-k7 boot
ln -s<nobr> <wbr></nobr>/usr/src/linux-2.6.8-2-k7 source
Now you can continue with the ATI driver installation as above (tested on Debian Sarge).
Of course, you will have to adjust the kernel versions in the above to reflect your situation. You may also ask some Debian person for the name of the script (assuming it exists) that reassembles the unnecessarily split kernel sources. Of course, this script should be automatically run, when the kernel sources are installed.
Remember, that with SuSE or Mandriva, the kernel-sources can be installed with one or two clicks.
You may wish to speculate, as to the reasons the Debian packagers are deliberately making things difficult for you.
From <a href="http://m.domaindlx.com/LinuxHelp/ati/ati.htm" title="domaindlx.com">http://m.domaindlx.com/LinuxHelp/ati/ati.htm</a domaindlx.com>
#