Skip to content

Commit

Permalink
Correction and deactivate mirror_and_check job for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-mnemonic committed Jan 26, 2024
1 parent 00aa7be commit 01dc7cf
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 63 deletions.
93 changes: 30 additions & 63 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,14 @@ on:
workflow_dispatch:

jobs:
mirror_and_check:
runs-on: ubuntu-latest
outputs:
branch_matrix: ${{ steps.check.outputs.branch_matrix }}
steps:
- name: mirror
id: mirror
uses: bridgelightcloud/github-mirror-action@v3
with:
origin: 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git'
GITHUB_TOKEN: ${{ secrets.PAT }}

- name: check
id: check
run: |
REPO=$( basename $PWD )
cd ..
mv $REPO ${REPO}.git
git clone --shared ${REPO}.git $REPO
JSON_DATA_FILE="$PWD/workflows.json"
touch ${JSON_DATA_FILE}
cd $REPO
echo "DEBUG $( pwd ) - before for"
for branch in $( cat config/rc-branches ); do
git worktree add ../${branch} ${branch}
pushd ../${branch}
pwd
if git log --oneline | head -n1 | grep "Linux\ .*\-rc.*" &>/dev/null; then
KERNEL_VERSION=$( git log --oneline | head -n1 | grep -o "Linux\ .*\-rc.*" )
echo "DEBUG build ${KERNEL_VERSION}"
if [[ -s ${JSON_DATA_FILE} ]]; then
echo "DEBUG , \"${branch}\""
echo -n ", \"${branch}\"" >> ${JSON_DATA_FILE}
else
echo "DEBUG [\"${branch}\""
echo -n "[\"${branch}\"" >> ${JSON_DATA_FILE}
fi
fi
cat ${JSON_DATA_FILE} || echo "DEBUG #1"
popd
pwd
done
echo -n "]" >> ${JSON_DATA_FILE}
pwd
echo "DEBUG $( pwd ) - after for"
ls -1
ls -1 ../
cat -v ${JSON_DATA_FILE} || echo "DEBUG #2"
echo "branch_matrix=$( jq -cn --argjson environments "$( cat ${JSON_DATA_FILE} )" '{branch: $environments}' )" >> $GITHUB_OUTPUT
matrix_build:
needs: mirror_and_check
# needs: mirror_and_check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.mirror_and_check.outputs.branch_matrix)}}
# matrix: ${{fromJson(needs.mirror_and_check.outputs.branch_matrix)}}
matrix:
branch: [linux-4.19.y, linux-5.4.y, linux-5.10.y, linux-5.15.y, linux-6.1.y, linux-6.6.y, linux-6.7.y]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -91,12 +42,14 @@ jobs:

