Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit 7202ae0

Browse files
committed
buildroot/rebuild.sh: Use the git repo for seamless upgrades
This will save bandwidth across image upgrades/rebuilds. As it stands currently, each image build redownloads the source. Signed-off-by: Nathan Chancellor <[email protected]>
1 parent ae6d51a commit 7202ae0

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

buildroot/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
build/
1+
src/

buildroot/rebuild.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@
55
# Make sure we don't have any unset variables
66
set -u
77

8-
# Clean up
9-
rm -rf build
10-
mkdir -p build
11-
128
# Download latest buildroot release
13-
curl https://buildroot.org/downloads/buildroot-2019.02.3.tar.gz | tar -xzf - -C build --strip-components=1
14-
cd build || exit 1
9+
BUILDROOT_VERSION=2019.02.3
10+
if [[ -d src ]]; then
11+
cd src || exit 1
12+
if [[ $(git describe --exact-match --tags HEAD) != "${BUILDROOT_VERSION}" ]]; then
13+
git fetch origin ${BUILDROOT_VERSION}
14+
git checkout ${BUILDROOT_VERSION}
15+
fi
16+
17+
# Clean up artifacts from the last build
18+
make clean
19+
else
20+
git clone -b ${BUILDROOT_VERSION} git://git.busybox.net/buildroot src
21+
cd src || exit 1
22+
fi
1523

1624
# Use the config in the parent folder
1725
CONFIG=../${1}.config

0 commit comments

Comments
 (0)