mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-08 22:45:43 +00:00
core/linux-espressobin to 4.17.5-2
This commit is contained in:
parent
fe9bbbbaaf
commit
21eda39688
6 changed files with 123 additions and 147 deletions
12
core/linux-espressobin/60-linux.hook
Normal file
12
core/linux-espressobin/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%
|
11
core/linux-espressobin/90-linux.hook
Normal file
11
core/linux-espressobin/90-linux.hook
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Target = boot/Image
|
||||
Target = usr/lib/initcpio/*
|
||||
|
||||
[Action]
|
||||
Description = Updating %PKGBASE% initcpios...
|
||||
When = PostTransaction
|
||||
Exec = /usr/bin/mkinitcpio -p %PKGBASE%
|
11
core/linux-espressobin/91-linux.hook
Normal file
11
core/linux-espressobin/91-linux.hook
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Target = boot/Image
|
||||
Target = usr/lib/initcpio/*
|
||||
|
||||
[Action]
|
||||
Description = Updating %PKGBASE% uimg initcpios...
|
||||
When = PostTransaction
|
||||
Exec = /usr/bin/mkimage -n "Ramdisk Image" -A arm64 -O linux -T ramdisk -C none -d /boot/initramfs-linux.img /boot/initramfs-linux.uimg
|
|
@ -8,7 +8,7 @@ _srcname=linux-4.17
|
|||
_kernelname=${pkgbase#linux}
|
||||
_desc="Globalscale ESPRESSOBin"
|
||||
pkgver=4.17.5
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
arch=('aarch64')
|
||||
url="http://www.kernel.org/"
|
||||
license=('GPL2')
|
||||
|
@ -20,17 +20,23 @@ source=("http://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz"
|
|||
'0002-PCI-aardvark-set-host-and-device-to-the-same-MAX-pay.patch'
|
||||
'0003-PCI-aardvark-disable-LOS-state-by-default.patch'
|
||||
'config'
|
||||
'linux.preset')
|
||||
'linux.preset'
|
||||
'60-linux.hook'
|
||||
'90-linux.hook'
|
||||
'91-linux.hook')
|
||||
md5sums=('5bb13a03274b66b56c85b26682e407d7'
|
||||
'eb2b7a35e8d1f04c06227829daf8b392'
|
||||
'087a1417d83fa72c2e1cb69ec68ed94d'
|
||||
'960e91f38b59e9d1ce47ec3b4cef3195'
|
||||
'810cc7029cca0741c170209eba2f9dad'
|
||||
'ab50135a41889a2b6e2665d81c75364d'
|
||||
'd8d30aa4a9d4c2b8d4ea53faf46ccf80')
|
||||
'86d4a35722b5410e3b29fc92dae15d4b'
|
||||
'ce6c81ad1ad1f8b333fd6077d47abdaf'
|
||||
'3dc88030a8f2f5a5f97266d99b149f77'
|
||||
'9d68f10566962252c5190b386cd1584a')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${_srcname}"
|
||||
cd ${_srcname}
|
||||
|
||||
# add upstream patch
|
||||
git apply --whitespace=nowarn ../patch-${pkgver}
|
||||
|
@ -50,7 +56,7 @@ prepare() {
|
|||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${_srcname}"
|
||||
cd ${_srcname}
|
||||
|
||||
# get kernel version
|
||||
make prepare
|
||||
|
@ -84,13 +90,12 @@ _package() {
|
|||
pkgdesc="The Linux Kernel and modules - ${_desc}"
|
||||
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7' 'uboot-tools')
|
||||
optdepends=('crda: to set the correct wireless channels of your country')
|
||||
provides=('kernel26' "linux=${pkgver}")
|
||||
replaces=('linux-armv8')
|
||||
provides=("linux=${pkgver}")
|
||||
conflicts=('linux')
|
||||
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
|
||||
install=${pkgname}.install
|
||||
|
||||
cd "${srcdir}/${_srcname}"
|
||||
cd ${_srcname}
|
||||
|
||||
KARCH=arm64
|
||||
|
||||
|
@ -99,149 +104,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 "${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"
|
||||
# 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"
|
||||
sed "${_subst}" ../91-linux.hook |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/91-${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')
|
||||
|
||||
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
|
||||
|
||||
# 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/"
|
||||
|
||||
# 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}/ ]] && 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")
|
||||
|
|
|
@ -1,33 +1,7 @@
|
|||
# arg 1: the new package version
|
||||
# arg 2: the old package version
|
||||
|
||||
KERNEL_NAME=-espressobin
|
||||
KERNEL_VERSION=4.12.0-1-ARCH
|
||||
|
||||
post_install () {
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod ${KERNEL_VERSION}
|
||||
echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
|
||||
mkinitcpio -p linux${KERNEL_NAME}
|
||||
if [[ -e "/boot/initramfs-linux.img" ]]; then
|
||||
mkimage -n "Ramdisk Image" -A arm64 -O linux -T ramdisk -C none -d /boot/initramfs-linux.img /boot/initramfs-linux.uimg > /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
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}
|
||||
echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
|
||||
mkinitcpio -p linux${KERNEL_NAME}
|
||||
if [[ -e "/boot/initramfs-linux.img" ]]; then
|
||||
mkimage -n "Ramdisk Image" -A arm64 -O linux -T ramdisk -C none -d /boot/initramfs-linux.img /boot/initramfs-linux.uimg > /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# mkinitcpio preset file for the 'linux-espressobin' package
|
||||
# mkinitcpio preset file for the '%PKGBASE%' package
|
||||
|
||||
ALL_config="/etc/mkinitcpio.conf"
|
||||
ALL_kver="4.12.0-1-ARCH"
|
||||
ALL_kver="%KERNVER%"
|
||||
|
||||
PRESETS=('default')
|
||||
|
||||
|
|
Loading…
Reference in a new issue