Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/core/linux-lts/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'core/linux-lts/PKGBUILD')
-rw-r--r--core/linux-lts/PKGBUILD150
1 files changed, 140 insertions, 10 deletions
diff --git a/core/linux-lts/PKGBUILD b/core/linux-lts/PKGBUILD
index 54f91aaa..5e2126e6 100644
--- a/core/linux-lts/PKGBUILD
+++ b/core/linux-lts/PKGBUILD
@@ -1,16 +1,146 @@
-# upstream git revision: 14ca14bf86907e3fed6936bddad25499f214727b
+# Don't bother with sha256sums, use blake2 only
+unset sha256sums
-# fail if upstream's .config changes
-for ((i=0; i<${#sha256sums[@]}; i++)); do
- if [ "${sha256sums[${i}]}" = '6a2ee8f822810f594921aa85087e4cf0a17c68518d395586fd9c56b6c7e63dad' ]; then
- sha256sums[${i}]='179a491f053139b0a25b6938bed230ad08eb52779260135754cf00f38060436f'
- fi
-done
+source_pentium4=('config.pentium4')
+source_i686=('config.i686')
+source_i486=('config.i486')
+b2sums_pentium4=('c2fa0bef869355e68553944d0a33e6089d752fef862262633e24c9349147496c9c1a20e0d1790341e716ab86ae6e9f6863841baf773e8511c0d7351c73897642')
+b2sums_i686=('c2fa0bef869355e68553944d0a33e6089d752fef862262633e24c9349147496c9c1a20e0d1790341e716ab86ae6e9f6863841baf773e8511c0d7351c73897642')
+b2sums_i486=('c2fa0bef869355e68553944d0a33e6089d752fef862262633e24c9349147496c9c1a20e0d1790341e716ab86ae6e9f6863841baf773e8511c0d7351c73897642')
+
+# copy architecture specific config file, not default 'config'
eval "$(
- declare -f package_linux-lts-headers | \
+ declare -f prepare | \
sed '
- \,/tools/objtool" ,d
- \,arch/x86/Makefile,a install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile_32.cpu
+ s,\.\./config,../config.$CARCH,
'
)"
+
+# patch architecture when copying the kernel Makefile
+eval "$(
+ declare -f package_${pkgbase}-headers | \
+ sed '
+ \,arch/x86/Makefile, {
+ a \
+ install -t "${builddir}/arch/x86" -m644 arch/x86/Makefile_32.cpu
+ }
+ $ i depends+=(gcc-libs=$(_get_gcc_version_from_config))
+ '
+)"
+
+_get_gcc_version_from_config() {
+ if [ -z "$srcdir" ]; then
+ gcc --version \
+ | sed '
+ s@^.* @@
+ 1!d
+ '
+ else
+ for _config_file in "$srcdir/$_srcname/.config" "$srcdir/config" "${srcdir%/*}/config"; do
+ [ -f "$_config_file" ] && break
+ done
+ sed '
+ s/^CONFIG_CC_VERSION_TEXT="gcc (GCC) \([0-9.]\+\)"$/\1/
+ t
+ d
+ ' "$_config_file"
+ fi
+}
+
+# use our tarballer instead of cloning from git
+for ((i=0; i<${#source[@]}; i++)); do
+ infos=$(
+ printf '%s\n' "${source[${i}]}" | \
+ sed '
+ s@^\(\([^:]\+\)::\)\?\(git\|hg\)+\([^#?]\+\)\(?signed\)\?#\(\(tag\|commit\)=[^?]\+\)$@\3 \2 \4 \5 \6@
+ t
+ s@^\(\([^:]\+\)::\)\?\(git\|hg\)+\([^#?]\+\)#\(\(tag\|commit\)=[^?]\+\)\(?signed\)\?$@\3 \2 \4 \7 \5@
+ t
+ d
+ '
+ )
+ if [ -n "${infos}" ]; then
+ source[${i}]=$(
+ type="${infos%% *}"
+ infos="${infos#* }"
+ if [ -n "${infos%% *}" ]; then
+ prefix="${infos%% *}"
+ else
+ prefix=''
+ fi
+ infos="${infos#* }"
+ repo="${infos%% *}"
+ repo64=$(
+ printf '%s' "${repo}" | \
+ base64 -w0 | \
+ sed 's/=/%3D/g'
+ )
+ infos="${infos#* }"
+ if [ "${infos%% *}" = '?signed' ]; then
+ key_check=$(
+ printf '&valid_keys='
+ printf '%s,' "${validpgpkeys[@]}" | \
+ sed 's/,$//'
+ )
+ else
+ key_check=''
+ fi
+ infos="${infos#* }"
+ if [ -z "${prefix}" ]; then
+ prefix="${repo%.git}"
+ prefix="${prefix##*/}"
+ fi
+ prefix_64=$(
+ printf '%s/' "${prefix}" | \
+ base64 -w0 | \
+ sed 's/=/%3D/g'
+ )
+
+ printf '%s-%s.tar.gz::https://archive-server.archlinux32.org/?t=%s&p=%s&r=%s%s&%s\n' \
+ "${prefix}" \
+ "${pkgver}" \
+ "${type}" \
+ "${prefix_64}" \
+ "${repo64}" \
+ "${key_check}" \
+ "${infos}"
+ )
+ fi
+done
+
+# upstream prepare() does already do the *.patch patching
+
+# avoid using zstd compression in ultra mode (exhausts virtual memory)
+source+=('no-ultra-zstd.patch')
+b2sums+=('e7915714b504b92155c983a30df6d97966c14520dc9eb004671003dbdecf454b061138a6d237cabe86be32ae2ea4c598cdb821cb1dd52f6a9bfe5e280bffa321')
+
+# objtool doesn't exist because we don't have STACK_VALIDATION
+# and resolve_btfids doesn't exist because we disable BTF due to pahole running out of memory
+eval "$(
+ declare -f package_${pkgbase}-headers | \
+ sed '/objtool/d' | \
+ sed '/resolve_btfids/d' | \
+ sed 's@tools/bpf/bpftool/vmlinux.h@@'
+)"
+
+# temporarily disabled documentation due to sphinx_rtd_theme (FS32#163)
+pkgname=(
+ $(
+ printf '%s\n' "${pkgname[@]}" | \
+ grep -v '^\$pkgbase-docs'
+ )
+)
+
+# Also avoid building/running bpftool and doc-related
+eval "$(
+ declare -f build | \
+ sed '/htmldocs/d' | \
+ sed '/wait/d' | \
+ sed '/bpftool/d'
+)"
+makedepends=(${makedepends[@]//python-sphinx_rtd_theme/})
+makedepends=(${makedepends[@]//python-sphinx<6.0.0/})
+makedepends=(${makedepends[@]//graphviz/})
+makedepends=(${makedepends[@]//imagemagick/})
+makedepends=(${makedepends[@]//texlive-latexextra/})