You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
4.5 KiB
156 lines
4.5 KiB
18 years ago
|
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
|
||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
||
17 years ago
|
#
|
||
13 years ago
|
# Filename: package/.../linux/linux.conf
|
||
14 years ago
|
# Copyright (C) 2007 - 2010 The OpenSDE Project
|
||
18 years ago
|
# Copyright (C) 2004 - 2006 The T2 SDE Project
|
||
|
# Copyright (C) 1998 - 2003 Clifford Wolf
|
||
17 years ago
|
#
|
||
18 years ago
|
# More information can be found in the files COPYING and README.
|
||
17 years ago
|
#
|
||
18 years ago
|
# This program is free software; you can redistribute it and/or modify
|
||
|
# it under the terms of the GNU General Public License as published by
|
||
|
# the Free Software Foundation; version 2 of the License. A copy of the
|
||
|
# GNU General Public License can be found in the file COPYING.
|
||
|
# --- SDE-COPYRIGHT-NOTE-END ---
|
||
|
|
||
|
. $base/package/*/linux*/linux-conf.in
|
||
|
|
||
|
main_lx() {
|
||
|
lx_patch
|
||
|
lx_config
|
||
|
|
||
|
hook_eval premake
|
||
|
|
||
|
# we need to rerun the oldconfig since the used .config
|
||
|
# might not match the one used in the last oldconfig run
|
||
|
# (e.g. the nomods is run last - and normally the module
|
||
|
# one is used)
|
||
|
yes '' | eval $MAKE $makeopt oldconfig > /dev/null
|
||
|
|
||
|
kerneldir="$PWD"
|
||
|
moduledir="$root/lib/modules/${lx_kernelrelease}"
|
||
|
|
||
|
echo "Cleanup kernel ..."
|
||
|
eval $MAKE $makeopt clean > /dev/null
|
||
|
|
||
|
cp -vf .config $root/boot/kconfig_${lx_kernelrelease}
|
||
|
|
||
|
if [ -z "$SDEDEBUG_LINUX_SUBMODULES_ONLY" ] ; then
|
||
|
|
||
|
var_append makeopt ' ' vmlinux
|
||
|
if grep -q "CONFIG_MODULES=y" .config ; then
|
||
|
var_append makeopt ' ' modules
|
||
|
var_append makeinstopt ' ' "INSTALL_MOD_PATH=$root DEPMOD=/bin/true modules_install"
|
||
|
else
|
||
|
makeinstopt=
|
||
|
fi
|
||
|
|
||
|
case "$lx_cpu" in
|
||
16 years ago
|
x86|i386|x86_64)
|
||
18 years ago
|
var_append makeopt ' ' bzImage ;;
|
||
|
mips)
|
||
|
var_append makeopt ' ' vmlinux.ecoff ;;
|
||
|
ppc|sh)
|
||
|
var_append makeopt ' ' zImage ;;
|
||
|
sparc*)
|
||
|
var_append makeopt ' ' image ;;
|
||
|
esac
|
||
|
|
||
|
echo "Building the kernel ..."
|
||
|
eval $MAKE $makeopt
|
||
|
cp -vf System.map $root/boot/System.map_${lx_kernelrelease}
|
||
|
|
||
|
hook_eval inmake
|
||
|
|
||
|
[ "$makeinstopt" ] && eval $MAKE $makeinstopt
|
||
|
|
||
|
echo "Installing the kernel ..."
|
||
|
# for debugging with oprofile, also used to boot on some arches
|
||
|
cp -vf vmlinux $root/boot/vmlinux_${lx_kernelrelease}
|
||
|
case "$lx_cpu" in
|
||
16 years ago
|
x86|i386|x86_64)
|
||
18 years ago
|
cp -vf arch/${lx_cpu}/boot/bzImage $root/boot/vmlinuz_${lx_kernelrelease}
|
||
|
;;
|
||
|
alpha)
|
||
|
gzip < vmlinux > $root/boot/vmlinux_${lx_kernelrelease}.gz
|
||
|
;;
|
||
|
mips)
|
||
|
cp -vf vmlinux.ecoff $root/boot/vmlinux_${lx_kernelrelease}.ecoff
|
||
|
;;
|
||
|
ppc)
|
||
|
for x in arch/ppc/boot/images/zImage.* ; do
|
||
|
cp -v $x $root/boot/${x/*\//}-${lx_kernelrelease}
|
||
|
done
|
||
|
;;
|
||
|
sh)
|
||
|
cp -vf arch/sh/boot/zImage $root/boot/vmlinux_${lx_kernelrelease}
|
||
|
;;
|
||
|
sparc*)
|
||
|
cp -vf arch/$lx_cpu/boot/image $root/boot/vmlinux_${lx_kernelrelease}
|
||
|
;;
|
||
|
esac
|
||
|
else
|
||
|
eval $MAKE $makeopt scripts
|
||
|
touch $root/boot/System.map_${lx_kernelrelease}
|
||
|
mkdir -p $moduledir
|
||
|
ln -sf $PWD $moduledir/build
|
||
|
fi
|
||
|
|
||
|
hook_eval postmake
|
||
|
|
||
|
# iterate over the packages that provide 3rd party linux kernel modules
|
||
|
if grep -q "CONFIG_MODULES=y" .config ; then
|
||
|
module_error=0
|
||
|
echo_status "Registered 3rd party kernel modules:"
|
||
|
for x in $lx_3rd_party_modules ; do
|
||
|
echo "Sub-building 3rd party module package $x ..."
|
||
|
pushd $builddir
|
||
|
# ugly, bash does not abort properly when we have this in a if
|
||
|
# and without it the return 1 aborts immediatly ... :-(
|
||
|
set +e
|
||
|
build_package $x postlinux.conf
|
||
|
error=$?
|
||
|
set -e
|
||
|
if [ $error -ne 0 ]; then
|
||
|
echo_warning "Failed building $x."
|
||
|
module_error=1
|
||
|
fi
|
||
|
echo "Done building $x"
|
||
|
popd
|
||
|
done
|
||
|
|
||
|
# maybe fail hard
|
||
|
if ! atstage rebuild && [ $module_error = 1 ]; then
|
||
|
abort "At least one of the 3rd party kernel modules failed!"
|
||
|
fi
|
||
|
|
||
18 years ago
|
echo "Running 'depmod -ae -b ${root:-/} -q -F /boot/System.map ${lx_kernelrelease}' ..."
|
||
|
depmod -ae -b ${root:-/} -q -F $root/boot/System.map_${lx_kernelrelease} ${lx_kernelrelease}
|
||
18 years ago
|
|
||
|
# due static depmod :-(
|
||
|
for x in $moduledir/modules.*
|
||
|
do [ -f $x ] && add_flist $x; done
|
||
|
|
||
18 years ago
|
echo "Fixing /lib/modules/${ver}/build and source symlinks ..."
|
||
|
for x in build source; do
|
||
|
rm -f $root/lib/modules/${lx_kernelrelease}/$x
|
||
|
ln -snf ../../../usr/src/linux-${lx_kernelrelease} \
|
||
|
$root/lib/modules/${lx_kernelrelease}/$x
|
||
|
done
|
||
14 years ago
|
|
||
|
# if module versions is enabled we need to copy 'Module.symvers'
|
||
|
# to be able to build external 3rd party kernel modules without
|
||
13 years ago
|
# rebuilding the whole kernel using the linux-src package
|
||
|
if grep -q "CONFIG_MODVERSIONS=y" .config && pkginstalled linux-src ; then
|
||
14 years ago
|
echo "Copying Module.symvers -> /lib/modules/${lx_kernelrelease}/build/"
|
||
|
cp -v Module.symvers $root/lib/modules/${lx_kernelrelease}/build/
|
||
|
fi
|
||
18 years ago
|
fi
|
||
|
|
||
|
}
|
||
|
|
||
|
custmain="main_lx"
|
||
|
autopatch=0
|
||
|
|