mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-08 22:45:43 +00:00
core/linux-odroid-c2 to 3.16.57-1
This commit is contained in:
parent
caf66aebc9
commit
58f8f74a9f
6 changed files with 554 additions and 751 deletions
12
core/linux-odroid-c2/60-linux.hook
Normal file
12
core/linux-odroid-c2/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-odroid-c2/90-linux.hook
Normal file
11
core/linux-odroid-c2/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%
|
|
@ -4,14 +4,14 @@
|
||||||
buildarch=8
|
buildarch=8
|
||||||
|
|
||||||
pkgbase=linux-odroid-c2
|
pkgbase=linux-odroid-c2
|
||||||
_commit=f966ebfc0e8dc88c7931b4640b8a1b4bc2e13faa
|
_commit=a47cdcd05b6439422bf50409f1f09485dcc7b7b6
|
||||||
_srcname=linux-${_commit}
|
_srcname=linux-${_commit}
|
||||||
_kernelname=${pkgbase#linux}
|
_kernelname=${pkgbase#linux}
|
||||||
_desc="ODROID-C2"
|
_desc="ODROID-C2"
|
||||||
pkgver=3.14.79
|
pkgver=3.16.57
|
||||||
pkgrel=28
|
pkgrel=1
|
||||||
arch=('aarch64')
|
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')
|
license=('GPL2')
|
||||||
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git')
|
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git')
|
||||||
options=('!strip')
|
options=('!strip')
|
||||||
|
@ -20,13 +20,17 @@ source=("https://github.com/hardkernel/linux/archive/${_commit}.tar.gz"
|
||||||
'0001-add-extra-errata-843419-build-flags.patch'
|
'0001-add-extra-errata-843419-build-flags.patch'
|
||||||
'config'
|
'config'
|
||||||
'linux.preset'
|
'linux.preset'
|
||||||
'amlogic.service')
|
'amlogic.service'
|
||||||
md5sums=('62a01a1c7e830a081f92ad2908a1e7a9'
|
'60-linux.hook'
|
||||||
|
'90-linux.hook')
|
||||||
|
md5sums=('4ffd9e836370aea16f80e6798b969126'
|
||||||
'SKIP'
|
'SKIP'
|
||||||
'4e11a812de6e7d749103b6a2e6bef301'
|
'4e11a812de6e7d749103b6a2e6bef301'
|
||||||
'547859960a8837546feb44284f7695e8'
|
'9d0b2aafec410a06e3390a1c66800206'
|
||||||
'85fd3026c435ffa6d7c2d7f9767b4251'
|
'86d4a35722b5410e3b29fc92dae15d4b'
|
||||||
'b8956789318f49cec5b8bb0b41654a9b')
|
'b8956789318f49cec5b8bb0b41654a9b'
|
||||||
|
'ce6c81ad1ad1f8b333fd6077d47abdaf'
|
||||||
|
'3dc88030a8f2f5a5f97266d99b149f77')
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
cd "${srcdir}/${_srcname}"
|
cd "${srcdir}/${_srcname}"
|
||||||
|
@ -92,45 +96,50 @@ _package() {
|
||||||
_basekernel=${_kernver%%-*}
|
_basekernel=${_kernver%%-*}
|
||||||
_basekernel=${_basekernel%.*}
|
_basekernel=${_basekernel%.*}
|
||||||
|
|
||||||
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot/dtbs}
|
mkdir -p "${pkgdir}"/{boot/dtbs,usr/lib/modules}
|
||||||
make INSTALL_MOD_PATH="${pkgdir}" modules_install
|
make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
|
||||||
cp arch/$KARCH/boot/Image "${pkgdir}/boot"
|
cp arch/$KARCH/boot/Image "${pkgdir}/boot"
|
||||||
cp arch/$KARCH/boot/dts/meson64_odroidc2.dtb "${pkgdir}/boot/dtbs"
|
cp arch/$KARCH/boot/dts/meson64_odroidc2.dtb "${pkgdir}/boot/dtbs"
|
||||||
|
|
||||||
# set correct depmod command for install
|
# make room for external modules
|
||||||
sed \
|
local _extramodules="extramodules-${_basekernel}${_kernelname}"
|
||||||
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
|
ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
|
||||||
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
|
|
||||||
-i "${startdir}/${pkgname}.install"
|
|
||||||
|
|
||||||
# install mkinitcpio preset file for kernel
|
# add real version for building modules and running depmod from hook
|
||||||
install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
echo "${_kernver}" |
|
||||||
sed \
|
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
|
||||||
-e "1s|'linux.*'|'${pkgbase}'|" \
|
|
||||||
-e "s|ALL_kver=.*|ALL_kver=\"${_kernver}\"|" \
|
|
||||||
-i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
|
||||||
|
|
||||||
# remove build and source links
|
# remove build and source links
|
||||||
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
|
rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
|
||||||
|
|
||||||
# remove the firmware
|
# remove the firmware
|
||||||
rm -rf "${pkgdir}/lib/firmware"
|
rm -rf "${pkgdir}/usr/lib/firmware"
|
||||||
|
|
||||||
# gzip -9 all modules to save 100MB of space
|
# gzip -9 all modules to save 100MB of space
|
||||||
find "${pkgdir}" -name '*.ko' |xargs -P 2 -n 1 gzip -9
|
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...
|
# now we call depmod...
|
||||||
depmod -b "$pkgdir" -F System.map "$_kernver"
|
depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
|
||||||
|
|
||||||
# move module tree /lib -> /usr/lib
|
|
||||||
mkdir -p "${pkgdir}/usr"
|
|
||||||
mv "$pkgdir/lib" "$pkgdir/usr"
|
|
||||||
|
|
||||||
# add vmlinux
|
# 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 amlogic hdmi init script/service
|
||||||
install -Dm644 "${srcdir}/amlogic.service" "${pkgdir}/usr/lib/systemd/system/amlogic.service"
|
install -Dm644 "${srcdir}/amlogic.service" "${pkgdir}/usr/lib/systemd/system/amlogic.service"
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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() {
|
post_upgrade() {
|
||||||
if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then
|
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."
|
echo "WARNING: /boot appears to be a separate partition but is not mounted."
|
||||||
fi
|
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() {
|
post_remove() {
|
||||||
# also remove the compat symlinks
|
|
||||||
rm -f boot/initramfs-linux.img
|
rm -f boot/initramfs-linux.img
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_config="/etc/mkinitcpio.conf"
|
||||||
ALL_kver="3.14.29-1-ARCH"
|
ALL_kver="%KERNVER%"
|
||||||
|
|
||||||
PRESETS=('default')
|
PRESETS=('default')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue