Skip to content

Commit

Permalink
kernel-build: handle downloaded .kernel correctly for cached build
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Solodrai <[email protected]>
  • Loading branch information
theihor committed Nov 6, 2024
1 parent 8a0f25d commit c0a111c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,34 @@ jobs:
fetch-depth: 50
- if: ${{ inputs.download_sources }}
name: Download bpf-next tree
env:
FORCE_GIT_FETCH: ${{ env.CACHED_KERNEL_BUILD }}
uses: ./get-linux-source
with:
dest: '.kernel'
- if: ${{ inputs.download_sources }}
name: Move linux source in place
shell: bash
run: |
rm -rf .kernel/.git
cp -rf .kernel/. .
rm -rf .kernel
- if: $${{ env.CACHED_KERNEL_BUILD }}
mv .git /tmp/.git.not-kernel
cd .kernel
mv -t .. $(ls -A)
cd ..
rmdir .kernel
- if: ${{ env.CACHED_KERNEL_BUILD }}
uses: ./prepare-incremental-build
with:
repo-root: ${{ env.REPO_ROOT }}
base-branch: ${{ env.BASE_BRANCH }}
arch: ${{ inputs.arch }}
toolchain_full: ${{ inputs.toolchain_full }}
kbuild-output: ${{ env.KBUILD_OUTPUT }}
- if: ${{ inputs.download_sources }}
name: Restore .git # is this really necessary?
shell: bash
run: |
rm -rf .git
mv /tmp/.git.not-kernel .git
- uses: ./patch-kernel
with:
patches-root: '${{ github.workspace }}/ci/diffs'
Expand Down
4 changes: 3 additions & 1 deletion get-linux-source/checkout_latest_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ source $(cd $(dirname $0) && pwd)/../helpers.sh

CWD=$(pwd)

FORCE_GIT_FETCH=${FORCE_GIT_FETCH:-}

echo KERNEL_ORIGIN = ${KERNEL_ORIGIN}
echo KERNEL_BRANCH = ${KERNEL_BRANCH}
echo REPO_PATH = ${REPO_PATH}
Expand All @@ -29,7 +31,7 @@ if [ ! -d "${REPO_PATH}" ]; then
mkdir -p $(dirname "${REPO_PATH}")
cd $(dirname "${REPO_PATH}")
# attempt to fetch desired bpf-next repo snapshot
if [ -n "${SNAPSHOT_URL}" ] && \
if [ -n "${SNAPSHOT_URL}" ] && [ -z "${FORCE_GIT_FETCH}" ] && \
wget -U 'BPFCIBot/1.0 ([email protected])' -nv ${SNAPSHOT_URL} && \
tar xf bpf-next-${LINUX_SHA}.tar.gz --totals ; then
mv bpf-next-${LINUX_SHA} $(basename ${REPO_PATH})
Expand Down

0 comments on commit c0a111c

Please sign in to comment.