2021-10-01 16:18:24 +00:00
|
|
|
# Maintainer: graysky <graysky@archlinux.us>
|
2012-08-18 04:26:56 +00:00
|
|
|
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
|
2015-01-24 04:38:37 +00:00
|
|
|
# Maintainer: Oleg Rakhmanov <oleg@archlinuxarm.org>
|
2021-10-01 16:18:24 +00:00
|
|
|
# Maintainer: Dave Higham <pepedog@archlinuxarm.org>
|
|
|
|
# Contributer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
|
2015-01-24 04:38:37 +00:00
|
|
|
|
2015-02-06 01:44:29 +00:00
|
|
|
buildarch=20
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2012-07-18 23:30:18 +00:00
|
|
|
pkgbase=linux-raspberrypi
|
2021-10-01 16:18:24 +00:00
|
|
|
_commit=1faafd963e48eafb3abd555e13496a773d858b02
|
2014-09-22 07:20:04 +00:00
|
|
|
_srcname=linux-${_commit}
|
2013-11-22 01:47:03 +00:00
|
|
|
_kernelname=${pkgbase#linux}
|
2021-10-01 16:18:24 +00:00
|
|
|
_desc="Raspberry Pi 1 and 2"
|
2021-09-08 15:14:05 +00:00
|
|
|
pkgver=5.10.63
|
2021-10-02 10:12:55 +00:00
|
|
|
pkgrel=15
|
2021-10-01 16:18:24 +00:00
|
|
|
pkgdesc='Linux'
|
2012-03-17 02:49:52 +00:00
|
|
|
url="http://www.kernel.org/"
|
2021-10-01 16:18:24 +00:00
|
|
|
arch=(armv6h armv7h)
|
|
|
|
license=(GPL2)
|
|
|
|
makedepends=(
|
|
|
|
bc kmod inetutils
|
|
|
|
)
|
2012-03-17 02:49:52 +00:00
|
|
|
options=('!strip')
|
2013-11-22 01:47:03 +00:00
|
|
|
source=("https://github.com/raspberrypi/linux/archive/${_commit}.tar.gz"
|
2021-10-01 16:18:24 +00:00
|
|
|
cmdline.txt
|
|
|
|
config.txt
|
|
|
|
config
|
|
|
|
)
|
|
|
|
md5sums=('8b6f5b06d5a252cbb06ea1b33ee45c25'
|
2021-02-23 21:58:07 +00:00
|
|
|
'31c02f4518d46deb5f0c2ad1f8b083cd'
|
2021-04-30 10:22:04 +00:00
|
|
|
'9669d916a5929a2eedbd64477f83d99e'
|
2021-10-01 16:18:24 +00:00
|
|
|
'18d63f130f6e161aece55aea93b38e14')
|
|
|
|
|
|
|
|
# setup vars
|
|
|
|
[[ $CARCH == "armv6h" ]] && _kernel=kernel.img
|
|
|
|
[[ $CARCH == "armv7h" ]] && _kernel=kernel7.img
|
|
|
|
_image=zImage
|
|
|
|
_config=config
|
|
|
|
_bconfig=config.txt
|
|
|
|
KARCH=arm
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2013-11-22 01:47:03 +00:00
|
|
|
prepare() {
|
2013-11-22 01:51:15 +00:00
|
|
|
cd "${srcdir}/${_srcname}"
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
echo "Setting version..."
|
|
|
|
scripts/setlocalversion --save-scmversion
|
|
|
|
echo "-$pkgrel" > localversion.10-pkgrel
|
|
|
|
echo "${pkgbase#linux}" > localversion.20-pkgname
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
echo "Setting config..."
|
|
|
|
cp ../"$_config" .config
|
|
|
|
make olddefconfig
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
make -s kernelrelease > version
|
|
|
|
echo "Prepared $pkgbase version $(<version)"
|
2013-11-22 01:47:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2013-11-22 01:51:15 +00:00
|
|
|
cd "${srcdir}/${_srcname}"
|
2012-07-16 12:58:29 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
make "$_image" modules dtbs
|
2012-03-17 02:49:52 +00:00
|
|
|
}
|
|
|
|
|
2013-11-22 01:47:03 +00:00
|
|
|
_package() {
|
|
|
|
pkgdesc="The Linux Kernel and modules - ${_desc}"
|
2018-02-11 19:55:43 +00:00
|
|
|
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7' 'firmware-raspberrypi')
|
2012-03-17 02:49:52 +00:00
|
|
|
optdepends=('crda: to set the correct wireless channels of your country')
|
2021-01-26 23:55:15 +00:00
|
|
|
provides=('kernel26' "linux=${pkgver}" 'WIREGUARD-MODULE')
|
2012-03-17 02:49:52 +00:00
|
|
|
conflicts=('kernel26' 'linux')
|
|
|
|
install=${pkgname}.install
|
2015-01-24 04:38:37 +00:00
|
|
|
backup=('boot/config.txt' 'boot/cmdline.txt')
|
|
|
|
replaces=('linux-raspberrypi-latest')
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2013-11-22 01:51:15 +00:00
|
|
|
cd "${srcdir}/${_srcname}"
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
local kernver="$(<version)"
|
|
|
|
local modulesdir="$pkgdir/usr/lib/modules/$kernver"
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
# Used by mkinitcpio to name the kernel
|
|
|
|
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
echo "Installing modules..."
|
|
|
|
make INSTALL_MOD_PATH="$pkgdir/usr" modules_install
|
2015-01-24 04:38:37 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
# remove build and source links
|
|
|
|
rm "$modulesdir"/{source,build}
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
echo "Installing Arch ARM specific stuff..."
|
|
|
|
mkdir -p "${pkgdir}"/boot
|
|
|
|
make INSTALL_DTBS_PATH="${pkgdir}/boot" dtbs_install
|
2012-07-16 12:58:29 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
cp arch/$KARCH/boot/$_image "${pkgdir}/boot/$_kernel"
|
|
|
|
cp arch/$KARCH/boot/dts/overlays/README "${pkgdir}/boot/overlays"
|
|
|
|
install -m644 ../$_bconfig "${pkgdir}/boot/config.txt"
|
|
|
|
install -m644 ../cmdline.txt "${pkgdir}/boot"
|
2012-09-14 13:41:58 +00:00
|
|
|
|
2021-10-02 10:12:55 +00:00
|
|
|
if [[ $CARCH == "armv6h" ]]; then
|
|
|
|
rm -f "${pkgdir}"/boot/bcm{2836,2837,2838,2709,2710,2711}*.dtb
|
|
|
|
elif [[ $CARCH == "armv7h" ]]; then
|
|
|
|
rm -f "${pkgdir}"/boot/bcm{2835,2838,2708,2711}*.dtb
|
|
|
|
fi
|
2012-03-17 02:49:52 +00:00
|
|
|
}
|
|
|
|
|
2013-11-22 01:47:03 +00:00
|
|
|
_package-headers() {
|
|
|
|
pkgdesc="Header files and scripts for building modules for linux kernel - ${_desc}"
|
2015-01-24 04:38:37 +00:00
|
|
|
provides=("linux-headers=${pkgver}")
|
2014-05-10 10:35:37 +00:00
|
|
|
conflicts=('linux-headers')
|
2015-01-24 04:38:37 +00:00
|
|
|
replaces=('linux-raspberrypi-latest-headers')
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2019-08-29 00:15:47 +00:00
|
|
|
cd ${_srcname}
|
2021-10-01 16:18:24 +00:00
|
|
|
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
echo "Installing build files..."
|
|
|
|
install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
|
|
|
|
localversion.* version
|
|
|
|
install -Dt "$builddir/kernel" -m644 kernel/Makefile
|
|
|
|
install -Dt "$builddir/arch/$KARCH" -m644 "arch/$KARCH/Makefile"
|
|
|
|
cp -t "$builddir" -a scripts
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
# add xfs and shmem for aufs building
|
|
|
|
mkdir -p "$builddir"/{fs/xfs,mm}
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
echo "Installing headers..."
|
|
|
|
cp -t "$builddir" -a include
|
|
|
|
cp -t "$builddir/arch/$KARCH" -a "arch/$KARCH/include"
|
|
|
|
install -Dt "$builddir/arch/$KARCH/kernel" -m644 "arch/$KARCH/kernel/asm-offsets.s"
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
|
|
|
|
install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
# https://bugs.archlinux.org/task/13146
|
|
|
|
install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +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
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
# https://bugs.archlinux.org/task/71392
|
|
|
|
install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
|
2014-05-10 10:35:37 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
echo "Installing KConfig files..."
|
|
|
|
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
|
2012-03-17 02:49:52 +00:00
|
|
|
|
2021-10-01 16:18:24 +00:00
|
|
|
echo "Removing unneeded architectures..."
|
2019-08-29 00:15:47 +00:00
|
|
|
local _arch
|
2021-10-01 16:18:24 +00:00
|
|
|
for _arch in "$builddir"/arch/*/; do
|
|
|
|
[[ $_arch = */"$KARCH"/ ]] && continue
|
|
|
|
echo "Removing $(basename "$_arch")"
|
|
|
|
rm -r "$_arch"
|
2012-03-17 02:49:52 +00:00
|
|
|
done
|
|
|
|
|
2021-10-01 16:18:24 +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" ;;
|
2012-03-17 02:49:52 +00:00
|
|
|
esac
|
2021-10-01 16:18:24 +00:00
|
|
|
done < <(find "$builddir" -type f -perm -u+x)
|
|
|
|
|
|
|
|
echo "Adding symlink..."
|
|
|
|
mkdir -p "$pkgdir/usr/src"
|
|
|
|
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
|
2012-03-17 02:49:52 +00:00
|
|
|
}
|
2013-11-22 01:47:03 +00:00
|
|
|
|
|
|
|
pkgname=("${pkgbase}" "${pkgbase}-headers")
|
|
|
|
for _p in ${pkgname[@]}; do
|
|
|
|
eval "package_${_p}() {
|
|
|
|
_package${_p#${pkgbase}}
|
|
|
|
}"
|
|
|
|
done
|