aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-01-27 13:04:48 +0200
committerFathi Boudra <fathi.boudra@linaro.org>2013-01-27 13:04:48 +0200
commitabe1c6c4312426b469da4e462eb987dabaecf80e (patch)
treeb78c01220c5ee4024d29dde483f4e7ae3d92f3c0
parent3c4ed375200ac6e19b6e0241603bddb06df02db2 (diff)
scripts/package_kernel: various fixes to use tmpfs
Various fixes to speed up the build by using tmpfs: - avoid symlink, use cp - avoid to remove kernel_build/out directories completely Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
-rwxr-xr-xscripts/package_kernel31
1 files changed, 13 insertions, 18 deletions
diff --git a/scripts/package_kernel b/scripts/package_kernel
index c2064d5..6df8615 100755
--- a/scripts/package_kernel
+++ b/scripts/package_kernel
@@ -151,9 +151,8 @@ check_settings()
cleanup_previous_build()
{
- test -d out &&
- rm -rf out
- mkdir out
+ test -d out || mkdir out
+ rm -rf out/*
}
#
@@ -161,16 +160,14 @@ cleanup_previous_build()
#
setup_kernel_git()
{
- test -d kernel_build/linux && {
- mkdir new_kernel_build
- mv kernel_build/linux new_kernel_build
- rm -rf kernel_build
- mv new_kernel_build kernel_build
- }
- test -d kernel_build/linux || {
- mkdir -p kernel_build/linux
+ if [ -d kernel_build/linux ]; then
+ mv kernel_build/linux linux-tmp
+ rm -rf kernel_build/*
+ mv linux-tmp kernel_build/linux
+ else
+ test -d kernel_build || mkdir kernel_build
git clone $nearby_git kernel_build/linux
- }
+ fi
cd kernel_build/linux
for r in $(git remote)
do
@@ -212,7 +209,7 @@ setup_kernel_git()
test -d debian.linaro && git rm -r debian.linaro
test "$boot_wrapper_repo" && {
test -d linaro/boot-wrapper && rm -rf linaro/boot-wrapper
- mkdir -p linaro
+ test -d linaro || mkdir linaro
cp -a ../boot-wrapper/ linaro
rm -rf linaro/boot-wrapper/.git
git add linaro/boot-wrapper/
@@ -401,7 +398,7 @@ install_custom_toolchain()
test_build_source_pkg()
{
- mkdir -p test_build
+ mkdir test_build
cd test_build
dpkg-source -x ../*.dsc linux
cd linux
@@ -416,7 +413,7 @@ test_build_source_pkg()
# for some reason, --prepend-path isn't always enough
time debuild --set-envvar=PATH="$TCBINDIR:$DEFAULT_PATH" --prepend-path=$TCBINDIR --no-lintian -us -uc -b -a$DEBARCH -j`getconf _NPROCESSORS_ONLN`
cd ..
- ln *.deb *.changes ../../out
+ cp -a *.deb *.changes ../../out
cd ..
}
@@ -466,8 +463,6 @@ get_binary_url()
create_artifact_dir()
{
# save source pkg files to be ssh uploaded
- #
- #rm -rf out
OUT=out/$BUILD_NUMBER
mkdir -p $OUT
cat /dev/null > $OUT/jobinfo.sh
@@ -627,7 +622,7 @@ test "$do_create_source_pkg" == "true" && {
cd kernel_build/linux
create_source_pkg
cd ..
- ln *.tar.gz *.dsc *.changes ../out
+ cp -a *.tar.gz *.dsc *.changes ../out
cd ..
}