mirror of
https://github.com/archlinux-jerry/pkgbuilds
synced 2024-11-22 05:50:40 +08:00
update: linux-aarch64-raspberrypi to 4.19.75.r791931.g642e12d892e6
This commit is contained in:
parent
6bd03cf784
commit
beefdd0b4c
7 changed files with 706 additions and 1695 deletions
12
linux-aarch64-raspberrypi/0001-disable-scm-version.patch
Normal file
12
linux-aarch64-raspberrypi/0001-disable-scm-version.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
|
||||
index 71f39410691b..f76b0bbc6f5d 100755
|
||||
--- a/scripts/setlocalversion
|
||||
+++ b/scripts/setlocalversion
|
||||
@@ -31,6 +31,7 @@ fi
|
||||
|
||||
scm_version()
|
||||
{
|
||||
+ return
|
||||
local short
|
||||
short=false
|
||||
|
12
linux-aarch64-raspberrypi/60-linux.hook
Normal file
12
linux-aarch64-raspberrypi/60-linux.hook
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/%KERNVER%/*
|
||||
Target = usr/lib/modules/%EXTRAMODULES%/*
|
||||
|
||||
[Action]
|
||||
Description = Updating %PKGBASE% module dependencies...
|
||||
When = PostTransaction
|
||||
Exec = /usr/bin/depmod %KERNVER%
|
|
@ -6,6 +6,6 @@ Target = boot/Image
|
|||
Target = usr/lib/initcpio/*
|
||||
|
||||
[Action]
|
||||
Description = Updating %PKGBASE% initcpios
|
||||
Description = Updating %PKGBASE% initcpios...
|
||||
When = PostTransaction
|
||||
Exec = /usr/bin/mkinitcpio -p %PKGBASE%
|
|
@ -1,51 +1,55 @@
|
|||
# AArch64 kernel for RaspberryPi 3
|
||||
# Original Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
# Maintainer: Jerry Xiao <isjerryxiao at outlook dot com>
|
||||
|
||||
buildarch=8
|
||||
|
||||
pkgbase=linux-aarch64-raspberrypi
|
||||
_srcname=linux
|
||||
_srcname=linux-4.19
|
||||
_kernelname=${pkgbase#linux}
|
||||
_desc="AArch64 kernel for RaspberryPi 3"
|
||||
pkgver=4.19.25.g7f26b4456f70
|
||||
pkgver=4.19.75.r791931.g642e12d892e6
|
||||
pkgrel=1
|
||||
arch=('aarch64')
|
||||
url="https://github.com/raspberrypi/linux"
|
||||
license=('GPL2')
|
||||
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools' 'vboot-utils' 'dtc')
|
||||
options=('!strip')
|
||||
source=("git+https://github.com/raspberrypi/linux.git#branch=rpi-4.19.y"
|
||||
source=("${_srcname}::git+https://github.com/raspberrypi/linux.git#branch=rpi-4.19.y"
|
||||
'config'
|
||||
'0001-disable-scm-version.patch'
|
||||
'linux.preset'
|
||||
'99-linux.hook')
|
||||
'60-linux.hook'
|
||||
'90-linux.hook')
|
||||
md5sums=('SKIP'
|
||||
'8d69065f716d419a350953ee971b8775'
|
||||
'06e904bf795a75f5bc74b8b000780467'
|
||||
'1d4477026533efaa0358a40855d50a83')
|
||||
|
||||
pkgver() {
|
||||
cd "${srcdir}/${_srcname}"
|
||||
printf "%s.g%s" "$(make kernelversion)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
'3a489f6118198344f5c07d6cfd117abc'
|
||||
'b8a3b7cc32a8786114e29c41636979fc'
|
||||
'41cb5fef62715ead2dd109dbea8413d6'
|
||||
'ce6c81ad1ad1f8b333fd6077d47abdaf'
|
||||
'3dc88030a8f2f5a5f97266d99b149f77')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${_srcname}"
|
||||
cd ${_srcname}
|
||||
|
||||
# disable scm version
|
||||
patch -p1 < "../0001-disable-scm-version.patch"
|
||||
|
||||
cat "${srcdir}/config" > ./.config
|
||||
|
||||
# add pkgrel to extraversion
|
||||
sed -ri "s|^(EXTRAVERSION =)(.*)|\1 \2-${pkgrel}|" Makefile
|
||||
|
||||
# don't run depmod on 'make install'. We'll do this ourselves in packaging
|
||||
sed -i '2iexit 0' scripts/depmod.sh
|
||||
}
|
||||
|
||||
build() {
|
||||
pkgver() {
|
||||
cd "${srcdir}/${_srcname}"
|
||||
kernelver="$(make kernelversion)"
|
||||
printf "%s.r%s.g%s" "${kernelver%-*}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
# Dirty hack to get rid of the + in kernel version
|
||||
mv .git .git_1
|
||||
|
||||
# add pkgrel to extraversion
|
||||
sed -ri "s|^(EXTRAVERSION =)(.*)|\1 \2-${pkgrel}|" Makefile
|
||||
build() {
|
||||
cd ${_srcname}
|
||||
|
||||
# get kernel version
|
||||
make prepare
|
||||
|
@ -83,11 +87,11 @@ _package() {
|
|||
optdepends=('crda: to set the correct wireless channels of your country')
|
||||
provides=('kernel26' "linux=${pkgver}")
|
||||
replaces=('linux-armv8')
|
||||
conflicts=('linux' 'linux-aarch64')
|
||||
conflicts=('linux')
|
||||
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
|
||||
install=${pkgname}.install
|
||||
|
||||
cd "${srcdir}/${_srcname}"
|
||||
cd ${_srcname}
|
||||
|
||||
KARCH=arm64
|
||||
|
||||
|
@ -96,156 +100,112 @@ _package() {
|
|||
_basekernel=${_kernver%%-*}
|
||||
_basekernel=${_basekernel%.*}
|
||||
|
||||
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware}
|
||||
make INSTALL_MOD_PATH="${pkgdir}" modules_install
|
||||
mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
|
||||
make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
|
||||
make INSTALL_DTBS_PATH="${pkgdir}/boot/dtbs" dtbs_install
|
||||
cp arch/$KARCH/boot/Image{,.gz} "${pkgdir}/boot"
|
||||
|
||||
# set correct depmod command for install
|
||||
sed \
|
||||
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
|
||||
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
|
||||
-i "${startdir}/${pkgname}.install"
|
||||
# make room for external modules
|
||||
local _extramodules="extramodules-${_basekernel}${_kernelname}"
|
||||
ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
|
||||
|
||||
# install mkinitcpio preset file for kernel
|
||||
install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
||||
sed \
|
||||
-e "1s|'linux.*'|'${pkgbase}'|" \
|
||||
-e "s|ALL_kver=.*|ALL_kver=\"${_kernver}\"|" \
|
||||
-i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
||||
|
||||
# install pacman hook for initramfs regeneration
|
||||
sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/99-linux.hook" |
|
||||
install -D -m644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/99-${pkgbase}.hook"
|
||||
# add real version for building modules and running depmod from hook
|
||||
echo "${_kernver}" |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
|
||||
|
||||
# remove build and source links
|
||||
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
|
||||
# remove the firmware
|
||||
rm -rf "${pkgdir}/lib/firmware"
|
||||
# make room for external modules
|
||||
ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
|
||||
# add real version for building modules and running depmod from post_install/upgrade
|
||||
mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
|
||||
echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
|
||||
rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
|
||||
|
||||
# Now we call depmod...
|
||||
depmod -b "$pkgdir" -F System.map "$_kernver"
|
||||
|
||||
# move module tree /lib -> /usr/lib
|
||||
mkdir -p "${pkgdir}/usr"
|
||||
mv "$pkgdir/lib" "$pkgdir/usr"
|
||||
# now we call depmod...
|
||||
depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
|
||||
|
||||
# add vmlinux
|
||||
install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
|
||||
install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
|
||||
|
||||
# sed expression for following substitutions
|
||||
local _subst="
|
||||
s|%PKGBASE%|${pkgbase}|g
|
||||
s|%KERNVER%|${_kernver}|g
|
||||
s|%EXTRAMODULES%|${_extramodules}|g
|
||||
"
|
||||
|
||||
# install mkinitcpio preset file
|
||||
sed "${_subst}" ../linux.preset |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
||||
|
||||
# install pacman hooks
|
||||
sed "${_subst}" ../60-linux.hook |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/60-${pkgbase}.hook"
|
||||
sed "${_subst}" ../90-linux.hook |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
|
||||
}
|
||||
|
||||
_package-headers() {
|
||||
pkgdesc="Header files and scripts for building modules for linux kernel - ${_desc}"
|
||||
provides=("linux-headers=${pkgver}")
|
||||
replaces=('linux-armv8-headers')
|
||||
conflicts=('linux-headers' 'linux-aarch64-headers')
|
||||
conflicts=('linux-headers')
|
||||
|
||||
install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
|
||||
cd ${_srcname}
|
||||
local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||
|
||||
cd "${srcdir}/${_srcname}"
|
||||
install -D -m644 Makefile \
|
||||
"${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
|
||||
install -D -m644 kernel/Makefile \
|
||||
"${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
|
||||
install -D -m644 .config \
|
||||
"${pkgdir}/usr/lib/modules/${_kernver}/build/.config"
|
||||
install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
|
||||
install -Dt "${_builddir}/kernel" -m644 kernel/Makefile
|
||||
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
|
||||
mkdir "${_builddir}/.tmp_versions"
|
||||
|
||||
for i in acpi asm-generic clocksource config crypto drm generated keys linux \
|
||||
math-emu media net pcmcia scsi soc sound trace uapi video xen; do
|
||||
cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
|
||||
done
|
||||
cp -t "${_builddir}" -a include scripts
|
||||
|
||||
# copy arch includes for external modules
|
||||
mkdir -p ${pkgdir}/usr/lib/modules/${_kernver}/build/arch/$KARCH
|
||||
cp -a arch/$KARCH/include ${pkgdir}/usr/lib/modules/${_kernver}/build/arch/$KARCH/
|
||||
install -Dt "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile
|
||||
install -Dt "${_builddir}/arch/${KARCH}/kernel" -m644 arch/${KARCH}/kernel/asm-offsets.s arch/$KARCH/kernel/module.lds
|
||||
|
||||
# copy files necessary for later builds, like nvidia and vmware
|
||||
cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||
cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||
cp -t "${_builddir}/arch/${KARCH}" -a arch/${KARCH}/include
|
||||
mkdir -p "${_builddir}/arch/arm"
|
||||
cp -t "${_builddir}/arch/arm" -a arch/arm/include
|
||||
|
||||
# fix permissions on scripts dir
|
||||
chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"
|
||||
install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
|
||||
install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
|
||||
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
|
||||
|
||||
cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
|
||||
|
||||
cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
|
||||
|
||||
# copy module linker script
|
||||
cp arch/$KARCH/kernel/module.lds "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
|
||||
|
||||
# add dm headers
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
|
||||
cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
|
||||
|
||||
# add inotify.h
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
|
||||
cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"
|
||||
|
||||
# add wireless headers
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
|
||||
cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
|
||||
|
||||
# add dvb headers for external modules
|
||||
# in reference to:
|
||||
# http://bugs.archlinux.org/task/11194
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
|
||||
cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
|
||||
|
||||
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
|
||||
# in reference to:
|
||||
# http://bugs.archlinux.org/task/13146
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
|
||||
cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
|
||||
cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
|
||||
install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
|
||||
|
||||
# add dvb headers
|
||||
# in reference to:
|
||||
# http://bugs.archlinux.org/task/20402
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
|
||||
cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
|
||||
cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
|
||||
cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"
|
||||
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
|
||||
|
||||
# add xfs and shmem for aufs building
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
|
||||
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
|
||||
mkdir -p "${_builddir}"/{fs/xfs,mm}
|
||||
|
||||
# copy in Kconfig files
|
||||
for i in $(find . -name "Kconfig*"); do
|
||||
mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
|
||||
cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
|
||||
done
|
||||
|
||||
chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||
find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
|
||||
|
||||
# strip scripts directory
|
||||
find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
|
||||
case "$(file -bi "${binary}")" in
|
||||
*application/x-sharedlib*) # Libraries (.so)
|
||||
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
|
||||
*application/x-archive*) # Libraries (.a)
|
||||
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
|
||||
*application/x-executable*) # Binaries
|
||||
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
|
||||
esac
|
||||
done
|
||||
find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;
|
||||
|
||||
# remove unneeded architectures
|
||||
rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,x86,xtensa}
|
||||
local _arch
|
||||
for _arch in "${_builddir}"/arch/*/; do
|
||||
[[ ${_arch} == */${KARCH}/ || ${_arch} == */arm/ ]] && continue
|
||||
rm -r "${_arch}"
|
||||
done
|
||||
|
||||
# remove files already in linux-docs package
|
||||
rm -r "${_builddir}/Documentation"
|
||||
|
||||
# remove now broken symlinks
|
||||
find -L "${_builddir}" -type l -printf 'Removing %P\n' -delete
|
||||
|
||||
# Fix permissions
|
||||
chmod -R u=rwX,go=rX "${_builddir}"
|
||||
|
||||
# strip scripts directory
|
||||
local _binary _strip
|
||||
while read -rd '' _binary; do
|
||||
case "$(file -bi "${_binary}")" in
|
||||
*application/x-sharedlib*) _strip="${STRIP_SHARED}" ;; # Libraries (.so)
|
||||
*application/x-archive*) _strip="${STRIP_STATIC}" ;; # Libraries (.a)
|
||||
*application/x-executable*) _strip="${STRIP_BINARIES}" ;; # Binaries
|
||||
*) continue ;;
|
||||
esac
|
||||
/usr/bin/strip ${_strip} "${_binary}"
|
||||
done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null)
|
||||
}
|
||||
|
||||
pkgname=("${pkgbase}" "${pkgbase}-headers")
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,27 +1,10 @@
|
|||
# arg 1: the new package version
|
||||
# arg 2: the old package version
|
||||
|
||||
KERNEL_NAME=-aarch64-raspberrypi
|
||||
KERNEL_VERSION=4.12.5-1-ARCH
|
||||
|
||||
post_install () {
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod ${KERNEL_VERSION}
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then
|
||||
echo "WARNING: /boot appears to be a separate partition but is not mounted."
|
||||
fi
|
||||
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod ${KERNEL_VERSION}
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
# also remove the compat symlinks
|
||||
rm -f boot/initramfs-linux.img
|
||||
rm -f boot/initramfs-linux-fallback.img
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# mkinitcpio preset file for the 'linux-aarch64-raspberrypi' package
|
||||
# mkinitcpio preset file for the '%PKGBASE%' package
|
||||
|
||||
ALL_config="/etc/mkinitcpio.conf"
|
||||
ALL_kver="4.3.0-1-ARCH"
|
||||
ALL_kver="%KERNVER%"
|
||||
|
||||
PRESETS=('default' 'fallback')
|
||||
|
||||
|
@ -10,5 +10,5 @@ default_image="/boot/initramfs-linux.img"
|
|||
#default_options=""
|
||||
|
||||
#fallback_config="/etc/mkinitcpio.conf"
|
||||
fallback_image="/boot/initramfs-linux-fallback.img"
|
||||
fallback_image="/boot/initramfs-linux-fallback.img"
|
||||
fallback_options="-S autodetect"
|
||||
|
|
Loading…
Reference in a new issue