Merge tag 'v0.5' into debian
authorAntonio Ospite <ao2@ao2.it>
Sat, 9 Jan 2016 14:16:50 +0000 (15:16 +0100)
committerAntonio Ospite <ao2@ao2.it>
Sat, 9 Jan 2016 14:16:50 +0000 (15:16 +0100)
Release v0.5

Makefile
NEWS
README
kinect_fetch_fw
kinect_patch_udev_rules [new file with mode: 0755]
kinect_upload_fw/kinect_upload_fw.c
windows/README.asciidoc
windows/kinect_upload_fw.bat

index b3b755d..28813ba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,16 @@
 all:
-       $(MAKE) -C kinect_upload_fw 
+       $(MAKE) -C kinect_upload_fw
 
 install:
        $(MAKE) -C kinect_upload_fw install
+
+install_udev_rules:
        install -d $(DESTDIR)/lib/udev/rules.d
        install -m 644 contrib/55-kinect_audio.rules.in $(DESTDIR)/lib/udev/rules.d/55-kinect_audio.rules
+       ./kinect_patch_udev_rules \
+         "$(FIRMWARE_PATH)" \
+         "$(LOADER_PATH)" \
+         "$(DESTDIR)/lib/udev/rules.d/55-kinect_audio.rules"
 
 clean:
        $(MAKE) -C kinect_upload_fw clean
-
-changelog:
-       git log --pretty="format:%ai  %aN  <%aE>%n%n%x09* %s%d%n" > ChangeLog
diff --git a/NEWS b/NEWS
index abd781d..4f956e9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,13 @@
+News for v0.5:
+==============
+
+  * Fix broken links to the Kinect For Windows EULA
+  * kinect_fetch_fw: save the firmware as UACFirmware instead of
+    UACFirmware.C9C6E852_35A3_41DC_A57D_BDDEB43DFD04
+  * Add a kinect_patch_udev_rules script to improve the installation of the
+    udev rules file provided in contrib/
+  * Makefile: add a install_udev_rules target
+
 News for v0.4:
 ==============
 
diff --git a/README b/README
index 9e9bf1a..fb0d057 100644 (file)
--- a/README
+++ b/README
@@ -34,6 +34,12 @@ Install kinect_upload_fw first:
 it will be copied to /usr/local/sbin by default, assign the PREFIX
 variable on the command line to install it to another location.
 
+Then install the udev rules to automate the firmware loading:
+
+  # make install_udev_rules \
+    FIRMWARE_PATH=/lib/firmware/kinect/UACFirmware
+    LOADER_PATH=/usr/local/sbin/kinect_upload_fw
+
 Then run the firmware fetcher script (remember this is only needed
 once):
 
@@ -43,7 +49,7 @@ once):
 
 The UAC firmware is downloaded from the Microsoft Kinect SDK at
 http://www.kinectforwindows.org, the license of the SDK can be found at
-http://www.kinectforwindows.org/download/EULA.htm
+http://research.microsoft.com/en-us/um/legal/kinectsdk-tou_noncommercial.htm
 
 === Acknowledgements
 
index 28a9fe7..3459dca 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
-# kinect_fetch_fw -  Fetch and install the Microsoft Kinect UAC firmware
+# kinect_fetch_fw - Fetch and install the Microsoft Kinect UAC firmware
 #
-# Copyright (C) 2011  Antonio Ospite <ospite@studenti.unina.it>
+# Copyright (C) 2011-2016  Antonio Ospite <ao2@ao2.it>
 #
 # This program is free software. It comes without any warranty, to
 # the extent permitted by applicable law. You can redistribute it
@@ -21,9 +21,8 @@ set -e
 SDK_URL=${SDK_URL:-"http://download.microsoft.com/download/F/9/9/F99791F2-D5BE-478A-B77A-830AD14950C3/KinectSDK-v1.0-beta2-x86.msi"}
 SDK_MD5="40764fe9e00911bda5095e5be777e311"
 
