[ltp] Debian, laptop kernel, and dependencies

Daniel Schmidt linux-thinkpad@linux-thinkpad.org
Mon, 7 Jul 2003 08:55:10 +0200


Hi Steve,

----- Original Message -----
From: "Steve K" <shooz@myrealbox.com>
To: <linux-thinkpad@linux-thinkpad.org>
Sent: Sunday, July 06, 2003 5:24 AM
Subject: [ltp] Debian, laptop kernel, and dependencies


> Not exactly a thinkpad related question, but I am using 2.4.21 + the
> linux-laptop patches on my Debian unstable t40p.  The problem I've run
into

Are there any patches to 2.4.21, that may make sense on my TP600?
I am currently using 2.4.21 from kernel.org with -ac2.

> is that I'm trying to use apt-get to install alsa, but the alsa-modules
> package depends on the kernel-image package...

use alsa-source and make-kpkg modules_image

> The following packages have unmet dependencies:
>   alsa-modules-2.4.21: Depends: kernel-image-2.4.21 but it is not
installable
>
> What is the proper way to handle this?  I suppose there should be a way to
> tell the package system that I have the kernel-image package installed, or
a
> way to create a fake kernel-image package and install it (I think I did
this
> when I installed the Sun Java SDK).

My way is a script file:
#!/bin/sh

# This is /usr/local/sbin/tp600_make-kpkg.sh
# Compiling a new Kernel from debian-source-package - the debian way!

# get necessary packages
#apt-get install
#  kernel-package
# libc6-dev
# gcc
# debianutils
# make
# libncurses5-dev
# gawk
# gzip
# bzip2
# shellutils
# tk8.3
# fakeroot

# prepare Sources
# (get those from their most recent version of a debian package,
# evtl. from unstable or testing)
#apt-get install alsa-source thinkpad-source pcmcia-source

# Unpack them from /usr/src to /usr/src/modules
# (automagically done while unzipping)

# Get the most recent kernel (2.4.21) from http://www.kernel.org
# Get the latest -ac Patch (-ac2) to that kernel (can't tell you why ;-)
# extract kernel-Archive to /usr/src/linux-2.4.21
# rename that folder to /usr/src/kernel-source-2.4.21
# I copy this one to /usr/src/kernel-source-2.4.21-ac2
# unpack patch to /usr/src
# Patch the kernel from within in the /usr/src/kernel-source-2.4.21-ac2
directory
# via "patch -p 1 --backup < /usr/src/patch-2.4.21-ac2"

# Set Kernel-Version, this ist used to switch to the right source
# directory
KernelVersion=2.4.21-ac2

# Set a custom version to avoid conflicts with existing kernels and modules
CustomVersion=`date +-tp600.%Y%m%d-%H%M`
CustomVersionRevision=1.0

# (re-)create symbolic link /usr/src/linux
rm /usr/src/linux
ln -s /usr/src/kernel-source-$KernelVersion /usr/src/linux

# run following steps before in the source-directory:
# - make oldconfig|config|menuconfig|xconfig
# - make dep

# move to Kernel-Source-Directory
cd /usr/src/kernel-source-$KernelVersion

# Clean up
make-kpkg clean

# Generate the Kernel & Modules Packages
make-kpkg --config
oldconfig --append_to_version=$CustomVersion --revision=$CustomVersionRevisi
on kernel_image modules_image

This is not perfect yet, and i am looking for comments on this procedure.
Please note that you need /etc/kernel-pkg.conf and /etc/kernel-pkg.conf set
up according to your configuration.
I keep modules for a kernel in a corresponding subdirectory to avoid
conflicts.

HTH,

Daniel