mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4051 d57e44dd-8a1f-0410-8b47-8ef2f437770f
77 lines
1.8 KiB
Bash
Executable File
77 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
############################################################################
|
|
#
|
|
# Script for generating a kernel source tree with the SCST patches applied.
|
|
#
|
|
# Copyright (C) 2010 Bart Van Assche <bvanassche@acm.org>
|
|
#
|
|
# 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.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
############################################################################
|
|
|
|
|
|
########################
|
|
# Function definitions #
|
|
########################
|
|
|
|
source $(dirname $0)/kernel-functions
|
|
|
|
function usage {
|
|
echo "Usage: $0 <kernel version>"
|
|
}
|
|
|
|
|
|
#########################
|
|
# Argument verification #
|
|
#########################
|
|
|
|
set -e
|
|
|
|
if [ "$1" = "" ]; then
|
|
echo "Error: missing kernel version argument."
|
|
exit 1
|
|
fi
|
|
|
|
|
|
##########################
|
|
# Kernel tree generation #
|
|
##########################
|
|
|
|
scriptname="$0"
|
|
if [ "${scriptname#/}" = "${scriptname}" ]; then
|
|
scriptname="$PWD/$scriptname"
|
|
fi
|
|
target="linux-$1"
|
|
kernel_version="$(kernel_version "$1")"
|
|
patchlevel="$(patchlevel "$1")"
|
|
|
|
download_kernel "$1" || exit $?
|
|
|
|
extract_kernel_tree "$1" || exit $?
|
|
|
|
cd "${target}" || exit $?
|
|
|
|
svn status -v "$(dirname "$(dirname "$scriptname")")" \
|
|
| grep -vE '^\?|^Performing' \
|
|
| cut -c41- \
|
|
| grep -- "-${kernel_version}.*.patch$" \
|
|
| grep -v /in-tree/ \
|
|
| while read p
|
|
do
|
|
if [ "${p/readahead-2.6.32.below11.patch//}" = "$p" \
|
|
-o "${patchlevel:-0}" -lt 11 ]
|
|
then
|
|
echo "==== $p"
|
|
patch -p1 <$p
|
|
fi
|
|
done
|