- name: prepare_step
run: |
pwd
BASE_DIR=$( pwd )
BUILD_DIR="$( pwd )/${{ matrix.branch }}"
TOOLS_DIR="$( pwd )/__mirror"
HP_SIM_DIR=$( pwd )/hp-sim-for-linux"
HP_SIM_DIR="$( pwd )/hp-sim-for-linux"
SKI_DIR="$( pwd )/ski"
BRANCH=${{ matrix.branch }}
SUMMARY_FILE=${BASE_DIR}/summary.md
touch ${SUMMARY_FILE}
# prepare tools ######################################################
cd ${TOOLS_DIR}
COMPILER_URL=$( cat ./config/compiler-url )
Expand All @@ -106,46 +59,54 @@ jobs:
COMPILER=$( basename ${COMPILER_PATH}/bin/*-linux-gcc )
COMPILER_AND_VERSION=$( ${COMPILER} --version | head -n1 )
# exports ############################################################
echo "BASE_DIR=${BASE_DIR}" >> $GITHUB_ENV
echo "BUILD_DIR=${BUILD_DIR}" >> $GITHUB_ENV
echo "TOOLS_DIR=${TOOLS_DIR}" >> $GITHUB_ENV
echo "HP_SIM_DIR=${HP_SIM_DIR}" >> $GITHUB_ENV
echo "SKI_DIR=${SKI_DIR}" >> $GITHUB_ENV
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
echo "MODPATH=${PATH}" >> $GITHUB_ENV
echo "COMPILER_AND_VERSION=${COMPILER_AND_VERSION}" >> $GITHUB_ENV
echo "SUMMARY_FILE=${SUMMARY_FILE}" >> $GITHUB_ENV
- name: regular_build_step
run: |
USED_PATCHES="see [__mirror/patches/${BRANCH}/](https://github.com/johnny-mnemonic/linux-stable-rc/tree/__mirror/patches/${BRANCH}/)"
# apply any standard patches #########################################
PATH=${MODPATH}
cd ${BUILD_DIR}
KERNEL_VERSION=$( git log --oneline | head -n1 | grep -o "Linux\ .*\-rc.*" )
if [[ -e ${TOOLS_DIR}/patches/${BRANCH}/ ]]; then
for patch in ${TOOLS_DIR}/patches/${BRANCH}/*patch; do
patch -p1 < ${patch} || true
done
done
else
USED_PATCHES="no extra patches needed"
fi
# build ##############################################################
cd "${TOOLS_DIR}"
echo "| STATUS | BRANCH | VERSION | COMPILER |" >> $GITHUB_STEP_SUMMARY
echo "| ------ | ------ | ------- | -------- |" >> $GITHUB_STEP_SUMMARY
echo "| STATUS | BRANCH | VERSION | TYPE | USED PATCHES | COMPILER |" >> ${SUMMARY_FILE}
echo "| ------ | ------ | ------- | ---- | ------------ | -------- |" >> ${SUMMARY_FILE}
if time ./tools/make-kernel.bash ./config/rx2620-rx2660-rx2800-i2-combined-localmodconfig ia64 ${BUILD_DIR}; then
echo "| :white_check_mark: | ${BRANCH} | ${KERNEL_VERSION} | ${COMPILER_AND_VERSION} |" >> $GITHUB_STEP_SUMMARY
echo "| :white_check_mark: | ${BRANCH} | ${KERNEL_VERSION} | regular | ${USED_PATCHES} | ${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
else
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | ${COMPILER_AND_VERSION} |" >> $GITHUB_STEP_SUMMARY
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | regular | ${USED_PATCHES} |${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
fi
- name: hp_sim_build_step
run: |
USED_PATCHES="see [hp-sim-for-linux/${BRANCH}/](https://github.com/johnny-mnemonic/ski/tree/hp-sim-for-linux/${BRANCH}/)"
# ski available for our branch? ######################################
case ${BRANCH} in
linux-6.1.y | linux-6.6.y | linux-6.7.y)
echo "Ski not yet reinstated for ${BRANCH}"
exit 0
;;
*)
true
;;
esac
# apply ski patches ##################################################
PATH=${MODPATH}
Expand All @@ -156,13 +117,19 @@ jobs:
for patch in ${HP_SIM_DIR}/${BRANCH}/*patch; do
patch -p1 < ${patch} || true
done
else
USED_PATCHES="no extra patches needed"
fi
# build hp sim kernel ################################################
cd "${TOOLS_DIR}"
if time ./tools/make-kernel.bash ${BUILD_DIR}/arch/ia64/sim_defconfig ia64 ${BUILD_DIR} ski; then
echo "| :white_check_mark: | ${BRANCH} | ${KERNEL_VERSION} | ${COMPILER_AND_VERSION} |" >> $GITHUB_STEP_SUMMARY
if time ./tools/make-kernel.bash ${BUILD_DIR}/arch/ia64/configs/sim_defconfig ia64 ${BUILD_DIR} ski; then
echo "| :white_check_mark: | ${BRANCH} | ${KERNEL_VERSION} | hp_sim | ${USED_PATCHES} | ${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
else
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | ${COMPILER_AND_VERSION} |" >> $GITHUB_STEP_SUMMARY
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | hp_sim | ${USED_PATCHES} | ${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
fi
- name: steps_summary
run: |
cat ${SUMMARY_FILE} >> $GITHUB_STEP_SUMMARY
46 changes: 46 additions & 0 deletions patches/linux-6.7.y/ia64-linux-workaround-ice-with-gcc-13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From: Frank Scheiner <[email protected]>
Date: Mon, 18 Sep 2023 16:33:50 +0200
Subject: [ia64] `-fno-var-tracking` works around an ICE in gcc-13 for target
ia64

Apply it for the two files that trigger the ICE according to e.g. [1] to
enable successful Linux kernel builds for ia64 when using gcc-13 until
the corresponding GCC bug ([2]) is fixed.

[1]: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=ia64&ver=6.4.4-2&stamp=1690708282&raw=0

[2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425
---
drivers/net/ethernet/broadcom/bnx2x/Makefile | 3 +++
net/ipv4/Makefile | 3 +++
2 files changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/Makefile b/drivers/net/ethernet/broadcom/bnx2x/Makefile
index 2523cfc7527d..13db3ee9fcb5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/Makefile
+++ b/drivers/net/ethernet/broadcom/bnx2x/Makefile
@@ -5,5 +5,8 @@

obj-$(CONFIG_BNX2X) += bnx2x.o

+ifeq ($(ARCH),ia64)
+ CFLAGS_bnx2x_sp.o += -fno-var-tracking
+endif
bnx2x-y := bnx2x_main.o bnx2x_link.o bnx2x_cmn.o bnx2x_ethtool.o bnx2x_stats.o bnx2x_dcb.o bnx2x_sp.o bnx2x_self_test.o
bnx2x-$(CONFIG_BNX2X_SRIOV) += bnx2x_vfpf.o bnx2x_sriov.o
diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile
index b18ba8ef93ad..82326539bf25 100644
--- a/net/ipv4/Makefile
+++ b/net/ipv4/Makefile
@@ -3,6 +3,9 @@
# Makefile for the Linux TCP/IP (INET) layer.
#

+ifeq ($(ARCH),ia64)
+ CFLAGS_fib_semantics.o += -fno-var-tracking
+endif
obj-y := route.o inetpeer.o protocol.o \
ip_input.o ip_fragment.o ip_forward.o ip_options.o \
ip_output.o ip_sockglue.o inet_hashtables.o \
--
2.11.0
3 changes: 3 additions & 0 deletions tools/make-kernel.bash
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ else
exit 1
fi

cp vmlinux "../vmlinux${_flavor}"
cp vmlinux.gz "../vmlinux.gz${_flavor}"

exit

# modules_install
Expand Down

0 comments on commit 01dc7cf

Please sign in to comment.