2017-03-11 20:09:30 +00:00
|
|
|
# ODROID-XU3/4
|
2014-08-09 19:37:49 +00:00
|
|
|
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
|
|
|
|
buildarch=4
|
|
|
|
|
|
|
|
pkgbase=linux-odroid-xu3
|
2024-03-13 20:27:48 +00:00
|
|
|
_commit=ff2422d0b03367d454c7c1fc579f19993cb9b9f5
|
2014-08-09 19:37:49 +00:00
|
|
|
_srcname=linux-${_commit}
|
|
|
|
_kernelname=${pkgbase#linux}
|
2018-01-27 01:31:58 +00:00
|
|
|
_desc="ODROID-XU3/XU4/HC1"
|
2024-03-13 20:27:48 +00:00
|
|
|
pkgver=6.6.36
|
2024-07-06 08:31:00 +00:00
|
|
|
pkgrel=2
|
2014-08-09 19:37:49 +00:00
|
|
|
arch=('armv7h')
|
|
|
|
url="https://github.com/hardkernel/linux"
|
|
|
|
license=('GPL2')
|
2024-07-06 08:31:00 +00:00
|
|
|
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'cpio')
|
2014-08-09 19:37:49 +00:00
|
|
|
options=('!strip')
|
2024-03-13 20:27:48 +00:00
|
|
|
source=("linux-odroid-$_commit.tar.gz::https://github.com/hardkernel/linux/archive/${_commit}.tar.gz"
|
2017-03-11 20:09:30 +00:00
|
|
|
'config'
|
2024-03-13 20:27:48 +00:00
|
|
|
'linux.preset')
|
|
|
|
md5sums=('6a7d24b936d98cae82cf8c07c60b6c75'
|
|
|
|
'6779c133ce155d8ec39704bc9b6aba8a'
|
|
|
|
'86d4a35722b5410e3b29fc92dae15d4b')
|
2014-08-09 19:37:49 +00:00
|
|
|
|
|
|
|
prepare() {
|
2024-03-13 20:27:48 +00:00
|
|
|
cd $_srcname
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
echo "Setting version..."
|
|
|
|
echo "-$pkgrel" > localversion.10-pkgrel
|
|
|
|
echo "${pkgbase#linux}" > localversion.20-pkgname
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
cat "${srcdir}/config" > ./.config
|
2014-08-09 19:37:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2024-03-13 20:27:48 +00:00
|
|
|
cd $_srcname
|
2014-08-09 19:37:49 +00:00
|
|
|
|
|
|
|
# get kernel version
|
|
|
|
make prepare
|
2024-03-13 20:27:48 +00:00
|
|
|
make -s kernelrelease > version
|
2014-08-09 19:37:49 +00:00
|
|
|
|
|
|
|
# build!
|
2017-03-11 20:09:30 +00:00
|
|
|
make ${MAKEFLAGS} zImage modules dtbs
|
2014-08-09 19:37:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_package() {
|
|
|
|
pkgdesc="The Linux Kernel and modules - ${_desc}"
|
|
|
|
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
|
2024-03-13 20:27:48 +00:00
|
|
|
optdepends=('wireless-regdb: to set the correct wireless channels of your country')
|
|
|
|
provides=("linux=${pkgver}" "WIREGUARD-MODULE")
|
2014-08-09 19:37:49 +00:00
|
|
|
conflicts=('linux')
|
2024-03-13 20:27:48 +00:00
|
|
|
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
|
2014-08-09 19:37:49 +00:00
|
|
|
install=${pkgname}.install
|
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
cd $_srcname
|
|
|
|
local kernver="$(<version)"
|
|
|
|
local modulesdir="$pkgdir/usr/lib/modules/$kernver"
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
echo "Installing boot image and dtbs..."
|
|
|
|
install -Dm644 arch/arm/boot/zImage -t "${pkgdir}/boot"
|
|
|
|
make INSTALL_DTBS_PATH="${pkgdir}/boot/dtbs" dtbs_install
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
echo "Installing modules..."
|
|
|
|
make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
# remove build link
|
|
|
|
rm "$modulesdir"/build
|
|
|
|
|
|
|
|
# sed expression for following substitutions
|
|
|
|
local _subst="
|
|
|
|
s|%PKGBASE%|${pkgbase}|g
|
|
|
|
s|%KERNVER%|${kernver}|g
|
|
|
|
"
|
|
|
|
|
|
|
|
# install mkinitcpio preset file
|
|
|
|
sed "${_subst}" ../linux.preset |
|
|
|
|
install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
|
|
|
|
|
|
|
# rather than use another hook (90-linux.hook) rely on mkinitcpio's 90-mkinitcpio-install.hook
|
|
|
|
# which avoids a double run of mkinitcpio that can occur
|
|
|
|
install -d "${pkgdir}/usr/lib/initcpio/"
|
|
|
|
echo "dummy file to trigger mkinitcpio to run" > "${pkgdir}/usr/lib/initcpio/$kernver"
|
2014-08-09 19:37:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_package-headers() {
|
|
|
|
pkgdesc="Header files and scripts for building modules for linux kernel - ${_desc}"
|
|
|
|
provides=("linux-headers=${pkgver}")
|
|
|
|
conflicts=('linux-headers')
|
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
cd $_srcname
|
|
|
|
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
echo "Installing build files..."
|
|
|
|
install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
|
|
|
|
localversion.* version vmlinux
|
|
|
|
install -Dt "$builddir/kernel" -m644 kernel/Makefile
|
|
|
|
install -Dt "$builddir/arch/arm" -m644 arch/arm/Makefile
|
|
|
|
cp -t "$builddir" -a scripts
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
# add xfs and shmem for aufs building
|
|
|
|
mkdir -p "$builddir"/{fs/xfs,mm}
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
echo "Installing headers..."
|
|
|
|
cp -t "$builddir" -a include
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
install -Dt "$builddir/arch/arm/kernel" -m644 arch/arm/kernel/asm-offsets.s
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
cp -t "$builddir/arch/arm" -a arch/arm/include
|
|
|
|
|
|
|
|
install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
|
|
|
|
install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
|
|
|
|
|
|
|
|
# https://bugs.archlinux.org/task/13146
|
|
|
|
install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
# https://bugs.archlinux.org/task/20402
|
|
|
|
install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
|
|
|
|
install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
|
|
|
|
install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h
|
|
|
|
|
|
|
|
echo "Installing KConfig files..."
|
|
|
|
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
|
|
|
|
|
|
|
|
echo "Removing unneeded architectures..."
|
|
|
|
local arch
|
|
|
|
for arch in "$builddir"/arch/*/; do
|
|
|
|
[[ $arch == */arm/ ]] && continue
|
|
|
|
echo "Removing $(basename "$arch")"
|
|
|
|
rm -r "$arch"
|
2014-08-09 19:37:49 +00:00
|
|
|
done
|
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
echo "Removing documentation..."
|
|
|
|
rm -r "$builddir/Documentation"
|
|
|
|
|
|
|
|
echo "Removing broken symlinks..."
|
|
|
|
find -L "$builddir" -type l -printf 'Removing %P\n' -delete
|
|
|
|
|
|
|
|
echo "Removing loose objects..."
|
|
|
|
find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
|
|
|
|
|
|
|
|
echo "Stripping build tools..."
|
|
|
|
local file
|
|
|
|
while read -rd '' file; do
|
|
|
|
case "$(file -bi "$file")" in
|
|
|
|
application/x-sharedlib\;*) # Libraries (.so)
|
|
|
|
strip -v $STRIP_SHARED "$file" ;;
|
|
|
|
application/x-archive\;*) # Libraries (.a)
|
|
|
|
strip -v $STRIP_STATIC "$file" ;;
|
|
|
|
application/x-executable\;*) # Binaries
|
|
|
|
strip -v $STRIP_BINARIES "$file" ;;
|
|
|
|
application/x-pie-executable\;*) # Relocatable binaries
|
|
|
|
strip -v $STRIP_SHARED "$file" ;;
|
2014-08-09 19:37:49 +00:00
|
|
|
esac
|
2024-03-13 20:27:48 +00:00
|
|
|
done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
|
2014-08-09 19:37:49 +00:00
|
|
|
|
2024-03-13 20:27:48 +00:00
|
|
|
echo "Adding symlink..."
|
|
|
|
mkdir -p "$pkgdir/usr/src"
|
|
|
|
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
|
2014-08-09 19:37:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pkgname=("${pkgbase}" "${pkgbase}-headers")
|
|
|
|
for _p in ${pkgname[@]}; do
|
|
|
|
eval "package_${_p}() {
|
|
|
|
_package${_p#${pkgbase}}
|
|
|
|
}"
|
|
|
|
done
|