Skip to content
Snippets Groups Projects
Commit 869c8418 authored by Lucas De Marchi's avatar Lucas De Marchi
Browse files

dim_setup: Allow to use other setup as reference


On a slow network, most of the time for a setup is taken by the initial
clone of the kernel repository. It's common for kernel developers to
have a kernel clone lying around, so allow to borrow the git objects
from there.

Testing on a relatively fast connection, the initial checkout goes down
from ~7m45s to 2m21s.

Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 48a5acb5
No related branches found
No related tags found
1 merge request!25dim changes for xe
......@@ -53,6 +53,10 @@ fi
# prefix for repo directories
DIM_PREFIX=${DIM_PREFIX:-$HOME/linux}
# location of another dim setup used to speedup clones; default
# to something that doesn't exist so no cache is used
DIM_KERNEL_PREFIX=${DIM_KERNEL_REFERENCE:-/dev/fd/-1}
# main maintainer repo under $DIM_PREFIX
DIM_REPO=${DIM_REPO:-${DIM_DRM_INTEL:-src}}
......@@ -2321,7 +2325,7 @@ function parse_opt_dim_setup # options
{
local OPTS arg
OPTS=$(getopt --option y --long yes -n 'dim setup' -- "$@")
OPTS=$(getopt --option y --long yes,reference: -n 'dim setup' -- "$@")
eval set -- "$OPTS"
......@@ -2331,6 +2335,10 @@ function parse_opt_dim_setup # options
ASK_USER_ASSUME_YES=1
shift
;;
--reference)
DIM_KERNEL_REFERENCE=$2
shift 2
;;
--)
shift; break ;;
esac
......@@ -2361,7 +2369,8 @@ function dim_setup # options
if [[ ! -d "$DIM_REPO" ]]; then
if ask_user "The DIM_REPO maintainer kernel repository '$DIM_REPO' doesn't exist. Clone upstream?"; then
git clone "$linux_upstream_git" "$DIM_REPO"
git clone --reference-if-able "$DIM_KERNEL_REFERENCE" --dissociate \
"$linux_upstream_git" "$DIM_REPO"
fi
fi
......
......@@ -120,6 +120,13 @@ Available options:
Assume "yes" to all prompts or default values so
it can be executed non-attended
--reference <directory>
Use another kernel checkout to borrow the git objects
from while cloning so it reduces the network transfer
amount. The final repo is then dissociated from the
passed reference. See --reference and --dissociate in
GIT-CLONE(1).
update-branches
---------------
Updates all maintainer branches. Useful to synchronize all branches when other
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment