main/linux-postmarketos-*-dev: fix kernel-scripts

When cross compiling, the kernel scripts would be in the native arch
again. That was already fixed in !1234, however the mime type of the
binaries has changed, so we couldn't detect them properly anymore
(#1659).

This commit fixes it again, and also adds a checks so this won't
silently fail in the future.

[skip ci] because this would not run through anyway (building these
packages takes too long). Fixes #1659.
This commit is contained in:
Oliver Smith 2018-09-03 09:45:32 +02:00
parent 3db4c14c0f
commit a9bca26633
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 28 additions and 7 deletions

View file

@ -9,7 +9,7 @@ _kernver=${pkgver%_rc*}
_mainver=${_kernver%.*}
_patchlevel=${_kernver/$_mainver./}
_basever=${_mainver}.$((_patchlevel-1))
pkgrel=0
pkgrel=1
arch="x86_64 armhf aarch64"
pkgdesc="Linux for pmOS supported chipsets (mainline, more bleeding-edge than stable)"
@ -165,14 +165,21 @@ dev() {
if [ -n "$CROSS_COMPILE" ]; then
msg "Symlinking binary scripts..."
depends="$depends kernel-scripts"
local found="false"
cd "$dir/scripts"
local i
for i in $(find . -type f); do
local type="$(file -b --mime-type "$i")"
[ "$type" != "application/x-sharedlib" ] && continue
[ "$type" != "application/x-pie-executable" ] && continue
local native="/usr/bin/kernel-scripts/$(echo "$i" | cut -d '/' -f 2-)"
ln -svf "$native" "$i"
found="true"
done
if [ "$found" = "false" ]; then
error "Failed to symlink binary scripts!"
error "Did the mime-type change (see #1659)?"
return 1
fi
fi
}
sha512sums="4d9de340a26155a89ea8773131c76220cc2057f2b5d031b467b60e8b14c1842518e2d60a863d8c695f0f7640f3f18d43826201984a238dade857b6cef79837db linux-4.17.tar.xz

View file

@ -4,7 +4,7 @@ _config="config-${_flavor}.${CARCH}"
pkgname=linux-${_flavor}
pkgver=4.17_rc3
pkgrel=4
pkgrel=5
arch="armhf"
pkgdesc="Kernel close to mainline with extra patches for Qualcomm devices"
@ -38,7 +38,7 @@ builddir="$srcdir/linux-postmarketos-${_commit}"
prepare() {
local _patch_failed=
ls "$srcdir"
ls "$srcdir"
cd "$builddir"
# first apply patches in specified order
for i in $source; do
@ -164,14 +164,21 @@ dev() {
if [ -n "$CROSS_COMPILE" ]; then
msg "Symlinking binary scripts..."
depends="$depends kernel-scripts"
local found="false"
cd "$dir/scripts"
local i
for i in $(find . -type f); do
local type="$(file -b --mime-type "$i")"
[ "$type" != "application/x-sharedlib" ] && continue
[ "$type" != "application/x-pie-executable" ] && continue
local native="/usr/bin/kernel-scripts/$(echo "$i" | cut -d '/' -f 2-)"
ln -svf "$native" "$i"
found="true"
done
if [ "$found" = "false" ]; then
error "Failed to symlink binary scripts!"
error "Did the mime-type change (see #1659)?"
return 1
fi
fi
}
sha512sums="02fd136d24914e30decd207c3b2e0168cc9d6e4a0fc981abf8d537cd95c70583f5239d0dc7f2ae94a2ddd2ba82d822933159167801a035731a24aa1300c5ceec linux-09efb4857f1a4119eced855912043817bd96e064.tar.gz

View file

@ -9,7 +9,7 @@ case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=0
pkgrel=1
arch="x86_64 armhf aarch64"
pkgdesc="Linux for pmOS supported chipsets (stable)"
@ -172,14 +172,21 @@ dev() {
if [ -n "$CROSS_COMPILE" ]; then
msg "Symlinking binary scripts..."
depends="$depends kernel-scripts"
local found="false"
cd "$dir/scripts"
local i
for i in $(find . -type f); do
local type="$(file -b --mime-type "$i")"
[ "$type" != "application/x-sharedlib" ] && continue
[ "$type" != "application/x-pie-executable" ] && continue
local native="/usr/bin/kernel-scripts/$(echo "$i" | cut -d '/' -f 2-)"
ln -svf "$native" "$i"
found="true"
done
if [ "$found" = "false" ]; then
error "Failed to symlink binary scripts!"
error "Did the mime-type change (see #1659)?"
return 1
fi
fi
}