Skip to content

Commit

Permalink
Use github-mirror-action@v3
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-mnemonic committed Jan 5, 2024
1 parent ca4d9b8 commit 19833e1
Show file tree
Hide file tree
Showing 4 changed files with 4,669 additions and 2 deletions.
81 changes: 79 additions & 2 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'mirror'
name: 'mirror and test'
on:
push:
branches:
Expand All @@ -15,7 +15,84 @@ jobs:
steps:
- name: mirror
id: mirror
uses: bridgelightcloud/github-mirror-action@v2
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_env
run: |
pwd
ls -l
git status || true
git checkout linux-6.6.y || true
if git log --oneline HEAD~1 | grep "Linux\ .*\-rc.*"; then
echo "build"
echo "call linux-6.6.y test-build workflow"
else
echo "nobuild"
fi
cd ..
ls -l
# check_matrix:
# needs: mirror
# strategy:
# # Don't cancel the remaining running jobs if some job(s) fail(s)
# fail-fast: false
# matrix:
# branch: ['linux-6.6.y', 'linux-6.1.y' ]
# max-parallel: 1
# steps:
# - name: check
# run: |
# pwd
# ls -l
# if [[ -e Makefile ]]; then
# make mrproper || true
# fi
# git checkout ${{ matrix.branch }}
# if git log --oneline | grep "Linux\ .*\-rc.*"; then
# echo "build for ${{ matrix.branch }}"
# else
# echo "nobuild for ${{ matrix.branch }}"
# fi
# ls -l
# cd ..
# ls -l
# exit 0

# build_matrix:
# runs-on: ubuntu-latest
# strategy:
# # Don't cancel the remaining running jobs if some job(s) fail(s)
# fail-fast: false
# matrix:
# branch: ['linux-6.1.y', 'linux-5.15.y' ]
#
# steps:
# - uses: actions/checkout@v3
# with:
# ref: ${{ matrix.branch }}
#
# - name: build
# run: |
# if git log --oneline | grep "Linux\ .*\-rc.*"; then
# echo "build"
# build_dir=$( pwd )
# pushd ../
# wget 'https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-ia64-linux.tar.xz' -O ./tarball.tar.xz
# wget 'https://raw.githubusercontent.com/johnny-mnemonic/linux-stable-rc/__mirror/make-kernel.bash' && chmod +x make-kernel.bash
# wget 'https://raw.githubusercontent.com/johnny-mnemonic/linux-stable-rc/__mirror/rx2620-rx2660-rx2800-i2-combined-localmodconfig'
# wget 'https://raw.githubusercontent.com/johnny-mnemonic/linux-stable-rc/__mirror/ia64-linux-workaround-ice-with-gcc-13.patch'
# tar -xf tarball.tar.xz
# ls -l
# PATH=$PATH:$PWD/gcc-13.2.0-nolibc/ia64-linux/bin
# popd
# patch -p1 < ../ia64-linux-workaround-ice-with-gcc-13.patch
# pushd ../
# time ./make-kernel.bash ./rx2620-rx2660-rx2800-i2-combined-localmodconfig ia64 ${build_dir}
# else
# echo "nobuild"
# fi
#
46 changes: 46 additions & 0 deletions 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 <frank.scheiner@web.de>
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
242 changes: 242 additions & 0 deletions make-kernel.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
#!/usr/bin/env bash

# Frank Scheiner <frank.scheiner@web.de>

# 2023-10-23 - v0.2.0
# Use shortened SHA1 hashes in kernel release to allow for more space for `flavor`

# make-kernel - make kernel and modules (`all`) and install modules (`modules_install`) with given config

_debug=1

# Config
_ramdisk="/usr/src/ramdisk"

_supportedArches=( "alpha" "ia64" )

_threads=$( nproc )

# "-mp" or "-sp" extraversion for e.g. alpha architecture or identifier for special kernels
_flavor=""

usageMsg()
{
echo "Usage: $0 <KERNEL_CONFIG> <ARCH> <KERNEL_TREE> [<FLAVOR>]"

return
}

debug()
{
if [[ ${_debug} -eq 1 ]]; then

echo "$@" 1>&2
else
:
fi

return
}

EX_USAGE=64

if [[ "$1" != "" ]]; then

_kernelConfig="$1"
shift

if [[ "$1" != "" ]]; then

_arch="$1"
shift

if [[ "$1" != "" ]]; then

_kernelTree="$1"
shift
else
usageMsg
exit $EX_USAGE
fi
else
usageMsg
exit $EX_USAGE
fi
else
usageMsg
exit $EX_USAGE
fi

if [[ "$1" != "" ]]; then

_flavor="-${1}"
shift
fi

####

if [[ ! -e ${_kernelConfig} ]]; then

echo "$0: given kernel config not existing. Cannot continue."
exit 1
fi

_archIsSupported=0

for _supportedArch in "${_supportedArches[@]}"; do

if [[ "$_supportedArch" == "$_arch" ]]; then

