summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2019-05-05 17:36:18 -0700
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2019-05-05 17:36:18 -0700
commitfbde5b545740aa9118a09f26c9670c2dc26ef46f (patch)
tree856a8b1bcbd5f322ed86303edba77f20bf42274f
downloadlinux-libre-firmware-fbde5b545740aa9118a09f26c9670c2dc26ef46f.tar.xz
Initial commit
-rw-r--r--0001-Add-offline-files-and-a-toolchain-option-in-Makefile.patch236
-rw-r--r--PKGBUILD65
2 files changed, 301 insertions, 0 deletions
diff --git a/0001-Add-offline-files-and-a-toolchain-option-in-Makefile.patch b/0001-Add-offline-files-and-a-toolchain-option-in-Makefile.patch
new file mode 100644
index 0000000..a5dae8a
--- /dev/null
+++ b/0001-Add-offline-files-and-a-toolchain-option-in-Makefile.patch
@@ -0,0 +1,236 @@
+From 5ceda644200c8c84b9c1ea66f2ee677d374c34cb Mon Sep 17 00:00:00 2001
+From: David P <megver83@parabola.nu>
+Date: Fri, 7 Sep 2018 21:28:40 -0300
+Subject: [PATCH] Add offline files, and a toolchain option in Makefile
+
+The *.offline files are so if you want to build offline, you just have to
+pass toolchains= unset, or toolchains=1 for downloading them (which is the
+default). Read the INSTALL file for more.
+
+Signed-off-by: David P <megver83@parabola.nu>
+---
+ INSTALL | 20 +++++++
+ Makefile | 33 +++++++++--
+ ath9k_htc/Makefile.offline | 8 +++
+ ath9k_htc/target_firmware/configure.offline | 64 +++++++++++++++++++++
+ carl9170fw/extra/sh-elf-linux.cmake.offline | 22 +++++++
+ 5 files changed, 143 insertions(+), 4 deletions(-)
+ create mode 100644 ath9k_htc/Makefile.offline
+ create mode 100755 ath9k_htc/target_firmware/configure.offline
+ create mode 100644 carl9170fw/extra/sh-elf-linux.cmake.offline
+
+diff --git a/INSTALL b/INSTALL
+index 74c5cfd..733aab8 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -6,6 +6,14 @@ also specify targets to make. For example:
+
+ Please see the included Makefile for a list of all available targets.
+
++Some firmwares download toolchains. If you want this, run "make"
++passing the "toolchains=1" option (this is the default). If, however,
++you want to build these firmwares using your system's cross-compilers,
++then run "make" with the "toolchains=" option unset (anything different
++from "1" works), like this:
++
++ make toolchains=
++
+ Once the desired things are built, "make install" will put them into
+ the appropriate place, which is /lib/firmware by default although you
+ can override this with something like:
+@@ -35,6 +43,18 @@ On GNU/Linux distros that use apt you can install these with:
+ apt install binutils-arm-linux-gnueabi binutils-arm-none-eabi bison \
+ cmake flex g++ gcc gcc-arm-linux-gnueabi gcc-arm-none-eabi gperf make wget
+
++And if you pretend to build everything offline, you will also need:
++
++ * GNU C cross-compiler for Xtensa:
++ - xtensa-elf-gcc
++ - xtensa-elf-ld
++ - xtensa-elf-objcopy
++ * GNU C cross-compiler for SuperH:
++ - sh-elf-gcc (with newlib support)
++ - sh-elf-ld
++ - sh-elf-objcopy
++ * Newlib for SuperH (sh-elf)
++
+ CARL9170 Firmware Configuration
+ When building the carl9170 firmware you will be prompted with
+ configuration questions.
+diff --git a/Makefile b/Makefile
+index 21d16fb..3805eaf 100644
+--- a/Makefile
++++ b/Makefile
+@@ -16,6 +16,7 @@
+ shell=/bin/sh
+ prefix=/lib/firmware
+ install_program=install
++toolchains=1
+
+ .PHONY: all test clean install a56 as31 aica ath9k_htc_toolchain ath9k_htc av7110 b43-tools carl9170fw-toolchain carl9170fw cis-tools cis dsp56k ihex2fw isci keyspan_pda openfwwf usbdux
+
+@@ -31,10 +32,22 @@ aica:
+ cd aica/arm && $(MAKE)
+
+ ath9k_htc_toolchain:
+- cd ath9k_htc && $(MAKE) toolchain
++ if [[ "$(toolchains)" = 1 ]]; then \
++ cd ath9k_htc && $(MAKE) toolchain; \
++ else \
++ for f in $(shell find ath9k_htc -type f -name "*.offline") ; do \
++ if [ "$(shell find ath9k_htc -type f -name "*.bak")" = "" ]; then \
++ cp -v $${f%.offline} $${f%.offline}.bak ; \
++ cp -v $$f $${f%.offline} ; \
++ fi; \
++ done; \
++ fi
+
+ ath9k_htc: ath9k_htc_toolchain
+- cd ath9k_htc && $(MAKE) -C target_firmware
++ cd ath9k_htc && $(MAKE) -C target_firmware && \
++ for f in $(shell find -type f -name "*.bak") ; do \
++ mv -v ../$$f ../$${f%.bak}; \
++ done
+
+ av7110:
+ cd av7110 && $(MAKE)
+@@ -43,10 +56,22 @@ b43-tools:
+ cd b43-tools/assembler && $(MAKE)
+
+ carl9170fw-toolchain:
+- cd carl9170fw && $(MAKE) -C toolchain
++ if [[ "$(toolchains)" = 1 ]]; then \
++ cd carl9170fw && $(MAKE) -C toolchain; \
++ else \
++ for f in $(shell find carl9170fw -type f -name "*.offline") ; do \
++ if [ "$(shell find carl9170fw -type f -name "*.bak")" = "" ]; then \
++ cp -v $${f%.offline} $${f%.offline}.bak ; \
++ cp -v $$f $${f%.offline} ; \
++ fi; \
++ done; \
++ fi
+
+ carl9170fw: carl9170fw-toolchain
+- cd carl9170fw && ./autogen.sh
++ cd carl9170fw && ./autogen.sh && \
++ for f in $(shell find -type f -name "*.bak") ; do \
++ mv -v ../$$f ../$${f%.bak}; \
++ done
+
+ cis: cis-tools
+ cd cis && $(MAKE)
+diff --git a/ath9k_htc/Makefile.offline b/ath9k_htc/Makefile.offline
+new file mode 100644
+index 0000000..958eaaa
+--- /dev/null
++++ b/ath9k_htc/Makefile.offline
+@@ -0,0 +1,8 @@
++all: firmware
++clean:
++ $(MAKE) -C target_firmware clean
++
++firmware:
++ +$(MAKE) -C target_firmware
++
++.PHONY: all clean firmware
+diff --git a/ath9k_htc/target_firmware/configure.offline b/ath9k_htc/target_firmware/configure.offline
+new file mode 100755
+index 0000000..6e49093
+--- /dev/null
++++ b/ath9k_htc/target_firmware/configure.offline
+@@ -0,0 +1,64 @@
++#!/bin/sh
++##
++ # Copyright (c) 2013 Qualcomm Atheros, Inc.
++ #
++ # All rights reserved.
++ #
++ # Redistribution and use in source and binary forms, with or without
++ # modification, are permitted (subject to the limitations in the
++ # disclaimer below) provided that the following conditions are met:
++ #
++ # * Redistributions of source code must retain the above copyright
++ # notice, this list of conditions and the following disclaimer.
++ #
++ # * Redistributions in binary form must reproduce the above copyright
++ # notice, this list of conditions and the following disclaimer in the
++ # documentation and/or other materials provided with the
++ # distribution.
++ #
++ # * Neither the name of Qualcomm Atheros nor the names of its
++ # contributors may be used to endorse or promote products derived
++ # from this software without specific prior written permission.
++ #
++ # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
++ # GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
++ # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
++ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
++ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
++ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
++ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ ##
++
++TARGET=xtensa-elf
++
++[ -z "$CROSS_COMPILE" ] &&
++ CROSS_COMPILE="$TARGET-"
++
++TOOLCHAIN_FILE="$PWD/build/toolchain.cmake"
++
++set -e
++rm -rf build
++mkdir -p build
++
++cat > "$TOOLCHAIN_FILE" <<EOF
++SET(CMAKE_SYSTEM_NAME Generic)
++SET(CMAKE_C_COMPILER "${CROSS_COMPILE}gcc")
++EOF
++
++do_cmake() {
++ cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" "$@"
++}
++
++mkdir -p build/k2 build/magpie
++cd build/k2
++do_cmake -DTARGET_K2=ON ../..
++cd -
++cd build/magpie
++do_cmake -DTARGET_MAGPIE=ON ../..
++cd -
+diff --git a/carl9170fw/extra/sh-elf-linux.cmake.offline b/carl9170fw/extra/sh-elf-linux.cmake.offline
+new file mode 100644
+index 0000000..c0b1e84
+--- /dev/null
++++ b/carl9170fw/extra/sh-elf-linux.cmake.offline
+@@ -0,0 +1,22 @@
++set(CMAKE_SYSTEM_NAME "Generic")
++set(CMAKE_SYSTEM_PROCESSOR "sh2")
++
++set_property(DIRECTORY PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
++
++set(CMAKE_FIND_ROOT_PATH /)
++
++set(CMAKE_C_FLAGS "-m2 -ml -Os -ffreestanding -nostartfiles")
++set(CMAKE_C_LINK_FLAGS "-Wl,-static,-EL,-x,--gc-sections")
++set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
++
++set(OBJCOPY sh-elf-objcopy)
++set(CMAKE_C_COMPILER "sh-elf-gcc")
++set(CMAKE_AR sh-elf-ar)
++set(CMAKE_ASM_COMPILER sh-elf-as)
++set(CMAKE_ASM-ATT_COMPILER sh-elf-as)
++set(CMAKE_LINKER sh-elf-ld)
++set(CMAKE_C_LINK_EXECUTABLE "sh-elf-gcc <OBJECTS> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -o <TARGET>")
++
++set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
++set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
++set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+--
+2.18.0
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..49982ea
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,65 @@
+# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
+# Maintainer (Parabola): David P. <megver83@parabola.nu>
+# Contributor (Parabola): André Silva <emulatorman@hyperbola.info>
+# Contributor (Parabola): Márcio Silva <coadde@hyperbola.info>
+# Contributor (Parabola): Luke Shumaker <lukeshu@sbcglobal.net>
+
+# # I maintain this because:
+# Parabola version conflict with non-libre packages
+
+pkgname=linux-libre-firmware
+pkgver=1.3.1
+pkgrel=1
+epoch=1
+pkgdesc='Firmware files for Linux-libre'
+arch=(any)
+url='https://jxself.org/firmware'
+license=(GPL3)
+makedepends=(arm-linux-gnueabi-gcc arm-none-eabi-gcc cmake sh-elf-gcc sh-elf-newlib xtensa-elf-gcc)
+provides=(linux-firmware)
+conflicts=(linux-firmware
+ linux-firmware-git
+ kernel26-firmware
+ ar9170-fw
+ iwlwifi-1000-ucode
+ iwlwifi-3945-ucode
+ iwlwifi-4965-ucode
+ iwlwifi-5000-ucode
+ iwlwifi-5150-ucode
+ iwlwifi-6000-ucode
+ rt2870usb-fw
+ rt2x00-rt61-fw
+ rt2x00-rt71w-fw
+ amd-ucode
+ openfwwf
+ ath9k-htc-firmware)
+options=(!buildflags !makeflags)
+source=("$url/$pkgname-$pkgver.tar.lz"{,.asc}
+ 0001-Add-offline-files-and-a-toolchain-option-in-Makefile.patch)
+sha512sums=('d827ec7024b4900dcdf6af8cdd4e72b02596d0ade5c2262460cd573785300498e6aa655b9a59cd22e38a6a787826a564ae33acfac52e68df1d082445e66f18df'
+ 'SKIP'
+ '1aa4b3a463c0d24f295df2ea13e30d3b11a1af7abef3e03558036b07143b3262178a3b7ab6cc0cc7c255044f833e7df9a3cb18b98978e55737852fe0185dc22e')
+validpgpkeys=('F611A908FFA165C699584ED49D0DB31B545A3198') # Jason Self
+
+prepare() {
+ cd $srcdir/$pkgname-$pkgver/src
+
+ patch -p1 -i $srcdir/0001-Add-offline-files-and-a-toolchain-option-in-Makefile.patch
+
+ # Build carl9170 with the default config
+ sed '71s/autogen.sh/autogen.sh --alldefconfig/' -i Makefile
+}
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ make toolchains= -C src
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+
+ install -dm755 $pkgdir/usr/lib/firmware
+ make -C src prefix=$pkgdir/usr/lib/firmware install
+
+ install -Dm644 src/WHENCE $pkgdir/usr/share/licenses/$pkgname/WHENCE
+}