From 85a03a53587e8bc62c22dad04bfc542699af29ed Mon Sep 17 00:00:00 2001 From: Dima Krasner Date: Thu, 25 Apr 2019 13:49:56 +0300 Subject: [PATCH] Divided the build cache to two directories --- .gitignore | 13 +++++++------ .travis.yml | 11 ++++------- ci/build_firmware.sh | 6 +++--- ci/build_kernel.sh | 12 ++++++------ ci/build_rootfs.sh | 4 ++-- devsus.sh | 2 ++ dl/.gitignore | 0 7 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 dl/.gitignore diff --git a/.gitignore b/.gitignore index ccf5f76..b2fefe2 100644 --- a/.gitignore +++ b/.gitignore @@ -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-* diff --git a/.travis.yml b/.travis.yml index 13e826a..a40dfb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 @@ -83,10 +83,7 @@ before_deploy: - git config --local user.email "dima@dimakrasner.com" - git tag -f "$TRAVIS_BRANCH-$(git log --format=%h -1)" -before_cache: - - rm -f dl/hosts - cache: directories: - - dl - - cache + - kernel-cache + - firmware-cache diff --git a/ci/build_firmware.sh b/ci/build_firmware.sh index 11a9e59..130be36 100755 --- a/ci/build_firmware.sh +++ b/ci/build_firmware.sh @@ -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 diff --git a/ci/build_kernel.sh b/ci/build_kernel.sh index c699634..3f0586b 100755 --- a/ci/build_kernel.sh +++ b/ci/build_kernel.sh @@ -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 diff --git a/ci/build_rootfs.sh b/ci/build_rootfs.sh index 694051f..7ddd80d 100755 --- a/ci/build_rootfs.sh +++ b/ci/build_rootfs.sh @@ -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 @@ -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 diff --git a/devsus.sh b/devsus.sh index 447166d..d530093 100755 --- a/devsus.sh +++ b/devsus.sh @@ -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 diff --git a/dl/.gitignore b/dl/.gitignore deleted file mode 100644 index e69de29..0000000