summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-07-16 20:40:40 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2022-07-17 04:03:24 -0400
commitc22a0659a4d69fbef47a9038555e48c76c800f73 (patch)
tree8c3942beed161e75503373c73a7fc891fae95134
parent9bc4fd733a17e71f442c2675e5b21a2f4f398bea (diff)
downloadabslibre-c22a0659a4d69fbef47a9038555e48c76c800f73.tar.gz
abslibre-c22a0659a4d69fbef47a9038555e48c76c800f73.tar.bz2
abslibre-c22a0659a4d69fbef47a9038555e48c76c800f73.zip
sq - linux-libre-64
-rw-r--r--libre/linux-libre-64/PKGBUILD111
1 files changed, 56 insertions, 55 deletions
diff --git a/libre/linux-libre-64/PKGBUILD b/libre/linux-libre-64/PKGBUILD
index 6a8043b1b..db8c2378c 100644
--- a/libre/linux-libre-64/PKGBUILD
+++ b/libre/linux-libre-64/PKGBUILD
@@ -13,7 +13,7 @@
#
# The makedepends_armv7h, source_armv7h, and sha512sums_armv7h arrays
# (also source_aarch64 and sha512sums_aarch64 obviously),
-# and any lines with comment: '# aarch64 over-ride',
+# and any lines with comment: '# cross-compile over-ride',
# indicate code that would eventually be deleted or associated with
# $CARCH 'aarch64', if/when aarch64 becomes a valid target.
# All other LOCs of consequence in this file,
@@ -39,19 +39,19 @@ pkgbase=linux-libre
pkgver=5.18.5
pkgrel=1
pkgdesc='Linux-libre'
-pkgdesc+=' 64-bit (aarch64) for Parabola armv7h' # aarch64 over-ride
+pkgdesc+=' 64-bit (aarch64) for Parabola armv7h' # cross-compile over-ride
rcnver=5.18.2
rcnrel=armv7-x6
url='https://linux-libre.fsfla.org/'
arch=(i686 x86_64 armv7h)
-arch=(armv7h) # aarch64 over-ride
+arch=(armv7h) # cross-compile over-ride
license=(GPL2)
makedepends=(
bc libelf pahole cpio perl tar xz
xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick texlive-latexextra
)
makedepends_armv7h=(uboot-tools vboot-utils dtc) # required by linux-libre-chromebook
-makedepends_armv7h+=(aarch64-linux-gnu-gcc-initial) # aarch64 over-ride
+makedepends_armv7h+=(aarch64-linux-gnu-gcc-initial) # cross-compile over-ride
options=('!strip')
_srcname=linux-5.18
source=(
@@ -97,7 +97,7 @@ source_aarch64=(
0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch
0002-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch
)
-source_armv7h=( ${source_aarch64[*]} ) # aarch64 over-ride
+source_armv7h=( ${source_aarch64[*]} ) # cross-compile over-ride
validpgpkeys=(
'474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva
'6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P.
@@ -137,13 +137,13 @@ sha512sums_armv7h=('5a75b12dd386940a0bf1be630d45a514ef3c32289ec5976988764baa8483
sha512sums_aarch64=('bc7b70863929737346fe6757373897391b43af36bb6884d5351a95aca0f9120f2d2cf9b9c2c6426a440c6b394e9fb334c280711d64081563322a834ecdfb2ba6'
'69e81aff3ac5aada75f7330e8c82d0a6aa229585b3f442b2e1a9b86681b0eadc925408d5e2377026599fb0dee72d29043eca4d072b0e2606adc34c872e95c7d6'
'4224779106cc520dc2c431322d9693cc968476706854ae9630611cf2896c48a34ca11bf31a4c3995573a128cf5838a6763bac86eb4cbaf509ade9b6a83a24369')
-sha512sums_armv7h=( ${sha512sums_aarch64[*]} ) # aarch64 over-ride
+sha512sums_armv7h=( ${sha512sums_aarch64[*]} ) # cross-compile over-ride
_replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}")
_replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}")
_replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}")
case "$CARCH" in
- armv7h) KARCH=arm64 ; CROSS_COMPILE=aarch64-linux-gnu- ;; # aarch64 over-ride
+ armv7h) KARCH=arm64 ; CROSS_COMPILE=aarch64-linux-gnu- ;; # cross-compile over-ride
i686|x86_64) KARCH=x86;;
armv7h) KARCH=arm;;
esac
@@ -168,6 +168,7 @@ prepare() {
scripts/setlocalversion --save-scmversion
echo "-$pkgrel" > localversion.10-pkgrel
echo "${pkgbase#linux-libre}" > localversion.20-pkgname
+ echo "${pkgbase#linux-libre}-64" > localversion.20-pkgname # cross-compile over-ride
if [ "$CARCH" = "armv7h" ]; then
local src_armv7h
@@ -216,20 +217,20 @@ prepare() {
# config.aarch64 comes straight from Arch Linux ARM and doesn't have the
# compatibility for 32bit rootfs enabled. This makes maintenance faster than
# having to modify the configuration file by hand at each new kernel release.
- if [[ "${KARCH}" == aarch64 ]] # aarch64 over-ride
- then cp ../config.aarch64 .config ; echo 'CONFIG_COMPAT=y' >> .config ; # aarch64 over-ride
- fi # aarch64 over-ride
- make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE olddefconfig
+ if [[ "${KARCH}" == aarch64 ]] # cross-compile over-ride
+ then cp ../config.aarch64 .config ; echo 'CONFIG_COMPAT=y' >> .config ; # cross-compile over-ride
+ fi # cross-compile over-ride
+ make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE olddefconfig # cross-compile over-ride
diff -u ../config.$CARCH .config || :
- make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE -s kernelrelease > version
+ make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE -s kernelrelease > version # cross-compile over-ride
echo "Prepared $pkgbase version $(<version)"
}
build() {
cd $_srcname
- make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE all
- make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE htmldocs
+ make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE all # cross-compile over-ride
+ make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE htmldocs # cross-compile over-ride
}
_package() {
@@ -243,16 +244,17 @@ _package() {
provides+=("${_replacesarchkernel[@]/%/=$pkgver}" "LINUX-ABI_VERSION=$pkgver")
conflicts+=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
replaces+=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
+ # cross-compile over-rides
# NOTE: Above is providing/replacing the archarm armv7h 'linux' with the armv7h 'linux-libre'.
# We do not want this aarch64 'linux-libre-64' to provide nor replace the archarm armv7h 'linux';
# for the obvious reason. Anyways, the parabola armv7h 'linux-libre' serves that purpose.
# Below is providing/replacing 'linux-libre' and the obsolete parabola 'linux-libre-aarch64'.
# These are defined analogougly in _package-headers(), _package-docs(), and _package-chromebook().
- conflicts=( ${conflicts[*]/linux*/} ) # aarch64 over-ride
- replaces=( ${replaces[*]/linux*/} ) # aarch64 over-ride
- provides_armv7h=( linux-libre ) # aarch64 over-ride
- conflicts_armv7h=( linux-libre linux-libre-aarch64 ) # aarch64 over-ride
- replaces_armv7h=( linux-libre linux-libre-aarch64 ) # aarch64 over-ride
+ conflicts=( ${conflicts[*]/linux*/} ) # cross-compile over-ride
+ replaces=( ${replaces[*]/linux*/} ) # cross-compile over-ride
+ provides_armv7h=( linux-libre ) # cross-compile over-ride
+ conflicts_armv7h=( linux-libre linux-libre-aarch64 ) # cross-compile over-ride
+ replaces_armv7h=( linux-libre linux-libre-aarch64 ) # cross-compile over-ride
cd $_srcname
local kernver="$(<version)"
@@ -269,38 +271,35 @@ _package() {
# FIXME: aarch64 - the kernel is not installed under /boot
if [[ "$KARCH" == "arm64" && ! -f "$pkgdir/boot/Image" ]]
- then echo "FIXME: kernel was not installed to $\pkgdir/boot"
- cp "$modulesdir/vmlinuz" "$pkgdir/boot/Image"
+ then echo "FIXME: kernel was not installed to \$pkgdir/boot"
+ install -Dm644 "$modulesdir/vmlinuz" "$pkgdir/boot/vmlinuz-${basename}-64"
fi
# Used by mkinitcpio to name the kernel
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
+ echo "${pkgbase}-64" > "$modulesdir/pkgbase" # cross-compile over-ride
echo "Installing modules..."
- make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install
+ make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install # cross-compile over-ride
# remove build and source links
rm "$modulesdir"/{source,build}
-
-# DEBUG BEGIN
-echo "DEBUG: ls -l $pkgdir/etc/mkinitcpio.d/*" ; ls -l $pkgdir/etc/mkinitcpio.d/* ;
-[[ -f "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" ]] && cat "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" || echo "DEBUG: $pkgbase.preset does not exist"
-echo "DEBUG: END"
-# DEBUG END
-
-
if [ "$CARCH" = "armv7h" ]; then
echo "Installing device tree binaries..."
- make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_DTBS_PATH="$pkgdir/boot/dtbs/$pkgbase" dtbs_install
+ make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_DTBS_PATH="$pkgdir/boot/dtbs/$pkgbase" dtbs_install # cross-compile over-ride
# armv7h presets only work with ALL_kver=$kernver
backup=("etc/mkinitcpio.d/$pkgbase.preset")
echo "Installing mkinitcpio preset..."
sed "s|%PKGBASE%|$pkgbase|g;s|%KERNVER%|$kernver|g" ../linux-armv7h.preset \
| install -Dm644 /dev/stdin "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset"
- sed -i "s|${pkgbase}|${pkgbase}-64|g" "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" # aarch64 over-ride
- mv "$pkgdir/etc/mkinitcpio.d/$pkgbase{,-64}.preset" # aarch64 over-ride
+
+ local preset_file="${pkgdir}"/etc/mkinitcpio.d/${pkgbase}.preset # cross-compile over-ride
+ mv "${pkgdir}"/boot/dtbs/${pkgbase}{,-64} # cross-compile over-ride
+ backup=( ${backup[*]/${pkgbase}/${pkgbase}-64} ) # cross-compile over-ride
+ sed -i "s|${pkgbase}|${pkgbase}-64|g" "${preset_file}" # cross-compile over-ride
+ mv "${preset_file}" "${preset_file/\.preset/-64\.preset}" # cross-compile over-ride
fi
}
@@ -310,11 +309,11 @@ _package-headers() {
provides=("${_replacesarchkernel[@]/%/-headers=$pkgver}")
conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}")
replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}")
- # aarch64 over-rides - see note in _package()
- conflicts=() # aarch64 over-ride
- replaces=() # aarch64 over-ride
- conflicts_armv7h=( linux-libre-headers linux-libre-aarch64-headers ) # aarch64 over-ride
- replaces_armv7h=( linux-libre-headers linux-libre-aarch64-headers ) # aarch64 over-ride
+ # cross-compile over-rides - see note in _package()
+ conflicts=() # cross-compile over-ride
+ replaces=() # cross-compile over-ride
+ conflicts_armv7h=( linux-libre-headers linux-libre-aarch64-headers ) # cross-compile over-ride
+ replaces_armv7h=( linux-libre-headers linux-libre-aarch64-headers ) # cross-compile over-ride
cd $_srcname
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
@@ -344,7 +343,7 @@ _package-headers() {
cp -t "$builddir/arch/$KARCH" -a arch/$KARCH/include
install -Dt "$builddir/arch/$KARCH/kernel" -m644 arch/$KARCH/kernel/asm-offsets.s
- [[ "$KARCH" == "arm64" ]] || # aarch64 over-ride
+ [[ "$KARCH" == "arm64" ]] || # cross-compile over-ride
# from linux-armv7
if [ "$CARCH" = "armv7h" ]; then
for i in dove omap2; do
@@ -391,7 +390,7 @@ _package-headers() {
echo "Removing loose objects..."
find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
- alias strip=${CROSS_COMPILE}strip # aarch64 over-ride
+ strip() { ${CROSS_COMPILE}strip "${@}" ; } ; # cross-compile over-ride
echo "Stripping build tools..."
local file
@@ -414,6 +413,7 @@ _package-headers() {
echo "Adding symlink..."
mkdir -p "$pkgdir/usr/src"
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
+ mv "${pkgdir}"/usr/src/${pkgbase}{,-64} # cross-compile over-ride
}
_package-docs() {
@@ -421,11 +421,11 @@ _package-docs() {
provides=("${_replacesarchkernel[@]/%/-docs=$pkgver}")
conflicts=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}")
replaces=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}")
- # aarch64 over-rides - see note in _package()
- conflicts=() # aarch64 over-ride
- replaces=() # aarch64 over-ride
- conflicts_armv7h=(linux-libre-docs linux-libre-aarch64-docs) # aarch64 over-ride
- replaces_armv7h=( linux-libre-docs linux-libre-aarch64-docs) # aarch64 over-ride
+ # cross-compile over-rides - see note in _package()
+ conflicts=() # cross-compile over-ride
+ replaces=() # cross-compile over-ride
+ conflicts_armv7h=(linux-libre-docs linux-libre-aarch64-docs) # cross-compile over-ride
+ replaces_armv7h=( linux-libre-docs linux-libre-aarch64-docs) # cross-compile over-ride
cd $_srcname
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
@@ -441,6 +441,7 @@ _package-docs() {
echo "Adding symlink..."
mkdir -p "$pkgdir/usr/share/doc"
ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"
+ mv "${pkgdir}"/usr/share/doc/${pkgbase}{,-64} # cross-compile over-ride
}
_package-chromebook() {
@@ -450,12 +451,12 @@ _package-chromebook() {
conflicts=("${_replacesarchkernel[@]/%/-armv7-chromebook}" "${_replacesoldkernels[@]/%/-armv7-chromebook}")
replaces=("${_replacesarchkernel[@]/%/-armv7-chromebook}" "${_replacesoldkernels[@]/%/-armv7-chromebook}")
install=$pkgbase-chromebook.install
- # aarch64 over-rides - see note in _package()
- depends=( ${depends[*]/${pkgbase}/${pkgbase}-64} ) # aarch64 over-ride
- provides=( ${provides[*]/armv7/aarch64} ) # aarch64 over-ride
- conflicts=( ${conflicts[*]/armv7/aarch64} ) # aarch64 over-ride
- replaces=( ${replaces[*]/armv7/aarch64} ) # aarch64 over-ride
- install=${install/${pkgbase}/${pkgbase}-64} # aarch64 over-ride
+ # cross-compile over-rides - see note in _package()
+ depends=( ${depends[*]/${pkgbase}/${pkgbase}-64} ) # cross-compile over-ride
+ provides=( ${provides[*]/armv7/aarch64} ) # cross-compile over-ride
+ conflicts=( ${conflicts[*]/armv7/aarch64} ) # cross-compile over-ride
+ replaces=( ${replaces[*]/armv7/aarch64} ) # cross-compile over-ride
+ install=${install/${pkgbase}/${pkgbase}-64} # cross-compile over-ride
cd $_srcname
@@ -481,16 +482,16 @@ _package-chromebook() {
}
pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
-pkgname=( ${pkgname[*]/${pkgbase}/${pkgbase}-64} ) # aarch64 over-ride
+pkgname=( ${pkgname[*]/${pkgbase}/${pkgbase}-64} ) # cross-compile over-ride
# The chromebook package is disabled until the following error is fixed:
# | ==> Starting package_linux-libre-64-chromebook()...
# | FATAL ERROR: Couldn't open "arch/arm/boot/zImage": No such file or directory
# | mkimage: Can't read kernel.signed.tmp: Invalid argument
-# [[ "${KARCH}" != aarch64 ]] || pkgname+=("$pkgbase-chromebook") # aarch64 over-ride
+# [[ "${KARCH}" != aarch64 ]] || pkgname+=("$pkgbase-chromebook") # cross-compile over-ride
for _p in "${pkgname[@]}"; do
eval "package_$_p() {
- $(declare -f "_package${_p#$pkgbase}")
- _package${_p#$pkgbase}
+ $(declare -f "_package${_p#${pkgbase}-64}") # cross-compile over-ride
+ _package${_p#${pkgbase}-64} # cross-compile over-ride
}"
done