summaryrefslogtreecommitdiff
path: root/libre-testing/linux-libre/PKGBUILD
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-22 19:29:44 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-22 19:29:44 -0300
commit1a23deef5d9f0a429670a7563fc1c16bf827d80b (patch)
tree17270c06745c3ce79765e3ec3969910cc7227a5a /libre-testing/linux-libre/PKGBUILD
parentd38b500b6ffad2f4a88676dc45a74b0eb8157b2c (diff)
downloadabslibre-1a23deef5d9f0a429670a7563fc1c16bf827d80b.tar.gz
abslibre-1a23deef5d9f0a429670a7563fc1c16bf827d80b.tar.bz2
abslibre-1a23deef5d9f0a429670a7563fc1c16bf827d80b.zip
linux-libre-4.2_gnu-4: updating version for armv7h
Diffstat (limited to 'libre-testing/linux-libre/PKGBUILD')
-rw-r--r--libre-testing/linux-libre/PKGBUILD183
1 files changed, 164 insertions, 19 deletions
diff --git a/libre-testing/linux-libre/PKGBUILD b/libre-testing/linux-libre/PKGBUILD
index 9978e3a24..45289d4c5 100644
--- a/libre-testing/linux-libre/PKGBUILD
+++ b/libre-testing/linux-libre/PKGBUILD
@@ -4,6 +4,7 @@
# Contributor: Michał Masłowski <mtjm@mtjm.eu>
# Contributor: Márcio Silva <coadde@parabola.nu>
# Contributor: Luke Shumaker <lukeshu@sbcglobal.net>
+# Contributor: Luke R. <g4jc@openmailbox.org>
# Based on linux package
@@ -20,10 +21,14 @@ _srcname=linux-${_pkgbasever%-*}
_archpkgver=${_pkgver%-*}
pkgver=${_pkgver//-/_}
pkgrel=4
-arch=('i686' 'x86_64')
+rcnrel=armv7-x2
+arch=('i686' 'x86_64' 'armv7h')
url="http://linux-libre.fsfla.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
+if [ "$CARCH" = "armv7h" ]; then
+ makedepends+=('git' 'uboot-tools')
+fi
options=('!strip')
source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/linux-libre-${_pkgbasever}.tar.xz"
"http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/linux-libre-${_pkgbasever}.tar.xz.sign"
@@ -36,14 +41,25 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/li
"https://repo.parabola.nu/other/linux-libre/logos/logo_linux_vga16.ppm"
"https://repo.parabola.nu/other/linux-libre/logos/logo_linux_vga16.ppm.sig"
# the main kernel config files
- 'config.i686' 'config.x86_64'
+ 'config.i686' 'config.x86_64' 'config.armv7h'
# standard config files for mkinitcpio ramdisk
'linux.preset'
'change-default-console-loglevel.patch'
'0001-e1000e-Fix-tight-loop-implementation-of-systime-read.patch'
'0001-netfilter-conntrack-use-nf_ct_tmpl_free-in-CT-synpro.patch'
'0001-fix-bridge-regression.patch'
- '0001-drm-radeon-Make-the-driver-load-without-the-firmwares.patch')
+ '0001-drm-radeon-Make-the-driver-load-without-the-firmwares.patch'
+ # armv7h patches
+ "https://repo.parabola.nu/other/rcn-libre/patches/${_pkgver%-*}/rcn-libre-${_pkgver%-*}-${rcnrel}.patch"
+ "https://repo.parabola.nu/other/rcn-libre/patches/${_pkgver%-*}/rcn-libre-${_pkgver%-*}-${rcnrel}.patch.sig"
+ '0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch'
+ '0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch'
+ '0003-SMILE-Plug-device-tree-file.patch'
+ '0004-fix-mvsdio-eMMC-timing.patch'
+ '0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch'
+ '0006-ARM-TLV320AIC23-SoC-Audio-Codec-Fix-errors-reported-.patch'
+ '0007-set-default-cubietruck-led-triggers.patch'
+ '0008-USB-armory-support.patch')
sha256sums=('3a8fc9da5a38f15cc4ed0c5132d05b8245dfc1007c37e7e1994b2486535ecf49'
'SKIP'
'bfd4a7f61febe63c880534dcb7c31c5b932dde6acf991810b41a939a93535494'
@@ -54,14 +70,26 @@ sha256sums=('3a8fc9da5a38f15cc4ed0c5132d05b8245dfc1007c37e7e1994b2486535ecf49'
'SKIP'
'526249099c8b163e283a239864f3867d62b7df5db1d8487eeb97f88bea9cd5f9'
'930a85f346c9e6108654e1e8b6c53eca18c7560a9edbb848715fc2d93eee8ae5'
+ '56e3990839578cc8de71f2bb8bdb4b3d3adc2a62cb1bceb1455708aeea34ab50'
'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c'
'1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99'
'0b1e41ba59ae45f5929963aa22fdc53bc8ffb4534e976cec046269d1a462197b'
'6ed9e31ae5614c289c4884620e45698e764c03670ebc45bab9319d741238cbd3'
'0a8fe4434e930d393c7983e335842f6cb77ee263af5592a0ca7e14bae7296183'
- '61370b766e0c60b407c29d2c44b3f55fc352e9049c448bc8fcddb0efc53e42fc')
+ '61370b766e0c60b407c29d2c44b3f55fc352e9049c448bc8fcddb0efc53e42fc'
+ 'd42780dcc79c1c50c60cb8ebfd68be4f07e11b72bf28265bc6dd898e10a215f4'
+ 'SKIP'
+ '2654680bc8f677f647bca6e2b367693bf73ffb2edc21e3757a329375355a335d'
+ '842e4f483fa36c0e7dbe18ad46d78223008989cce097e5bef1e14450280f5dfe'
+ '810697eec07faa60acb59b97df291e5f2e9428e86ae54e5ef90a6e4b2d0844ab'
+ 'c743e41975260aab3176b6f473707c8d8371cb89575e1c128bddb3bd74030b8b'
+ 'abc9593a479b9bb677112fa1d6502c8165d27d0854a712e1662374e4bafb96a0'
+ 'd068215561ce769439901da0118e251c624de58fe414cc2166fbf972f76dd1a7'
+ 'ac0fb2180560652f94bebb3c09baef3c34785b539cae541df175ebec6989d79c'
+ 'c23c3bf29fd557fe2e9ca72e65cd0f1e790b771b4568d0732388d7d420cefd6a')
validpgpkeys=(
'474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva
+ 'C92BAA713B8D53D3CAE63FC9E6974752F9704456' # André Silva
'684D54A189305A9CC95446D36B888913DDB59515' # Márcio Silva
)
@@ -72,6 +100,7 @@ _replacesoldmodules=("${_replacesoldmodules[@]/\%/${_kernelname}}")
case "$CARCH" in
i686|x86_64) KARCH=x86;;
+ armv7h) KARCH=arm;;
esac
prepare() {
@@ -82,6 +111,22 @@ prepare() {
patch -p1 -i "${srcdir}/patch-${_pkgbasever}-${_pkgver}"
fi
+ if [ "${CARCH}" = "armv7h" ]; then
+
+ # RCN patch (CM3 firmware deblobbed)
+ git apply -v "${srcdir}/rcn-libre-${_pkgver%-*}-${rcnrel}.patch"
+
+ # ALARM patches
+ patch -p1 -i "${srcdir}/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch"
+ patch -p1 -i "${srcdir}/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch"
+ patch -p1 -i "${srcdir}/0003-SMILE-Plug-device-tree-file.patch"
+ patch -p1 -i "${srcdir}/0004-fix-mvsdio-eMMC-timing.patch"
+ patch -p1 -i "${srcdir}/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch"
+ patch -p1 -i "${srcdir}/0006-ARM-TLV320AIC23-SoC-Audio-Codec-Fix-errors-reported-.patch"
+ patch -p1 -i "${srcdir}/0007-set-default-cubietruck-led-triggers.patch"
+ patch -p1 -i "${srcdir}/0008-USB-armory-support.patch"
+ fi
+
# add freedo as boot logo
install -m644 -t drivers/video/logo \
"${srcdir}/logo_linux_"{clut224.ppm,vga16.ppm,mono.pbm}
@@ -109,7 +154,9 @@ prepare() {
# Make the radeon driver load without the firmwares
# http://www.fsfla.org/pipermail/linux-libre/2015-August/003098.html
- patch -p1 -i "${srcdir}/0001-drm-radeon-Make-the-driver-load-without-the-firmwares.patch"
+ if [ "${CARCH}" != "armv7h" ]; then ## This patch is only needed for x86 computers, so we disable it for others
+ patch -p1 -i "${srcdir}/0001-drm-radeon-Make-the-driver-load-without-the-firmwares.patch"
+ fi
cat "${srcdir}/config.${CARCH}" > ./.config
@@ -137,18 +184,27 @@ prepare() {
build() {
cd "${srcdir}/${_srcname}"
- make ${MAKEFLAGS} LOCALVERSION= bzImage modules
+ if [ "${CARCH}" != "armv7h" ]; then
+ make ${MAKEFLAGS} LOCALVERSION= bzImage modules
+ else
+ make ${MAKEFLAGS} LOCALVERSION= zImage modules dtbs
+ fi
}
_package() {
pkgdesc="The ${pkgbase^} kernel and modules"
[ "${pkgbase}" = "linux-libre" ] && groups=('base')
- depends=('coreutils' 'linux-libre-firmware' 'kmod' 'mkinitcpio>=0.7')
+ depends=('coreutils' 'linux-libre-firmware' 'kmod')
+ if [ "${CARCH}" != "armv7h" ]; then
+ depends+=('mkinitcpio>=0.7')
+ fi
optdepends=('crda: to set the correct wireless channels of your country')
provides=("${_replacesarchkernel[@]/%/=${_archpkgver}}")
conflicts=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
replaces=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
- backup=("etc/mkinitcpio.d/${pkgbase}.preset")
+ if [ "$CARCH" != "armv7h" ]; then
+ backup=("etc/mkinitcpio.d/${pkgbase}.preset")
+ fi
install=linux.install
cd "${srcdir}/${_srcname}"
@@ -159,8 +215,16 @@ _package() {
_basekernel=${_basekernel%.*}
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
+ if [ "${CARCH}" = "armv7h" ]; then
+ mkdir -p "${pkgdir}"/boot/dtbs
+ fi
make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
- cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
+ if [ "${CARCH}" != "armv7h" ]; then
+ cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
+ else
+ cp arch/$KARCH/boot/zImage "${pkgdir}/boot/zImage"
+ cp arch/$KARCH/boot/dts/*.dtb "${pkgdir}/boot/dtbs"
+ fi
# set correct depmod command for install
cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
@@ -170,19 +234,25 @@ _package() {
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
-i "${startdir}/${install}"
- # 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=\"/boot/vmlinuz-${pkgbase}\"|" \
- -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
- -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
- -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+ if [ "$CARCH" != "armv7h" ]; then
+ # 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=\"/boot/vmlinuz-${pkgbase}\"|" \
+ -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
+ -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
+ -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+ fi
# remove build and source links
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf "${pkgdir}/lib/firmware"
+ if [ "$CARCH" = "armv7h" ]; then
+ # gzip -9 all modules to save 100MB of space
+ find "${pkgdir}" -name '*.ko' |xargs -P 2 -n 1 gzip -9
+ fi
# make room for external modules
ln -s "../extramodules-${_basekernel}${_kernelname}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
@@ -196,8 +266,10 @@ _package() {
mkdir -p "${pkgdir}/usr"
mv "${pkgdir}/lib" "${pkgdir}/usr/"
- # add vmlinux
- install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
+ if [ "$CARCH" != "armv7h" ]; then
+ # add vmlinux
+ install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
+ fi
}
_package-headers() {
@@ -226,6 +298,14 @@ _package-headers() {
# 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}/"
+ if [ "$CARCH" = "armv7h" ]; then
+ mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-omap2"
+ cp -a arch/${KARCH}/mach-omap2/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-omap2/"
+ mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-mvebu"
+ cp -a arch/${KARCH}/mach-mvebu/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-mvebu/"
+ mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/plat-omap"
+ cp -a arch/${KARCH}/plat-omap/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/plat-omap/"
+ fi
# copy files necessary for later builds
cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
@@ -337,7 +417,72 @@ _package-docs() {
rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
}
+_package-smileplug() {
+ pkgdesc="The ${pkgbase^} kernel - Marvell SMILE Plug"
+ arch=('armv7h')
+ depends=("${pkgbase}")
+
+ cd "${srcdir}/${_srcname}"
+
+ mkdir -p "${pkgdir}/boot"
+ cat arch/$KARCH/boot/zImage arch/$KARCH/boot/dts/armada-370-smileplug.dtb > myimage
+ mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "${pkgbase}" -d myimage "${pkgdir}/boot/uImage"
+}
+
+_package-mirabox() {
+ pkgdesc="The ${pkgbase^} kernel - Globalscale Mirabox"
+ arch=('armv7h')
+ depends=("${pkgbase}")
+
+ cd "${srcdir}/${_srcname}"
+
+ mkdir -p "${pkgdir}/boot"
+ cat arch/$KARCH/boot/zImage arch/$KARCH/boot/dts/armada-370-mirabox.dtb > myimage
+ mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "${pkgbase}" -d myimage "${pkgdir}/boot/uImage"
+}
+
+_package-ax3() {
+ pkgdesc="The ${pkgbase^} kernel - OpenBlocks AX3-4"
+ arch=('armv7h')
+ depends=("${pkgbase}")
+
+ cd "${srcdir}/${_srcname}"
+
+ mkdir -p "${pkgdir}/boot"
+ cat arch/$KARCH/boot/zImage arch/$KARCH/boot/dts/armada-xp-openblocks-ax3-4.dtb > myimage
+ mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "${pkgbase}" -d myimage "${pkgdir}/boot/uImage"
+}
+
+_package-d3plug() {
+ pkgdesc="The ${pkgbase^} kernel - Globalscale D3Plug"
+ arch=('armv7h')
+ depends=("${pkgbase}")
+
+ cd "${srcdir}/${_srcname}"
+
+ mkdir -p "${pkgdir}/boot"
+ cat arch/$KARCH/boot/zImage arch/$KARCH/boot/dts/dove-d3plug.dtb > myimage
+ mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "${pkgbase}" -d myimage "${pkgdir}/boot/uImage"
+}
+
+_package-cubox() {
+ pkgdesc="The ${pkgbase^} kernel - SolidRun Cubox (Marvell)"
+ arch=('armv7h')
+ depends=("${pkgbase}")
+
+ cd "${srcdir}/${_srcname}"
+
+ mkdir -p "${pkgdir}/boot"
+ cat arch/$KARCH/boot/zImage arch/$KARCH/boot/dts/dove-cubox.dtb > myimage
+ mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "${pkgbase}" -d myimage "${pkgdir}/boot/uImage"
+}
+
pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
+
+if [ "$CARCH" = "armv7h" ]; then
+ pkgname+=("${pkgbase}-smileplug" "${pkgbase}-mirabox" "${pkgbase}-ax3" "${pkgbase}-d3plug" "${pkgbase}-cubox")
+fi
+
for _p in ${pkgname[@]}; do
eval "package_${_p}() {
$(declare -f "_package${_p#${pkgbase}}")