_archIsSupported=1
else
continue
fi
done

if [[ $_archIsSupported -eq 0 ]]; then

echo "$0: given architecure is not supported yet. Cannot continue."
exit 1
fi

if [[ -d ${_kernelTree} ]]; then

#echo "Copying kernel tree to RAMdisk..."
#debug "cp -rad ${_kernelTree}/ ${_ramdisk}/"
#cp -rad ${_kernelTree}/ ${_ramdisk}/
#
#if [[ $? == 0 ]]; then
# echo "done"
#else
# echo "failed"
# exit 1
#fi
# Expect that the kernel tree is there already.
:
else
echo "$0: given kernel tree not existing. Cannot continue."
exit 1
fi

####

echo "Copying kernel config..."
debug "cp ${_kernelConfig} ${_kernelTree}/.config"
cp ${_kernelConfig} ${_kernelTree}/.config

if [[ $? -eq 0 ]]; then

echo "done"
else
echo "failed"
exit 1
fi

_oldPWD="$PWD"
cd ${_kernelTree} || ( echo "$0: cannot cd to \"${_kernelTree}\"."; exit 1 )

# olddefconfig

echo "Configuring kernel..."
debug "make LOCALVERSION=\"-$( git rev-parse --short HEAD )-${_arch}${_flavor}\" ARCH=${_arch} CROSS_COMPILE=${_arch}-linux- olddefconfig"
make LOCALVERSION="-$( git rev-parse --short HEAD )-${_arch}${_flavor}" ARCH=${_arch} CROSS_COMPILE=${_arch}-linux- olddefconfig

if [[ $? -eq 0 ]]; then

echo "done"
else
echo "failed"
exit 1
fi

# all

echo "Making kernel..."
debug "time make -j${_threads} LOCALVERSION=\"-$( git rev-parse --short HEAD )-${_arch}${_flavor}\" ARCH=${_arch} CROSS_COMPILE=${_arch}-linux- all"
date
time make -j${_threads} LOCALVERSION="-$( git rev-parse --short HEAD )-${_arch}${_flavor}" ARCH=${_arch} CROSS_COMPILE=${_arch}-linux- all
_makeReturned=$?
echo ${_makeReturned}
date

if [[ ${_makeReturned} -eq 0 ]]; then

echo "done"
else
echo "failed"
exit 1
fi

exit

# modules_install

echo "Installing modules..."
debug "time make LOCALVERSION=\"-$( git rev-parse --short HEAD )-${_arch}${_flavor}\" ARCH=${_arch} CROSS_COMPILE=${_arch}-linux- modules_install"
date
time make LOCALVERSION="-$( git rev-parse --short HEAD )-${_arch}${_flavor}" ARCH=${_arch} CROSS_COMPILE=${_arch}-linux- modules_install
_makeReturned=$?
echo ${_makeReturned}
date

if [[ ${_makeReturned} -eq 0 ]]; then

echo "done"
else
echo "failed"
exit 1
fi

_kernelRelease=$( make -s LOCALVERSION="-$( git rev-parse --short HEAD )-${_arch}${_flavor}" kernelrelease )

# save artifacts
cp vmlinux /boot/vmlinux-${_kernelRelease}

_uncompressedKernel="/boot/vmlinux-${_kernelRelease}"

if [[ "${_arch}" == "alpha" ]]; then

# Due to aboot being unable to handle arbitrary large kernel and initrd images (total max size roughly 13 MiB or so!)
alpha-linux-strip vmlinux
gzip -c -9 vmlinux > vmlinuz
_compressedKernel="/boot/vmlinuz-${_kernelRelease}-stripped"
cp vmlinuz "${_compressedKernel}"
else
_compressedKernel="/boot/vmlinuz-${_kernelRelease}"
cp vmlinux.gz "${_compressedKernel}"
fi

cp .config /boot/config-${_kernelRelease}

_configuration="/boot/config-${_kernelRelease}"

cd /lib/modules

if [[ "${_arch}" == "alpha" ]]; then

# same here (see above)
tar -cf ${_kernelRelease}-non-stripped.tar ${_kernelRelease}
cd ${_kernelRelease}
find . -name "*.ko" -exec alpha-linux-strip --strip-debug '{}' \;
cd ..
tar -cf ${_kernelRelease}-stripped.tar ${_kernelRelease}

_kernelModules=( "/lib/modules/${_kernelRelease}-non-stripped.tar" "/lib/modules/${_kernelRelease}-stripped.tar" )
else
tar -cf ${_kernelRelease}.tar ${_kernelRelease}

_kernelModules=( "/lib/modules/${_kernelRelease}.tar" )
fi

cd ${_oldPWD}

echo "Build artifacts:"
echo "${_configuration}"
echo "${_uncompressedKernel}"
echo "${_compressedKernel}"
for _tarball in "${_kernelModules[@]}"; do

echo "${_tarball}"
done

exit
Loading

0 comments on commit 19833e1

Please sign in to comment.