Initial commit

This commit is contained in:
crt0mega 2021-08-26 17:38:51 +02:00
commit 90eaf68e17
Signed by: crt0mega
GPG Key ID: DCAA09100B14F420
16 changed files with 374 additions and 0 deletions

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.pc
debian/.debhelper
debian/*.ex
debian/*.EX
debian/*.substvars
debian/debhelper-build-stamp
debian/files
debian/sixfireusb-fwcutter

10
debian/README.Debian vendored Normal file
View File

@ -0,0 +1,10 @@
sixfireusb-fwcutter for Debian
-----------------------------
This script is part of the out-of-tree driver for TerraTec's DMX 6Fire USB
sound card found at sf.net. It downloads the official Windoze driver and
extracts the necessary firmware files into Debian's firmware directory.
It also takes care of cleaning up that mess with a postrm-trigger.
-- crt0mega <crt0mega@c-r-t.tk> Thu, 26 Aug 2021 12:03:39 +0200

15
debian/README.source vendored Normal file
View File

@ -0,0 +1,15 @@
sixfireusb-fwcutter for Debian
-----------------------------
Patches for the script might be supplied through quilt. There's already
a patch inspired by the unofficial AUR package which choses install over
mkdir which is a more sane approach IMHO.
If TerraTec decides to release new drivers, please follow the instructions
of fwinst.txt for adding support.
It might be necessary to obtain the drivers from a web archive in the
future.
-- crt0mega <crt0mega@c-r-t.tk> Thu, 26 Aug 2021 12:03:39 +0200

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
sixfireusb-fwcutter (0.0.1-1) unstable; urgency=medium
* Initial release
-- crt0mega <crt0mega@c-r-t.tk> Thu, 26 Aug 2021 12:03:39 +0200

21
debian/control vendored Normal file
View File

@ -0,0 +1,21 @@
Source: sixfireusb-fwcutter
Section: unknown
Priority: optional
Maintainer: crt0mega <crt0mega@c-r-t.tk>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Homepage: <insert the upstream URL, if relevant>
#Vcs-Browser: https://salsa.debian.org/debian/sixfireusb-fwcutter
#Vcs-Git: https://salsa.debian.org/debian/sixfireusb-fwcutter.git
Rules-Requires-Root: no
Package: sixfireusb-fwcutter
Architecture: all
Depends: ${misc:Depends}, p7zip, wget
Recommends: sixfireusb-dkms
Description: Firmware installer for TerraTec DMX 6Fire USB
The script fwinst.sh is used to install the firmware for
the TerraTec DMX 6Fire USB. The firmware is required for
the device to work after it has been disconnected from
power. It will download the windows driver version 1.23.0.02
and extract the firmware from it.

39
debian/copyright vendored Normal file
View File

@ -0,0 +1,39 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: sixfireusb-fwcutter
Upstream-Contact: <preferred name and address to reach the upstream project>
Source: <url://example.com>
Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: GPL-3.0+
Files: debian/*
Copyright: 2021 crt0mega <crt0mega@c-r-t.tk>
License: GPL-3.0+
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid picking licenses with terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
#
# If you need, there are some extra license texts available in two places:
# /usr/share/debhelper/dh_make/licenses/
# /usr/share/common-licenses/

1
debian/install vendored Normal file
View File

@ -0,0 +1 @@
fwinst.sh usr/sbin/sixfireusb-fwcutter

15
debian/patches/fwinst.patch vendored Normal file
View File

@ -0,0 +1,15 @@
Use install instead of mkdir (inspred by Castix' patch
for the AUR package) because it looks more sane
Index: sixfireusb-fwcutter/fwinst.sh
===================================================================
--- sixfireusb-fwcutter.orig/fwinst.sh
+++ sixfireusb-fwcutter/fwinst.sh
@@ -106,7 +106,7 @@ if ! copy_bymd5 a65eecc11adc87af7307f526
fi
step_begin "Installing firmware files"
-if ! mkdir -p $FW_6FIRE_PATH >/dev/null 2>&1 ; then
+if ! install -dm755 $FW_6FIRE_PATH >/dev/null 2>&1 ; then
step_error "Creation of firmware path failed. Are you root?"
fi

1
debian/patches/series vendored Normal file
View File

@ -0,0 +1 @@
fwinst.patch

41
debian/postinst vendored Normal file
View File

@ -0,0 +1,41 @@
#!/bin/sh
# postinst script for sixfireusb-fwcutter
#
# see: dh_installdeb(1)
set -e
PFX="/usr/sbin/sixfireusb-fwcutter"
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
sh "$PFX/fwinst.sh"
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

45
debian/postrm vendored Normal file
View File

@ -0,0 +1,45 @@
#!/bin/sh
# postrm script for sixfireusb-fwcutter
#
# see: dh_installdeb(1)
FW_DIR="/lib/firmware/6fire"
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
if [ -d "$FW_DIR" ]; then
echo "Removing downloaded firmware files"
rm -r /lib/firmware/6fire
else
echo "No firmware files found for removal"
fi
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

25
debian/rules vendored Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

2
debian/sixfireusb-fwcutter-docs.docs vendored Normal file
View File

@ -0,0 +1,2 @@
README.source
README.Debian

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

127
fwinst.sh Executable file
View File

@ -0,0 +1,127 @@
#!/bin/sh
#
# This shell script downloads and installs firmware for the Terratec
# DMX 6Fire USB. See fwinst.txt for more information.
#
# Windows driver version used: 1.11.0.19
#
# Author: Torsten Schenk
# Copyright: (C) Torsten Schenk
#
# Thanks:
# - Richard Lucassen: he fixed minor bugs in this script and
# helped fixing 7z version problems
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
export FW_PATH=/lib/firmware
export FW_6FIRE_PATH=$FW_PATH/6fire
cleanup() {
rm -Rf /tmp/dmx
rm -f /tmp/dmx.exe
rm -f /tmp/dmx.tmp
rm -f /tmp/dmx6firel2.ihx
rm -f /tmp/dmx6fireap.ihx
rm -f /tmp/dmx6firecf.bin
}
success() {
echo -e "\033[1;32m$1\033[m"
cleanup
exit
}
step_begin() {
echo -e -n "\033[1;33m$1...\033[m"
}
step_error() {
echo -e "\033[1;33mfailed.\033[0m"
echo -e "\033[1;31m$1\033[0m"
cleanup
exit
}
step_success() {
echo -e "\033[1;33mdone.\033[m"
}
copy_bymd5() {
file=`find /tmp/dmx -type f -exec md5sum {} \; | grep "$1"`
if test -z "$file" ; then
return 1
fi
file=`echo $file | awk '{ print $2 }'`
cp "$file" "/tmp/$2"
return 0
}
cleanup
step_begin "Checking for firmware directory"
if ! [ -d $FW_PATH ]; then
step_error "Firmware directory\n $FW_PATH\ndoes not exist.\n\nEither you have no firmware installed or your system uses another directory.\nPlease set FW_PATH in this script file accordingly.\nTypical paths you could try are:\n /lib/firmware\n /usr/lib/hotplug/firmware\n\nIf you nevertheless want to install the firmware into this path,\nplease create it manually:\n $ sudo mkdir -p $FW_PATH\nor, if you are root:\n $ mkdir -p $FW_PATH"
fi
step_success
step_begin "Downloading windows driver"
if ! wget "http://terratec.ultron.info/Audio/DMX_6fire_USB/Updates/History/Windows/DMX_6fire_USB_Setup_1.23.0.02_XP_Vista_7.exe" -q -O /tmp/dmx.exe ; then
step_error "Internet connection alive? Perhaps a new driver version is available.\nIf that is the case, please redownload this script."
fi
step_success
step_begin "Checking MD-5 checksum of windows driver"
if ! echo "86049155f9326a77329d87f7b027a8b9 /tmp/dmx.exe" | md5sum -c >/dev/null 2>&1 ; then
step_error "Downloaded windows driver has wrong MD-5 checksum."
fi
step_success
step_begin "Unpacking windows driver"
if ! mkdir /tmp/dmx ; then
step_error "Cannot create temporary directory /tmp/dmx."
fi
if ! 7z x -aot -o/tmp/dmx /tmp/dmx.exe >/dev/null 2>&1 ; then
step_error "Is 7z installed?"
fi
step_success
step_begin "Extracting firmware files"
if ! copy_bymd5 fa80973cb8c02097712933bd1d1c23b2 dmx6firel2.ihx ; then
step_error "No file found which has the MD5 checksum of dmx6firel2.ihx"
fi
if ! copy_bymd5 7497b6b80d43e68f13b6929934ab60f4 dmx6fireap.ihx ; then
step_error "No file found which has the MD5 checksum of dmx6fireap.ihx"
fi
if ! copy_bymd5 a65eecc11adc87af7307f5266ad31d65 dmx6firecf.bin ; then
step_error "No file found which has the MD5 checksum of dmx6firecf.bin"
fi
step_begin "Installing firmware files"
if ! mkdir -p $FW_6FIRE_PATH >/dev/null 2>&1 ; then
step_error "Creation of firmware path failed. Are you root?"
fi
if ! cp /tmp/dmx6firel2.ihx $FW_6FIRE_PATH >/dev/null 2>&1 ; then
step_error "Installation of file 'dmx6firel2.ihx' failed. Are you root?"
fi
if ! cp /tmp/dmx6fireap.ihx $FW_6FIRE_PATH >/dev/null 2>&1 ; then
step_error "Installation of file 'dmx6fireap.ihx' failed. Are you root?"
fi
if ! cp /tmp/dmx6firecf.bin $FW_6FIRE_PATH >/dev/null 2>&1 ; then
step_error "Installation of file 'dmx6firecf.bin' failed. Are you root?"
fi
step_success
success "Installation completed."

18
fwinst.txt Normal file
View File

@ -0,0 +1,18 @@
Firmware installer for TerraTec DMX 6Fire USB
=========================================================
The script fwinst.sh is used to install the firmware for the TerraTec DMX 6Fire USB. The firmware is required for the device to work after it has been disconnected from power. It will download the windows driver version 1.23.0.02 and extract the firmware from it. If TerraTec releases a new driver and the old one is not available any longer, please redownload the script.
If you have an older version of the driver than 0.5.4, you need to use the fwinst_1.11.0.19.sh script in the old/ folder that will download and install firmware version 1.11.0.19.
To perform the installation, ensure that your internet connection is up. Also you need to have installed 7z (found in p7zip) and wget.
Usually the firmware is located in /lib/firmware. If that is not the case for your system, you need to change the line
export FW_PATH=/lib/firmware
accordingly.
Then, type
$ sudo sh fwinst.sh
or (if you already are logged in as root)
$ sh fwinst.sh