mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-25 07:51:28 +00:00
scripts/kernel-functions: Check local kernel git repo before downloading
This approach works faster than downloading kernel source code tarballs. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8119 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
kernel_mirror="http://cdn.kernel.org/pub/linux/kernel"
|
||||
kernel_downloads="$HOME/software/downloads"
|
||||
kernel_tree="$HOME/software/linux-kernel"
|
||||
|
||||
# Whether or not kernel version $1 is lower than or equal kernel version $2.
|
||||
function kernel_version_le {
|
||||
@@ -422,5 +423,14 @@ EOF
|
||||
}
|
||||
|
||||
function download_and_extract_kernel_tree {
|
||||
if [ -e "${kernel_tree}" ]; then
|
||||
rm -rf "linux-$1"
|
||||
mkdir "linux-$1"
|
||||
(
|
||||
cd "${kernel_tree}" &&
|
||||
{ git tag -l "v$1" >/dev/null || git fetch stable; } &&
|
||||
git archive "v$1"
|
||||
) | tar -C "linux-$1" -xf-
|
||||
fi
|
||||
download_kernel "$1" && extract_kernel_tree "$1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user