Skip to content

Commit

Permalink
Divided the build cache to two directories
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Apr 25, 2019
1 parent d27049d commit 85a03a5
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
devuan-*-c201-libre-*GB.img
open-ath9k-htc-firmware
linux-*
dl/*
cache/*
devsus-*
/devuan-*-c201-libre-*GB.img
/open-ath9k-htc-firmware
/linux-*
/dl
/hosts
/*-cache
/devsus-*
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ git:
jobs:
include:
- stage: build
script: docker run --rm -e CI -w /root/devsus -v `pwd`:/root/devsus -v `pwd`/cache:/root/.ccache dimkr/devsus:latest ./ci/build_kernel.sh
script: docker run --rm -e CI -w /root/devsus -v `pwd`:/root/devsus -v `pwd`/kernel-cache:/root/.ccache dimkr/devsus:latest ./ci/build_kernel.sh
name: Kernel
deploy:
provider: releases
Expand All @@ -41,7 +41,7 @@ jobs:
repo: dimkr/devsus
all_branches: true
overwrite: true
- script: docker run --rm -e CI -w /root/devsus -v `pwd`:/root/devsus -v `pwd`/cache:/root/.ccache dimkr/devsus:latest ./ci/build_firmware.sh
- script: docker run --rm -e CI -w /root/devsus -v `pwd`:/root/devsus -v `pwd`/firmware-cache:/root/.ccache dimkr/devsus:latest ./ci/build_firmware.sh
name: Firmware
deploy:
provider: releases
Expand Down Expand Up @@ -83,10 +83,7 @@ before_deploy:
- git config --local user.email "[email protected]"
- git tag -f "$TRAVIS_BRANCH-$(git log --format=%h -1)"

before_cache:
- rm -f dl/hosts

cache:
directories:
- dl
- cache
- kernel-cache
- firmware-cache
6 changes: 3 additions & 3 deletions ci/build_firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

# build AR9271 firmware
cd open-ath9k-htc-firmware
if [ -d ../cache/xtensa-toolchain ]
if [ -d ../firmware-cache/xtensa-toolchain ]
then
mkdir toolchain
mv ../cache/xtensa-toolchain toolchain/inst
mv ../firmware-cache/xtensa-toolchain toolchain/inst
else
make toolchain
fi
CROSS_COMPILE=`pwd`/../ci/xtensa-elf- make -C target_firmware
mv toolchain/inst ../cache/xtensa-toolchain
mv toolchain/inst ../firmware-cache/xtensa-toolchain
cd ..

# put AR9271 firmware in /lib/firmware
Expand Down
12 changes: 6 additions & 6 deletions ci/build_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
KVER=4.9

minor=`wget -q -O- http://linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-$KVER.N/ | grep -F patch-$KVER-gnu | head -n 1 | cut -f 9 -d . | cut -f 1 -d -`
[ ! -f dl/linux-libre-$KVER-gnu.tar.xz ] && wget -O dl/linux-libre-$KVER-gnu.tar.xz http://linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-$KVER.0/linux-libre-$KVER-gnu.tar.xz
[ ! -f dl/patch-$KVER-gnu-$KVER.$minor-gnu ] && wget -O- https://www.linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-$KVER.N/patch-$KVER-gnu-$KVER.$minor-gnu.xz | xz -d > dl/patch-$KVER-gnu-$KVER.$minor-gnu
[ ! -f dl/ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch ] && wget -O dl/ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=2b721118b7821107757eb1d37af4b60e877b27e7
[ ! -f kernel-cache/linux-libre-$KVER-gnu.tar.xz ] && wget -O kernel-cache/linux-libre-$KVER-gnu.tar.xz http://linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-$KVER.0/linux-libre-$KVER-gnu.tar.xz
[ ! -f kernel-cache/patch-$KVER-gnu-$KVER.$minor-gnu ] && wget -O- https://www.linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-$KVER.N/patch-$KVER-gnu-$KVER.$minor-gnu.xz | xz -d > kernel-cache/patch-$KVER-gnu-$KVER.$minor-gnu
[ ! -f kernel-cache/ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch ] && wget -O kernel-cache/ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=2b721118b7821107757eb1d37af4b60e877b27e7

# build Linux-libre
[ ! -d linux-$KVER ] && tar -xJf dl/linux-libre-$KVER-gnu.tar.xz
[ ! -d linux-$KVER ] && tar -xJf kernel-cache/linux-libre-$KVER-gnu.tar.xz
cd linux-$KVER
patch -p 1 < ../dl/patch-$KVER-gnu-$KVER.$minor-gnu
patch -p 1 < ../kernel-cache/patch-$KVER-gnu-$KVER.$minor-gnu
make clean
make mrproper
# work around instability of ath9k_htc, see https://github.com/SolidHal/PrawnOS/issues/38
patch -R -p 1 < ../dl/ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch
patch -R -p 1 < ../kernel-cache/ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch
# reset the minor version number, so out-of-tree drivers continue to work after
# a kernel upgrade
sed s/'SUBLEVEL = .*'/'SUBLEVEL = 0'/ -i Makefile
Expand Down
4 changes: 2 additions & 2 deletions ci/build_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.

[ ! -f cache/hosts ] && wget -O- https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts | grep ^0\.0\.0\.0 | awk '{print $1" "$2}' | grep -F -v "0.0.0.0 0.0.0.0" > cache/hosts
[ ! -f hosts ] && wget -O- https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts | grep ^0\.0\.0\.0 | awk '{print $1" "$2}' | grep -F -v "0.0.0.0 0.0.0.0" > hosts

debootstrap --arch=armhf --foreign --variant=minbase --include=eudev,kmod,net-tools,inetutils-ping,traceroute,iproute2,isc-dhcp-client,wpasupplicant,iw,alsa-utils,cgpt,elvis-tiny,less,psmisc,netcat-traditional,ca-certificates,bzip2,xz-utils,unscd,dbus,dbus-x11,bluez,pulseaudio,pulseaudio-module-bluetooth,elogind,libpam-elogind,ntp,xserver-xorg-core,xserver-xorg-input-libinput,xserver-xorg-video-fbdev,libgl1-mesa-dri,xserver-xorg-input-synaptics,xinit,x11-xserver-utils,ratpoison,xbindkeys,xvkbd,rxvt-unicode,htop,firefox-esr,mupdf,locales,man-db,dmz-cursor-theme,apt-transport-https ascii devsus-rootfs http://packages.devuan.org/merged

Expand All @@ -28,7 +28,7 @@ for i in 80disable-recommends 99-brightness.rules 98-mac.rules fstab .xbindkeysr
do
install -m 644 devsus/$i devsus-rootfs/opt/devsus/$i
done
install -m 644 cache/hosts devsus-rootfs/opt/devsus/hosts
install -m 644 hosts devsus-rootfs/opt/devsus/hosts
install -m 744 devsus/.xinitrc devsus-rootfs/opt/devsus/.xinitrc
install -m 755 devsus/init devsus-rootfs/opt/devsus/init

Expand Down
2 changes: 2 additions & 0 deletions devsus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ cleanup() {
branch=`git symbolic-ref --short HEAD`
commit=`git log --format=%h -1`

mkdir -p dl

[ ! -f dl/devsus-kernel.tar.gz ] && wget -O dl/devsus-kernel.tar.gz https://github.com/dimkr/devsus/releases/download/$branch-$commit/devsus-kernel.tar.gz
[ ! -f dl/devsus-firmware.tar.gz ] && wget -O dl/devsus-firmware.tar.gz https://github.com/dimkr/devsus/releases/download/$branch-$commit/devsus-firmware.tar.gz
[ ! -f dl/devsus-rootfs.tar.gz ] && wget -O dl/devsus-rootfs.tar.gz https://github.com/dimkr/devsus/releases/download/$branch-$commit/devsus-rootfs.tar.gz
Expand Down
Empty file removed dl/.gitignore
Empty file.

0 comments on commit 85a03a5

Please sign in to comment.