core/linux-odroid-c2 to 3.16.57-1

This commit is contained in:
Kevin Mihelich 2018-09-01 02:40:21 +00:00
parent caf66aebc9
commit 58f8f74a9f
6 changed files with 554 additions and 751 deletions

View 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%

View 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%

View file

@ -4,14 +4,14 @@
buildarch=8
pkgbase=linux-odroid-c2
_commit=f966ebfc0e8dc88c7931b4640b8a1b4bc2e13faa
_commit=a47cdcd05b6439422bf50409f1f09485dcc7b7b6
_srcname=linux-${_commit}
_kernelname=${pkgbase#linux}
_desc="ODROID-C2"
pkgver=3.14.79
pkgrel=28
pkgver=3.16.57
pkgrel=1
arch=('aarch64')
url="https://github.com/hardkernel/linux/tree/odroidc2-3.14.y"
url="https://github.com/hardkernel/linux/tree/odroidc2-v3.16.y"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git')
options=('!strip')
@ -20,13 +20,17 @@ source=("https://github.com/hardkernel/linux/archive/${_commit}.tar.gz"
'0001-add-extra-errata-843419-build-flags.patch'
'config'
'linux.preset'
'amlogic.service')
md5sums=('62a01a1c7e830a081f92ad2908a1e7a9'
'amlogic.service'
'60-linux.hook'
'90-linux.hook')
md5sums=('4ffd9e836370aea16f80e6798b969126'
'SKIP'
'4e11a812de6e7d749103b6a2e6bef301'
'547859960a8837546feb44284f7695e8'
'85fd3026c435ffa6d7c2d7f9767b4251'
'b8956789318f49cec5b8bb0b41654a9b')
'9d0b2aafec410a06e3390a1c66800206'
'86d4a35722b5410e3b29fc92dae15d4b'
'b8956789318f49cec5b8bb0b41654a9b'
'ce6c81ad1ad1f8b333fd6077d47abdaf'
'3dc88030a8f2f5a5f97266d99b149f77')
prepare() {
cd "${srcdir}/${_srcname}"
@ -92,45 +96,50 @@ _package() {
_basekernel=${_kernver%%-*}
_basekernel=${_basekernel%.*}
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot/dtbs}
make INSTALL_MOD_PATH="${pkgdir}" modules_install
mkdir -p "${pkgdir}"/{boot/dtbs,usr/lib/modules}
make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
cp arch/$KARCH/boot/Image "${pkgdir}/boot"
cp arch/$KARCH/boot/dts/meson64_odroidc2.dtb "${pkgdir}/boot/dtbs"
# 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}
rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf "${pkgdir}/lib/firmware"
rm -rf "${pkgdir}/usr/lib/firmware"
# gzip -9 all modules to save 100MB of space
find "${pkgdir}" -name '*.ko' |xargs -P 2 -n 1 gzip -9
# 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"
# 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"
# install amlogic hdmi init script/service
install -Dm644 "${srcdir}/amlogic.service" "${pkgdir}/usr/lib/systemd/system/amlogic.service"

File diff suppressed because it is too large Load diff

View file

@ -1,30 +1,9 @@
# arg 1: the new package version
# arg 2: the old package version
KERNEL_NAME=-odroid-c2
KERNEL_VERSION=3.14.29-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}
}
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}
}
post_remove() {
# also remove the compat symlinks
rm -f boot/initramfs-linux.img
}

View file

@ -1,7 +1,7 @@
# mkinitcpio preset file for the 'linux-odroid-c2' package
# mkinitcpio preset file for the '%PKGBASE%' package
ALL_config="/etc/mkinitcpio.conf"
ALL_kver="3.14.29-1-ARCH"
ALL_kver="%KERNVER%"
PRESETS=('default')