-[ $# -lt 1 ] && { echo "usage: $(basename "$0") <firmware destdir> [<path of kinect_upload_fw binary>]" 1>&2; exit 1; }
-FW_DESTDIR=$(readlink -f $1)
-LOADER_PATH=${2:-"/usr/local/sbin/kinect_upload_fw"}
+[ $# -lt 1 ] && { echo "usage: $(basename "$0") <firmware destdir>" 1>&2; exit 1; }
+FW_DESTDIR=$(readlink -m $1)
 
 command -v wget >/dev/null 2>&1 || { echo "$(basename "$0"): command 'wget' is needed." 1>&2 ; exit 1; }
 command -v 7z >/dev/null 2>&1 || { echo "$(basename "$0"): command '7z' is needed." 1>&2; exit 1; }
@@ -34,12 +33,12 @@ trap "exit 2" 1 2 3 15
 
 cat << EOM
 
-This script is going to download the UAC Firmware for the Microsoft 
+This script is going to download the UAC Firmware for the Microsoft
 Kinect Sensor device from the Microsoft Kinect for Windows SDK:
 http://kinectforwindows.org/
 
 The full license of the SDK can be found at:
-http://www.kinectforwindows.org/download/EULA.htm
+http://research.microsoft.com/en-us/um/legal/kinectsdk-tou_noncommercial.htm
 
 EOM
 
@@ -59,15 +58,7 @@ echo -n "Extracting the UAC firmware..."
 echo " done."
 
 FW_FILE=$(ls UACFirmware.* | cut -d ' ' -f 1)
+FIRMWARE_PATH="${FW_DESTDIR}/UACFirmware"
 
-install -d "${DESTDIR}${FW_DESTDIR}"
-install -m 644 "$FW_FILE" "${DESTDIR}${FW_DESTDIR}"
-
-FIRMWARE_PATH=$FW_DESTDIR/$(basename "$FW_FILE")
-
-if [ -f "${DESTDIR}/lib/udev/rules.d/55-kinect_audio.rules" ];
-then
-  sed -e "s|@LOADER_PATH@|$LOADER_PATH|g" \
-      -e "s|@FIRMWARE_PATH@|$FIRMWARE_PATH|g" \
-      -i "${DESTDIR}/lib/udev/rules.d/55-kinect_audio.rules"
-fi
+install -d "$FW_DESTDIR"
+install -m 644 "$FW_FILE" "$FIRMWARE_PATH"
diff --git a/kinect_patch_udev_rules b/kinect_patch_udev_rules
new file mode 100755 (executable)
index 0000000..85027ce
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# kinect_patch_udev_rules - Patch contrib/ udev rules file to load UACFirmware
+#
+# Copyright (C) 2016  Antonio Ospite <ao2@ao2.it>
+#
+# This program is free software. It comes without any warranty, to
+# the extent permitted by applicable law. You can redistribute it
+# and/or modify it under the terms of the Do What The Fuck You Want
+# To Public License, Version 2, as published by Sam Hocevar. See
+# http://sam.zoy.org/wtfpl/COPYING for more details.
+
+set -e
+
+[ $# -lt 3 ] && { echo "usage: $(basename "$0") <firmware path> <kinect_upload_fw path> <55-kinect_audio.rules path>" 1>&2; exit 1; }
+FIRMWARE_PATH="$1"
+LOADER_PATH="$2"
+UDEV_RULES_PATH="$3"
+
+[ "x$FIRMWARE_PATH" != "x" ] || { echo "Empty FIRMWARE_PATH" 1>&2; exit 1;}
+[ "x$LOADER_PATH" != "x" ] || { echo "Empty LOADER_PATH" 1>&2; exit 1;}
+
+# The udev rules file must exist the other files may not exist just yet: they
+# may be under a prefixed path different from the final one, like in the case
+# when this is called at package creation time.
+[ -f "$UDEV_RULES_PATH" ] || { echo "Cannot find the udev rules file: $UDEV_RULES_PATH" 1>&2; exit 1; }
+
+if grep -q "@LOADER_PATH@ @FIRMWARE_PATH@" "$UDEV_RULES_PATH";
+then
+  sed -e "s|@LOADER_PATH@|${LOADER_PATH}|g" \
+      -e "s|@FIRMWARE_PATH@|${FIRMWARE_PATH}|g" \
+      -i "$UDEV_RULES_PATH"
+else
+  echo "$UDEV_RULES_PATH does not contain the expected placeholders." 2>&1
+  exit 1
+fi
index b258ba0..1bd4102 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright 2011 Drew Fisher <drew.m.fisher@gmail.com>. All rights reserved.
+ * Copyright (C) 2016  Antonio Ospite <ao2@ao2.it>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -305,7 +306,7 @@ int main(int argc, char *argv[]) {
                goto out_libusb_close;
        }
 
-       /* 
+       /*
         * Checking that the configuration has not changed, as suggested in
         * http://libusb.sourceforge.net/api-1.0/caveats.html
         */
index 00ec5e4..646f309 100644 (file)
@@ -40,16 +40,16 @@ Compiling kinect_upload_fw
 Using kinect_upload_fw.exe on Windows
 -------------------------------------
 
-First of all, make sure the drivers from ''libfreenect'' are installed, they are 
+First of all, make sure the drivers from ''libfreenect'' are installed, they are
 under ''platform/windows/inf''.
 
 Download the MSR Kinect SDK from:
 http://download.microsoft.com/download/8/4/C/84C9EF40-EE49-42C2-AE26-C6E30921182F/KinectSDK32.msi
 
-Explore ''KinectSDK32.msi'' using 7-zip from http://www.7-zip.org, extract the 
-''media1.cab'' file in it and extract the firmware file from ''media1.cab'', the 
+Explore ''KinectSDK32.msi'' using 7-zip from http://www.7-zip.org, extract the
+''media1.cab'' file in it and extract the firmware file from ''media1.cab'', the
 firmware file is named ''UACFirmware.*''.
 
-Put ''kinect_upload_fw.exe'', the firmware file and ''kinect_upload_fw.bat'' 
-file in the same directory and double_click on the ''kinect_upload_fw.bat'' 
+Put ''kinect_upload_fw.exe'', the firmware file and ''kinect_upload_fw.bat''
+file in the same directory and double_click on the ''kinect_upload_fw.bat''
 file.
index 3757670..d388666 100644 (file)
@@ -1,14 +1,14 @@
-REM First of all, make sure the drivers from ''libfreenect'' are installed, \r
+REM First of all, make sure the drivers from ''libfreenect'' are installed,\r
 REM they are in ''platform/windows/inf'' in the libfreenect code base..\r
-REM \r
+REM\r
 REM Download the MSR Kinect SDK from:\r
 REM http://download.microsoft.com/download/8/4/C/84C9EF40-EE49-42C2-AE26-C6E30921182F/KinectSDK32.msi\r
-REM \r
-REM Explore ''KinectSDK32.msi'' using 7-zip from http://www.7-zip.org, extract the \r
+REM\r
+REM Explore ''KinectSDK32.msi'' using 7-zip from http://www.7-zip.org, extract the\r
 REM ''media1.cab'' file in it and get the firmware file, named ''UACFirmware.*''\r
-REM \r
-REM Put ''kinect_upload_fw.exe'', the firmware file and ''kinect_upload_fw.bat'' \r
-REM file in the same directory and double_click on the ''kinect_upload_fw.bat'' \r
+REM\r
+REM Put ''kinect_upload_fw.exe'', the firmware file and ''kinect_upload_fw.bat''\r
+REM file in the same directory and double_click on the ''kinect_upload_fw.bat''\r
 REM file.\r
 \r
 Set FIRMWARE="UACFirmware.C9C6E852_35A3_41DC_A57D_BDDEB43DFD04"\r