Skip to content

Commit

Permalink
Add ski build and test, also deactivate mirroring for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-mnemonic committed Jan 30, 2024
1 parent a4a0b7b commit d4c3673
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 4,659 deletions.
168 changes: 105 additions & 63 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,22 @@
name: 'make-sandwich'
on:
#push:
# branches:
# - __mirror
push:
branches:
- __mirror
schedule:
# Run everyday at 3 AM UTC
- cron: '0 3 * * *'
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
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
popd
pwd
done
echo -n "]" >> ${JSON_DATA_FILE}
pwd
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:
# 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]
# 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 Down Expand Up @@ -97,12 +52,12 @@ jobs:
touch ${SUMMARY_FILE}
# prepare tools ######################################################
cd ${TOOLS_DIR}
COMPILER_URL=$( cat ./config/compiler-url )
wget "${COMPILER_URL}" -O - | unxz | tar -xf -
COMPILER_PATH=$( echo gcc-*/*-linux )
PATH=$PATH:$PWD/${COMPILER_PATH}/bin
COMPILER=$( basename ${COMPILER_PATH}/bin/*-linux-gcc )
COMPILER_AND_VERSION=$( ${COMPILER} --version | head -n1 )
CROSS_COMPILER_URL=$( cat ./config/compiler-url )
wget "${CROSS_COMPILER_URL}" -O - | unxz | tar -xf -
CROSS_COMPILER_PATH=$( echo gcc-*/*-linux )
PATH=$PATH:$PWD/${CROSS_COMPILER_PATH}/bin
CROSS_COMPILER=$( basename ${CROSS_COMPILER_PATH}/bin/*-linux-gcc )
CROSS_COMPILER_AND_VERSION=$( ${CROSS_COMPILER} --version | head -n1 )
# exports ############################################################
echo "BASE_DIR=${BASE_DIR}" >> $GITHUB_ENV
echo "BUILD_DIR=${BUILD_DIR}" >> $GITHUB_ENV
Expand All @@ -111,7 +66,7 @@ jobs:
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 "CROSS_COMPILER_AND_VERSION=${CROSS_COMPILER_AND_VERSION}" >> $GITHUB_ENV
echo "SUMMARY_FILE=${SUMMARY_FILE}" >> $GITHUB_ENV
- name: regular_build_step
Expand All @@ -133,10 +88,10 @@ jobs:
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} | regular | ${USED_PATCHES} | ${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
echo "| :white_check_mark: | ${BRANCH} | ${KERNEL_VERSION} | regular | ${USED_PATCHES} | ${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
else
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | regular | ${USED_PATCHES} |${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | regular | ${USED_PATCHES} |${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
fi
Expand Down Expand Up @@ -168,12 +123,99 @@ jobs:
# build hp sim kernel ################################################
cd "${TOOLS_DIR}"
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}
echo "| :white_check_mark: | ${BRANCH} | ${KERNEL_VERSION} | hp_sim | ${USED_PATCHES} | ${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
else
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | hp_sim | ${USED_PATCHES} | ${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
fi
HP_SIM_KERNEL="${BUILD_DIR}/../vmlinux-ski"
# exports ############################################################
echo "HP_SIM_KERNEL=${HP_SIM_KERNEL}" >> $GITHUB_ENV
- name: ski_build_step
run: |
# 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
# install build dependencies #########################################
sudo apt update
sudo apt install binutils-dev libelf-dev libiberty-dev libncurses-dev autoconf autoconf-archive automake flex bison gperf pkg-config
# build Ski ##########################################################
COMPILER_AND_VERSION=$( gcc --version | head -n1 )
cd ${SKI_DIR}
echo "" >> ${SUMMARY_FILE}
echo "| STATUS | TOOL | COMPILER |" >> ${SUMMARY_FILE}
echo "| ------ | ---- | -------- |" >> ${SUMMARY_FILE}
if \
./autogen.sh && \
./configure --prefix=${SKI_DIR}/install && \
make -j$( nproc ) && \
make -j$( nproc ) install; then
echo "| :white_check_mark: | ski | ${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
else
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | hp_sim | ${USED_PATCHES} | ${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
echo "| :x: | ski | ${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
fi
BSKI="${SKI_DIR}/install/bin/bski"
# cross-build ski-bootloader #########################################
PATH=${MODPATH}
cd ${SKI_DIR}/ski-bootloader
if make CROSS_COMPILE=ia64-linux-; then
echo "| :white_check_mark: | ski-bootloader | ${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
else
echo "| :x: | ski-bootloader | ${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
fi
SKI_BOOTLOADER="${SKI_DIR}/ski-bootloader/ski-bootloader"
# exports ############################################################
echo "SKI_BOOTLOADER=${SKI_BOOTLOADER}" >> $GITHUB_ENV
echo "BSKI=${BSKI}" >> $GITHUB_ENV
- name: ski_test_step
run: |
# 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
# get ia64 root FS ###################################################
SKI_TEST_DIR="${BASE_DIR}/ski-test"
mkdir ${SKI_TEST_DIR} && cd ${SKI_TEST_DIR}
cp ${TOOLS_DIR}/tools/run_ski_test.bash ${TOOLS_DIR}/config/sdc-debian.xz.SHA256 .
chmod +x run_ski_test.bash
IA64_ROOTFS_URL=$( cat ${TOOLS_DIR}/config/ia64-rootfs-url )
wget "${IA64_ROOTFS_URL}"
if sha256sum -c sdc-debian.xz.SHA256; then
rm sdc-debian.xz.SHA256
xz --decompress --verbose sdc-debian.xz && mv sdc-debian sdc
echo "" >> ${SUMMARY_FILE}
echo "| STATUS | TOOL |" >> ${SUMMARY_FILE}
echo "| ------ | ---- |" >> ${SUMMARY_FILE}
if ./run_ski_test.bash ${BSKI} ${SKI_BOOTLOADER} ${HP_SIM_KERNEL}; then
echo "| :white_check_mark: | run_ski_test.bash |" >> ${SUMMARY_FILE}
true
else
echo "| :x: | run_ski_test.bash |" >> ${SUMMARY_FILE}
true
fi
else
echo "ERROR: Wrong SHA256 hash for ia64 root FS. Refuse to continue." >> ${SUMMARY_FILE}
fi
- name: steps_summary
run: |
Expand Down
1 change: 1 addition & 0 deletions config/ia64-rootfs-url
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://ftp.machine-hall.org/pub/debian/sid/ia64/sdc-debian.xz
1 change: 1 addition & 0 deletions config/sdc-debian.xz.SHA256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
89faa8cc38f55700b4fe6475a92fc0c89dacde40d2fa8f123562140471a70b8f sdc-debian.xz
46 changes: 0 additions & 46 deletions ia64-linux-workaround-ice-with-gcc-13.patch

This file was deleted.

Loading

0 comments on commit d4c3673

Please sign in to comment.