[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Building modules



------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <21207.993532750.1@gbr>

  I essentially build and install my kernel as follows (I've included
  the full script in case someone finds it useful):

    make-kpkg --revision=${revision} kernel_image
    dpkg -i ../kernel-image-${version}_${revision}_i386.deb

  My question is this: How do I add modules to /lib/modules?

  For example, I found that I neglected to include the lp modules and
  want to build and install them in a similar Debian-fashioned way but
  without doing a full kernel install and reboot. The docs indicated
  that this might do it:

    [root@gbr:503]# make-kpkg modules_image
    [...compilation deleted...]
    for module in  ; do
    ...
    /bin/sh: -c: line 1: syntax error near unexpected token `;'
    /bin/sh: -c: line 1: `for module in  ; do

  But alas, it did not. make-kpkg modules_image appears to be more for
  addons in /usr/src/modules (which does not yet exist on my system,
  but creating it didn't help) rather than mainstreamed modules.

  Suggestions?
  
------- =_aaaaaaaaaa0
Content-Type: text/plain; name="makekernel"; charset="us-ascii"
Content-ID: <21207.993532750.2@gbr>

#! /bin/sh
#
# $Id: makekernel,v 1.8 2001/06/26 05:18:34 wohler Exp $
#
# Configure, build and install a new kernel. This script expects to be run in a 
# directory called kernel-source-nnnn; the version of the kernel is
# extracted from nnnn.
#
cwd=`pwd`
if [ `expr $cwd : '.*kernel-source-'` -eq 0 ]; then
    echo "$0: must be in a kernel-source directory"
    exit 1
fi

version=`pwd | sed 's/.*kernel-source-//'`
buildversionfile=../.build-$version

# If LOGNAME is root, try to set LOGNAME to the actual person that is
# logged in.
if [ -z "$LOGNAME" -o "$LOGNAME" = root ]; then
    LOGNAME=`who am i | sed -e 's/^[^!]*!//' -e 's/ .*$//'`
fi
if [ -z "$LOGNAME" ]; then
    echo "Could not set LOGNAME. Please set LOGNAME manually, as in:"
    echo "  LOGNAME=luser $0"
    exit 1
fi

# Set custom version string.
hostname=`uname --nodename|sed 's/\..*//'`
revision=$hostname.1
buildversion=1
if [ -f $buildversionfile ]; then
    buildversion=`cat $buildversionfile`
    buildversion=`expr $buildversion + 1`
    revision=$hostname.$buildversion
fi

# Create configuration file.
if [ -z "$DISPLAY" ]; then
    echo "DISPLAY environment variable not set; "
    echo "attempt to use X display :0.0, text-only menu, skip configuration,"
    echo -n "or abort? [Xtsa] "
    read ans
    echo $ans
    if [ -z "$ans" -o "$ans" = "x" -o "$ans" = "X" ]; then
        DISPLAY=:0.0 make xconfig || exit 1
    elif [ "$ans" = "t" -o "$ans" = "T" ]; then
        make menuconfig || exit 1
    elif [ "$ans" = "s" -o "$ans" = "S" ]; then
        echo "Skipping configuration..."
    else
        exit 0
    fi
else
    make xconfig
fi

# Build everything.
set -x
make-kpkg clean
make-kpkg --revision=${revision} kernel_image
make-kpkg kernel_headers	# --revision saved between invocations
make-kpkg kernel_doc

# Prepare to install.
# Removing the modules directory eliminates the warning you get during
# the kernel-image install about mismatched modules.
set +x
modules=/lib/modules/$version
echo "The modules directory for this version needs to be removed"
echo "before installing the kernel in order to prevent a mismatch"
echo "between the kernel and the modules. Verify that the correct"
echo "module directory is to be removed and hit return. If it is"
echo "not correct, interrupt with C-c and correct the error."
echo ""
echo -n "Hit return to remove $modules, C-c to abort: "
read
set -x
rm -rf $modules

# Install everything.
dpkg -i ../kernel-image-${version}_${revision}_i386.deb
dpkg -i ../kernel-headers-${version}_${revision}_i386.deb
dpkg -i ../kernel-doc-${version}_${revision}_all.deb

# Post installation chores.
if [ -e /usr/bin/vmware-config.pl ]; then
    vmware-config.pl << EOF








EOF
fi
echo $buildversion > $buildversionfile

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <21207.993532750.3@gbr>

--
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and mh-e. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.

------- =_aaaaaaaaaa0--



Reply to: