diff --git a/core/linux-raspberrypi4/60-linux.hook b/core/linux-raspberrypi4/60-linux.hook deleted file mode 100644 index b33873c85..000000000 --- a/core/linux-raspberrypi4/60-linux.hook +++ /dev/null @@ -1,12 +0,0 @@ -[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% diff --git a/core/linux-raspberrypi4/90-linux.hook b/core/linux-raspberrypi4/90-linux.hook deleted file mode 100644 index 4e62c1676..000000000 --- a/core/linux-raspberrypi4/90-linux.hook +++ /dev/null @@ -1,13 +0,0 @@ -[Trigger] -Type = File -Operation = Install -Operation = Upgrade -Target = boot/kernel.img -Target = boot/kernel7.img -Target = boot/kernel8.img -Target = usr/lib/initcpio/* - -[Action] -Description = Updating %PKGBASE% initcpios... -When = PostTransaction -Exec = /usr/bin/mkinitcpio -p %PKGBASE% diff --git a/core/linux-raspberrypi4/PKGBUILD b/core/linux-raspberrypi4/PKGBUILD index 9a7916e5b..82e9fa2df 100644 --- a/core/linux-raspberrypi4/PKGBUILD +++ b/core/linux-raspberrypi4/PKGBUILD @@ -1,39 +1,38 @@ -# Maintainer: Dave Higham <pepedog@archlinuxarm.org> +# Maintainer: graysky <graysky@archlinux.us> # Maintainer: Kevin Mihelich <kevin@archlinuxarm.org> # Maintainer: Oleg Rakhmanov <oleg@archlinuxarm.org> -# Maintainer: graysky <graysky@archlinux.us> +# Maintainer: Dave Higham <pepedog@archlinuxarm.org> +# Contributer: Jan Alexander Steffens (heftig) <heftig@archlinux.org> buildarch=12 pkgbase=linux-raspberrypi4 -_commit=f694d1cfee63afaaa77e7d9e1f621a83e2f98846 +_commit=1faafd963e48eafb3abd555e13496a773d858b02 _srcname=linux-${_commit} _kernelname=${pkgbase#linux} _desc="Raspberry Pi 3/4/400" pkgver=5.10.63 -pkgrel=14 -arch=('armv7h' 'aarch64') +pkgrel=15 +pkgdesc='Linux' url="http://www.kernel.org/" -license=('GPL2') -makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git') +arch=(armv7h aarch64) +license=(GPL2) +makedepends=( + bc kmod inetutils +) options=('!strip') source_armv7h=('config' 'config.txt') source_aarch64=('config8' 'config8.txt') source=("https://github.com/raspberrypi/linux/archive/${_commit}.tar.gz" - 'cmdline.txt' - 'linux.preset' - '0001-Make-proc-cpuinfo-consistent-on-arm64-and-arm.patch' - '60-linux.hook' - '90-linux.hook') -md5sums=('cb39469f07bcf3c3eb2509ed24231f9f' + cmdline.txt + 0001-Make-proc-cpuinfo-consistent-on-arm64-and-arm.patch +) +md5sums=('8b6f5b06d5a252cbb06ea1b33ee45c25' '31c02f4518d46deb5f0c2ad1f8b083cd' - '86d4a35722b5410e3b29fc92dae15d4b' - 'f66a7ea3feb708d398ef57e4da4815e9' - 'ce6c81ad1ad1f8b333fd6077d47abdaf' - '441ec084c47cddc53e592fb0cbce4edf') -md5sums_armv7h=('49e21ac4ec344d22bc09dca53503e4ac' + 'f66a7ea3feb708d398ef57e4da4815e9') +md5sums_armv7h=('50e8caecceed5b0e959f1e62b0a481e8' '9669d916a5929a2eedbd64477f83d99e') -md5sums_aarch64=('bb13c50eca73c2641fe15e9a6c212bbc' +md5sums_aarch64=('f7855453cf26a32256472c34f67748cf' '9669d916a5929a2eedbd64477f83d99e') # setup vars @@ -43,46 +42,26 @@ md5sums_aarch64=('bb13c50eca73c2641fe15e9a6c212bbc' prepare() { cd "${srcdir}/${_srcname}" - 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 - # consistent behavior of lscpu on arm/arm64 patch -Np1 -i ../0001-Make-proc-cpuinfo-consistent-on-arm64-and-arm.patch + + echo "Setting version..." + scripts/setlocalversion --save-scmversion + echo "-$pkgrel" > localversion.10-pkgrel + echo "${pkgbase#linux}" > localversion.20-pkgname + + echo "Setting config..." + cp ../"$_config" .config + make olddefconfig + + make -s kernelrelease > version + echo "Prepared $pkgbase version $(<version)" } build() { cd "${srcdir}/${_srcname}" - # get kernel version - make prepare - - # load configuration - # Configure the kernel. Replace the line below with one of your choice. - #make menuconfig # CLI menu for configuration - #make nconfig # new CLI menu for configuration - #make xconfig # X-based configuration - #make oldconfig # using old config from previous kernel version - #make bcmrpi_defconfig # using RPi defconfig - # ... or manually edit .config - - # Copy back our configuration (use with new kernel version) - #cp ./.config ../${pkgver}.config - - #################### - # stop here - # this is useful to configure the kernel - #msg "Stopping build" - #return 1 - #################### - - #yes "" | make config - - make ${MAKEFLAGS} $_image modules dtbs + make "$_image" modules dtbs } _package() { @@ -97,13 +76,20 @@ _package() { cd "${srcdir}/${_srcname}" - # get kernel version - _kernver="$(make kernelrelease)" - _basekernel=${_kernver%%-*} - _basekernel=${_basekernel%.*} + local kernver="$(<version)" + local modulesdir="$pkgdir/usr/lib/modules/$kernver" - mkdir -p "${pkgdir}"/{boot,usr/lib/modules} - make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install + # Used by mkinitcpio to name the kernel + echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" + + echo "Installing modules..." + make INSTALL_MOD_PATH="$pkgdir/usr" modules_install + + # remove build and source links + rm "$modulesdir"/{source,build} + + echo "Installing Arch ARM specific stuff..." + mkdir -p "${pkgdir}"/boot make INSTALL_DTBS_PATH="${pkgdir}/boot" dtbs_install if [[ $CARCH == "aarch64" ]]; then @@ -114,41 +100,7 @@ _package() { fi cp arch/$KARCH/boot/$_image "${pkgdir}/boot/$_kernel" - cp arch/$KARCH/boot/dts/overlays/README "${pkgdir}/boot/overlays" - - # make room for external modules - local _extramodules="extramodules-${_basekernel}${_kernelname}" - ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules" - - # 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 "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build} - - # now we call depmod... - depmod -b "${pkgdir}/usr" -F System.map "${_kernver}" - - # 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" - - # install boot files install -m644 ../$_bconfig "${pkgdir}/boot/config.txt" install -m644 ../cmdline.txt "${pkgdir}/boot" } @@ -160,66 +112,79 @@ _package-headers() { replaces=('linux-raspberrypi-latest-headers') cd ${_srcname} - local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build" + local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - install -Dt "${_builddir}" -m644 Makefile .config Module.symvers - install -Dt "${_builddir}/kernel" -m644 kernel/Makefile - - mkdir "${_builddir}/.tmp_versions" - - cp -t "${_builddir}" -a include scripts - - install -Dt "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile - install -Dt "${_builddir}/arch/${KARCH}/kernel" -m644 arch/${KARCH}/kernel/asm-offsets.s scripts/module.lds - - cp -t "${_builddir}/arch/${KARCH}" -a arch/${KARCH}/include - - install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h - install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h - - # http://bugs.archlinux.org/task/13146 - install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h - - # http://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 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 # add xfs and shmem for aufs building - mkdir -p "${_builddir}"/{fs/xfs,mm} + mkdir -p "$builddir"/{fs/xfs,mm} - # copy in Kconfig files - find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \; + 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" - # remove unneeded architectures + 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 + + # 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 + + # https://bugs.archlinux.org/task/71392 + install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.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} == */${KARCH}/ ]] && continue - rm -r "${_arch}" + for _arch in "$builddir"/arch/*/; do + if [[ $CARCH == "aarch64" ]]; then + [[ $_arch = */"$KARCH"/ || $_arch == */arm/ ]] && continue + else + [[ $_arch = */"$KARCH"/ ]] && continue + fi + echo "Removing $(basename "$_arch")" + rm -r "$_arch" done - # remove files already in linux-docs package - rm -r "${_builddir}/Documentation" + echo "Removing documentation..." + rm -r "$builddir/Documentation" - # remove now broken symlinks - find -L "${_builddir}" -type l -printf 'Removing %P\n' -delete + echo "Removing broken symlinks..." + find -L "$builddir" -type l -printf 'Removing %P\n' -delete - # Fix permissions - if ! chmod -R u=rwX,go=rX "${_builddir}"; then - true - fi + echo "Removing loose objects..." + find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete - # 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 ;; + 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" ;; esac - /usr/bin/strip ${_strip} "${_binary}" - done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null) + done < <(find "$builddir" -type f -perm -u+x) + + echo "Adding symlink..." + mkdir -p "$pkgdir/usr/src" + ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" } pkgname=("${pkgbase}" "${pkgbase}-headers") diff --git a/core/linux-raspberrypi4/config b/core/linux-raspberrypi4/config index 3365757e8..0070bcf00 100644 --- a/core/linux-raspberrypi4/config +++ b/core/linux-raspberrypi4/config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 5.10.52-4 Kernel Configuration +# Linux/arm 5.10.63 Kernel Configuration # CONFIG_CC_VERSION_TEXT="gcc (GCC) 10.2.0" CONFIG_CC_IS_GCC=y @@ -4191,7 +4191,7 @@ CONFIG_REGULATOR_GPIO=y # CONFIG_REGULATOR_PV88080 is not set # CONFIG_REGULATOR_PV88090 is not set # CONFIG_REGULATOR_PWM is not set -# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set +CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m # CONFIG_REGULATOR_RT4801 is not set # CONFIG_REGULATOR_RTMV20 is not set # CONFIG_REGULATOR_SLG51000 is not set @@ -4652,6 +4652,7 @@ CONFIG_VIDEO_IMX290=m CONFIG_VIDEO_IMX477=m # CONFIG_VIDEO_IMX319 is not set # CONFIG_VIDEO_IMX355 is not set +CONFIG_VIDEO_IMX519=m # CONFIG_VIDEO_OV2640 is not set # CONFIG_VIDEO_OV2659 is not set # CONFIG_VIDEO_OV2680 is not set @@ -5082,7 +5083,7 @@ CONFIG_DRM_DISPLAY_CONNECTOR=m # CONFIG_DRM_SII9234 is not set CONFIG_DRM_SIMPLE_BRIDGE=m # CONFIG_DRM_THINE_THC63LVD1024 is not set -# CONFIG_DRM_TOSHIBA_TC358762 is not set +CONFIG_DRM_TOSHIBA_TC358762=m # CONFIG_DRM_TOSHIBA_TC358764 is not set # CONFIG_DRM_TOSHIBA_TC358767 is not set # CONFIG_DRM_TOSHIBA_TC358768 is not set diff --git a/core/linux-raspberrypi4/config8 b/core/linux-raspberrypi4/config8 index 097469de4..0c0067992 100644 --- a/core/linux-raspberrypi4/config8 +++ b/core/linux-raspberrypi4/config8 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 5.10.52-4 Kernel Configuration +# Linux/arm64 5.10.63 Kernel Configuration # CONFIG_CC_VERSION_TEXT="gcc (GCC) 10.2.0" CONFIG_CC_IS_GCC=y @@ -4184,7 +4184,7 @@ CONFIG_REGULATOR_GPIO=y # CONFIG_REGULATOR_PV88080 is not set # CONFIG_REGULATOR_PV88090 is not set # CONFIG_REGULATOR_PWM is not set -# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set +CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m # CONFIG_REGULATOR_RT4801 is not set # CONFIG_REGULATOR_RTMV20 is not set # CONFIG_REGULATOR_SLG51000 is not set @@ -4657,6 +4657,7 @@ CONFIG_VIDEO_IMX290=m CONFIG_VIDEO_IMX477=m # CONFIG_VIDEO_IMX319 is not set # CONFIG_VIDEO_IMX355 is not set +CONFIG_VIDEO_IMX519=m # CONFIG_VIDEO_OV2640 is not set # CONFIG_VIDEO_OV2659 is not set # CONFIG_VIDEO_OV2680 is not set @@ -5080,7 +5081,7 @@ CONFIG_DRM_DISPLAY_CONNECTOR=m # CONFIG_DRM_SII9234 is not set CONFIG_DRM_SIMPLE_BRIDGE=m # CONFIG_DRM_THINE_THC63LVD1024 is not set -# CONFIG_DRM_TOSHIBA_TC358762 is not set +CONFIG_DRM_TOSHIBA_TC358762=m # CONFIG_DRM_TOSHIBA_TC358764 is not set # CONFIG_DRM_TOSHIBA_TC358767 is not set # CONFIG_DRM_TOSHIBA_TC358768 is not set @@ -7972,7 +7973,7 @@ CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y CONFIG_AUDIT_COMPAT_GENERIC=y # CONFIG_RANDOM32_SELFTEST is not set CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=m +CONFIG_ZLIB_DEFLATE=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_LZ4_COMPRESS=y diff --git a/core/linux-raspberrypi4/linux.preset b/core/linux-raspberrypi4/linux.preset deleted file mode 100644 index 8d7f379c9..000000000 --- a/core/linux-raspberrypi4/linux.preset +++ /dev/null @@ -1,10 +0,0 @@ -# mkinitcpio preset file for the '%PKGBASE%' package - -ALL_config="/etc/mkinitcpio.conf" -ALL_kver="%KERNVER%" - -PRESETS=('default') - -#default_config="/etc/mkinitcpio.conf" -default_image="/boot/initramfs-linux.img" -#default_options=""