Merge pull request #1123 from teslamint/patch-2
authorImre Kaloz <kaloz@openwrt.org>
Tue, 28 Apr 2015 12:59:21 +0000 (14:59 +0200)
committerImre Kaloz <kaloz@openwrt.org>
Tue, 28 Apr 2015 12:59:21 +0000 (14:59 +0200)
coova-chilli: add netfilter kernel module package with patches

257 files changed:
README.md
admin/debootstrap/Makefile
admin/monit/Makefile
admin/muninlite/Makefile
admin/muninlite/patches/220-modify-ifname-parser.patch [new file with mode: 0644]
admin/sudo/Makefile
admin/zabbix/files/wifi
devel/lttng-modules/Makefile
devel/lttng-modules/patches/001-mm_page_alloc_extfrag.patch [new file with mode: 0644]
devel/patch/Makefile
lang/erlang/Makefile
lang/lpeg/Makefile [new file with mode: 0644]
lang/lua-cjson/Makefile [new file with mode: 0644]
lang/lua-copas/Makefile [new file with mode: 0644]
lang/lua-copas/patches/makefile.patch [new file with mode: 0644]
lang/lua-coxpcall/Makefile [new file with mode: 0644]
lang/lua-coxpcall/patches/config.patch [new file with mode: 0644]
lang/lua-lzlib/Makefile [new file with mode: 0644]
lang/lua-md5/Makefile [new file with mode: 0644]
lang/lua-md5/patches/config.patch [new file with mode: 0644]
lang/lua-md5/patches/makefile.patch [new file with mode: 0644]
lang/lua-mobdebug/Makefile [new file with mode: 0644]
lang/lua-penlight/Makefile
lang/lua-rings/Makefile [new file with mode: 0644]
lang/lua-rings/patches/config.patch [new file with mode: 0644]
lang/lua-rings/patches/makefile.patch [new file with mode: 0644]
lang/lua-rs232/Makefile [new file with mode: 0644]
lang/lua-wsapi/Makefile [new file with mode: 0644]
lang/lua-xavante/Makefile [new file with mode: 0644]
lang/luasocket/Makefile
lang/lzmq/Makefile [new file with mode: 0644]
lang/php5/Makefile
lang/python-yaml/Makefile [new file with mode: 0644]
lang/python/files/python-package-ncurses.mk
lang/python/files/python-package.mk
lang/python/patches/011-do-not-prefer-ncursesw.patch [new file with mode: 0644]
lang/python3/Makefile
lang/python3/files/python3-package-lzma.mk [new file with mode: 0644]
lang/python3/files/python3-package-ncurses.mk
lang/python3/patches/011-do-not-prefer-ncursesw.patch [new file with mode: 0644]
lang/ruby/Makefile
lang/vala/Makefile
libs/avahi/Makefile
libs/avahi/files/avahi-daemon.conf
libs/boost/Makefile
libs/boost/patches/001-mips-options-fix.patch [new file with mode: 0644]
libs/boost/patches/100-do-not-use-librt.patch [deleted file]
libs/fftw3/Makefile [new file with mode: 0644]
libs/fftw3/patches/001-makefile.patch [new file with mode: 0644]
libs/gdbm/Makefile
libs/glib2/Makefile
libs/gnutls/Makefile
libs/gnutls/patches/001-ai-idn-remove.patch [deleted file]
libs/gnutls/patches/001-libopts-detection.patch [new file with mode: 0644]
libs/ldns/Makefile [new file with mode: 0644]
libs/libimobiledevice/Makefile
libs/libmicrohttpd/Makefile
libs/libtasn1/Makefile
libs/libvpx/Makefile
libs/libxerces-c/Makefile
libs/nspr/Makefile [deleted file]
libs/nspr/patches/001-compile.patch [deleted file]
libs/pcre/Makefile
libs/sbc/Makefile [new file with mode: 0644]
libs/yaml/Makefile [new file with mode: 0644]
libs/zmq/Makefile [new file with mode: 0644]
libs/zmq/patches/disable_pedantic_on_linux_with_ulibc++.patch [new file with mode: 0644]
libs/zmq/patches/streamoff_missing_with_ulibc++.patch [new file with mode: 0644]
libs/zmq/patches/tools_gcc_fix.patch [new file with mode: 0644]
mail/alpine/Makefile
mail/bogofilter/Makefile
mail/mailman/Makefile
mail/msmtp/Makefile
multimedia/ffmpeg/Config.in
multimedia/ffmpeg/Makefile
multimedia/gst1-plugins-bad/Makefile
multimedia/gst1-plugins-good/Makefile
multimedia/icecast/Makefile
multimedia/oggfwd/Makefile [new file with mode: 0644]
net/apinger/Makefile [new file with mode: 0644]
net/apinger/files/apinger.init [new file with mode: 0644]
net/apinger/patches/001-autoreconf.patch [new file with mode: 0644]
net/apinger/patches/002-run_as_user.patch [new file with mode: 0644]
net/apinger/patches/003-no_docs.patch [new file with mode: 0644]
net/bind/patches/002-autoconf-ar-fix.patch [new file with mode: 0644]
net/coova-chilli/Makefile
net/coova-chilli/patches/300-fix-compile-with-cyassl.patch [new file with mode: 0644]
net/ddns-scripts/Makefile
net/ddns-scripts/files/ddns.config
net/ddns-scripts/files/ddns.init
net/ddns-scripts/files/dynamic_dns_functions.sh [changed mode: 0644->0755]
net/ddns-scripts/files/dynamic_dns_lucihelper.sh
net/ddns-scripts/files/services_ipv6
net/ddns-scripts/files/tld_names.dat
net/dmapd/Makefile
net/freeradius2/Makefile
net/freeradius2/patches/001-fix-makefile.patch
net/freeradius2/patches/002-config.patch
net/freeradius2/patches/004-ldap_configure.patch
net/freeradius2/patches/008-honor_ccpflags.patch
net/freeradius2/patches/010-disbale-openssl-check.patch
net/git/Makefile
net/haproxy/Makefile
net/haproxy/patches/0003-BUG-MEDIUM-Do-not-consider-an-agent-check-as-failed-.patch [new file with mode: 0644]
net/haproxy/patches/0004-BUG-MEDIUM-peers-correctly-configure-the-client-time.patch [new file with mode: 0644]
net/haproxy/patches/0005-BUG-MEDIUM-buffer-one-byte-miss-in-buffer-free-space.patch [new file with mode: 0644]
net/haproxy/patches/0006-BUG-MAJOR-http-don-t-read-past-buffer-s-end-in-http_.patch [new file with mode: 0644]
net/haproxy/patches/0007-BUG-MEDIUM-http-the-function-req-res-replace-value-d.patch [new file with mode: 0644]
net/haproxy/patches/0008-BUG-MINOR-compression-consider-the-expansion-factor-.patch [new file with mode: 0644]
net/haproxy/patches/0009-BUG-MEDIUM-http-hdr_cnt-would-not-count-any-header-w.patch [new file with mode: 0644]
net/keepalived/Makefile
net/knot/Makefile
net/knot/patches/03_zscanner_tests.patch
net/knxd/Makefile
net/linknx/Makefile
net/lksctp-tools/Makefile [new file with mode: 0644]
net/luci-app-sqm/files/sqm-cbi.lua
net/mdnsresponder/Makefile
net/mdnsresponder/patches/001-cross_compile.patch
net/mdnsresponder/patches/100-linux_fixes.patch
net/mosquitto/Makefile
net/mosquitto/patches/100-libwebsockets-fixes.patch [deleted file]
net/mosquitto/patches/101-qos2-inflight.patch [new file with mode: 0644]
net/mwan3-luci/Makefile
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua
net/mwan3/Makefile
net/mwan3/files/etc/config/mwan3
net/mwan3/files/etc/hotplug.d/iface/15-mwan3
net/mwan3/files/usr/sbin/mwan3
net/net-snmp/Makefile
net/net-snmp/files/snmpd.default [deleted file]
net/net-snmp/files/snmpd.init
net/nsd/Makefile
net/ntpd/Makefile
net/ntpd/files/ntpd.hotplug
net/ocserv/Makefile
net/ocserv/files/ocserv.conf.template
net/ocserv/files/ocserv.init
net/ocserv/patches/001-correct-session-expiration.patch [new file with mode: 0644]
net/openconnect/README
net/openconnect/files/openconnect.sh
net/openssh/Makefile
net/openssh/patches/130-implicit_memset_decl_fix.patch
net/openvswitch/Makefile
net/openvswitch/patches/0001-netdev-linux-Let-interface-flag-survive-internal-por.patch [deleted file]
net/openvswitch/patches/0001-netdev-linux-Use-unsigned-int-for-ifi_flags.patch [new file with mode: 0644]
net/openvswitch/patches/0002-netdev-linux-Let-interface-flag-survive-internal-por.patch [new file with mode: 0644]
net/openvswitch/patches/0002-netdev-linux-Use-unsigned-int-for-ifi_flags.patch [deleted file]
net/openvswitch/patches/0003-lib-util.h-Disable-ovs_assert-when-build-with-NDEBUG.patch [deleted file]
net/openvswitch/patches/0004-datapath-Use-ccflags-y-instead-of-deprecated-EXTRA_C.patch [deleted file]
net/pen/Makefile
net/prosody/Makefile
net/radicale/Makefile [new file with mode: 0644]
net/radicale/files/config.template [new file with mode: 0644]
net/radicale/files/logging.template [new file with mode: 0644]
net/radicale/files/radicale.config [new file with mode: 0644]
net/radicale/files/radicale.hotplug [new file with mode: 0644]
net/radicale/files/radicale.init [new file with mode: 0755]
net/radicale/files/radicale.rights [new file with mode: 0644]
net/radicale/files/radicale.users [new file with mode: 0644]
net/radicale/patches/010-Run-as-user-group-radicale-radicale.patch [new file with mode: 0644]
net/siit/Makefile [new file with mode: 0644]
net/siit/src/Makefile [new file with mode: 0644]
net/siit/src/siit.c [new file with mode: 0644]
net/siit/src/siit.h [new file with mode: 0644]
net/snort/Config.in [new file with mode: 0644]
net/snort/Makefile
net/spawn-fcgi/Makefile [new file with mode: 0644]
net/sqm-scripts/Makefile
net/sqm-scripts/files/etc/hotplug.d/iface/11-sqm
net/sqm-scripts/files/etc/init.d/sqm
net/sqm-scripts/files/usr/lib/sqm/functions.sh
net/sqm-scripts/files/usr/lib/sqm/run.sh
net/strongswan/Makefile
net/strongswan/patches/001-ikev1-fix.patch [deleted file]
net/strongswan/patches/300-include-ipsec-user-script.patch
net/stunnel/Makefile [new file with mode: 0644]
net/stunnel/files/stunnel.conf [new file with mode: 0644]
net/stunnel/files/stunnel.init [new file with mode: 0644]
net/stunnel/patches/010_fix_getnameinfo.patch [new file with mode: 0644]
net/stunnel/patches/011_disable_ssp_linking.patch [new file with mode: 0644]
net/tor/Makefile
net/transmission/Makefile
net/transmission/patches/010_libtransmission_fallocate64_eglibc.patch
net/transmission/patches/030-fix-musl-build.patch [new file with mode: 0644]
net/unbound/Makefile
net/unbound/patches/001-conf.patch
net/wavemon/Makefile
net/wget/Makefile
net/wifidog/Makefile [new file with mode: 0644]
net/wifidog/files/wifidog.init [new file with mode: 0644]
net/xl2tpd/patches/120-no-bsd-signal-in-musl.patch [new file with mode: 0644]
net/znc/Makefile
sound/pianod/Makefile [new file with mode: 0644]
sound/pianod/files/pianod.init [new file with mode: 0644]
sound/pianod/patches/005-Fix_IPV6_socket_handling.patch [new file with mode: 0644]
sound/pianod/patches/010-Configure_add_SSL_options.patch [new file with mode: 0644]
sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch [new file with mode: 0644]
sound/pianod/patches/030-Waitress_add_polarssl_variant.patch [new file with mode: 0644]
sound/pulseaudio/Makefile
utils/avrdude/Makefile [new file with mode: 0644]
utils/avrdude/patches/010-configure-fixups.patch [new file with mode: 0644]
utils/bluez/Makefile
utils/bluez/files/bluetooth.config
utils/bluez/files/bluetoothd.init [new file with mode: 0644]
utils/bluez/files/bluez-utils.init [deleted file]
utils/bluez/patches/201-readline.patch
utils/btrfs-progs/Makefile
utils/btrfs-progs/patches/001-fix-xattr-h-include-location.patch
utils/bzip2/Makefile
utils/cryptsetup/Makefile
utils/dbus/Makefile
utils/dosfstools/Makefile
utils/haserl/Makefile
utils/hfsprogs/Makefile [new file with mode: 0644]
utils/hfsprogs/files/hfsfsck.sh [new file with mode: 0644]
utils/hfsprogs/patches/0001-Create-short-Makefiles-for-Debian.patch [new file with mode: 0644]
utils/hfsprogs/patches/0002-Add-exclude-Darwin-specific-code.patch [new file with mode: 0644]
utils/hfsprogs/patches/0003-Add-helper-include-files-absent-from-the-upstream-pa.patch [new file with mode: 0644]
utils/hfsprogs/patches/0004-Fix-compilation-on-64-bit-arches.patch [new file with mode: 0644]
utils/hfsprogs/patches/0005-Remove-Apple-specific-p-from-strings.patch [new file with mode: 0644]
utils/hfsprogs/patches/0006-Adjust-types-for-printing.patch [new file with mode: 0644]
utils/hfsprogs/patches/0007-Fix-path-for-HFS-wrapper-block.patch [new file with mode: 0644]
utils/hfsprogs/patches/0008-Provide-command-line-option-a.patch [new file with mode: 0644]
utils/hfsprogs/patches/0009-Rename-dprintf-to-dbg_printf.patch [new file with mode: 0644]
utils/hfsprogs/patches/0010-Rename-custom-macro-nil-with-NULL.patch [new file with mode: 0644]
utils/hfsprogs/patches/0011-Fix-types.patch [new file with mode: 0644]
utils/hfsprogs/patches/0012-Fix-mkfs-not-creating-UUIDs-for-new-filesystems.patch [new file with mode: 0644]
utils/hfsprogs/patches/0013-Fix-manpages.patch [new file with mode: 0644]
utils/hfsprogs/patches/0014-uClibc_no_loadavg.patch [new file with mode: 0644]
utils/lvm2/Makefile
utils/lvm2/patches/001-include_fix.patch
utils/lvm2/patches/002-const-stdio.patch [new file with mode: 0644]
utils/lvm2/patches/003-no-mallinfo.patch [new file with mode: 0644]
utils/lxc/Makefile
utils/lxc/patches/030-lxc-download.patch [new file with mode: 0644]
utils/lxc/patches/300-fix-lxc-destroy.patch [deleted file]
utils/lxc/patches/300-lxc-destroy.patch [new file with mode: 0644]
utils/mc/Makefile
utils/mmc-utils/Makefile
utils/mmc-utils/patches/001-dont-set-fortify-source-in-makefile.patch [deleted file]
utils/mmc-utils/patches/001-properly-set-fortify-source-in-makefile.patch [new file with mode: 0644]
utils/mysql/Makefile
utils/nano/Makefile
utils/ntfs-3g/patches/001-fuseint-fix-path-mounted-on-musl.patch [new file with mode: 0644]
utils/open-plc-utils/Makefile
utils/openocd/Makefile
utils/pciutils/Makefile
utils/sumo/Makefile
utils/sumo/files/sumo.sh
utils/sumo/patches/100-configure_fix.patch [new file with mode: 0644]
utils/tmux/patches/200-usr-local.patch [new file with mode: 0644]
utils/unrar/Makefile
utils/usbmuxd/Makefile
utils/xz/Makefile [new file with mode: 0644]
utils/zoneinfo/Makefile

index dd33d776b5b33138c6892fd49564a96fe7ed1ae4..930b6f0dd0e70ff82042b66747e6998b4aeb9780 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,10 +2,14 @@
 
 ## Description
 
-This is the OpenWrt "packages"-feed containing community-maintained packages.
+This is the OpenWrt "packages"-feed containing community-maintained build scripts, options and patches for applications, modules and libraries used within OpenWrt.
+
+Installation of pre-built packages is handled directly by the **opkg** utility within your running OpenWrt system or by using the [OpenWrt SDK](http://doc/howto/obtain.firmware.sdk) on a build system.
 
 ## Usage
 
+This repository is intended to be layered on-top of an OpenWrt buildroot. If you do not have an OpenWrt buildroot installed, see the documentation at: [OpenWrt Buildroot – Installation](http://wiki.openwrt.org/doc/howto/buildroot.exigence) on the OpenWrt support site.
+
 This feed is enabled by default. To install all its package definitions, run:
 ```
 ./scripts/feeds update packages
index f2e18d5d8554b748254f04ba45d73475bb276572..a55ba353f51d094dff5f47a62fd353fb1f84dd05 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=debootstrap
-PKG_VERSION:=1.0.66
+PKG_VERSION:=1.0.67
 PKG_RELEASE:=1
 PKG_MAINTAINER=Daniel Golle <daniel@makrotopia.org>
 
 PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
-PKG_MD5SUM:=bf6370ea0aa80308dfb03a4a35e33ad1
+PKG_MD5SUM:=e7854d4b10ab860f08921525406debdd
 PKG_LICENSE:=Unique
 PKG_LICENSE_FILES:=debian/copyright
 
index 9d5570f9ecb848f1bcab532c9b8884d12f192f1b..b14b2225791bd020c3b292847a1b08a0cdce4f45 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=monit
-PKG_VERSION:=5.12.1
+PKG_VERSION:=5.12.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mmonit.com/monit/dist
-PKG_MD5SUM:=1ffde79207270925f6f7df787d19100a
+PKG_MD5SUM:=5f5cf4c18b42e8091b49b4e07cf972ce
 
 PKG_LICENSE:=AGPL-3.0
 PKG_LICENSE_FILES:=COPYING
index 1c1793edd82e0c6735d0337baf0e9fbb57322e55..46fc8c4f89aced9621f26ddba8aa6dba8a10b35f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=muninlite
 PKG_VERSION:=1.0.4
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
diff --git a/admin/muninlite/patches/220-modify-ifname-parser.patch b/admin/muninlite/patches/220-modify-ifname-parser.patch
new file mode 100644 (file)
index 0000000..95655cf
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/plugins/if_
++++ b/plugins/if_
+@@ -26,7 +26,7 @@ config_if() {
+   fi
+ }
+ fetch_if() {
+-  IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/  / /g')
++  IINFO=$(cat /proc/net/dev | sed -e 's/-/_/g' | grep "$1:" | cut -d: -f2 | sed -e 's/  */ /g' -e 's/^[ \t]*//')
+   echo "down.value" $(echo $IINFO | cut -d\  -f1)
+   echo "up.value" $(echo $IINFO | cut -d\  -f9)
+ }
+--- a/plugins/if_err_
++++ b/plugins/if_err_
+@@ -15,7 +15,7 @@ config_if_err() {
+   echo "trans.warning 1"
+ }
+ fetch_if_err() {
+-  IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/  / /g')
++  IINFO=$(cat /proc/net/dev | sed -e 's/-/_/g' | grep "$1:" | cut -d: -f2 | sed -e 's/  */ /g' -e 's/^[ \t]*//')
+   echo "rcvd.value" $(echo $IINFO | cut -d\  -f3)
+   echo "trans.value" $(echo $IINFO | cut -d\  -f11)
+ }
index 25a0ff348cbd5649476fd365de773868ebb05543..69ace6060f200287767875138eca627fb2753daa 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sudo
-PKG_VERSION:=1.8.12
+PKG_VERSION:=1.8.13
 PKG_RELEASE:=1
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=doc/LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.sudo.ws/sudo/dist
-PKG_MD5SUM:=87558f3a55c62bc9244b19594f103ffa
+PKG_MD5SUM:=f61577ec330ad1bd504c0e2eec6ea2d8
 
 PKG_INSTALL:=1
 
index 250d2f913393d6240295b4876a8feaaeb8669771..6315ea995b2fa17e7bb6e401941c92e618902b1b 100644 (file)
@@ -3,7 +3,7 @@
 # wifi interface discovery
 # exemple: {"data":[{"{#IF}":"wlan0", "{#MODE}":"ap", "{#SSID}":"Openwrt", "{#NET}":"lan", "{#DEV}":"radio0", "{#ENC}":"psk2+ccmp", "{#TYPE}":"mac80211", "{#HWMODE}":"11ng", "{#CHANNEL}":"11", "{#BSSID}":"xx:xx:xx:xx:xx:xx"}]}
 # ubus call only work as root so you need to run zabbix as root to use wifi.ifdiscovery
-UserParameter=wifi.ifdiscovery, lua -l uci -l ubus -l iwinfo -e 'u = ubus.connect();x = uci.cursor();list="{\"data\":[";stat=u:call("network.wireless", "status", {});for dev, dev_table in pairs(stat) do for i, iface in pairs(dev_table["interfaces"]) do s=iface["section"];list=list.."{\"{#IF}\":\""..iface["ifname"].."\", \"{#MODE}\":\""..x:get("wireless", s, "mode").."\", \"{#SSID}\":\""..x:get("wireless", s, "ssid").."\", \"{#NET}\":\""..x:get("wireless", s, "network").."\", \"{#DEV}\":\""..dev.."\", \"{#ENC}\":\""..(x:get("wireless", s, "encryption") or "?").."\", \"{#TYPE}\":\""..x:get("wireless", dev, "type").."\", \"{#HWMODE}\":\""..x:get("wireless", dev, "hwmode").."\", \"{#CHANNEL}\":\""..x:get("wireless", dev, "channel").."\", \"{#BSSID}\":\""..iwinfo[iwinfo.type(iface["ifname"])].bssid(iface["ifname"]).."\"},";end;end;list=string.gsub(list,",$","");print(list.."]}")'
+UserParameter=wifi.ifdiscovery, lua -l ubus -l iwinfo -e 'u=ubus.connect();list="{\"data\":[";stat=u:call("network.wireless", "status", {});for dev, dev_table in pairs(stat) do for i, iface in pairs(dev_table["interfaces"]) do c=iface["config"];i=iface["ifname"];t=iwinfo.type(i);iw=iwinfo[t];e = iw.encryption(i);e = e and e.description or "None";n = table.concat(c["network"]," ");list=list.."{\"{#IF}\":\""..i.."\", \"{#MODE}\":\""..iw.mode(i).."\", \"{#SSID}\":\""..c["ssid"].."\", \"{#NET}\":\""..n.."\", \"{#DEV}\":\""..dev.."\", \"{#ENC}\":\""..e.."\", \"{#TYPE}\":\""..t.."\", \"{#HWMODE}\":\"".."?".."\", \"{#CHANNEL}\":\""..iw.channel(i).."\", \"{#BSSID}\":\""..iw.bssid(i).."\"},";end;end;list=string.gsub(list,",$","");print(list.."]}")'
 
 
 #iwinfo info (you need {#IF} as parameter, like 'wlan0')
index 1fcfa73da3e4c2708016d4a2259cda4a4e9870f5..355f325035a5b88e275731a75543887001dac8ed 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lttng-modules
 PKG_VERSION:=2.6.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/
diff --git a/devel/lttng-modules/patches/001-mm_page_alloc_extfrag.patch b/devel/lttng-modules/patches/001-mm_page_alloc_extfrag.patch
new file mode 100644 (file)
index 0000000..183f7d1
--- /dev/null
@@ -0,0 +1,98 @@
+--- a/instrumentation/events/lttng-module/kmem.h
++++ b/instrumentation/events/lttng-module/kmem.h
+@@ -286,7 +286,94 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT(mm
+               __entry->order, __entry->migratetype)
+ )
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2)     \
++      || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \
++      || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0))
++
++LTTNG_TRACEPOINT_EVENT(mm_page_alloc_extfrag,
++
++      TP_PROTO(struct page *page,
++              int alloc_order, int fallback_order,
++              int alloc_migratetype, int fallback_migratetype),
++
++      TP_ARGS(page,
++              alloc_order, fallback_order,
++              alloc_migratetype, fallback_migratetype),
++
++      TP_STRUCT__entry(
++              __field_hex(    struct page *,  page                    )
++              __field(        int,            alloc_order             )
++              __field(        int,            fallback_order          )
++              __field(        int,            alloc_migratetype       )
++              __field(        int,            fallback_migratetype    )
++              __field(        int,            change_ownership        )
++      ),
++
++      TP_fast_assign(
++              tp_assign(page, page)
++              tp_assign(alloc_order, alloc_order)
++              tp_assign(fallback_order, fallback_order)
++              tp_assign(alloc_migratetype, alloc_migratetype)
++              tp_assign(fallback_migratetype, fallback_migratetype)
++              tp_assign(change_ownership,
++                      (alloc_migratetype == get_pageblock_migratetype(page)))
++      ),
++
++      TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d",
++              __entry->page,
++              page_to_pfn(__entry->page),
++              __entry->alloc_order,
++              __entry->fallback_order,
++              pageblock_order,
++              __entry->alloc_migratetype,
++              __entry->fallback_migratetype,
++              __entry->fallback_order < pageblock_order,
++              __entry->change_ownership)
++)
++
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,30))
++
++LTTNG_TRACEPOINT_EVENT(mm_page_alloc_extfrag,
++
++      TP_PROTO(struct page *page,
++              int alloc_order, int fallback_order,
++              int alloc_migratetype, int fallback_migratetype, int new_migratetype),
++
++      TP_ARGS(page,
++              alloc_order, fallback_order,
++              alloc_migratetype, fallback_migratetype, new_migratetype),
++
++      TP_STRUCT__entry(
++              __field_hex(    struct page *,  page                    )
++              __field(        int,            alloc_order             )
++              __field(        int,            fallback_order          )
++              __field(        int,            alloc_migratetype       )
++              __field(        int,            fallback_migratetype    )
++              __field(        int,            change_ownership        )
++      ),
++
++      TP_fast_assign(
++              tp_assign(page, page)
++              tp_assign(alloc_order, alloc_order)
++              tp_assign(fallback_order, fallback_order)
++              tp_assign(alloc_migratetype, alloc_migratetype)
++              tp_assign(fallback_migratetype, fallback_migratetype)
++              tp_assign(change_ownership, (new_migratetype == alloc_migratetype))
++      ),
++
++      TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d",
++              __entry->page,
++              page_to_pfn(__entry->page),
++              __entry->alloc_order,
++              __entry->fallback_order,
++              pageblock_order,
++              __entry->alloc_migratetype,
++              __entry->fallback_migratetype,
++              __entry->fallback_order < pageblock_order,
++              __entry->change_ownership)
++)
++
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+ LTTNG_TRACEPOINT_EVENT(mm_page_alloc_extfrag,
index b7119a485669afc6d87939938ddccdda3c694d95..d705a30a1ed608c186e062cab1e234f8e3e7fb2c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=patch
-PKG_VERSION:=2.7.4
+PKG_VERSION:=2.7.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/patch
-PKG_MD5SUM:=abc59498fcdddd44e0d07764aa105fd2
+PKG_MD5SUM:=e3da7940431633fb65a01b91d3b7a27a
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 
index dc4c31670a21572b1ca1bd1e8beb42fcb65aa589..2423f374dd4bc1439c0b0e05e9f630ec5bf5077a 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=erlang
-PKG_VERSION:=17.4
+PKG_VERSION:=17.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= http://www.erlang.org/download/ \
        http://erlang.mirror.su.se/
-PKG_MD5SUM:=3d33c4c6bd7950240dcd7479edd9c7d8
+PKG_MD5SUM:=346dd0136bf1cc28cebc140e505206bb
 
 PKG_LICENSE:=ErlPL-1.1
 PKG_LICENSE_FILES:=EPLICENCE
@@ -45,7 +45,7 @@ endef
 define Package/erlang
 $(call Package/erlang/Default)
   DEPENDS+= +libncurses +librt +zlib
-  PROVIDES:= erlang-erts=6.1 erlang-kernel=3.0.1 erlang-sasl=2.4 erlang-stdlib=2.1
+  PROVIDES:= erlang-erts=6.4 erlang-kernel=3.2 erlang-sasl=2.4.1 erlang-stdlib=2.4
 endef
 
 define Package/erlang/description
@@ -59,7 +59,7 @@ endef
 define Package/erlang-asn1
 $(call Package/erlang/Default)
   TITLE:=Abstract Syntax Notation One (ASN.1) support
-  VERSION:=3.0.1
+  VERSION:=3.0.4
   DEPENDS+= +erlang +erlang-syntax-tools
 endef
 
@@ -74,7 +74,7 @@ endef
 define Package/erlang-compiler
 $(call Package/erlang/Default)
   TITLE:=Byte code compiler
-  VERSION:=5.0.1
+  VERSION:=5.0.4
   DEPENDS+= +erlang +erlang-hipe
 endef
 
@@ -89,7 +89,7 @@ endef
 define Package/erlang-crypto
 $(call Package/erlang/Default)
   TITLE:=Cryptography support
-  VERSION:=3.4
+  VERSION:=3.5
   DEPENDS+= +erlang +libopenssl
 endef
 
@@ -104,7 +104,7 @@ endef
 define Package/erlang-hipe
 $(call Package/erlang/Default)
   TITLE:=High Performance Erlang
-  VERSION:=3.11
+  VERSION:=3.11.3
   DEPENDS+= +erlang
 endef
 
@@ -119,7 +119,7 @@ endef
 define Package/erlang-inets
 $(call Package/erlang/Default)
   TITLE:=Internet clients and servers
-  VERSION:=5.10.2
+  VERSION:=5.10.6
   DEPENDS+= +erlang
 endef
 
@@ -135,7 +135,7 @@ endef
 define Package/erlang-mnesia
 $(call Package/erlang/Default)
   TITLE:=Distributed database
-  VERSION:=4.12.1
+  VERSION:=4.12.5
   DEPENDS+= +erlang
 endef
 
@@ -152,7 +152,7 @@ endef
 define Package/erlang-runtime-tools
 $(call Package/erlang/Default)
   TITLE:=Low-profile debugging/tracing tools
-  VERSION:=1.8.14
+  VERSION:=1.8.16
   DEPENDS+= +erlang
 endef
 
@@ -167,7 +167,7 @@ endef
 define Package/erlang-snmp
 $(call Package/erlang/Default)
   TITLE:=Simple Network Management Protocol (SNMP) support
-  VERSION:=4.25.1
+  VERSION:=5.1.1
   DEPENDS+= +erlang +erlang-asn1
 endef
 
@@ -183,7 +183,7 @@ endef
 define Package/erlang-ssh
 $(call Package/erlang/Default)
   TITLE:=Secure Shell (SSH) support
-  VERSION:=3.0.3
+  VERSION:=3.2
   DEPENDS+= +erlang +erlang-crypto
 endef
 
@@ -198,7 +198,7 @@ endef
 define Package/erlang-ssl
 $(call Package/erlang/Default)
   TITLE:=Secure Sockets Layer (SSL) support
-  VERSION:=5.3.5
+  VERSION:=6.0
   DEPENDS+= +erlang +erlang-crypto
 endef
 
@@ -213,7 +213,7 @@ endef
 define Package/erlang-syntax-tools
 $(call Package/erlang/Default)
   TITLE:=Abstract Erlang syntax trees handling support
-  VERSION:=1.6.15
+  VERSION:=1.6.18
   DEPENDS+= +erlang
 endef
 
@@ -300,9 +300,9 @@ endef
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/obj/*/*.a $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/obj/*/*.a $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/include/*.h $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/include/*.h $(1)/usr/include/
 endef
 
 define BuildModule
diff --git a/lang/lpeg/Makefile b/lang/lpeg/Makefile
new file mode 100644 (file)
index 0000000..ee8a4ef
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lpeg
+PKG_VERSION:=0.12.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
+PKG_MD5SUM:=fabb614eb46e370d4f6b8fd82d17ca7e
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lpeg
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LPeg
+  URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
+  DEPENDS:=+lua
+endef
+
+define Package/lpeg/description
+       LPeg is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs)
+endef
+
+define Build/Configure
+endef
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Package/lpeg/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lpeg.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lpeg))
diff --git a/lang/lua-cjson/Makefile b/lang/lua-cjson/Makefile
new file mode 100644 (file)
index 0000000..fd489f2
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-cjson
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.kyne.com.au/~mark/software/download/
+PKG_MD5SUM:=24f270663e9f6ca8ba2a02cef19f7963
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lua-cjson
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua CJSON parser
+  URL:=https://github.com/mpx/lua-cjson
+  DEPENDS:= +lua +libzmq
+endef
+
+define Package/lua-cjson/description
+  Lua CJSON is a fast JSON encoding/parsing module for Lua.
+endef
+
+CMAKE_OPTIONS += \
+       -DUSE_LUA=ON
+
+define Package/lua-cjson/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/cjson
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/lua/cjson/util.lua $(1)/usr/lib/lua/cjson
+endef
+
+$(eval $(call BuildPackage,lua-cjson))
diff --git a/lang/lua-copas/Makefile b/lang/lua-copas/Makefile
new file mode 100644 (file)
index 0000000..4f073e2
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-copas
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/copas.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=f39a80add9f7c010ac979297652bbaaea0360a27
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-copas
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Copas
+  URL:=https://github.com/keplerproject/copas
+  DEPENDS:=+lua
+endef
+
+define Package/lua-copas/description
+  Copas is a dispatcher based on coroutines that can be used by TCP/IP servers.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               T="$(BUILD_VARIANT)" \
+               PREFIX="$(PKG_INSTALL_DIR)/usr" \
+               install
+endef
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Package/lua-copas/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas.lua $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/ftp.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/smtp.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/http.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/limit.lua $(1)/usr/lib/lua/copas
+endef
+
+$(eval $(call BuildPackage,lua-copas))
diff --git a/lang/lua-copas/patches/makefile.patch b/lang/lua-copas/patches/makefile.patch
new file mode 100644 (file)
index 0000000..10e4734
--- /dev/null
@@ -0,0 +1,15 @@
+--- lua-copas-1.2.1_org/Makefile       2014-06-04 16:39:17.451563827 +0800
++++ lua-copas-1.2.1/Makefile   2014-06-04 16:39:41.115563309 +0800
+@@ -1,10 +1,10 @@
+ # $Id: Makefile,v 1.3 2007/10/29 22:50:16 carregal Exp $
+ # Default prefix
+-PREFIX = /usr/local
++PREFIX ?= $(DESTDIR)/usr
+ # System's lua directory (where Lua libraries are installed)
+-LUA_DIR= $(PREFIX)/share/lua/5.1
++LUA_DIR= $(PREFIX)/lib/lua
+ install:
+       mkdir -p $(LUA_DIR)/copas
diff --git a/lang/lua-coxpcall/Makefile b/lang/lua-coxpcall/Makefile
new file mode 100644 (file)
index 0000000..6ca3ff8
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-coxpcall
+PKG_VERSION:=1.15.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/coxpcall.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=979257892884816c97391dfd7b0a7b30dcc8f479
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-coxpcall
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Coxpcall
+  URL:=https://github.com/keplerproject/coxpcall
+  DEPENDS:=+lua
+endef
+
+define Package/lua-coxpcall/description
+  Coxpcall encapsulates the protected calls with a coroutine based loop,
+  so errors can be dealed without the usual pcall/xpcall issues with coroutines.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               T="$(BUILD_VARIANT)" \
+               LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               install
+endef
+
+define Package/lua-coxpcall/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/coxpcall.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-coxpcall))
diff --git a/lang/lua-coxpcall/patches/config.patch b/lang/lua-coxpcall/patches/config.patch
new file mode 100644 (file)
index 0000000..2a1dbfd
--- /dev/null
@@ -0,0 +1,4 @@
+--- lua-coxpcall-1.15.0_org/config     1970-01-01 08:00:00.000000000 +0800
++++ lua-coxpcall-1.15.0/config 2014-06-04 16:51:55.487547258 +0800
+@@ -0,0 +1 @@
++LUA_DIR ?=$(DESTDIR)/usr/lib/lua
diff --git a/lang/lua-lzlib/Makefile b/lang/lua-lzlib/Makefile
new file mode 100644 (file)
index 0000000..4b94687
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-lzlib
+PKG_VERSION:=0.4.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/LuaDist/lzlib.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=9fa3993bb4504fbbc10511cde141e1c6a48c072d
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-lzlib
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua zlib binding
+  URL:=http://github.com/LuaDist/lzlib
+  DEPENDS:= +lua +zlib
+endef
+
+define Package/lua-lzlib/description
+       A library to access zlib library functions and also to read/write gzip files using an interface similar to the base io package. 
+endef
+
+define Build/Install
+endef
+
+define Package/lua-lzlib/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/zlib.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/gzip.lua $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-lzlib))
diff --git a/lang/lua-md5/Makefile b/lang/lua-md5/Makefile
new file mode 100644 (file)
index 0000000..36e0d9d
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-md5
+PKG_VERSION:=1.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/md5.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=024b65738b4434860777fc43d7cacaefea29ec60
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-md5
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-MD5
+  URL:=https://github.com/keplerproject/md5
+  DEPENDS:=+lua
+endef
+
+define Package/lua-md5/description
+  MD5 offers basic cryptographic facilities for Lua
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               PREFIX="$(STAGING_DIR)/usr" \
+               LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
+               clean
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               PREFIX="$(STAGING_DIR)/usr" \
+               LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
+               LIB_OPTION="-shared" \
+               CC="$(TARGET_CROSS)gcc" \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+               all
+endef
+
+define Build/Install
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               LUA_LIBDIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               install
+endef
+
+define Package/lua-md5/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/md5.lua $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/md5
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/core.so $(1)/usr/lib/lua/md5/core.so
+endef
+
+$(eval $(call BuildPackage,lua-md5))
diff --git a/lang/lua-md5/patches/config.patch b/lang/lua-md5/patches/config.patch
new file mode 100644 (file)
index 0000000..abea3a8
--- /dev/null
@@ -0,0 +1,19 @@
+--- lua-md5-1.2/config 2014-06-04 16:55:50.000000000 +0800
++++ lua-md5-1.2_new/config     2014-06-04 16:57:54.223539416 +0800
+@@ -1,13 +1,13 @@
+ # Installation directories
+ # Default prefix
+-PREFIX = /usr/local
++PREFIX = /usr
+ # System's libraries directory (where binary libraries are installed)
+-LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
++LUA_LIBDIR= $(PREFIX)/lib/lua
+ # System's lua directory (where Lua libraries are installed)
+-LUA_DIR= $(PREFIX)/share/lua/5.1
++LUA_DIR= $(PREFIX)/lib/lua
+ # Lua includes directory
+ LUA_INC= $(PREFIX)/include
diff --git a/lang/lua-md5/patches/makefile.patch b/lang/lua-md5/patches/makefile.patch
new file mode 100644 (file)
index 0000000..89a2e33
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/Makefile.orig    2014-06-04 17:16:40.083514808 +0800
++++ b/Makefile 2014-06-04 17:17:27.111513780 +0800
+@@ -1,6 +1,6 @@
+ # $Id: Makefile,v 1.7 2007/10/11 00:02:56 carregal Exp $
+-CONFIG= ./config
++CFLAGS+= -fPIC
+ include $(CONFIG)
diff --git a/lang/lua-mobdebug/Makefile b/lang/lua-mobdebug/Makefile
new file mode 100644 (file)
index 0000000..3d11539
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-mobdebug
+PKG_VERSION:=0.61
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/pkulchenko/MobDebug.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=9a03aa59696647ba3b7f9ae2f29a9f28532a4feb
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-mobdebug
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-MobDebug
+  URL:=https://github.com/pkulchenko/MobDebug
+  DEPENDS:=+lua
+endef
+
+define Package/lua-mobdebug/description
+  MobDebug is a remote debugger for Lua (including Lua 5.1, Lua 5.2, Lua 5.3, and LuaJIT 2.x).
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Package/lua-mobdebug/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/mobdebug.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-mobdebug))
index e06f4c25b7bcb527c27da115bda8343d6c5a9834..89192e29af05edbbb12068987c83d4322c9656bc 100644 (file)
@@ -8,11 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lua-penlight
-PKG_VERSION:=1.3.1
+PKG_VERSION:=1.3.2
 PKG_RELEASE:=1
 PKG_BUILD_DIR:=$(BUILD_DIR)/Penlight-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/stevedonovan/Penlight/archive/
+PKG_MD5SUM:=0315a39834bb6fab07741ec04ede1bf4
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILE:=LICENSE.md
 
diff --git a/lang/lua-rings/Makefile b/lang/lua-rings/Makefile
new file mode 100644 (file)
index 0000000..9b39c96
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-rings
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/rings.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=2b8a900f8b9dbde304859a3ac9d437795c3fdde3
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-rings
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Rings
+  URL:=http://www.inf.puc-rio.br/~roberto/lua-rings/
+  DEPENDS:=+lua
+endef
+
+define Package/lua-rings/description
+  Rings is a library which provides a way to create new Lua states from within Lua.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Package/lua-rings/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/rings.so $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/stable.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-rings))
diff --git a/lang/lua-rings/patches/config.patch b/lang/lua-rings/patches/config.patch
new file mode 100644 (file)
index 0000000..5740fae
--- /dev/null
@@ -0,0 +1,28 @@
+--- lua-rings-1.3.0_org/config 2014-06-04 15:24:24.223662038 +0800
++++ lua-rings-1.3.0/config     2014-06-04 16:16:15.183594040 +0800
+@@ -1,15 +1,15 @@
+ # Installation directories
+ # Default prefix
+-PREFIX ?= /usr/local
++PREFIX ?= /usr
+ DESTDIR ?= /
+ # System's libraries directory (where binary libraries are installed)
+-LUA_LIBDIR ?= $(PREFIX)/lib/lua/5.1
++LUA_LIBDIR ?= $(PREFIX)/lib/lua
+ # System's lua directory (where Lua libraries are installed)
+-LUA_DIR ?= $(PREFIX)/share/lua/5.1
++LUA_DIR ?= $(PREFIX)/lib/lua
+ # Lua includes directory
+ LUA_INC ?= $(PREFIX)/include
+@@ -24,6 +24,5 @@
+ WARN ?= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -Wpointer-arith -pedantic
+ INCS ?= -I$(LUA_INC)
+ CFLAGS ?= $(WARN) $(INCS)
+-CC ?= gcc
+ # $Id: config,v 1.7 2007/10/29 22:51:39 carregal Exp $
diff --git a/lang/lua-rings/patches/makefile.patch b/lang/lua-rings/patches/makefile.patch
new file mode 100644 (file)
index 0000000..8bb0551
--- /dev/null
@@ -0,0 +1,11 @@
+--- lua-rings-1.3.0_org/Makefile       2014-06-04 15:24:37.583661746 +0800
++++ lua-rings-1.3.0/Makefile   2014-06-04 15:23:41.611662970 +0800
+@@ -3,6 +3,8 @@
+ T= rings
+ CONFIG= ./config
++CFLAGS+= -fPIC
++
+ include $(CONFIG)
+ SRCS= src/rings.c
diff --git a/lang/lua-rs232/Makefile b/lang/lua-rs232/Makefile
new file mode 100644 (file)
index 0000000..7ef5ac7
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-rs232
+PKG_VERSION:=1.0.3
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-rs232
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua Serial Library
+  URL:=https://github.com/srdgame/librs232
+  DEPENDS:= +lua
+endef
+
+define Package/lua-rs232/description
+  multiplatform library for serial communications over RS-232
+endef
+
+CONFIGURE_ARGS += \
+       --with-lua-inc=$(STAGING_DIR)/usr/include \
+       --with-lua-lib=$(STAGING_DIR)/usr/lib
+
+#define Build/Configure
+#      ( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
+#      $(call Build/Configure/Default)
+#endef
+define Build/Configure
+endef
+
+define Build/Compile
+       (cd "$(PKG_BUILD_DIR)"; $(TARGET_CC)  src/rs232.c src/rs232_posix.c bindings/lua/luars232.c -DLUAROCKS_HACK -std=gnu99 -I./include -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib -fPIC -shared -o luars232.so)
+endef
+
+define Build/Install
+endef
+
+define Package/lua-rs232/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/luars232.so $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-rs232))
diff --git a/lang/lua-wsapi/Makefile b/lang/lua-wsapi/Makefile
new file mode 100644 (file)
index 0000000..b382ad6
--- /dev/null
@@ -0,0 +1,95 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-wsapi
+PKG_VERSION:=1.6.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/wsapi.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=eed8338401196cc155e59280adbe58d78933ead0
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-wsapi/Default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua WSAPI
+  URL:=http://www.keplerproject.org/wsapi
+  DEPENDS:= +lua
+endef
+
+define Package/lua-wsapi/Default/description
+  WSAPI is an API that abstracts the web server from Lua web applications
+endef
+
+
+define Package/lua-wsapi-base
+$(call Package/lua-wsapi/Default)
+  TITLE+= base
+  DEPENDS+= +luafilesystem
+  VARIANT:=base
+endef
+
+define Package/lua-wsapi-base/description
+$(call Package/lua-wsapi/Default/description)
+ .
+ This package contains the basic stuff.
+endef
+
+define Package/lua-wsapi-xavante
+$(call Package/lua-wsapi/Default)
+  TITLE+= xavante
+  DEPENDS+= +lua-wsapi-base +lua-xavante
+  VARIANT:=xavante
+endef
+
+define Package/lua-wsapi-xavante/description
+$(call Package/lua-wsapi/Default/description)
+ .
+ This package contains the Xavante stuff.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+define Package/lua-wsapi-base/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi.lua $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/launcher/wsapi.cgi $(1)/usr/bin
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/wsapi
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi/{common,request,response,util,cgi,sapi,ringer,mock}.lua $(1)/usr/lib/lua/wsapi
+endef
+
+define Package/lua-wsapi-xavante/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/launcher/wsapi $(1)/usr/bin
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/wsapi
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi/xavante.lua $(1)/usr/lib/lua/wsapi
+endef
+
+
+$(eval $(call BuildPackage,lua-wsapi-base))
+$(eval $(call BuildPackage,lua-wsapi-xavante))
diff --git a/lang/lua-xavante/Makefile b/lang/lua-xavante/Makefile
new file mode 100644 (file)
index 0000000..13b66ee
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-xavante
+PKG_VERSION:=2.3.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/xavante.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=9825b905133e14d37a4c179f2d02367ab93f1ef6
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-xavante
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Xavante Web Server
+  URL:=http://www.keplerproject.org/xavante
+  DEPENDS:= +lua
+endef
+
+define Package/lua-xavante/description
+  Xavante is a Lua HTTP 1.1 Web server that uses a modular architecture based on URI mapped handlers.
+endef
+
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+define Package/lua-xavante/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/sajax/sajax.lua $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/xavante/xavante.lua $(1)/usr/lib/lua
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/xavante
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/xavante/{cgiluahandler,encoding,filehandler,httpd,mime,patternhandler,redirecthandler,vhostshandler,indexhandler,urlhandler,ruleshandler}.lua $(1)/usr/lib/lua/xavante
+endef
+
+$(eval $(call BuildPackage,lua-xavante))
index ceb70772964cc14a7dd39152747fde29cda9243d..5e7c98300fd3988c15d5291312e846ea5b3ac055 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=luasocket
 PKG_SOURCE_VERSION:=6d5e40c324c84d9c1453ae88e0ad5bdd0a631448
 PKG_VERSION:=3.0-rc1-20130909
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/diegonehab/luasocket.git
@@ -56,6 +56,7 @@ define Package/luasocket/install
        ln -sf ../mime.so.1.0.3 $(1)/usr/lib/lua/mime/core.so
        $(INSTALL_DIR) $(1)/usr/lib/lua/socket
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ftp,http,smtp,tp,url,headers}.lua $(1)/usr/lib/lua/socket
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/unix.so $(1)/usr/lib/lua/socket
        ln -sf ../socket.so.3.0-rc1 $(1)/usr/lib/lua/socket/core.so
 endef
 
diff --git a/lang/lzmq/Makefile b/lang/lzmq/Makefile
new file mode 100644 (file)
index 0000000..bc1587e
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lzmq
+PKG_VERSION:=0.4.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
+PKG_SOURCE_URL:=https://codeload.github.com/zeromq/lzmq/zip/v0.4.2?
+PKG_MD5SUM:=6789895c925e7eb9036e526181ec1a33
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lzmq
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua ZeroMQ binding
+  URL:=https://github.com/moteus/lzmq/
+  DEPENDS:= +lua +libzmq
+endef
+
+define Package/lzmq/description
+ LZMQ is a Lua binding to ZeroMQ.
+endef
+
+CMAKE_OPTIONS += \
+       -DUSE_LUA=ON
+
+define Package/lzmq/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lzmq.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/lzmq
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lzmq/timer.so $(1)/usr/lib/lua/lzmq
+       $(CP) -R $(PKG_BUILD_DIR)/src/lua/lzmq/* $(1)/usr/lib/lua/lzmq
+endef
+
+$(eval $(call BuildPackage,lzmq))
index ccb55f4a55a1289a08b65d4af963ba85b46b3dfd..1092b5cde90ef04a5676148c6b8de90c212c6681 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
-PKG_VERSION:=5.6.6
+PKG_VERSION:=5.6.7
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
@@ -18,7 +18,7 @@ PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=b198117ee1d44c8143e030cee15f1b52
+PKG_MD5SUM:=2e4b0534d4b8aa9aabedeef12e7c0aa8
 
 PKG_FIXUP:=libtool autoreconf
 PKG_BUILD_PARALLEL:=1
diff --git a/lang/python-yaml/Makefile b/lang/python-yaml/Makefile
new file mode 100644 (file)
index 0000000..3af2f0e
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=PyYAML
+PKG_VERSION:=3.11
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pyyaml.org/download/pyyaml/
+PKG_MD5SUM:=f50e08ef0fe55178479d3a618efe21db
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DEPENDS:=python
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-yaml
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=YAML parser and emitter for Python
+  URL:=http://pyyaml.org/wiki/PyYAML
+  DEPENDS:=+python +libyaml
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,\
+               --with-libyaml install --prefix="$(PKG_INSTALL_DIR)/usr" \
+       )
+endef
+
+$(eval $(call PyPackage,python-yaml))
+$(eval $(call BuildPackage,python-yaml))
index 04751ef8373849bdb0c641e04b6c9a6ca396e598..bab9415593a866edfdc08b2f6749173da31080db 100644 (file)
@@ -8,7 +8,7 @@
 define Package/python-ncurses
 $(call Package/python/Default)
   TITLE:=Python $(PYTHON_VERSION) ncurses module
-  DEPENDS:=+python-light +libncursesw
+  DEPENDS:=+python-light +libncurses
 endef
 
 $(eval $(call PyBasePackage,python-ncurses, \
index 6936a0748bd2953d968b05bae7002c87a2fca170..4895b91a1748d8ad7f60918e490364bf4354fb72 100644 (file)
@@ -33,6 +33,13 @@ define HostPython
        )
 endef
 
+# These configure args are needed in detection of path to Python header files
+# using autotools.
+CONFIGURE_ARGS += \
+       _python_sysroot="$(STAGING_DIR)" \
+       _python_prefix="/usr" \
+       _python_exec_prefix="/usr"
+
 PKG_USE_MIPS16:=0
 # This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
 # flags are inherited from the Python base package (via sysconfig module)
diff --git a/lang/python/patches/011-do-not-prefer-ncursesw.patch b/lang/python/patches/011-do-not-prefer-ncursesw.patch
new file mode 100644 (file)
index 0000000..c5f323c
--- /dev/null
@@ -0,0 +1,15 @@
+diff --git a/setup.py b/setup.py
+index 7868b7b..86b0119 100644
+--- a/setup.py
++++ b/setup.py
+@@ -725,8 +725,8 @@ class PyBuildExt(build_ext):
+         # use the same library for the readline and curses modules.
+         if 'curses' in readline_termcap_library:
+             curses_library = readline_termcap_library
+-        elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+-            curses_library = 'ncursesw'
++        #elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
++        #    curses_library = 'ncursesw'
+         elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
+             curses_library = 'ncurses'
+         elif self.compiler.find_library_file(lib_dirs, 'curses'):
index 1cd18750dc1e52c42cf18f99036e7dc311e4beda..b9d29aab229be70cd87345139268abc57f878533 100644 (file)
@@ -111,6 +111,10 @@ MAKE_FLAGS+=\
        LD="$(TARGET_CC)" \
        PGEN=pgen3
 
+ifeq ($(ARCH),i386)
+MAKE_FLAGS+=PYTHON_DECIMAL_WITH_MACHINE=ansi32
+endif
+
 EXTRA_CFLAGS+= \
        -DNDEBUG -fno-inline
 EXTRA_LDFLAGS+= \
diff --git a/lang/python3/files/python3-package-lzma.mk b/lang/python3/files/python3-package-lzma.mk
new file mode 100644 (file)
index 0000000..b04f072
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-lzma
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) lzma module
+  DEPENDS:=+python3-light +liblzma
+endef
+
+$(eval $(call Py3BasePackage,python3-lzma, \
+       /usr/lib/python$(PYTHON3_VERSION)/lzma.py \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_lzma.$(PYTHON3_SO_SUFFIX) \
+))
index 74bedfe2f9dea2a902e672f08e73a1dbf928eca0..7e703b3ddf5798992aa0e57a17a3aa209d46cfe9 100644 (file)
@@ -8,7 +8,7 @@
 define Package/python3-ncurses
 $(call Package/python3/Default)
   TITLE:=Python $(PYTHON3_VERSION) ncurses module
-  DEPENDS:=+python3-light +libncursesw
+  DEPENDS:=+python3-light +libncurses
 endef
 
 $(eval $(call Py3BasePackage,python3-ncurses, \
diff --git a/lang/python3/patches/011-do-not-prefer-ncursesw.patch b/lang/python3/patches/011-do-not-prefer-ncursesw.patch
new file mode 100644 (file)
index 0000000..c023225
--- /dev/null
@@ -0,0 +1,15 @@
+diff --git a/setup.py b/setup.py
+index 2779658..b6d3d61 100644
+--- a/setup.py
++++ b/setup.py
+@@ -693,8 +693,8 @@ class PyBuildExt(build_ext):
+         # use the same library for the readline and curses modules.
+         if 'curses' in readline_termcap_library:
+             curses_library = readline_termcap_library
+-        elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+-            curses_library = 'ncursesw'
++        #elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
++        #    curses_library = 'ncursesw'
+         elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
+             curses_library = 'ncurses'
+         elif self.compiler.find_library_file(lib_dirs, 'curses'):
index 97a32f27f9d2915e2e8c968b0b449febca245a4a..eb90e3563ac2ede8cf722243064ba732dec250bc 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ruby
-PKG_VERSION:=2.2.1
-PKG_RELEASE:=1
+PKG_VERSION:=2.2.2
+PKG_RELEASE:=2
 
 PKG_LIBVER:=2.2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_LIBVER)/
-PKG_MD5SUM:=06973777736d8e6bdad8dcaa469a9da3
+PKG_MD5SUM:=af6eb4fa7247f1f7b2e19c8e6f3e3145
 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYING
@@ -575,7 +575,7 @@ endef
 define Package/ruby-psych
 $(call Package/ruby/Default)
   TITLE+=YAML parser and emitter
-  DEPENDS:=ruby +ruby-bigdecimal +ruby-datetime +ruby-misc +ruby-enc
+  DEPENDS:=ruby +ruby-bigdecimal +ruby-datetime +ruby-misc +ruby-enc +libyaml
 endef
 
 define Package/ruby-psych/description
@@ -803,6 +803,13 @@ HOST_CONFIGURE_ARGS += \
        --disable-install-rdoc \
        --disable-install-capi \
        --with-static-linked-ext \
+       --with-out-ext=tk,tk/tkutil,win32,win32ole,dbm,gdbm,readline \
+
+# even not used, host build with restricted exts results in gems not being
+# compiling for target (probably some cross compiling problem like checking
+# host for selecting target features)
+#      --with-out-ext \
+#      --with-ext=thread,stringio \
 
 CONFIGURE_ARGS += \
        --enable-shared \
@@ -813,6 +820,7 @@ CONFIGURE_ARGS += \
        --disable-install-capi \
        --with-ruby-version=minor \
        --with-iconv-dir=$(ICONV_PREFIX) \
+       --with-out-ext=tk,tk/tkutil,win32,win32ole
 
 ifndef CONFIG_RUBY_DIGEST_USE_OPENSSL
 CONFIGURE_ARGS += \
@@ -874,7 +882,6 @@ define Package/ruby-datetime/install
        ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
                usr/lib/ruby/$(PKG_LIBVER)/time.rb \
                usr/lib/ruby/$(PKG_LIBVER)/date.rb \
-               usr/lib/ruby/$(PKG_LIBVER)/date/ \
                usr/lib/ruby/$(PKG_LIBVER)/*/date_core.so \
        ) | ( cd $(1); $(TAR) -xf - )
 endef
@@ -1252,7 +1259,6 @@ endef
 
 define Package/ruby-socket/install
        ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
-               usr/lib/ruby/$(PKG_LIBVER)/gserver.rb \
                usr/lib/ruby/$(PKG_LIBVER)/ipaddr.rb \
                usr/lib/ruby/$(PKG_LIBVER)/resolv-replace.rb \
                usr/lib/ruby/$(PKG_LIBVER)/resolv.rb \
index ff462a9521d60b4c8d7dd815e6abe122e6f8b006..c8b9c1b585e0b7cbf149a91a15bbef0fd7f6856e 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vala
-PKG_VERSION:=0.27.1
+PKG_VERSION:=0.28.0
 PKG_RELEASE:=1
 PKG_LICENSE:=LGPL-2.1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=@GNOME/vala/0.27/
-PKG_MD5SUM:=27302efb557d4a6bf634eb6444d90be8
+PKG_SOURCE_URL:=@GNOME/vala/0.28/
+PKG_MD5SUM:=8d4ceac3451a0d5497e7be38e5e4c2ad
 
 PKG_BUILD_DEPENDS:=glib2 glib2/host vala/host
 HOST_BUILD_DEPENDS:=glib2/host
index 4a56b61559ad7bfea5155fa3cbb4fd074f29f9a1..2d1a64b319b7eaa23397dc9f2aa7ee1b649d7ba0 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=avahi
 PKG_VERSION:=0.6.31
-PKG_RELEASE:=11
+PKG_RELEASE:=12
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://avahi.org/download/
@@ -56,7 +56,7 @@ define Package/libavahi/Default
   SECTION:=libs
   CATEGORY:=Libraries
   PROVIDES:=libavahi
-  DEPENDS:=+libpthread +SSP_SUPPORT:libssp
+  DEPENDS:=+libpthread
 endef
 
 define Package/libavahi/description
@@ -70,7 +70,7 @@ endef
 define Package/avahi-autoipd
   $(call Package/avahi/Default)
   SUBMENU:=IP Addresses and Names
-  DEPENDS:=+libdaemon +SSP_SUPPORT:libssp
+  DEPENDS:=+libdaemon
   TITLE:=IPv4LL network address configuration daemon
 endef
 
@@ -100,6 +100,7 @@ define Package/avahi-nodbus-daemon
   SUBMENU:=IP Addresses and Names
   DEPENDS:=+libavahi-nodbus-support +libexpat +librt +libdaemon
   TITLE+= (daemon)
+  USERID:=avahi=105:avahi=105
 endef
 
 define Package/avahi-daemon/description
@@ -155,7 +156,7 @@ endef
 define Package/avahi-dnsconfd
   $(call Package/avahi/Default)
   SUBMENU:=IP Addresses and Names
-  DEPENDS:=+libavahi +libdaemon +libpthread +SSP_SUPPORT:libssp
+  DEPENDS:=+libavahi +libdaemon +libpthread
   TITLE:=A Unicast DNS server using avahi-daemon
 endef
 
index 4ef64df2a8bcf2167edffc6f020890e7beac1ae4..3ef0788ebcec865a0fd8272f5453bf7be6821ef9 100644 (file)
@@ -2,7 +2,7 @@
 #host-name=foo
 #domain-name=local
 use-ipv4=yes
-use-ipv6=no
+use-ipv6=yes
 check-response-ttl=no
 use-iff-running=no
 
index 56e294c61c116a2f3900cae28af0429990a2656f..e9c2364e5d7c9ae0e243ea4d7a7d85956329ef0b 100644 (file)
@@ -16,14 +16,14 @@ include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/target.mk 
 
 PKG_NAME:=boost
-PKG_VERSION:=1_57_0
-PKG_RELEASE:=3
+PKG_VERSION:=1_58_0
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/boost
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_VERSION)
-PKG_MD5SUM:=25f9a8ac28beeb5ab84aa98510305299
+PKG_MD5SUM:=5a5d5614d9a07672e1ab2a250b5defc5
 PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
 PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
 
@@ -34,6 +34,7 @@ PKG_USE_MIPS16:=0
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
 
+
 define Package/boost/Default
   SECTION:=libs
   CATEGORY:=Libraries
@@ -135,7 +136,7 @@ endef
 $(eval $(call DefineBoostLibrary,atomic,system,))
 $(eval $(call DefineBoostLibrary,chrono,system,))
 $(eval $(call DefineBoostLibrary,container,,))
-$(eval $(call DefineBoostLibrary,context,,))
+$(eval $(call DefineBoostLibrary,context,chrono system thread,))
 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
 $(eval $(call DefineBoostLibrary,date_time,,))
 #$(eval $(call DefineBoostLibrary,exception,,))
@@ -149,6 +150,10 @@ $(eval $(call DefineBoostLibrary,math,,))
 #$(eval $(call DefineBoostLibrary,mpi,,))
 $(eval $(call DefineBoostLibrary,program_options,,))
 $(eval $(call DefineBoostLibrary,random,system,))
+
+# We need a beter way to provide this package, information regarding the Python packages
+#  such as Python version and directories locations. 
+# Python 2.7 version is for now hard-coded. Python 3 is (until this date) broken in the trunk tree.
 $(eval $(call DefineBoostLibrary,python,,+PACKAGE_boost-python:python))
 $(eval $(call DefineBoostLibrary,regex,,))
 $(eval $(call DefineBoostLibrary,serialization,,))
diff --git a/libs/boost/patches/001-mips-options-fix.patch b/libs/boost/patches/001-mips-options-fix.patch
new file mode 100644 (file)
index 0000000..b32f447
--- /dev/null
@@ -0,0 +1,11 @@
+--- boost_1_58_0/tools/build/src/tools/gcc.jam 2015-04-23 12:01:37.723438995 +0200
++++ boost_1_58_0/tools/build/src/tools/gcc.jam 2015-04-23 12:00:21.427441384 +0200
+@@ -451,7 +451,7 @@
+         else
+         {
+             local arch = [ feature.get-values architecture : $(properties) ] ;
+-            if $(arch) != arm
++            if $(arch) != arm && $(arch) != mips1
+             {
+                 if $(model) = 32
+                 {
diff --git a/libs/boost/patches/100-do-not-use-librt.patch b/libs/boost/patches/100-do-not-use-librt.patch
deleted file mode 100644 (file)
index a7560c6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-Index: boost_1_57_0/tools/build/src/tools/gcc.jam
-===================================================================
---- boost_1_57_0.orig/tools/build/src/tools/gcc.jam
-+++ boost_1_57_0/tools/build/src/tools/gcc.jam
-@@ -1037,7 +1037,7 @@ rule setup-threading ( targets * : sourc
-             case *bsd    : option = -pthread ;  # There is no -lrt on BSD.
-             case sgi     : # gcc on IRIX does not support multi-threading.
-             case darwin  : # No threading options.
--            case *       : option = -pthread ; libs = rt ;
-+            case *       : # pass appropriate options via OpenWrt
-         }
-         if $(option)
-Index: boost_1_57_0/tools/build/src/tools/gcc.py
-===================================================================
---- boost_1_57_0.orig/tools/build/src/tools/gcc.py
-+++ boost_1_57_0/tools/build/src/tools/gcc.py
-@@ -700,8 +700,8 @@ elif bjam.variable('UNIX'):
-         # Darwin has no threading options, don't set anything here.
-         pass
-     else:
--        flags('gcc', 'OPTIONS', ['<threading>multi'], ['-pthread'])
--        flags('gcc', 'FINDLIBS-SA', [], ['rt'])
-+        # pass appropriate options via OpenWrt
-+        pass
- def cpu_flags(toolset, variable, architecture, instruction_set, values, default=None):
-     #FIXME: for some reason this fails.  Probably out of date feature code
diff --git a/libs/fftw3/Makefile b/libs/fftw3/Makefile
new file mode 100644 (file)
index 0000000..7d31b73
--- /dev/null
@@ -0,0 +1,119 @@
+#
+# Copyright (C) 2007-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fftw3
+PKG_VERSION:=3.3.4
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0+
+
+PKG_SOURCE:=fftw-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.fftw.org
+PKG_MD5SUM:=2edab8c06b24feeb3b82bbb3ebf3e7b3
+
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/fftw-$(PKG_VERSION)
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fftw3
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=@!avr32 +libpthread
+  VARIANT:=double
+  TITLE:=Fast Fourier transform library
+  URL:=http://www.fftw.org/
+  MAINTAINER:=Vladimir Ulrich <admin@evl.su>
+endef
+
+define Package/fftw3f
+  $(call Package/fftw3)
+  VARIANT:=single
+  TITLE+= (single precision)
+endef
+
+define Package/fftw3l
+  $(call Package/fftw3)
+  DEPENDS:=@BROKEN
+  VARIANT:=long-double
+  TITLE+= (long-double precision)
+endef
+
+define Package/fftw3/description
+       FFTW is a collection of fast C routines for computing the
+       Discrete Fourier Transform in one or more dimensions. It
+       includes complex, real, and parallel transforms, and can
+       handle arbitrary array sizes efficiently.
+endef
+
+define Package/fftw3f/description
+  $(call Package/fftw3/description)
+
+  This package contains the single precision library.
+endef
+
+define Package/fftw3l/description
+  $(call Package/fftw3/description)
+
+  This package contains the long-double precision library.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --prefix=/usr \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+       --enable-shared \
+       --enable-threads \
+       --enable-type-prefix \
+       --disable-debug \
+       --disable-fortran
+
+ifeq ($(BUILD_VARIANT), single)
+CONFIGURE_ARGS += \
+       --enable-single
+endif
+
+ifeq ($(BUILD_VARIANT), long-double)
+CONFIGURE_ARGS += \
+       --enable-long-double
+endif
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/fftw3.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3*.{a,la} $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3*.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/fftw3/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3.so* $(1)/usr/lib/
+endef
+
+define Package/fftw3f/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3f.so* $(1)/usr/lib/
+endef
+
+define Package/fftw3l/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3l.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,fftw3))
+$(eval $(call BuildPackage,fftw3f))
+$(eval $(call BuildPackage,fftw3l))
diff --git a/libs/fftw3/patches/001-makefile.patch b/libs/fftw3/patches/001-makefile.patch
new file mode 100644 (file)
index 0000000..c5dd857
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -232,7 +232,7 @@ 
+ CTAGS = ctags
+ CSCOPE = cscope
+ DIST_SUBDIRS = support genfft kernel simd-support dft rdft reodft api \
+-      libbench2 . threads tests mpi doc tools m4
++      libbench2 . threads mpi doc tools m4
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ distdir = $(PACKAGE)-$(VERSION)
+ top_distdir = $(distdir)
+@@ -444,7 +444,7 @@
+ #
+ @COMBINED_THREADS_TRUE@CHICKEN_EGG = threads .
+ SUBDIRS = support $(GENFFT) kernel simd-support dft rdft reodft api   \
+-libbench2 $(CHICKEN_EGG) tests mpi doc tools m4
++libbench2 $(CHICKEN_EGG) mpi m4
+ EXTRA_DIST = COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in
+ SIMD_LIBS = \
index d2c4939bc826d28c824ae25d530538d0777e7624..21ecfb2dd3f02d53a59e7c00fbafb639d14661fa 100644 (file)
@@ -19,7 +19,7 @@ PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
 
-PKG_FIXUP:=autoreconf
+PKG_FIXUP:=autoreconf gettext-version
 PKG_REMOVE_FILES:=Makefile compat/Makefile doc/Makefile export/Makefile src/Makefile tests/Makefile
 PKG_BUILD_PARALLEL:=0
 
index 5b516a2cce8d2b1bd277e7de588b15302f34b9f4..80b9768bb737e542a5980b8bce49c1606869cc1f 100644 (file)
@@ -16,6 +16,8 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
 PKG_SOURCE_URL:=@GNOME/glib/2.43
 PKG_MD5SUM:=2f28879252c660a65aa3139ec499776b
 
+PKG_BUILD_PARALLEL:=1
+HOST_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=glib2/host libpthread zlib libintl libffi
 HOST_BUILD_DEPENDS:=libintl/host libiconv/host libffi/host
 PKG_INSTALL:=1
index 87cb554721ed03107f53b696bc610e88e18c5ad7..ea8aa53d0a3f0b911faa0298044742e4f4fdce2f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2005-2010 OpenWrt.org
+# Copyright (C) 2005-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnutls
-PKG_VERSION:=3.3.13
-PKG_RELEASE:=3
+PKG_VERSION:=3.4.0
+PKG_RELEASE:=2
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3
-PKG_MD5SUM:=a7387fe8bf3e604bf518a6da9ab2a4e6
+PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4
+PKG_MD5SUM:=aa015c2666b031044edfb01b01980d84
+PKG_FIXUP:=autoreconf gettext-version
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
+PKG_LICENSE:=LGPLv2.1+
 
 PKG_INSTALL:=1
 PKG_LIBTOOL_PATHS:=. lib
@@ -122,10 +124,10 @@ CONFIGURE_ARGS+= \
        --enable-local-libopts \
        --disable-doc \
        --disable-tests \
-       --disable-rsa-export \
+       --enable-openssl-compatibility \
        --with-default-trust-store-dir=/etc/ssl/certs/ \
        --disable-crywrap \
-       --with-librt-prefix="$(STAGING_DIR)/"
+       --with-librt-prefix="$(LIBRT_ROOT_DIR)/"
 
 ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
 CONFIGURE_ARGS += --with-included-libtasn1
@@ -179,17 +181,18 @@ TARGET_CFLAGS += $(FPIC)
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so* \
+               $(1)/usr/lib/
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/include/gnutls \
                $(1)/usr/include/
-       $(CP) \
-               $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
-               $(1)/usr/lib/
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
                $(1)/usr/lib/pkgconfig/
 endef
 
+
 define Package/certtool/conffiles
 /etc/gnutls/certtool.cfg
 endef
diff --git a/libs/gnutls/patches/001-ai-idn-remove.patch b/libs/gnutls/patches/001-ai-idn-remove.patch
deleted file mode 100644 (file)
index 9acf756..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/socket.c b/src/socket.c
-index 82c6252..e2feda9 100644
---- a/src/socket.c
-+++ b/src/socket.c
-@@ -241,10 +241,6 @@ socket_open(socket_st * hd, const char *hostname, const char *service,
-       /* get server name */
-       memset(&hints, 0, sizeof(hints));
--#ifdef AI_IDN
--      hints.ai_flags = AI_IDN|AI_IDN_ALLOW_UNASSIGNED;
--#endif
--
-       hints.ai_socktype = udp ? SOCK_DGRAM : SOCK_STREAM;
-       if ((err = getaddrinfo(hostname, service, &hints, &res))) {
-               fprintf(stderr, "Cannot resolve %s:%s: %s\n", hostname,
diff --git a/libs/gnutls/patches/001-libopts-detection.patch b/libs/gnutls/patches/001-libopts-detection.patch
new file mode 100644 (file)
index 0000000..eb69f00
--- /dev/null
@@ -0,0 +1,84 @@
+diff --git a/configure.ac b/configure.ac
+index 7c454cd..185ebb6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,7 +64,7 @@ if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
+ ***
+ *** autogen not found. Will not link against libopts.
+ *** ]])
+-    enable_local_libopts=yes
++    included_libopts=yes
+   fi
+ fi
+@@ -523,7 +523,7 @@ fi
+ AM_CONDITIONAL(ENABLE_TROUSERS, test "$with_tpm" != "no")
+-enable_local_libopts=no
++included_libopts=no
+ if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
+       LIBOPTS_CHECK([src/libopts])
+       if test "$NEED_LIBOPTS_DIR" = "true";then
+@@ -540,15 +540,17 @@ if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
+               if test -z "$missing_baks"; then
+                       AC_SUBST([AUTOGEN], [/bin/true])
+               fi
+-              enable_local_libopts=yes
++              included_libopts=yes
+       fi
+ else
+       # Need to ensure the relevant conditionals get set
+       gl_STDNORETURN_H
+       AM_CONDITIONAL([INSTALL_LIBOPTS],[false])
+       AM_CONDITIONAL([NEED_LIBOPTS], [false])
++      included_libopts=yes
+ fi
+-AM_CONDITIONAL(NEED_LIBOPTS, test "$enable_local_libopts" = "yes")
++
++AM_CONDITIONAL(NEED_LIBOPTS, test "$included_libopts" = "yes")
+ AC_CHECK_TYPE(ssize_t,
+   [
+@@ -896,7 +898,7 @@ AC_MSG_NOTICE([summary of build options:
+   Compiler:             ${CC}
+   CFlags:               ${CFLAGS}
+   Library types:        Shared=${enable_shared}, Static=${enable_static}
+-  Local libopts:        ${enable_local_libopts}
++  Local libopts:        ${included_libopts}
+   Local libtasn1:       ${included_libtasn1}
+   Use nettle-mini:      ${mini_nettle}
+ ])
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 4105ab6..b907249 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -30,13 +30,6 @@ if ENABLE_CRYWRAP
+ SUBDIRS += crywrap
+ endif
+-if NEED_LIBOPTS
+-LIBOPTS = libopts/libopts.la
+-SUBDIRS += libopts
+-else
+-LIBOPTS = $(LIBOPTS_LDADD)
+-endif
+-
+ EXTRA_DIST = args-std.def
+ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+@@ -49,6 +42,14 @@ AM_CPPFLAGS = \
+       -I$(srcdir)/../extra/includes   \
+       $(LIBOPTS_CFLAGS)
++if NEED_LIBOPTS
++LIBOPTS = libopts/libopts.la
++SUBDIRS += libopts
++AM_CPPFLAGS += -I$(srcdir)/libopts
++else
++LIBOPTS = $(LIBOPTS_LDADD)
++endif
++
+ bin_PROGRAMS = psktool gnutls-cli-debug certtool
+ if ENABLE_SRP
+ bin_PROGRAMS += srptool
diff --git a/libs/ldns/Makefile b/libs/ldns/Makefile
new file mode 100644 (file)
index 0000000..9a0b4e1
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2011-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ldns
+PKG_VERSION:=1.6.17
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/ldns
+PKG_MD5SUM:=a79423bcc4129e6d59b616b1cae11e5e
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libldns/Default
+  URL:=http://www.nlnetlabs.nl/projects/ldns/
+  DEPENDS:=+libopenssl
+endef
+
+define Package/libldns
+  $(call Package/libldns/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A library to simplify DNS programming
+endef
+
+define Package/libldns/description
+  The goal of ldns is to simplify DNS programming, it supports recent RFCs like
+  the DNSSEC documents, and allows developers to easily create software
+  conforming to current RFCs, and experimental software for current Internet
+  Drafts.
+endef
+
+define Package/drill
+  $(call Package/libldns/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=IP Addresses and Names
+  TITLE:=DNS(SEC) information tool
+  DEPENDS+= +libldns
+endef
+
+define Package/drill/description
+  drill is a tool to designed to get all sorts of information out of the DNS. It
+  is specificly designed to be used with DNSSEC.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-ecdsa \
+       --disable-gost \
+       --with-drill \
+       --with-ssl="$(STAGING_DIR)/usr"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ldns $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libldns.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libldns/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libldns.so.* $(1)/usr/lib/
+endef
+
+define Package/drill/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/drill $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libldns))
+$(eval $(call BuildPackage,drill))
index 7cb06224c16eefb27c3217a694c76e25d4023d57..304cf275f8a7309f687c1473368f2728e76818e7 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libimobiledevice
 PKG_VERSION:=1.2.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
 PKG_LICENSE:=LGPL-2.1+
@@ -42,7 +42,7 @@ define Package/libimobiledevice
   $(call Package/libimobiledevice/Default)
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=$(ICONV_DEPENDS) +libplist +libusbmuxd +libopenssl +libcrypto
+  DEPENDS:=$(ICONV_DEPENDS) +libplist +libusbmuxd +libopenssl
 endef
 
 define Package/libimobiledevice/description
index 3f1608ee94df34fe950e9df9cf15d2cb46407f42..91e98341c0012caea44f63d011c8274071bdf479 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmicrohttpd
 PKG_VERSION:=0.9.38
-PKG_RELEASE:=1.1
+PKG_RELEASE:=1.2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/libmicrohttpd
@@ -29,7 +29,7 @@ define Package/libmicrohttpd
        CATEGORY:=Libraries
        TITLE:=GNU libmicrohttpd is a library that runs an HTTP server.
        URL:=http://www.gnu.org/software/libmicrohttpd/
-       DEPENDS:=+libpthread +libgcrypt +libgnutls +libgpg-error +libcrypto +libopenssl
+       DEPENDS:=+libpthread +libgcrypt +libgnutls +libgpg-error +libopenssl
 endef
 
 define Package/libmicrohttpd/description
index fe8a2c254f432cbd40cf8a9a50c75e22e02fe2a4..2b5a2d4b86afb497568dbb1cb9e70fb8bf8c9a30 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libtasn1
-PKG_VERSION:=4.3
+PKG_VERSION:=4.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/libtasn1
-PKG_MD5SUM:=67e98988f966a34fbf1b82d33eef9e7e
+PKG_MD5SUM:=c26d76d1309dd339365c563076599912
 
 #PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 4d8bb46b69a72233e20e396832e5288b4b81106e..ae25bddf99702837ab3a04397299814235b95a84 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2014 OpenWrt.org
+# Copyright (C) 2008-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libvpx
-PKG_VERSION:=1.3.0
+PKG_VERSION:=1.4.0
 PKG_RELEASE:=1
 
 PKG_REV:=v$(PKG_VERSION)
index c2dd0972726f16e6eedbe38823b3631189fd8ab8..e892084ea80491a593cbaebc81aeca97578e7b12 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libxerces-c
-PKG_VERSION:=3.1.1
+PKG_VERSION:=3.1.2
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://git.apache.org/xerces-c.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=Xerces-C_3_1_1
+PKG_SOURCE_VERSION:=Xerces-C_3_1_2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
@@ -22,10 +22,11 @@ PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_BUILD_PARALLEL:=1
-PKG_FIXUP:=libtool
+PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/package.mk
 
 CONFIGURE_ARGS += \
@@ -34,14 +35,7 @@ CONFIGURE_ARGS += \
        --enable-netaccessor-socket \
        --enable-msgloader-inmemory
 
-TARGET_CFLAGS += \
-       -I$(STAGING_DIR)/usr/lib/libiconv-full/include
-
-TARGET_CPPFLAGS += \
-       -I$(STAGING_DIR)/usr/lib/libiconv-full/include
-
 TARGET_LDFLAGS += \
-       -L$(STAGING_DIR)/usr/lib/libiconv-full/lib \
        -lm
 
 define Package/libxerces-c
@@ -49,7 +43,7 @@ define Package/libxerces-c
   CATEGORY:=Libraries
   TITLE:=Validating XML parser library for C++
   URL:=http://xerces.apache.org/
-  DEPENDS:=$(CXX_DEPENDS) +libc +libiconv +libpthread
+  DEPENDS:=$(CXX_DEPENDS) $(ICONV_DEPENDS) +libc +libpthread
 endef
 
 define Package/libxerces-c-samples
@@ -60,12 +54,6 @@ define Package/libxerces-c-samples
   DEPENDS:=+libxerces-c
 endef
 
-define Build/Configure
-       (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
-       ./reconf;)
-       $(call Build/Configure/Default)
-endef
-
 define Package/libxerces-c/description
   Xerces-C++ is a validating XML parser written in a portable subset of
   C++. Xerces-C++ makes it easy to give your application the ability
diff --git a/libs/nspr/Makefile b/libs/nspr/Makefile
deleted file mode 100644 (file)
index d14d086..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=nspr
-PKG_VERSION:=3.16.6
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/nss-$(PKG_VERSION)
-PKG_SOURCE:=nss-$(PKG_VERSION)-with-nspr-4.10.6.tar.gz
-PKG_SOURCE_URL:=ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_16_6_RTM/src/
-PKG_MD5SUM:=4722706ea101948712b5ad003629679f
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-CONFIGURE_PATH=nspr
-MAKE_PATH=nspr
-
-define Package/nspr
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Netscape Portable Runtime (NSPR)
-  URL:=https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR
-  DEPENDS:=+libpthread +librt
-  MAINTAINER:=Luka Perkov <luka@openwrt.org>
-endef
-
-define Package/nspr/description
-  Netscape Portable Runtime (NSPR) provides a platform-neutral API for system
-  level and libc-like functions. The API is used in the Mozilla clients, many of
-  Red Hat's and Sun's server applications, and other software offerings.
-endef
-
-CONFIGURE_ARGS += \
-       --with-arch=toolchain-default \
-       --with-fpu=toolchain-default \
-       --with-float-abi=toolchain-default \
-       --with-soft-float=toolchain-default
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/ $(1)/usr/
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*{a,so} $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nspr.pc $(1)/usr/lib/pkgconfig/
-endef
-
-define Package/nspr/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*so $(1)/usr/lib
-endef
-
-$(eval $(call BuildPackage,nspr))
diff --git a/libs/nspr/patches/001-compile.patch b/libs/nspr/patches/001-compile.patch
deleted file mode 100644 (file)
index 63b697e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/nspr/config/Makefile.in
-+++ b/nspr/config/Makefile.in
-@@ -30,7 +30,6 @@ CSRCS        = now.c
- # This version hasn't been ported for us; the one in mozilla/config has
- ifneq ($(OS_ARCH),OS2)
--CSRCS  += nsinstall.c
-  
- PLSRCS        = nfspwd.pl
- endif
-@@ -84,7 +83,6 @@ else
- ifeq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
- TARGETS = $(PROGS)
- else
--PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
- TARGETS = $(PROGS) $(PLSRCS:.pl=)
- endif
- endif
-@@ -114,6 +112,7 @@ endif
- $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
-       @$(MAKE_OBJDIR)
-       $(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@
-+      gcc nsinstall.c -o nsinstall
- install:: nspr.m4
-       $(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal
index 2c708ec861fd5f83af41df46288c4ffaf3eacb7f..007af93d6ffd6377436a60573dff10712e457337 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -36,6 +36,11 @@ define Package/libpcre
   TITLE:=A Perl Compatible Regular Expression library
 endef
 
+define Package/libpcre16
+  $(call Package/libpcre/default)
+  TITLE:=A Perl Compatible Regular Expression library (16bit support)
+endef
+
 define Package/libpcrecpp
   $(call Package/libpcre/default)
   TITLE:=C++ wrapper for Perl Compatible Regular Expression library
@@ -47,6 +52,7 @@ TARGET_CFLAGS += $(FPIC)
 CONFIGURE_ARGS += \
        --enable-utf8 \
        --enable-unicode-properties \
+       --enable-pcre16 \
 
 ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
   CONFIGURE_ARGS+= --enable-cpp
@@ -68,7 +74,7 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/include/pcre*.h $(1)/usr/include/
 
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib//
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib/
 
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcre*.pc $(1)/usr/lib/pkgconfig/
@@ -77,6 +83,12 @@ endef
 define Package/libpcre/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre{,posix}.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre.so $(1)/usr/lib/
+endef
+
+define Package/libpcre16/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre16.so* $(1)/usr/lib/
 endef
 
 define Package/libpcrecpp/install
@@ -85,4 +97,5 @@ define Package/libpcrecpp/install
 endef
 
 $(eval $(call BuildPackage,libpcre))
+$(eval $(call BuildPackage,libpcre16))
 $(eval $(call BuildPackage,libpcrecpp))
diff --git a/libs/sbc/Makefile b/libs/sbc/Makefile
new file mode 100644 (file)
index 0000000..cca5472
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sbc
+PKG_VERSION:=1.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://www.kernel.org/pub/linux/bluetooth/
+PKG_MD5SUM:=2d8b7841f2c11ab287718d562f2b981c
+
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING.LIB
+PKG_MAINTAINER:=Dirk Neukirchen <dirkneukirchen@web.de>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/sbc
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=sbc encoding library
+  DEPENDS:=+libsndfile
+  URL:=http://www.bluez.org
+endef
+
+define Package/sbc/description
+  Low Complexity Subband Coding for bluetooth audio profiles encoding and decoding.
+  Needed for A2DP support.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/sbc
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/sbc/sbc.h $(1)/usr/include/sbc/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsbc* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sbc.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/sbc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sbc* $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsbc.so* $(1)/usr/lib/
+endef
+
+
+$(eval $(call BuildPackage,sbc))
diff --git a/libs/yaml/Makefile b/libs/yaml/Makefile
new file mode 100644 (file)
index 0000000..c2b818a
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=yaml
+PKG_VERSION:=0.1.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pyyaml.org/download/libyaml/
+PKG_MD5SUM:=5fe00cda18ca5daeb43762b80c38e06e
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libyaml
+  SUBMENU:=Languages
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Fast YAML 1.1 parser and emitter library
+  URL:=http://pyyaml.org/wiki/LibYAML
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/yaml.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyaml*.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/yaml*.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libyaml/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyaml*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libyaml))
diff --git a/libs/zmq/Makefile b/libs/zmq/Makefile
new file mode 100644 (file)
index 0000000..31bf6bf
--- /dev/null
@@ -0,0 +1,81 @@
+# 
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# This Makefile for ZeroMQ
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zeromq
+PKG_VERSION:=4.0.5
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=LICENCE.txt
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:= http://download.zeromq.org
+PKG_MD5SUM:=73c39f5eb01b9d7eaf74a5d899f1d03d
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=libuuid
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libzmq/Default
+  TITLE:=ZeroMQ - Code Connected 
+  URL:=http://www.zeromq.org/
+endef
+
+define Package/libzmq/Default/description
+  A replacment for raw socket developing library 
+endef
+
+define Package/libzmq
+  $(call Package/libzmq/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libuuid +libpthread +librt $(CXX_DEPENDS)
+  TITLE+= (library)
+  URL:=
+endef
+
+define Package/libzmq/description
+  $(call Package/libzmq/Default/description)
+ This package contains the ZeroMQ shared library, used by other
+ programs.
+endef
+
+# add extra configure flags here
+CONFIGURE_ARGS += \
+       --enable-static \
+       --enable-shared
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq.h $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq_utils.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzmq.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libzmq/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libzmq))
diff --git a/libs/zmq/patches/disable_pedantic_on_linux_with_ulibc++.patch b/libs/zmq/patches/disable_pedantic_on_linux_with_ulibc++.patch
new file mode 100644 (file)
index 0000000..9d1f06e
--- /dev/null
@@ -0,0 +1,14 @@
+--- zeromq-4.0.4_org/configure.ac      2014-06-04 10:19:35.140061796 +0800
++++ zeromq-4.0.4/configure.ac  2014-06-04 11:08:17.231997926 +0800
+@@ -127,8 +127,10 @@
+     *linux*)
+         # Define on Linux to enable all library features. Define if using a gnu compiler
+         if test "x$GXX" = "xyes"; then
+-            CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
++            CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS -Wno-long-long"
+         fi
++        libzmq_pedantic="no"
++        libzmq_werror="no"
+         AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
+         libzmq_on_linux="yes"
diff --git a/libs/zmq/patches/streamoff_missing_with_ulibc++.patch b/libs/zmq/patches/streamoff_missing_with_ulibc++.patch
new file mode 100644 (file)
index 0000000..543d6ec
--- /dev/null
@@ -0,0 +1,10 @@
+--- zeromq-4.0.4_org/src/blob.hpp      2014-06-04 10:19:12.680062287 +0800
++++ zeromq-4.0.4/src/blob.hpp  2014-06-04 10:30:31.168047457 +0800
+@@ -21,6 +21,7 @@
+ #define __ZMQ_BLOB_HPP_INCLUDED__
+ #include <string>
++#include <ios>
+ #include <string.h>
+ // Borrowed from id3lib_strings.h:
diff --git a/libs/zmq/patches/tools_gcc_fix.patch b/libs/zmq/patches/tools_gcc_fix.patch
new file mode 100644 (file)
index 0000000..a91e846
--- /dev/null
@@ -0,0 +1,10 @@
+diff -ruNa zeromq-4.0.4_org/tools/Makefile.am zeromq-4.0.4/tools/Makefile.am
+--- zeromq-4.0.4_org/tools/Makefile.am 2014-06-03 20:01:12.392379933 +0800
++++ zeromq-4.0.4/tools/Makefile.am     2014-06-03 19:59:18.616382420 +0800
+@@ -1,5 +1,5 @@
+ EXTRA_DIST = curve_keygen.c 
++CFLAGS += -std=c99
+-
+ INCLUDES = -I$(top_srcdir)/include
+ bin_PROGRAMS = curve_keygen
index 322e954b650fc7038e7f2f597921795c250b73e8..cd32a628d0113d681ccc077ba994eddc897f2720 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=alpine
 PKG_VERSION:=2.20
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://patches.freeiz.com/alpine/release/src/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -44,7 +44,7 @@ endef
 define Package/alpine
 $(call Package/alpine/Default)
   TITLE+= (with OpenSSL support)
-  DEPENDS+= +libcrypto +libopenssl
+  DEPENDS+= +libopenssl
   VARIANT:=ssl
 endef
 
index de3646b01137dbeed803f36d59ad57b083c95312..d31dfa8c1c742e4f4b233c97493ca8d5350ed4ff 100644 (file)
@@ -35,7 +35,10 @@ define Package/bogofilter/description
        Bogofilter is a fast Bayesian spam filter
 endef
 
-CONFIGURE_ARGS += --disable-unicode
+CONFIGURE_ARGS += \
+       --disable-unicode \
+       --with-libdb-prefix=$(STAGING_DIR) \
+       --with-included-gsl
 
 define Package/bogofilter/install
        $(INSTALL_DIR)  $(1)/etc/ \
index 2e1b9f83cbcce2c284a29a0975a4b72656fac5a8..eee50f85dc7a51258773f06e0f24623bf2b68a7d 100644 (file)
@@ -10,8 +10,8 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=mailman
 PKG_RELEASE:=1
 PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/mailman/ http://ftp.gnu.org/gnu/mailman/
-PKG_VERSION:=2.1.19
-PKG_MD5SUM:=13a33d758f8a6308c91dd267fc3ba123
+PKG_VERSION:=2.1.20
+PKG_MD5SUM:=96819640406f90a12bc28edd3dc09d4a
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
 PKG_LICENSE:=GPL-2.0+
index 8c91a95b00826d9b69d7cd5943ab0f7dcfe4e3b8..9a29f5ce032237ecccf15057dcb002e4ed7a0c7b 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=msmtp
-PKG_VERSION:=1.6.1
-PKG_RELEASE:=3
+PKG_VERSION:=1.6.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/msmtp
-PKG_MD5SUM:=6ebba4809bbc665b8a665a018d1a5ee1
+PKG_MD5SUM:=3baca93c7e5f1aa9d36a2e5b38739ab9
 
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
index c014987781555297ae27fddbcfdc31cc13508e4c..71c30d1ba0d2b3ab8e18734b6bf263f21b45aed5 100644 (file)
@@ -406,6 +406,10 @@ config FFMPEG_CUSTOM_PROTOCOL_file
 config FFMPEG_CUSTOM_PROTOCOL_http
        bool "http:"
 
+config FFMPEG_CUSTOM_PROTOCOL_icecast
+       bool "icecast:"
+       select FFMPEG_CUSTOM_PROTOCOL_http
+
 config FFMPEG_CUSTOM_PROTOCOL_pipe
        bool "pipe:"
 
index 13293a83a839eeeba2f92f4dc249677ed76a79fa..9fd40113b6d0b48b991f56922d39b7359f1cb41e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ffmpeg
-PKG_VERSION:=2.5.4
-PKG_RELEASE:=1
+PKG_VERSION:=2.5.5
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://ffmpeg.org/releases/
-PKG_MD5SUM:=af92a816b642d32134a764d2d7f55b75
+PKG_MD5SUM:=46e5697fc43d21de531de3b5f7b97e24
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
@@ -108,7 +108,7 @@ FFMPEG_CUSTOM_PARSERS:= \
        mpegvideo \
 
 FFMPEG_CUSTOM_PROTOCOLS:= \
-       file http pipe rtp tcp udp
+       file http icecast pipe rtp tcp udp
 
 FFMPEG_MINI_DECODERS:= \
        aac \
@@ -202,7 +202,7 @@ FFMPEG_AUDIO_PARSERS:= \
        mpegaudio \
 
 FFMPEG_AUDIO_PROTOCOLS:= \
-       file http rtp tcp udp
+       file http icecast rtp tcp udp
 
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@@ -395,6 +395,7 @@ FFMPEG_CONFIGURE:= \
        --disable-mipsfpu \
        \
        --disable-dxva2 \
+       --disable-lzma \
        --disable-vaapi \
        --disable-vda \
        --disable-vdpau \
index f4e8120ce1a31e00a5044f83725babab69ca97ae..bfeb1c593f3cbc41dcb242321013e9532b346ecb 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-bad
 PKG_VERSION:=1.4.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
@@ -257,6 +257,7 @@ $(eval $(call GstBuildPlugin,mpegpsmux,mpegpsmux support,,,))
 #$(eval $(call GstBuildPlugin,mpegtsdemux,mpegtsdemux support,mpegts pbutils tag,,))
 #$(eval $(call GstBuildPlugin,mpegtsmux,mpegtsmux support,video,,))
 $(eval $(call GstBuildPlugin,mxf,mxf support,audio video,,))
+$(eval $(call GstBuildPlugin,opus,OPUS plugin library,audio tag rtp,,+libopus))
 $(eval $(call GstBuildPlugin,pcapparse,pcapparse support,,,))
 $(eval $(call GstBuildPlugin,pnm,pnm support,video,,))
 $(eval $(call GstBuildPlugin,rawparse,rawparse support,audio video,,))
index f5965e493d3a7d61accc7c5d4d0d149e946a793b..f52d82fc3f1447568e3d05143d3c461ee5fde99b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-good
 PKG_VERSION:=1.4.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
index 796e9bb958e838588ffd60fbd1e1d95e9953fd27..1b0766e7e4655d5937de263a7e3114f7d49b3410 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=icecast
-PKG_VERSION:=2.4.1
+PKG_VERSION:=2.4.2
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=André Gaul <andre@gaul.io>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/icecast/
-PKG_MD5SUM:=b1402712a79734d4720c8fe15fd9fb10
+PKG_MD5SUM:=55947c83d31dfcbbede58c9521c676f4
 
 PKG_FIXUP:=autoreconf
 
diff --git a/multimedia/oggfwd/Makefile b/multimedia/oggfwd/Makefile
new file mode 100644 (file)
index 0000000..8caf7f1
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=oggfwd
+PKG_REV:=506088e5066abd086efc951670906187c120e9a3
+PKG_VERSION:=20150412
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=git://r-w-x.org/oggfwd.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/oggfwd
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  SUBMENU:=Streaming
+  TITLE:=Pipe media into icecast
+  URL:=http://www.v2v.cc/~j/oggfwd
+  DEPENDS:=+libpthread +libshout
+endef
+
+define Package/oggfwd/description
+ A basic icecast client that is very simple but also very useful for video
+ streaming.
+endef
+
+MAKE_FLAGS += \
+       INCLUDEFLAGS="$(TARGET_LDFLAGS)" \
+       LINKFLAGS="$(TARGET_LDFLAGS) -lshout" \
+
+define Package/oggfwd/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/oggfwd $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,oggfwd))
diff --git a/net/apinger/Makefile b/net/apinger/Makefile
new file mode 100644 (file)
index 0000000..5d73ae1
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=apinger
+PKG_VERSION:=0.6.1
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/Jajcus/apinger.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=c7da72f7ec26eedd7fd8d224c0e10787b204f94e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
+PKG_LICENSE:= GPL-2.0
+
+PKG_FIXUP:=autoreconf
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/apinger
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Tool which monitors various IP devices by simple ICMP echo requests
+  URL:=https://github.com/Jajcus/apinger
+  PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
+endef
+
+define Package/apinger/description
+       Alarm Pinger (apinger) is a little tool which monitors various IP devices by
+       simple ICMP echo requests. There are various other tools, that can do this,
+       but most of them are shell or perl scripts, spawning many processes, thus much
+       CPU-expensive, especially when one wants continuous monitoring and fast
+       response on target failure.  Alarm Pinger is a single program written in C, so
+       it doesn't need much CPU power even when monitoring many targets with frequent
+       probes.  Alarm Pinger supports both IPv4 and IPv6. The code have been tested
+       on Linux and FreeBSD.
+endef
+
+define Package/apinger/conffiles
+/etc/apinger.conf
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default)
+endef
+
+define Package/apinger/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apinger $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/apinger.conf $(1)/etc/apinger.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/apinger.init $(1)/etc/init.d/apinger
+endef
+
+$(eval $(call BuildPackage,apinger))
+
diff --git a/net/apinger/files/apinger.init b/net/apinger/files/apinger.init
new file mode 100644 (file)
index 0000000..8caac38
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
+START=80
+
+SERVICE_USE_PID=1
+
+start() {
+       service_start /usr/sbin/apinger
+}
+
+stop() {
+       service_stop /usr/sbin/apinger
+}
+
+reload() {
+       service_reload /usr/sbin/apinger
+}
diff --git a/net/apinger/patches/001-autoreconf.patch b/net/apinger/patches/001-autoreconf.patch
new file mode 100644 (file)
index 0000000..cb5bd45
--- /dev/null
@@ -0,0 +1,13 @@
+--- apinger-0.6.1/acinclude.m4 2003-10-21 12:44:48.000000000 +0000
++++ apinger-0.6.1/acinclude.m4 2015-04-08 15:27:37.451903960 +0000
+@@ -39,9 +39,7 @@
+               [$jk_inet_includes
+ $jk_icmp_includes])
+-AC_CHECK_MEMBERS([struct icmp.icmp_type, struct icmp.icmp_code,\
+-struct icmp.icmp_cksum, struct icmp.icmp_seq,\
+-struct icmp.icmp_id],[],
++AC_CHECK_MEMBERS([struct icmp.icmp_type, struct icmp.icmp_code,struct icmp.icmp_cksum, struct icmp.icmp_seq,struct icmp.icmp_id],[],
+               AC_MSG_ERROR(struct icmp not defined or not compatible),
+               [$jk_inet_includes
+ $jk_icmp_includes])
diff --git a/net/apinger/patches/002-run_as_user.patch b/net/apinger/patches/002-run_as_user.patch
new file mode 100644 (file)
index 0000000..16d64ac
--- /dev/null
@@ -0,0 +1,11 @@
+--- apinger-0.6.1/src/apinger.conf.orig        2015-04-08 16:05:24.558919722 +0000
++++ apinger-0.6.1/src/apinger.conf     2015-04-08 16:07:47.089170236 +0000
+@@ -9,7 +9,7 @@
+ ## User and group the pinger should run as
+ user "nobody"
+-group "nobody"
++group "nogroup"
+ ## Mailer to use (default: "/usr/lib/sendmail -t")
+ #mailer "/var/qmail/bin/qmail-inject" 
diff --git a/net/apinger/patches/003-no_docs.patch b/net/apinger/patches/003-no_docs.patch
new file mode 100644 (file)
index 0000000..c08f44d
--- /dev/null
@@ -0,0 +1,11 @@
+--- apinger-0.6.1/Makefile.am.orig     2015-04-08 16:47:40.999990050 +0000
++++ apinger-0.6.1/Makefile.am  2015-04-08 16:48:07.565220137 +0000
+@@ -1,7 +1,7 @@
+ EXTRA_DIST = autogen.sh TODO BUGS
+-SUBDIRS = src doc
++SUBDIRS = src
+ .PHONY: ChangeLog
diff --git a/net/bind/patches/002-autoconf-ar-fix.patch b/net/bind/patches/002-autoconf-ar-fix.patch
new file mode 100644 (file)
index 0000000..501fa7d
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/configure.in
++++ b/configure.in
+@@ -93,26 +93,11 @@ esac
+ #
+ AC_CONFIG_FILES([make/rules make/includes])
+-AC_PATH_PROG(AR, ar)
+-ARFLAGS="cruv"
+-AC_SUBST(AR)
+-AC_SUBST(ARFLAGS)
+-
+ # The POSIX ln(1) program.  Non-POSIX systems may substitute
+ # "copy" or something.
+ LN=ln
+ AC_SUBST(LN)
+-case "$AR" in
+-      "")
+-              AC_MSG_ERROR([
+-ar program not found.  Please fix your PATH to include the directory in
+-which ar resides, or set AR in the environment with the full path to ar.
+-])
+-
+-              ;;
+-esac
+-
+ #
+ # Etags.
+ #
index ad9d3015e3b62efd7a0305efc253d7df9d912e81..e6be637566057b1d69f044251a342690d76ae252 100644 (file)
@@ -113,7 +113,7 @@ define Build/Configure
        $(if $(CONFIG_COOVACHILLI_LARGELIMITS),--enable,--disable)-largelimits \
        $(if $(CONFIG_COOVACHILLI_UAMDOMAINFILE),--enable,--disable)-uamdomainfile \
        $(if $(CONFIG_COOVACHILLI_MATRIXSSL),--with,--without)-matrixssl \
-       $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyaxssl \
+       $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyassl \
        $(if $(CONFIG_COOVACHILLI_OPENSSL),--with,--without)-openssl \
        $(if $(CONFIG_PACKAGE_kmod-ipt-coova),--with-nfcoova) \
        )
diff --git a/net/coova-chilli/patches/300-fix-compile-with-cyassl.patch b/net/coova-chilli/patches/300-fix-compile-with-cyassl.patch
new file mode 100644 (file)
index 0000000..3b61d49
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/src/md5.h
++++ b/src/md5.h
+@@ -28,6 +28,14 @@
+ #define MD5Update MD5_Update
+ #define MD5Final MD5_Final
++#elif HAVE_CYASSL
++#include <cyassl/openssl/md5.h>
++
++#define MD5Init MD5_Init
++#define MD5Update MD5_Update
++#define MD5Final MD5_Final
++
++typedef struct CYASSL_MD5_CTX MD5_CTX;
+ #else
+ struct MD5Context {
+--- a/src/md5.c
++++ b/src/md5.c
+@@ -18,7 +18,7 @@
+ #include <string.h>           /* for memcpy() */
+ #include "md5.h"
+-#ifndef HAVE_OPENSSL
++#if !defined(HAVE_OPENSSL) && !defined(HAVE_CYASSL)
+ void byteReverse(unsigned char *buf, size_t longs);
index 54379bf1dc2019291d2ad20219c1263888098224..f739cb729c35e7732c067e77870c8f0379de43ff 100644 (file)
@@ -1,9 +1,15 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+#
+
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 # Version == major.minor.patch
 # increase on new functionality (minor) or patches (patch)
-PKG_VERSION:=2.4.0
+PKG_VERSION:=2.4.1
 # Release == build
 # increase on changes of services files or tld_names.dat
 PKG_RELEASE:=1
@@ -103,6 +109,7 @@ define Build/Compile
                -e '/^\/\/\s/d' \
                -e '/^\s*$$$$/d'        $$$$FILE; \
        done
+       gzip -9 $(PKG_BUILD_DIR)/files/tld_names.dat
 endef
 
 define Package/$(PKG_NAME)/conffiles
@@ -158,7 +165,7 @@ endef
 define Package/$(PKG_NAME)_cloudflare/install
        $(INSTALL_DIR) $(1)/usr/lib/ddns
        $(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/update_CloudFlare.sh $(1)/usr/lib/ddns
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/tld_names.dat $(1)/usr/lib/ddns
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/tld_names.dat.gz $(1)/usr/lib/ddns
 endef
 define Package/$(PKG_NAME)_cloudflare/postinst
        #!/bin/sh
index 57b5477f88ed1c6a7e9700655e331cd7ed6db366..5d69bb17cc590e6243d9c20a03de043d76e5d2ff 100644 (file)
@@ -11,7 +11,7 @@ config ddns "global"
 
 
 config service "myddns_ipv4"
-       option service_name     "example.org"
+       option service_name     "dyndns.com"
        option domain           "yourhost.example.com"
        option username         "your_username"
        option password         "your_password"
index 84abfd5e5ba022d69943c205077fbed47fe89fcd..2cc9b90fa48b3140a7db5e89f491f7b8413aa8ec 100644 (file)
@@ -24,4 +24,5 @@ start() {
 
 stop() {
        killall dynamic_dns_updater.sh 2>/dev/null
+       return 0 # if killall fails, ignore
 }
old mode 100644 (file)
new mode 100755 (executable)
index 9bd2f81..0023f88
@@ -37,7 +37,7 @@ PIDFILE=""            # pid file
 UPDFILE=""             # store UPTIME of last update
 DATFILE=""             # save stdout data of WGet and other external programs called
 ERRFILE=""             # save stderr output of WGet and other external programs called
-TLDFILE=/usr/lib/ddns/tld_names.dat    # TLD file used by split_FQDN
+TLDFILE=/usr/lib/ddns/tld_names.dat.gz # TLD file used by split_FQDN
 
 CHECK_SECONDS=0                # calculated seconds out of given
 FORCE_SECONDS=0                # interval and unit
@@ -1058,43 +1058,63 @@ split_FQDN() {
        # $4    name of variable to store Host/Subdomain
 
        [ $# -ne 4 ] && write_log 12 "Error calling 'split_FQDN()' - wrong number of parameters"
+       [ -z "$1"  ] && write_log 12 "Error calling 'split_FQDN()' - missing FQDN to split"
+       [ -f $TLDFILE ] || write_log 12 "Error calling 'split_FQDN()' - missing file '$TLDFILE'"
 
-       _SET="$@"                                       # save given parameters
-       local _FHOST _FTLD _FOUND
-       local _FDOM=$(echo "$1" | tr [A-Z] [a-z])       # to lower
+       local _HOST _FDOM _CTLD _FTLD
+       local _SET="$@"                                 # save given function parameters
 
-       set -- $(echo "$_FDOM" | tr "." " ")            # replace DOT with SPACE and set as script parameters
-       _FDOM=""                                        # clear variable for later reuse
+       local _PAR=$(echo "$1" | tr [A-Z] [a-z] | tr "." " ")   # to lower and replace DOT with SPACE
+       set -- $_PAR                                    # set new as function parameters
+       _PAR=""                                         # clear variable for later reuse
+       while [ -n "$1" ] ; do                          # as long we have parameters
+               _PAR="$1 $_PAR"                         # invert order of parameters
+               shift
+       done
+       set -- $_PAR                                    # use new as function parameters
+       _PAR=""                                         # clear variable
 
        while [ -n "$1" ] ; do                          # as long we have parameters
-               _FTLD=$(echo $@ | tr " " ".")           # build back dot separated as TLD
-               # look if match excludes "!" in tld_names.dat
-               grep -E "^!$_FTLD$" $TLDFILE >/dev/null 2>&1 || {
-                       # Don't match excludes
-                       # check if match any "*" in tld_names.dat
-                       grep -E "^*.$_FTLD$" $TLDFILE >/dev/null 2>&1 && {
-                               _FOUND="VALID"
-                               break   # found leave while
-                       }
-                       # check if exact match in tld_names.dat
-                       grep -E "^$_FTLD$" $TLDFILE >/dev/null 2>&1 && {
-                               _FOUND="VALID"
-                               break   # found leave while
-                       }
+               if [ -z "$_CTLD" ]; then                # first loop
+                       _CTLD="$1"                      # CURRENT TLD to look at
+                       shift
+               else
+                       _CTLD="$1.$_CTLD"               # Next TLD to look at
+                       shift
+               fi
+               # check if TLD exact match in tld_names.dat, save TLD
+               zcat $TLDFILE | grep -E "^$_CTLD$" >/dev/null 2>&1 && {
+                       _FTLD="$_CTLD"          # save found
+                       _FDOM="$1"              # save domain next step might be invalid
+                       continue
                }
-               # nothing match so
-               _FHOST="$_FHOST $_FDOM"         # append DOMAIN to last found HOST
-               _FDOM="$1"                      # set 1st parameter as DOMAIN
-               _FTLD=""                        # clear TLD
-               shift                           # delete 1st parameter and retry with the rest
+               # check if match any "*" in tld_names.dat,
+               zcat $TLDFILE | grep -E "^\*.$_CTLD$" >/dev/null 2>&1 && {
+                       [ -z "$1" ] && break    # no more data break
+                       # check if next level TLD match excludes "!" in tld_names.dat
+                       if zcat $TLDFILE | grep -E "^!$1.$_CTLD$" >/dev/null 2>&1 ; then
+                               _FTLD="$_CTLD"  # Yes
+                       else
+                               _FTLD="$1.$_CTLD"
+                               shift
+                       fi
+                       _FDOM="$1"; shift
+               }
+               [ -n "$_FTLD" ] && break        # we have something valid, break
+       done
+
+       # the leftover parameters are the HOST/SUBDOMAIN
+       while [ -n "$1" ]; do
+               _HOST="$1 $HOST"                # remember we need to invert
+               shift
        done
+       _HOST=$(echo $_HOST | tr " " ".")       # insert DOT
 
        set -- $_SET                            # set back parameters from function call
-       [ -n "$_FHOST" ] && _FHOST=$(echo $_FHOST | tr " " ".") # put dots back into HOST
-       [ -n "$_FOUND" ] && {
-               eval "$2=$_FTLD"        # set found TLD
-               eval "$3=$_FDOM"        # set found registrable domain
-               eval "$4=$_FHOST"       # set found HOST/SUBDOMAIN
+       [ -n "$_FTLD" ] && {
+               eval "$2=$_FTLD"                # set TLD
+               eval "$3=$_FDOM"                # set registrable domain
+               eval "$4=$_HOST"                # set HOST/SUBDOMAIN
                return 0
        }
        eval "$2=''"            # clear TLD
index cc22d25e6afe2a9045b8e5feacbcde49055ffd8a..0f8bb5aa8597038615a208b3daf0d22f51dfae47 100755 (executable)
@@ -22,8 +22,8 @@
 # preset some variables, wrong or not set in dynamic_dns_functions.sh
 SECTION_ID="lucihelper"
 LOGFILE="$LOGDIR/$SECTION_ID.log"
-DATFILE="$RUNDIR/$SECTION_ID.dat"      # save stdout data of WGet and other extern programs called
-ERRFILE="$RUNDIR/$SECTION_ID.err"      # save stderr output of WGet and other extern programs called
+DATFILE="$RUNDIR/$SECTION_ID.$$.dat"   # save stdout data of WGet and other extern programs called
+ERRFILE="$RUNDIR/$SECTION_ID.$$.err"   # save stderr output of WGet and other extern programs called
 VERBOSE_MODE=0         # no console logging
 # global variables normally set by reading DDNS UCI configuration
 use_syslog=0           # no syslog
index 88831e9e7badc601d8891e986d68870ab2d22dc6..a0781a24fb7bdef597fd196f4ac46d0ef37403cd 100644 (file)
@@ -38,3 +38,6 @@
 
 # IPv6 @ freedns.afraid.org
 "freedns.afraid.org"   "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
+
+# IPv6 @ LoopiaDNS
+"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]"
index f9274e43b01774d388e60383ae376c5c5ba3c837..474b780b304bb5b6927f40843a7bd235a2d64a46 100644 (file)
@@ -7113,7 +7113,10 @@ xxx
 *.zw
 
 
-// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2015-01-27T00:02:07Z
+// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2015-04-07T06:02:08Z
+
+// aaa : 2015-02-26 American Automobile Association, Inc.
+aaa
 
 // abb : 2014-10-24 ABB Ltd
 abb
@@ -7151,12 +7154,18 @@ ads
 // adult : 2014-10-16 ICM Registry AD LLC
 adult
 
+// aeg : 2015-03-19 Aktiebolaget Electrolux
+aeg
+
 // afl : 2014-10-02 Australian Football League
 afl
 
 // africa : 2014-03-24 ZA Central Registry NPC trading as Registry.Africa
 africa
 
+// africamagic : 2015-03-05 Electronic Media Network (Pty) Ltd
+africamagic
+
 // agency : 2013-11-14 Steel Falls, LLC
 agency
 
@@ -7277,6 +7286,9 @@ bbc
 // bbva : 2014-10-02 BANCO BILBAO VIZCAYA ARGENTARIA, S.A.
 bbva
 
+// bcg : 2015-04-02 The Boston Consulting Group, Inc.
+bcg
+
 // bcn : 2014-07-24 Municipi de Barcelona
 bcn
 
@@ -7370,6 +7382,9 @@ broadway
 // broker : 2014-12-11 IG Group Holdings PLC
 broker
 
+// brother : 2015-01-29 Brother Industries, Ltd.
+brother
+
 // brussels : 2014-02-06 DNS.be vzw
 brussels
 
@@ -7397,6 +7412,9 @@ bzh
 // cab : 2013-10-24 Half Sunset, LLC
 cab
 
+// cafe : 2015-02-11 Pioneer Canyon, LLC
+cafe
+
 // cal : 2014-07-24 Charleston Road Registry Inc.
 cal
 
@@ -7496,9 +7514,12 @@ christmas
 // chrome : 2014-07-24 Charleston Road Registry Inc.
 chrome
 
-// church : 2014-02-06 Holly Fileds, LLC
+// church : 2014-02-06 Holly Fields, LLC
 church
 
+// cipriani : 2015-02-19 Hotel Cipriani Srl
+cipriani
+
 // circle : 2014-12-18 Amazon EU S.à r.l.
 circle
 
@@ -7589,6 +7610,12 @@ corsica
 // country : 2013-12-19 Top Level Domain Holdings Limited
 country
 
+// coupon : 2015-02-26 Amazon EU S.à r.l.
+coupon
+
+// coupons : 2015-03-26 Black Island, LLC
+coupons
+
 // courses : 2014-12-04 OPEN UNIVERSITIES AUSTRALIA PTY LTD
 courses
 
@@ -7664,6 +7691,9 @@ delivery
 // dell : 2014-10-24 Dell Inc.
 dell
 
+// delta : 2015-02-19 Delta Air Lines, Inc.
+delta
+
 // democrat : 2013-10-24 United TLD Holdco Ltd.
 democrat
 
@@ -7721,6 +7751,12 @@ doosan
 // download : 2014-11-20 dot Support Limited
 download
 
+// drive : 2015-03-05 Charleston Road Registry Inc.
+drive
+
+// dstv : 2015-03-12 MultiChoice (Proprietary) Limited
+dstv
+
 // dubai : 2015-01-01 Dubai Smart Government Department
 dubai
 
@@ -7796,6 +7832,9 @@ expert
 // exposed : 2013-12-05 Victor Beach, LLC
 exposed
 
+// express : 2015-02-11 Sea Sunset, LLC
+express
+
 // fage : 2014-12-18 Fage International S.A.
 fage
 
@@ -7808,6 +7847,9 @@ fairwinds
 // faith : 2014-11-20 dot Faith Limited
 faith
 
+// family : 2015-04-02 Bitter Galley, LLC
+family
+
 // fan : 2014-03-06
 fan
 
@@ -7859,6 +7901,9 @@ fit
 // fitness : 2014-03-06 Brice Orchard, LLC
 fitness
 
+// flickr : 2015-04-02 Yahoo! Domain Services Inc.
+flickr
+
 // flights : 2013-12-05 Fox Station, LLC
 flights
 
@@ -7889,6 +7934,9 @@ forex
 // forsale : 2014-05-22
 forsale
 
+// forum : 2015-04-02 Fegistry, LLC
+forum
+
 // foundation : 2013-12-05 John Dale, LLC
 foundation
 
@@ -7898,6 +7946,9 @@ frl
 // frogans : 2013-12-19 OP3FT
 frogans
 
+// frontier : 2015-02-05 Frontier Communications Corporation
+frontier
+
 // fund : 2014-03-20 John Castle, LLC
 fund
 
@@ -7907,12 +7958,18 @@ furniture
 // futbol : 2013-09-20
 futbol
 
+// fyi : 2015-04-02 Silver Tigers, LLC
+fyi
+
 // gal : 2013-11-07 Asociación puntoGAL
 gal
 
 // gallery : 2013-09-13 Sugar House, LLC
 gallery
 
+// gallup : 2015-02-19 Gallup, Inc.
+gallup
+
 // garden : 2014-06-26 Top Level Domain Holdings Limited
 garden
 
@@ -7928,6 +7985,9 @@ gea
 // gent : 2014-01-23 COMBELL GROUP NV/SA
 gent
 
+// genting : 2015-03-12 Resorts World Inc Pte. Ltd.
+genting
+
 // ggee : 2014-01-09 GMO Internet, Inc.
 ggee
 
@@ -7988,6 +8048,9 @@ gop
 // got : 2014-12-18 Amazon EU S.à r.l.
 got
 
+// gotv : 2015-03-12 MultiChoice (Proprietary) Limited
+gotv
+
 // graphics : 2013-09-13 Over Madison, LLC
 graphics
 
@@ -8027,12 +8090,21 @@ hangout
 // haus : 2013-12-05
 haus
 
+// hdfcbank : 2015-02-12 HDFC Bank Limited
+hdfcbank
+
+// health : 2015-02-11 DotHealth, LLC
+health
+
 // healthcare : 2014-06-12 Silver Glen, LLC
 healthcare
 
 // help : 2014-06-26 Uniregistry, Corp.
 help
 
+// helsinki : 2015-02-05 City of Helsinki
+helsinki
+
 // here : 2014-02-06 Charleston Road Registry Inc.
 here
 
@@ -8048,12 +8120,18 @@ hitachi
 // hiv : 2014-03-13 dotHIV gemeinnuetziger e.V.
 hiv
 
+// hockey : 2015-03-19 Half Willow, LLC
+hockey
+
 // holdings : 2013-08-27 John Madison, LLC
 holdings
 
 // holiday : 2013-11-07 Goose Woods, LLC
 holiday
 
+// homedepot : 2015-04-02 Homer TLC, Inc.
+homedepot
+
 // homes : 2014-01-09 DERHomes, LLC
 homes
 
@@ -8069,6 +8147,9 @@ host
 // hosting : 2014-05-29 Uniregistry, Corp.
 hosting
 
+// hoteles : 2015-03-05 Travel Reservations SRL
+hoteles
+
 // hotmail : 2014-12-18 Microsoft Corporation
 hotmail
 
@@ -8081,9 +8162,15 @@ how
 // hsbc : 2014-10-24 HSBC Holdings PLC
 hsbc
 
+// htc : 2015-04-02 HTC corporation
+htc
+
 // ibm : 2014-07-31 International Business Machines Corporation
 ibm
 
+// icbc : 2015-02-19 Industrial and Commercial Bank of China Limited
+icbc
+
 // ice : 2014-10-30 IntercontinentalExchange, Inc.
 ice
 
@@ -8117,6 +8204,9 @@ ink
 // institute : 2013-11-07 Outer Maple, LLC
 institute
 
+// insurance : 2015-02-19 fTLD Registry Services LLC
+insurance
+
 // insure : 2014-03-20 Pioneer Willow, LLC
 insure
 
@@ -8132,6 +8222,9 @@ ipiranga
 // irish : 2014-08-07 Dot-Irish LLC
 irish
 
+// iselect : 2015-02-11 iSelect Ltd
+iselect
+
 // ist : 2014-08-28 Istanbul Metropolitan Municipality
 ist
 
@@ -8156,9 +8249,21 @@ jcb
 // jetzt : 2014-01-09 New TLD Company AB
 jetzt
 
+// jewelry : 2015-03-05 Wild Bloom, LLC
+jewelry
+
+// jio : 2015-04-02 Affinity Names, Inc.
+jio
+
 // jlc : 2014-12-04 Richemont DNS Inc.
 jlc
 
+// jll : 2015-04-02 Jones Lang LaSalle Incorporated
+jll
+
+// jmp : 2015-03-26 Matrix IP LLC
+jmp
+
 // joburg : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry
 joburg
 
@@ -8210,18 +8315,27 @@ krd
 // kred : 2013-12-19 KredTLD Pty Ltd
 kred
 
+// kyknet : 2015-03-05 Electronic Media Network (Pty) Ltd
+kyknet
+
 // kyoto : 2014-11-07 Academic Institution: Kyoto Jyoho Gakuen
 kyoto
 
 // lacaixa : 2014-01-09 CAIXA D'ESTALVIS I PENSIONS DE BARCELONA
 lacaixa
 
+// lancaster : 2015-02-12 LANCASTER
+lancaster
+
 // land : 2013-09-10 Pine Moon, LLC
 land
 
 // landrover : 2014-11-13 Jaguar Land Rover Ltd
 landrover
 
+// lasalle : 2015-04-02 Jones Lang LaSalle Incorporated
+lasalle
+
 // lat : 2014-10-16 ECOM-LAC Federaciòn de Latinoamèrica y el Caribe para Internet y el Comercio Electrònico
 lat
 
@@ -8288,12 +8402,18 @@ link
 // live : 2014-12-04 Half Woods, LLC
 live
 
+// lixil : 2015-03-19 LIXIL Group Corporation
+lixil
+
 // loan : 2014-11-20 dot Loan Limited
 loan
 
 // loans : 2014-03-20 June Woods, LLC
 loans
 
+// lol : 2015-01-30 Uniregistry, Corp.
+lol
+
 // london : 2013-11-14 Dot London Domains Limited
 london
 
@@ -8354,10 +8474,13 @@ markets
 // marriott : 2014-10-09 Marriott Worldwide Corporation
 marriott
 
+// mba : 2015-04-02 Lone Hollow, LLC
+mba
+
 // media : 2014-03-06 Grand Glen, LLC
 media
 
-// meet : 2014-01-16 Afilias Limited
+// meet : 2014-01-16
 meet
 
 // melbourne : 2014-05-29 The Crown in right of the State of Victoria, represented by its Department of State Development, Business and Innovation
@@ -8369,6 +8492,9 @@ meme
 // memorial : 2014-10-16 Dog Beach, LLC
 memorial
 
+// men : 2015-02-26 Exclusive Registry Limited
+men
+
 // menu : 2013-09-11 Wedding TLD2, LLC
 menu
 
@@ -8387,6 +8513,9 @@ mini
 // mma : 2014-11-07 MMA IARD
 mma
 
+// mnet : 2015-03-05 Electronic Media Network (Pty) Ltd
+mnet
+
 // mobily : 2014-12-18 GreenTech Consultancy Company W.L.L.
 mobily
 
@@ -8423,6 +8552,9 @@ motorcycles
 // mov : 2014-01-30 Charleston Road Registry Inc.
 mov
 
+// movie : 2015-02-05 New Frostbite, LLC
+movie
+
 // movistar : 2014-10-16 Telefónica S.A.
 movistar
 
@@ -8432,12 +8564,30 @@ mtn
 // mtpc : 2014-11-20 Mitsubishi Tanabe Pharma Corporation
 mtpc
 
+// mtr : 2015-03-12 MTR Corporation Limited
+mtr
+
+// multichoice : 2015-03-12 MultiChoice (Proprietary) Limited
+multichoice
+
+// mutual : 2015-04-02 Northwestern Mutual MU TLD Registry, LLC
+mutual
+
+// mzansimagic : 2015-03-05 Electronic Media Network (Pty) Ltd
+mzansimagic
+
 // nadex : 2014-12-11 IG Group Holdings PLC
 nadex
 
 // nagoya : 2013-10-24 GMO Registry, Inc.
 nagoya
 
+// naspers : 2015-02-12 Intelprop (Proprietary) Limited
+naspers
+
+// natura : 2015-03-12 NATURA COSMÉTICOS S.A.
+natura
+
 // navy : 2014-03-06 United TLD Holdco Ltd.
 navy
 
@@ -8456,7 +8606,7 @@ neustar
 // new : 2014-01-30 Charleston Road Registry Inc.
 new
 
-// news : 2014-12-18 Hidden Bloom, LLC
+// news : 2014-12-18
 news
 
 // nexus : 2014-07-24 Charleston Road Registry Inc.
@@ -8501,6 +8651,9 @@ nyc
 // obi : 2014-09-25 OBI Group Holding SE & Co. KGaA
 obi
 
+// office : 2015-03-12 Microsoft Corporation
+office
+
 // okinawa : 2013-12-05 BusinessRalliart Inc.
 okinawa
 
@@ -8525,9 +8678,15 @@ ooo
 // oracle : 2014-06-19 Oracle Corporation
 oracle
 
+// orange : 2015-03-12 Orange Brand Services Limited
+orange
+
 // organic : 2014-03-27 Afilias Limited
 organic
 
+// orientexpress : 2015-02-05 Belmond Ltd.
+orientexpress
+
 // osaka : 2014-09-04 Interlink Co., Ltd.
 osaka
 
@@ -8540,6 +8699,9 @@ ovh
 // page : 2014-12-04 Charleston Road Registry Inc.
 page
 
+// pamperedchef : 2015-02-05 The Pampered Chef, Ltd.
+pamperedchef
+
 // panerai : 2014-11-07 Richemont DNS Inc.
 panerai
 
@@ -8558,6 +8720,12 @@ parts
 // party : 2014-09-11 Blue Sky Registry Limited
 party
 
+// passagens : 2015-03-05 Travel Reservations SRL
+passagens
+
+// payu : 2015-02-12 MIH PayU B.V.
+payu
+
 // pharmacy : 2014-06-19 National Association of Boards of Pharmacy
 pharmacy
 
@@ -8603,9 +8771,15 @@ pizza
 // place : 2014-04-24 Snow Galley, LLC
 place
 
+// play : 2015-03-05 Charleston Road Registry Inc.
+play
+
 // plumbing : 2013-09-10 Spring Tigers, LLC
 plumbing
 
+// plus : 2015-02-05 Sugar Mill, LLC
+plus
+
 // pohl : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG
 pohl
 
@@ -8648,6 +8822,9 @@ qpon
 // quebec : 2013-12-19 PointQuébec Inc
 quebec
 
+// quest : 2015-03-26 Quest ION Limited
+quest
+
 // racing : 2014-12-04 Premier Registry Limited
 racing
 
@@ -8657,6 +8834,9 @@ read
 // realtor : 2014-05-29 Real Estate Domains LLC
 realtor
 
+// realty : 2015-03-19 Fegistry, LLC
+realty
+
 // recipes : 2013-10-17 Grand Island, LLC
 recipes
 
@@ -8666,6 +8846,9 @@ red
 // redstone : 2014-10-31 Redstone Haute Couture Co., Ltd.
 redstone
 
+// redumbrella : 2015-03-26 Travelers TLD, LLC
+redumbrella
+
 // rehab : 2014-03-06 United TLD Holdco Ltd.
 rehab
 
@@ -8678,6 +8861,9 @@ reisen
 // reit : 2014-09-04 National Association of Real Estate Investment Trusts, Inc.
 reit
 
+// reliance : 2015-04-02 Reliance Industries Limited
+reliance
+
 // ren : 2013-12-12 Beijing Qianxiang Wangjing Technology Development Co., Ltd.
 ren
 
@@ -8714,6 +8900,9 @@ rich
 // ricoh : 2014-11-20 Ricoh Company, Ltd.
 ricoh
 
+// ril : 2015-04-02 Reliance Industries Limited
+ril
+
 // rio : 2014-02-27 Empresa Municipal de Informática SA - IPLANRIO
 rio
 
@@ -8738,6 +8927,12 @@ rsvp
 // ruhr : 2013-10-02 regiodot GmbH & Co. KG
 ruhr
 
+// run : 2015-03-19 Snow Park, LLC
+run
+
+// rwe : 2015-04-02 RWE AG
+rwe
+
 // ryukyu : 2014-01-09 BusinessRalliart Inc.
 ryukyu
 
@@ -8780,9 +8975,15 @@ sapo
 // sarl : 2014-07-03 Delta Orchard, LLC
 sarl
 
+// sas : 2015-04-02 Research IP LLC
+sas
+
 // saxo : 2014-10-31 Saxo Bank A/S
 saxo
 
+// sbi : 2015-03-12 STATE BANK OF INDIA
+sbi
+
 // sbs : 2014-11-07 SPECIAL BROADCASTING SERVICE CORPORATION
 sbs
 
@@ -8852,9 +9053,15 @@ shoes
 // shouji : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD.
 shouji
 
+// show : 2015-03-05 Snow Beach, LLC
+show
+
 // shriram : 2014-01-23 Shriram Capital Ltd.
 shriram
 
+// sina : 2015-03-12 Sina Corporation
+sina
+
 // singles : 2013-08-27 Fern Madison, LLC
 singles
 
@@ -8873,6 +9080,12 @@ skype
 // smile : 2014-12-18 Amazon EU S.à r.l.
 smile
 
+// sncf : 2015-02-19 Société Nationale des Chemins de fer Francais S N C F
+sncf
+
+// soccer : 2015-03-26 Foggy Shadow, LLC
+soccer
+
 // social : 2013-11-07 United TLD Holdco Ltd.
 social
 
@@ -8888,6 +9101,9 @@ solar
 // solutions : 2013-11-07 Silver Cover, LLC
 solutions
 
+// song : 2015-02-26 Amazon EU S.à r.l.
+song
+
 // sony : 2015-01-08 Sony Corporation
 sony
 
@@ -8900,6 +9116,9 @@ space
 // spiegel : 2014-02-05 SPIEGEL-Verlag Rudolf Augstein GmbH & Co. KG
 spiegel
 
+// spot : 2015-02-26 Amazon EU S.à r.l.
+spot
+
 // spreadbetting : 2014-12-11 IG Group Holdings PLC
 spreadbetting
 
@@ -8909,6 +9128,12 @@ stada
 // star : 2015-01-08 Star India Private Limited
 star
 
+// starhub : 2015-02-05 StarHub Limited
+starhub
+
+// statebank : 2015-03-12 STATE BANK OF INDIA
+statebank
+
 // statoil : 2014-12-04 Statoil ASA
 statoil
 
@@ -8924,6 +9149,9 @@ stockholm
 // storage : 2014-12-22 Self Storage Company LLC
 storage
 
+// studio : 2015-02-11 Spring Goodbye, LLC
+studio
+
 // study : 2014-12-11 OPEN UNIVERSITIES AUSTRALIA PTY LTD
 study
 
@@ -8933,6 +9161,9 @@ style
 // sucks : 2014-12-22 Vox Populi Registry Inc.
 sucks
 
+// supersport : 2015-03-05 SuperSport International Holdings Proprietary Limited
+supersport
+
 // supplies : 2013-12-19 Atomic Fields, LLC
 supplies
 
@@ -8975,6 +9206,9 @@ taipei
 // taobao : 2015-01-15 Alibaba Group Holding Limited
 taobao
 
+// tatamotors : 2015-03-12 Tata Motors Ltd
+tatamotors
+
 // tatar : 2014-04-24 Limited Liability Company
 tatar
 
@@ -8984,12 +9218,24 @@ tattoo
 // tax : 2014-03-20 Storm Orchard, LLC
 tax
 
+// taxi : 2015-03-19 Pine Falls, LLC
+taxi
+
 // tci : 2014-09-12 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
 tci
 
+// team : 2015-03-05 Atomic Lake, LLC
+team
+
+// tech : 2015-01-30 Dot Tech LLC
+tech
+
 // technology : 2013-09-13 Auburn Falls
 technology
 
+// telecity : 2015-02-19 TelecityGroup International Limited
+telecity
+
 // telefonica : 2014-10-16 Telefónica S.A.
 telefonica
 
@@ -8999,9 +9245,21 @@ temasek
 // tennis : 2014-12-04 Cotton Bloom, LLC
 tennis
 
+// thd : 2015-04-02 Homer TLC, Inc.
+thd
+
+// theater : 2015-03-19 Blue Tigers, LLC
+theater
+
+// tickets : 2015-02-05 Accent Media Limited
+tickets
+
 // tienda : 2013-11-14 Victor Manor, LLC
 tienda
 
+// tiffany : 2015-01-30 Tiffany and Company
+tiffany
+
 // tips : 2013-09-20 Corn Willow, LLC
 tips
 
@@ -9050,15 +9308,30 @@ trading
 // training : 2013-11-07 Wild Willow, LLC
 training
 
+// travelers : 2015-03-26 Travelers TLD, LLC
+travelers
+
+// travelersinsurance : 2015-03-26 Travelers TLD, LLC
+travelersinsurance
+
 // trust : 2014-10-16
 trust
 
+// trv : 2015-03-26 Travelers TLD, LLC
+trv
+
 // tui : 2014-07-03 TUI AG
 tui
 
+// tunes : 2015-02-26 Amazon EU S.à r.l.
+tunes
+
 // tushu : 2014-12-18 Amazon EU S.à r.l.
 tushu
 
+// tvs : 2015-02-19 T V SUNDRAM IYENGAR & SONS LIMITED
+tvs
+
 // ubs : 2014-12-11 UBS AG
 ubs
 
@@ -9095,6 +9368,9 @@ viajes
 // video : 2014-10-16
 video
 
+// viking : 2015-04-02 Viking River Cruises (Bermuda) Ltd.
+viking
+
 // villas : 2013-12-05 New Sky, LLC
 villas
 
@@ -9134,6 +9410,9 @@ voto
 // voyage : 2013-08-27 Ruby House, LLC
 voyage
 
+// vuelos : 2015-03-05 Travel Reservations SRL
+vuelos
+
 // wales : 2014-05-08 Nominet UK
 wales
 
@@ -9155,6 +9434,9 @@ watches
 // weather : 2015-01-08 The Weather Channel, LLC
 weather
 
+// weatherchannel : 2015-03-12 The Weather Channel, LLC
+weatherchannel
+
 // webcam : 2014-01-23 dot Webcam Limited
 webcam
 
@@ -9167,6 +9449,12 @@ wed
 // wedding : 2014-04-24 Top Level Domain Holdings Limited
 wedding
 
+// weibo : 2015-03-05 Sina Corporation
+weibo
+
+// weir : 2015-01-29 Weir Group IP Limited
+weir
+
 // whoswho : 2014-02-20 Who's Who Registry
 whoswho
 
@@ -9219,6 +9507,10 @@ xin
 कॉम
 xn--11b4c3d
 
+// xn--1ck2e1b : 2015-02-26 Amazon EU S.à r.l.
+セール
+xn--1ck2e1b
+
 // xn--1qqw23a : 2014-01-09 Guangzhou YU Wei Information Technology Co., Ltd.
 佛山
 xn--1qqw23a
@@ -9283,6 +9575,10 @@ xn--80asehdb
 сайт
 xn--80aswg
 
+// xn--8y0a063a : 2015-03-26 China United Network Communications Corporation Limited
+联通
+xn--8y0a063a
+
 // xn--9dbq2a : 2015-01-15 VeriSign Sarl
 קום
 xn--9dbq2a
@@ -9291,10 +9587,18 @@ xn--9dbq2a
 时尚
 xn--9et52u
 
+// xn--9krt00a : 2015-03-12 Sina Corporation
+微博
+xn--9krt00a
+
 // xn--b4w605ferd : 2014-08-07 Temasek Holdings (Private) Limited
 淡马锡
 xn--b4w605ferd
 
+// xn--bck1b9a5dre4c : 2015-02-26 Amazon EU S.à r.l.
+ファッション
+xn--bck1b9a5dre4c
+
 // xn--c1avg : 2013-11-14 Public Interest Registry
 орг
 xn--c1avg
@@ -9303,11 +9607,15 @@ xn--c1avg
 नेट
 xn--c2br7g
 
+// xn--cck2b3b : 2015-02-26 Amazon EU S.à r.l.
+ストア
+xn--cck2b3b
+
 // xn--cg4bki : 2013-09-27 SAMSUNG SDS CO., LTD
 삼성
 xn--cg4bki
 
-// xn--czr694b : 2014-01-16 HU YI GLOBAL INFORMATION RESOURCES(HOLDING) COMPANY.HONGKONG LIMITED
+// xn--czr694b : 2014-01-16 HU YI GLOBAL INFORMATION RESOURCES (HOLDING) COMPANY.HONGKONG LIMITED
 商标
 xn--czr694b
 
@@ -9331,6 +9639,10 @@ xn--eckvdtc9d
 新闻
 xn--efvy88h
 
+// xn--estv75g : 2015-02-19 Industrial and Commercial Bank of China Limited
+工行
+xn--estv75g
+
 // xn--fhbei : 2015-01-15 VeriSign Sarl
 كوم
 xn--fhbei
@@ -9351,6 +9663,14 @@ xn--fjq720a
 谷歌
 xn--flw351e
 
+// xn--g2xx48c : 2015-01-30 Minds + Machines Group Limited
+购物
+xn--g2xx48c
+
+// xn--gckr3f0f : 2015-02-26 Amazon EU S.à r.l.
+クラウド
+xn--gckr3f0f
+
 // xn--hxt814e : 2014-05-15 Zodiac Libra Limited
 网店
 xn--hxt814e
@@ -9375,6 +9695,10 @@ xn--j1aef
 诺基亚
 xn--jlq61u9w7b
 
+// xn--jvr189m : 2015-02-26 Amazon EU S.à r.l.
+食品
+xn--jvr189m
+
 // xn--kcrx77d1x4a : 2014-11-07 Koninklijke Philips N.V.
 飞利浦
 xn--kcrx77d1x4a
@@ -9455,6 +9779,10 @@ xn--qcka1pmc
 世界
 xn--rhqv96g
 
+// xn--rovu88b : 2015-02-26 Amazon EU S.à r.l.
+書籍
+xn--rovu88b
+
 // xn--ses554g : 2014-01-16
 网址
 xn--ses554g
@@ -9501,6 +9829,9 @@ xyz
 // yachts : 2014-01-09 DERYachts, LLC
 yachts
 
+// yahoo : 2015-04-02 Yahoo! Domain Services Inc.
+yahoo
+
 // yamaxun : 2014-12-18 Amazon EU S.à r.l.
 yamaxun
 
index f69622e9c9c06ffdaa656f482b1bc83fd4047881..d53c5576f5f6328eb15fada3f1cd16d67e8d885f 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dmapd
-PKG_VERSION:=0.0.70
+PKG_VERSION:=0.0.72
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
@@ -18,7 +18,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.flyn.org/projects/dmapd
-PKG_MD5SUM:=f503bf95f79b5c1f9418cccf26203952
+PKG_MD5SUM:=0fe290d1bf003296b1ed9dfcc0108d6f
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=2
index 1f1d86dce6320128de503892fc467e261d8aa4d1..ac0c1b04bd0ade7ec5441f495ba66303766181c6 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=freeradius2
-PKG_VERSION:=2.2.6
+PKG_VERSION:=2.2.7
 PKG_RELEASE:=1
 
 PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/freeradius/
-PKG_MD5SUM:=e9a6f9bbee9706b008b924061ab3f915
+PKG_MD5SUM:=b84b9ffa1ac9b20b2643e5a08ac483a1
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYRIGHT LICENSE
index 2daaec82305d74d5143390757364d0bca10369a8..676f99cd1a4ee94c480136b8296cab04e002a04c 100644 (file)
@@ -1,5 +1,7 @@
---- a/Make.inc.in
-+++ b/Make.inc.in
+Index: freeradius-server-2.2.7/Make.inc.in
+===================================================================
+--- freeradius-server-2.2.7.orig/Make.inc.in
++++ freeradius-server-2.2.7/Make.inc.in
 @@ -5,6 +5,7 @@
  #
  
index 8794345fa8745ebeda0e1e930fa9b3ada8fc17bf..c486389b8c4dc3c71117bb7cab9527d7df4528d7 100644 (file)
@@ -1,5 +1,7 @@
---- a/raddb/dictionary.in
-+++ b/raddb/dictionary.in
+Index: freeradius-server-2.2.7/raddb/dictionary.in
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/dictionary.in
++++ freeradius-server-2.2.7/raddb/dictionary.in
 @@ -11,7 +11,7 @@
  #
  #     The filename given here should be an absolute path. 
@@ -9,8 +11,10 @@
  
  #
  #     Place additional attributes or $INCLUDEs here.  They will
---- a/raddb/eap.conf
-+++ b/raddb/eap.conf
+Index: freeradius-server-2.2.7/raddb/eap.conf
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/eap.conf
++++ freeradius-server-2.2.7/raddb/eap.conf
 @@ -27,7 +27,7 @@
                #  then that EAP type takes precedence over the
                #  default type configured here.
  
                        # This option enables support for MS-SoH
                        # see doc/SoH.txt for more info.
---- a/raddb/modules/counter
-+++ b/raddb/modules/counter
+Index: freeradius-server-2.2.7/raddb/modules/counter
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/modules/counter
++++ freeradius-server-2.2.7/raddb/modules/counter
 @@ -69,7 +69,7 @@
  #  'check-name' attribute.
  #
        key = User-Name
        count-attribute = Acct-Session-Time
        reset = daily
---- a/raddb/modules/pap
-+++ b/raddb/modules/pap
+Index: freeradius-server-2.2.7/raddb/modules/pap
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/modules/pap
++++ freeradius-server-2.2.7/raddb/modules/pap
 @@ -18,5 +18,5 @@
  #
  #  http://www.openldap.org/faq/data/cache/347.html
 -      auto_header = no
 +      auto_header = yes
  }
---- a/raddb/modules/radutmp
-+++ b/raddb/modules/radutmp
+Index: freeradius-server-2.2.7/raddb/modules/radutmp
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/modules/radutmp
++++ freeradius-server-2.2.7/raddb/modules/radutmp
 @@ -12,7 +12,7 @@ radutmp {
        #  Where the file is stored.  It's not a log file,
        #  so it doesn't need rotating.
  
        #  The field in the packet to key on for the
        #  'user' name,  If you have other fields which you want
---- a/raddb/modules/sradutmp
-+++ b/raddb/modules/sradutmp
+Index: freeradius-server-2.2.7/raddb/modules/sradutmp
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/modules/sradutmp
++++ freeradius-server-2.2.7/raddb/modules/sradutmp
 @@ -10,7 +10,7 @@
  # then name "sradutmp" to identify it later in the "accounting"
  # section.
        perm = 0644
        callerid = "no"
  }
---- a/raddb/radiusd.conf.in
-+++ b/raddb/radiusd.conf.in
+Index: freeradius-server-2.2.7/raddb/radiusd.conf.in
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/radiusd.conf.in
++++ freeradius-server-2.2.7/raddb/radiusd.conf.in
 @@ -66,7 +66,7 @@ name = radiusd
  
  #  Location of config and logfiles.
  #     clients = per_socket_clients
  }
  
-@@ -584,8 +584,8 @@ security {
+@@ -576,8 +576,8 @@ security {
  #
  #  allowed values: {no, yes}
  #
  
  
  # CLIENTS CONFIGURATION
-@@ -782,7 +782,7 @@ instantiate {
+@@ -774,7 +774,7 @@ instantiate {
        #  The entire command line (and output) must fit into 253 bytes.
        #
        #  e.g. Framed-Pool = `%{exec:/bin/echo foo}`
  
        #
        #  The expression module doesn't do authorization,
-@@ -799,15 +799,15 @@ instantiate {
+@@ -791,15 +791,15 @@ instantiate {
        #  other xlat functions such as md5, sha1 and lc.
        #
        #  We do not recommend removing it's listing here.
  
        # subsections here can be thought of as "virtual" modules.
        #
-@@ -831,7 +831,7 @@ instantiate {
+@@ -823,7 +823,7 @@ instantiate {
  #     to multiple times.
  #
  ######################################################################
  
  ######################################################################
  #
-@@ -841,9 +841,9 @@ $INCLUDE policy.conf
+@@ -833,9 +833,9 @@ $INCLUDE policy.conf
  #     match the regular expression: /[a-zA-Z0-9_.]+/
  #
  #     It allows you to define new virtual servers simply by placing
  
  ######################################################################
  #
-@@ -851,7 +851,7 @@ $INCLUDE sites-enabled/
+@@ -843,7 +843,7 @@ $INCLUDE sites-enabled/
  #     "authenticate {}", "accounting {}", have been moved to the
  #     the file:
  #
  #
  #     This is the "default" virtual server that has the same
  #     configuration as in version 1.0.x and 1.1.x.  The default
---- a/raddb/sites-available/default
-+++ b/raddb/sites-available/default
+Index: freeradius-server-2.2.7/raddb/sites-available/default
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/sites-available/default
++++ freeradius-server-2.2.7/raddb/sites-available/default
 @@ -85,7 +85,7 @@ authorize {
        #
        #  It takes care of processing the 'raddb/hints' and the
  #     ntdomain
  
        #
-@@ -195,8 +195,8 @@ authorize {
+@@ -197,8 +197,8 @@ authorize {
        # Use the checkval module
  #     checkval
  
  
        #
        #  If no other module has claimed responsibility for
-@@ -277,7 +277,7 @@ authenticate {
+@@ -279,7 +279,7 @@ authenticate {
        #  If you have a Cisco SIP server authenticating against
        #  FreeRADIUS, uncomment the following line, and the 'digest'
        #  line in the 'authorize' section.
  
        #
        #  Pluggable Authentication Modules.
-@@ -294,7 +294,7 @@ authenticate {
+@@ -296,7 +296,7 @@ authenticate {
        #  be used for authentication ONLY for compatibility with legacy
        #  FreeRADIUS configurations.
        #
  
        # Uncomment it if you want to use ldap for authentication
        #
-@@ -330,8 +330,8 @@ authenticate {
+@@ -332,8 +332,8 @@ authenticate {
  #
  #  Pre-accounting.  Decide which accounting type to use.
  #
  
        #
        #  Session start times are *implied* in RADIUS.
-@@ -354,7 +354,7 @@ preacct {
+@@ -356,7 +356,7 @@ preacct {
        #
        #  Ensure that we have a semi-unique identifier for every
        #  request, and many NAS boxes are broken.
  
        #
        #  Look for IPASS-style 'realm/', and if not found, look for
-@@ -364,13 +364,13 @@ preacct {
+@@ -366,13 +366,13 @@ preacct {
        #  Accounting requests are generally proxied to the same
        #  home server as authentication requests.
  #     IPASS
  
  #
  #  Accounting.  Log the accounting data.
-@@ -380,7 +380,7 @@ accounting {
+@@ -382,7 +382,7 @@ accounting {
        #  Create a 'detail'ed log of the packets.
        #  Note that accounting requests which are proxied
        #  are also logged in the detail file.
  #     daily
  
        #  Update the wtmp file
-@@ -432,7 +432,7 @@ accounting {
+@@ -434,7 +434,7 @@ accounting {
        exec
  
        #  Filter attributes from the accounting response.
  
        #
        #  See "Autz-Type Status-Server" for how this works.
-@@ -458,7 +458,7 @@ session {
+@@ -460,7 +460,7 @@ session {
  #  Post-Authentication
  #  Once we KNOW that the user has been authenticated, there are
  #  additional steps we can take.
        #  Get an address from the IP Pool.
  #     main_pool
  
-@@ -488,7 +488,7 @@ post-auth {
+@@ -490,7 +490,7 @@ post-auth {
  #     ldap
  
        # For Exec-Program and Exec-Program-Wait
  
        #
        #  Calculate the various WiMAX keys.  In order for this to work,
-@@ -572,12 +572,12 @@ post-auth {
+@@ -574,18 +574,18 @@ post-auth {
        #  Add the ldap module name (or instance) if you have set 
        #  'edir_account_policy_check = yes' in the ldap module configuration
        #
 +#     Post-Auth-Type REJECT {
 +#             # log failed authentications in SQL, too.
  #             sql
+               # Insert EAP-Failure message if the request was
+               # rejected by policy instead of because of an
+               # authentication failure
+-              eap
++#             eap
 -              attr_filter.access_reject
 -      }
 -}
  
  #
  #  When the server decides to proxy a request to a home server,
-@@ -587,7 +587,7 @@ post-auth {
+@@ -595,7 +595,7 @@ post-auth {
  #
  #  Only a few modules currently have this method.
  #
  #     attr_rewrite
  
        #  Uncomment the following line if you want to change attributes
-@@ -603,14 +603,14 @@ pre-proxy {
+@@ -611,14 +611,14 @@ pre-proxy {
        #  server, un-comment the following line, and the
        #  'detail pre_proxy_log' section, above.
  #     pre_proxy_log
  
        #  If you want to have a log of replies from a home server,
        #  un-comment the following line, and the 'detail post_proxy_log'
-@@ -634,7 +634,7 @@ post-proxy {
+@@ -642,7 +642,7 @@ post-proxy {
        #  hidden inside of the EAP packet, and the end server will
        #  reject the EAP request.
        #
  
        #
        #  If the server tries to proxy a request and fails, then the
-@@ -656,5 +656,5 @@ post-proxy {
+@@ -664,5 +664,5 @@ post-proxy {
  #     Post-Proxy-Type Fail {
  #                     detail
  #     }
 -}
 +#}
  
---- a/raddb/users
-+++ b/raddb/users
+Index: freeradius-server-2.2.7/raddb/users
+===================================================================
+--- freeradius-server-2.2.7.orig/raddb/users
++++ freeradius-server-2.2.7/raddb/users
 @@ -169,22 +169,22 @@
  #     by the terminal server in which case there may not be a "P" suffix.
  #     The terminal server sends "Framed-Protocol = PPP" for auto PPP.
index 7f3e2401741f9ebf8e4e6eea88a690e406e7b8b8..05b6789b35065121b62f7c81c8a08c826be3d2ce 100644 (file)
@@ -1,5 +1,7 @@
---- a/src/modules/rlm_ldap/configure
-+++ b/src/modules/rlm_ldap/configure
+Index: freeradius-server-2.2.7/src/modules/rlm_ldap/configure
+===================================================================
+--- freeradius-server-2.2.7.orig/src/modules/rlm_ldap/configure
++++ freeradius-server-2.2.7/src/modules/rlm_ldap/configure
 @@ -1,10 +1,10 @@
  #! /bin/sh
  # From configure.in Revision.
 +fi
  
  
---- a/src/modules/rlm_ldap/configure.in
-+++ b/src/modules/rlm_ldap/configure.in
+Index: freeradius-server-2.2.7/src/modules/rlm_ldap/configure.in
+===================================================================
+--- freeradius-server-2.2.7.orig/src/modules/rlm_ldap/configure.in
++++ freeradius-server-2.2.7/src/modules/rlm_ldap/configure.in
 @@ -87,6 +87,9 @@ if test x$with_[]modname != xno; then
                         )
        fi
index 086e71723949bbf4214b59bda5b2a33f8d92d332..7e6d81e0453d9723711c651faaa081f78555cf54 100644 (file)
@@ -1,5 +1,7 @@
---- a/src/modules/rules.mak
-+++ b/src/modules/rules.mak
+Index: freeradius-server-2.2.7/src/modules/rules.mak
+===================================================================
+--- freeradius-server-2.2.7.orig/src/modules/rules.mak
++++ freeradius-server-2.2.7/src/modules/rules.mak
 @@ -63,10 +63,10 @@ $(LT_OBJS): $(SERVER_HEADERS)
  #
  #######################################################################
index c254912d46a9313d32070166825148f5b4c79cda..483221dbc083e1628700a95f5fe128b435c93050 100644 (file)
@@ -1,6 +1,8 @@
---- a/configure.in
-+++ b/configure.in
-@@ -796,35 +796,6 @@ if test "x$WITH_OPENSSL" = xyes; then
+Index: freeradius-server-2.2.7/configure.in
+===================================================================
+--- freeradius-server-2.2.7.orig/configure.in
++++ freeradius-server-2.2.7/configure.in
+@@ -820,35 +820,6 @@ if test "x$WITH_OPENSSL" = xyes; then
      OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
    fi
  
index f161dcb130aabe7988fbe023d41864e69cbc588b..429d8e690fa4fdc8ca256b7d1600a179b809934c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=git
-PKG_VERSION:=2.3.3
+PKG_VERSION:=2.3.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_MD5SUM:=14a885da3b432455b606cc1a25a6c681
+PKG_MD5SUM:=be8c0bbb0c5ee6ab7cdcffd2c9375fe6
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
index 38ce8fd5a99d611509fc617e11730b0f36feb9f3..7ed23696d2e2f8c32b13e10094c560eca2204111 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
 PKG_VERSION:=1.5.11
-PKG_RELEASE:=02
+PKG_RELEASE:=09
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
diff --git a/net/haproxy/patches/0003-BUG-MEDIUM-Do-not-consider-an-agent-check-as-failed-.patch b/net/haproxy/patches/0003-BUG-MEDIUM-Do-not-consider-an-agent-check-as-failed-.patch
new file mode 100644 (file)
index 0000000..1f257ef
--- /dev/null
@@ -0,0 +1,43 @@
+From bfb8f885955efa1ef90f79595f16a01e30fd0dcf Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms@verge.net.au>
+Date: Thu, 26 Feb 2015 11:26:17 +0900
+Subject: [PATCH 3/9] BUG/MEDIUM: Do not consider an agent check as failed on
+ L7 error
+
+As failure to connect to the agent check is not sufficient to mark it as
+failed it stands to reason that an L7 error shouldn't either.
+
+Without this fix if an L7 error occurs, for example of connectivity to the
+agent is lost immediately after establishing a connection to it, then the
+agent check will be considered to have failed and thus may end up with zero
+health. Once this has occurred if the primary health check also reaches
+zero health, which is likely if connectivity to the server is lost, then
+the server will be marked as down and not be marked as up again until a
+successful agent check occurs regardless of the success of any primary
+health checks.
+
+This behaviour is not correct as a failed agent check should never cause a
+server to be marked as down or by extension continue to be marked as down.
+
+Signed-off-by: Simon Horman <horms@verge.net.au>
+(cherry picked from commit eaabd52e29a29187f9829fe727028a6ca530cbf9)
+---
+ src/checks.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/checks.c b/src/checks.c
+index b9048da..71debb6 100644
+--- a/src/checks.c
++++ b/src/checks.c
+@@ -246,7 +246,7 @@ static void set_server_check_status(struct check *check, short status, const cha
+                * cause the server to be marked down.
+                */
+               if ((!(check->state & CHK_ST_AGENT) ||
+-                  (check->status >= HCHK_STATUS_L7TOUT)) &&
++                  (check->status >= HCHK_STATUS_L57DATA)) &&
+                   (check->health >= check->rise)) {
+                       s->counters.failed_checks++;
+                       report = 1;
+-- 
+2.0.5
+
diff --git a/net/haproxy/patches/0004-BUG-MEDIUM-peers-correctly-configure-the-client-time.patch b/net/haproxy/patches/0004-BUG-MEDIUM-peers-correctly-configure-the-client-time.patch
new file mode 100644 (file)
index 0000000..8d33bb5
--- /dev/null
@@ -0,0 +1,33 @@
+From fc940eb2bf0bbd7adf5b283f28bcff136501ae7f Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Fri, 13 Mar 2015 16:18:25 +0100
+Subject: [PATCH 4/9] BUG/MEDIUM: peers: correctly configure the client timeout
+
+The peers frontend timeout was mistakenly set on timeout.connect instead
+of timeout.client, resulting in no timeout being applied to the peers
+connections. The impact is just that peers can establish connections and
+remain connected until they speak. Once they start speaking, only one of
+them will still be accepted, and old sessions will be killed, so the
+problem is limited. This fix should however be backported to 1.5 since
+it was introduced in 1.5-dev3 with peers.
+(cherry picked from commit 9ff95bb18c4cd9ae747fa5b3bef6d3f94e54172f)
+---
+ src/cfgparse.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cfgparse.c b/src/cfgparse.c
+index a91e027..b7613b8 100644
+--- a/src/cfgparse.c
++++ b/src/cfgparse.c
+@@ -1834,7 +1834,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
+                               curpeers->peers_fe->cap = PR_CAP_FE;
+                               curpeers->peers_fe->maxconn = 0;
+                               curpeers->peers_fe->conn_retries = CONN_RETRIES;
+-                              curpeers->peers_fe->timeout.connect = 5000;
++                              curpeers->peers_fe->timeout.client = MS_TO_TICKS(5000);
+                               curpeers->peers_fe->accept = peer_accept;
+                               curpeers->peers_fe->options2 |= PR_O2_INDEPSTR | PR_O2_SMARTCON | PR_O2_SMARTACC;
+                               curpeers->peers_fe->conf.args.file = curpeers->peers_fe->conf.file = strdup(file);
+-- 
+2.0.5
+
diff --git a/net/haproxy/patches/0005-BUG-MEDIUM-buffer-one-byte-miss-in-buffer-free-space.patch b/net/haproxy/patches/0005-BUG-MEDIUM-buffer-one-byte-miss-in-buffer-free-space.patch
new file mode 100644 (file)
index 0000000..bdc674c
--- /dev/null
@@ -0,0 +1,30 @@
+From b92902814f796bb1dc24bab2179000caceb5b151 Mon Sep 17 00:00:00 2001
+From: Thierry FOURNIER <tfournier@exceliance.fr>
+Date: Tue, 10 Mar 2015 01:55:01 +0100
+Subject: [PATCH 5/9] BUG/MEDIUM: buffer: one byte miss in buffer free space
+ check
+
+Space is not avalaible only if the end of the data inserted
+is strictly greater than the end of buffer. If these two value
+are equal, the space is avamaible.
+(cherry picked from commit fdda6777bffb4f933569c609ba54e24ea5eabf29)
+---
+ src/buffer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/buffer.c b/src/buffer.c
+index 9037dd3..8d2644e 100644
+--- a/src/buffer.c
++++ b/src/buffer.c
+@@ -46,7 +46,7 @@ int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int
+       delta = len - (end - pos);
+-      if (bi_end(b) + delta >= b->data + b->size)
++      if (bi_end(b) + delta > b->data + b->size)
+               return 0;  /* no space left */
+       if (buffer_not_empty(b) &&
+-- 
+2.0.5
+
diff --git a/net/haproxy/patches/0006-BUG-MAJOR-http-don-t-read-past-buffer-s-end-in-http_.patch b/net/haproxy/patches/0006-BUG-MAJOR-http-don-t-read-past-buffer-s-end-in-http_.patch
new file mode 100644 (file)
index 0000000..66e0c69
--- /dev/null
@@ -0,0 +1,52 @@
+From 8e05ac2044c6523c867ceaaae1f10486370eec89 Mon Sep 17 00:00:00 2001
+From: Thierry FOURNIER <tfournier@haproxy.com>
+Date: Mon, 16 Mar 2015 11:14:41 +0100
+Subject: [PATCH 6/9] BUG/MAJOR: http: don't read past buffer's end in
+ http_replace_value
+
+The function http_replace_value use bad variable to detect the end
+of the input string.
+
+Regression introduced by the patch "MEDIUM: regex: Remove null
+terminated strings." (c9c2daf2)
+
+We need to backport this patch int the 1.5 stable branch.
+
+WT: there is no possibility to overwrite existing data as we only read
+    past the end of the request buffer, to copy into the trash. The copy
+    is bounded by buffer_replace2(), just like the replacement performed
+    by exp_replace(). However if a buffer happens to contain non-zero data
+    up to the next unmapped page boundary, there's a theorical risk of
+    crashing the process despite this not being reproducible in tests.
+    The risk is low because "http-request replace-value" did not work due
+    to this bug so that probably means it's not used yet.
+(cherry picked from commit 534101658d6e19aeb598bf7833a8ce167498c4ed)
+---
+ src/proto_http.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index 705f3b4..f53b5e2 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -3206,7 +3206,7 @@ static int http_replace_value(struct my_regex *re, char *dst, uint dst_size, cha
+               /* look for delim. */
+               p_delim = p;
+-              while (p_delim < p + len && *p_delim != delim)
++              while (p_delim < val + len && *p_delim != delim)
+                       p_delim++;
+               if (regex_exec_match2(re, p, p_delim-p, MAX_MATCH, pmatch)) {
+@@ -3230,7 +3230,7 @@ static int http_replace_value(struct my_regex *re, char *dst, uint dst_size, cha
+                       return -1;
+               /* end of the replacements. */
+-              if (p_delim >= p + len)
++              if (p_delim >= val + len)
+                       break;
+               /* Next part. */
+-- 
+2.0.5
+
diff --git a/net/haproxy/patches/0007-BUG-MEDIUM-http-the-function-req-res-replace-value-d.patch b/net/haproxy/patches/0007-BUG-MEDIUM-http-the-function-req-res-replace-value-d.patch
new file mode 100644 (file)
index 0000000..5d4dbc0
--- /dev/null
@@ -0,0 +1,171 @@
+From 06170c50ae5cd0fb23510b832826f7e63a5a8894 Mon Sep 17 00:00:00 2001
+From: Thierry FOURNIER <tfournier@haproxy.com>
+Date: Mon, 16 Mar 2015 23:23:53 +0100
+Subject: [PATCH 7/9] BUG/MEDIUM: http: the function "(req|res)-replace-value"
+ doesn't respect the HTTP syntax
+
+These function used an invalid header parser.
+ - The trailing white-spaces were embedded in the replacement regex,
+ - The double-quote (") containing comma (,) were not respected.
+
+This patch replace this parser by the "official" parser http_find_header2().
+(cherry picked from commit 191f9efdc58f21af1d9dde3db5ba198d7f1ce22e)
+---
+ src/proto_http.c | 126 +++++++++++++++----------------------------------------
+ 1 file changed, 34 insertions(+), 92 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index f53b5e2..c49c4f4 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -3179,113 +3179,55 @@ static inline void inet_set_tos(int fd, struct sockaddr_storage from, int tos)
+ #endif
+ }
+-/* Returns the number of characters written to destination,
+- * -1 on internal error and -2 if no replacement took place.
+- */
+-static int http_replace_header(struct my_regex *re, char *dst, uint dst_size, char *val, int len,
+-                               const char *rep_str)
+-{
+-      if (!regex_exec_match2(re, val, len, MAX_MATCH, pmatch))
+-              return -2;
+-
+-      return exp_replace(dst, dst_size, val, rep_str, pmatch);
+-}
+-
+-/* Returns the number of characters written to destination,
+- * -1 on internal error and -2 if no replacement took place.
+- */
+-static int http_replace_value(struct my_regex *re, char *dst, uint dst_size, char *val, int len, char delim,
+-                              const char *rep_str)
+-{
+-      char* p = val;
+-      char* dst_end = dst + dst_size;
+-      char* dst_p = dst;
+-
+-      for (;;) {
+-              char *p_delim;
+-
+-              /* look for delim. */
+-              p_delim = p;
+-              while (p_delim < val + len && *p_delim != delim)
+-                      p_delim++;
+-
+-              if (regex_exec_match2(re, p, p_delim-p, MAX_MATCH, pmatch)) {
+-                      int replace_n = exp_replace(dst_p, dst_end - dst_p, p, rep_str, pmatch);
+-
+-                      if (replace_n < 0)
+-                              return -1;
+-
+-                      dst_p += replace_n;
+-              } else {
+-                      uint len = p_delim - p;
+-
+-                      if (dst_p + len >= dst_end)
+-                              return -1;
+-
+-                      memcpy(dst_p, p, len);
+-                      dst_p += len;
+-              }
+-
+-              if (dst_p >= dst_end)
+-                      return -1;
+-
+-              /* end of the replacements. */
+-              if (p_delim >= val + len)
+-                      break;
+-
+-              /* Next part. */
+-              *dst_p++ = delim;
+-              p = p_delim + 1;
+-      }
+-
+-      return dst_p - dst;
+-}
+-
+ static int http_transform_header(struct session* s, struct http_msg *msg, const char* name, uint name_len,
+                                  char* buf, struct hdr_idx* idx, struct list *fmt, struct my_regex *re,
+                                  struct hdr_ctx* ctx, int action)
+ {
++      int (*http_find_hdr_func)(const char *name, int len, char *sol,
++                                struct hdr_idx *idx, struct hdr_ctx *ctx);
++      struct chunk *replace = get_trash_chunk();
++      struct chunk *output = get_trash_chunk();
++
++      replace->len = build_logline(s, replace->str, replace->size, fmt);
++      if (replace->len >= replace->size - 1)
++              return -1;
++
+       ctx->idx = 0;
+-      while (http_find_full_header2(name, name_len, buf, idx, ctx)) {
++      /* Choose the header browsing function. */
++      switch (action) {
++      case HTTP_REQ_ACT_REPLACE_VAL:
++      case HTTP_RES_ACT_REPLACE_VAL:
++              http_find_hdr_func = http_find_header2;
++              break;
++      case HTTP_REQ_ACT_REPLACE_HDR:
++      case HTTP_RES_ACT_REPLACE_HDR:
++              http_find_hdr_func = http_find_full_header2;
++              break;
++      default: /* impossible */
++              return -1;
++      }
++
++      while (http_find_hdr_func(name, name_len, buf, idx, ctx)) {
+               struct hdr_idx_elem *hdr = idx->v + ctx->idx;
+               int delta;
+-              char* val = (char*)ctx->line + ctx->val;
+-              char* val_end = (char*)ctx->line + hdr->len;
+-              char* reg_dst_buf;
+-              uint reg_dst_buf_size;
+-              int n_replaced;
+-
+-              trash.len = build_logline(s, trash.str, trash.size, fmt);
+-
+-              if (trash.len >= trash.size - 1)
+-                      return -1;
++              char *val = ctx->line + ctx->val;
++              char* val_end = val + ctx->vlen;
+-              reg_dst_buf = trash.str + trash.len + 1;
+-              reg_dst_buf_size = trash.size - trash.len - 1;
++              if (!regex_exec_match2(re, val, val_end-val, MAX_MATCH, pmatch))
++                      continue;
+-              switch (action) {
+-              case HTTP_REQ_ACT_REPLACE_VAL:
+-              case HTTP_RES_ACT_REPLACE_VAL:
+-                      n_replaced = http_replace_value(re, reg_dst_buf, reg_dst_buf_size, val, val_end-val, ',', trash.str);
+-                      break;
+-              case HTTP_REQ_ACT_REPLACE_HDR:
+-              case HTTP_RES_ACT_REPLACE_HDR:
+-                      n_replaced = http_replace_header(re, reg_dst_buf, reg_dst_buf_size, val, val_end-val, trash.str);
+-                      break;
+-              default: /* impossible */
++              output->len = exp_replace(output->str, output->size, val, replace->str, pmatch);
++              if (output->len == -1)
+                       return -1;
+-              }
+-              switch (n_replaced) {
+-              case -1: return -1;
+-              case -2: continue;
+-              }
+-
+-              delta = buffer_replace2(msg->chn->buf, val, val_end, reg_dst_buf, n_replaced);
++              delta = buffer_replace2(msg->chn->buf, val, val_end, output->str, output->len);
+               hdr->len += delta;
+               http_msg_move_end(msg, delta);
++
++              /* Adjust the length of the current value of the index. */
++              ctx->vlen += delta;
+       }
+       return 0;
+-- 
+2.0.5
+
diff --git a/net/haproxy/patches/0008-BUG-MINOR-compression-consider-the-expansion-factor-.patch b/net/haproxy/patches/0008-BUG-MINOR-compression-consider-the-expansion-factor-.patch
new file mode 100644 (file)
index 0000000..b8d01f6
--- /dev/null
@@ -0,0 +1,43 @@
+From 9b9531d90dfd8a334958d23394afafd0185bfa21 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Sat, 28 Mar 2015 12:20:33 +0100
+Subject: [PATCH 8/9] BUG/MINOR: compression: consider the expansion factor in
+ init
+
+When checking if the buffer is large enough, we used to rely on a fixed
+size that was "apparently" enough. We need to consider the expansion
+factor of deflate-encoded streams instead, which is of 5 bytes per 32kB.
+The previous value was OK till 128kB buffers but became wrong past that.
+It's totally harmless since we always keep the reserve when compressiong,
+so there's 1kB or so available, which is enough for buffers as large as
+6.5 MB, but better fix the check anyway.
+
+This fix could be backported into 1.5 since compression was added there.
+(cherry picked from commit 2aee2215c908c6997addcd1714b5b10f73c0703d)
+---
+ src/compression.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/compression.c b/src/compression.c
+index 3d6085e..d55f14e 100644
+--- a/src/compression.c
++++ b/src/compression.c
+@@ -130,9 +130,12 @@ int http_compression_buffer_init(struct session *s, struct buffer *in, struct bu
+ {
+       int left;
+-      /* not enough space */
+-      if (in->size - buffer_len(in) < 40)
+-          return -1;
++      /* output stream requires at least 10 bytes for the gzip header, plus
++       * at least 8 bytes for the gzip trailer (crc+len), plus a possible
++       * plus at most 5 bytes per 32kB block and 2 bytes to close the stream.
++       */
++      if (in->size - buffer_len(in) < 20 + 5 * ((in->i + 32767) >> 15))
++              return -1;
+       /* We start by copying the current buffer's pending outgoing data into
+        * a new temporary buffer that we initialize with a new empty chunk.
+-- 
+2.0.5
+
diff --git a/net/haproxy/patches/0009-BUG-MEDIUM-http-hdr_cnt-would-not-count-any-header-w.patch b/net/haproxy/patches/0009-BUG-MEDIUM-http-hdr_cnt-would-not-count-any-header-w.patch
new file mode 100644 (file)
index 0000000..cd258da
--- /dev/null
@@ -0,0 +1,70 @@
+From 2943734024525d4b9aeec13cca2c1d230c358ee5 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 1 Apr 2015 19:16:09 +0200
+Subject: [PATCH 9/9] BUG/MEDIUM: http: hdr_cnt would not count any header when
+ called without name
+
+It's documented that these sample fetch functions should count all headers
+and/or all values when called with no name but in practice it's not what is
+being done as a missing name causes an immediate return and an absence of
+result.
+
+This bug is present in 1.5 as well and must be backported.
+(cherry picked from commit 601a4d1741100d7a861b6d9b66561335c9911277)
+---
+ src/proto_http.c | 20 ++++++++++++++------
+ 1 file changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index c49c4f4..ccd52ad 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -10014,15 +10014,19 @@ smp_fetch_fhdr_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int
+       struct hdr_ctx ctx;
+       const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp;
+       int cnt;
++      const char *name = NULL;
++      int len = 0;
+-      if (!args || args->type != ARGT_STR)
+-              return 0;
++      if (args && args->type == ARGT_STR) {
++              name = args->data.str.str;
++              len = args->data.str.len;
++      }
+       CHECK_HTTP_MESSAGE_FIRST();
+       ctx.idx = 0;
+       cnt = 0;
+-      while (http_find_full_header2(args->data.str.str, args->data.str.len, msg->chn->buf->p, idx, &ctx))
++      while (http_find_full_header2(name, len, msg->chn->buf->p, idx, &ctx))
+               cnt++;
+       smp->type = SMP_T_UINT;
+@@ -10101,15 +10105,19 @@ smp_fetch_hdr_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int o
+       struct hdr_ctx ctx;
+       const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp;
+       int cnt;
++      const char *name = NULL;
++      int len = 0;
+-      if (!args || args->type != ARGT_STR)
+-              return 0;
++      if (args && args->type == ARGT_STR) {
++              name = args->data.str.str;
++              len = args->data.str.len;
++      }
+       CHECK_HTTP_MESSAGE_FIRST();
+       ctx.idx = 0;
+       cnt = 0;
+-      while (http_find_header2(args->data.str.str, args->data.str.len, msg->chn->buf->p, idx, &ctx))
++      while (http_find_header2(name, len, msg->chn->buf->p, idx, &ctx))
+               cnt++;
+       smp->type = SMP_T_UINT;
+-- 
+2.0.5
+
index 0f13149d450e624937d0d8a939f05bb149044db8..04a041fa08d0446537469f276235cc27c7488d95 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=keepalived
-PKG_VERSION:=1.2.15
+PKG_VERSION:=1.2.16
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= http://www.keepalived.org/software
-PKG_MD5SUM:=d85fcb8e564ea03b0ca7b2357bf30c51
+PKG_MD5SUM:=f834ab2cfc2e7300edf1bafaf4a5d83e
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
index d35fb7f942e93d1e4e9cec41b753e2e769d16ed4..fa32c655497f5eaabb8d02462638281ad30737f8 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=knot
-PKG_VERSION:=1.6.2
+PKG_VERSION:=1.6.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
-PKG_MD5SUM:=ad0a2d641556ad30d17d45200a2c45df
+PKG_MD5SUM:=fb744b50493ac7e724d5228ade2e35b1
 
 PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
 PKG_LICENSE:=GPL-2.0+
index 279df27997735bd85da4638b62c8f89945441a8f..a0d052421362f3b18adb24f908658d942e060c92 100644 (file)
@@ -34,8 +34,8 @@ index 846f351..272856c 100644
  TESTS_DIR="$SOURCE"/data
  ZSCANNER_TOOL="$BUILD"/zscanner-tool
  
--plan 69
-+plan 67
+-plan 71
++plan 69
  
  mkdir -p "$TMPDIR"/includes/
  for a in 1 2 3 4 5 6; do
index 97fcc8ea586bccadbba37673d73ae9df92b191f9..b9ce06d8b8ea0dcb314deb2adeb126f86c64ff31 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=knxd
-PKG_VERSION=2015-03-06-$(PKG_SOURCE_VERSION)
+PKG_VERSION=2015-03-31-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/knxd/knxd.git
-PKG_SOURCE_VERSION:=a63bc660d305e26ce3ed038607d387758fad8413
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=2c6c6732a684dffb87b391ea92cccdf07c8385b8
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
@@ -26,7 +26,8 @@ PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+PKG_BUILD_DEPENDS:=argp-standalone
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -55,7 +56,7 @@ define Package/libeibclient
   DEPENDS:=+pthsem
 endef
 
-define Package/knxd-tools/description
+define Package/libeibclient/description
 EIB KNX client library
 endef
 
@@ -84,9 +85,8 @@ CONFIGURE_ARGS+= \
        --without-pth-test \
        --without-libstdc
 
-TARGET_CFLAGS+= \
-       $(FPIC) \
-       -fno-builtin -nodefaultlibs -lc -lm -lgcc -largp -lpthsem
+EXTRA_LDFLAGS+= \
+       -fno-builtin -nodefaultlibs -lc -lgcc
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
index e3aed3b15111edbc3e921928929412de95cddd33..06083fc961bcd3704a70b61162c5d5ab52c77fc2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2014 OpenWrt.org
+# Copyright (C) 2008-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linknx
 PKG_VERSION:=0.0.1.32
-PKG_RELEASE:=4
+PKG_RELEASE:=6
 PKG_MD5SUM:=7ecc1208f59bceb05068c752b2250b63
 
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
@@ -17,7 +17,7 @@ PKG_LICENSE:=GPL-2.0+
 
 PKG_SOURCE_URL:=@SF/linknx
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_BUILD_DEPENDS:=pthsem curl libesmtp
+PKG_BUILD_DEPENDS:=argp-standalone
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -26,26 +26,19 @@ define Package/linknx
   CATEGORY:=Network
   TITLE:=KNX home automation platform
   URL:=http://sourceforge.net/projects/linknx/
-  DEPENDS:=pthsem +lua +luac +libstdcpp +libcurl +libesmtp
+  DEPENDS:=+pthsem +lua +luac +libstdcpp +libcurl +libesmtp
 endef
 
-define Build/Configure
-       (cd $(PKG_BUILD_DIR); touch aclocal.m4 Makefile.in config.h.in configure; \
-       $(SED) 's,\"2.0.4\",\"2.0.4\"\n_pth_version=\"2.0.8\",g' $(PKG_BUILD_DIR)/configure )
-       $(call Build/Configure/Default,--verbose --without-pth-test --with-pth=$(STAGING_DIR) --without-log4cpp --with-lua --with-libcurl --without-mysql, \
-       CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -lcrypt" \
-       )
-endef
+CONFIGURE_ARGS+= \
+       --verbose \
+       --without-pth-test \
+       --without-log4cpp \
+       --with-lua \
+       --with-libcurl \
+       --without-mysql
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR)/ \
-               LIBDIR="$(TARGET_LDFLAGS)" \
-               CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) " \
-               LD="$(TARGET_CROSS)ld -shared" \
-               LUA="$(STAGING_DIR_HOST)/bin/lua" \
-               LUAC="$(STAGING_DIR_HOST)/bin/luac" \
-               CFLAGS="$(TARGET_CFLAGS) -nodefaultlibs" all
-endef
+EXTRA_LDFLAGS+= \
+       -fno-builtin
 
 define Package/linknx/install
        $(INSTALL_DIR) $(1)/usr/bin
diff --git a/net/lksctp-tools/Makefile b/net/lksctp-tools/Makefile
new file mode 100644 (file)
index 0000000..0d65292
--- /dev/null
@@ -0,0 +1,92 @@
+#
+# Copyright (C) 2010-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lksctp-tools
+PKG_VERSION:=1.0.16
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/lksctp
+PKG_MD5SUM:=708bb0b5a6806ad6e8d13c55b067518e
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lksctp-tools/Default
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=SCTP user-land
+  URL:=http://lksctp.sourceforge.net
+endef
+
+define Package/libsctp
+$(call Package/lksctp-tools/Default)
+  SUBMENU:=Networking
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= library
+  URL:=http://lksctp.sourceforge.net
+  DEPENDS:=+kmod-sctp
+endef
+
+define Package/sctp
+$(call Package/lksctp-tools/Default)
+  TITLE+= (meta)
+  URL:=http://lksctp.sourceforge.net
+  DEPENDS:=+libsctp +sctp-tools
+endef
+
+define Package/sctp-tools
+$(call Package/lksctp-tools/Default)
+  TITLE+= tools
+  URL:=http://lksctp.sourceforge.net
+  DEPENDS:=+libsctp
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/netinet \
+               $(STAGING_DIR)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libsctp.{a,so*} \
+               $(1)/usr/lib/
+endef
+
+define Package/libsctp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libsctp.so.* \
+               $(1)/usr/lib/
+endef
+
+define Package/sctp/install
+       :
+endef
+
+define Package/sctp-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/bin/checksctp \
+               $(1)/usr/bin/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/bin/sctp_{darn,status,test} \
+               $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libsctp))
+$(eval $(call BuildPackage,sctp))
+$(eval $(call BuildPackage,sctp-tools))
index e7d79df00ec5536b53e47741d329f4020d61c81e..8379025979e176b0469681d3026a9e7366e26e5e 100644 (file)
@@ -89,7 +89,7 @@ sc.default = "simple.qos"
 sc.rmempty = false
 sc.description = qos_desc
 
-ad = s:taboption("tab_qdisc", Flag, "qdisc_advanced", translate("Show Advanced Configuration"))
+ad = s:taboption("tab_qdisc", Flag, "qdisc_advanced", translate("Show and Use Advanced Configuration"))
 ad.default = false
 ad.rmempty = true
 
@@ -121,7 +121,7 @@ eecn.default = "NOECN"
 eecn.rmempty = true
 eecn:depends("qdisc_advanced", "1")
 
-ad2 = s:taboption("tab_qdisc", Flag, "qdisc_really_really_advanced", translate("Show Dangerous Configuration"))
+ad2 = s:taboption("tab_qdisc", Flag, "qdisc_really_really_advanced", translate("Show and Use Dangerous Configuration"))
 ad2.default = false
 ad2.rmempty = true
 ad2:depends("qdisc_advanced", "1")
@@ -140,12 +140,12 @@ elim.rmempty = true
 elim:depends("qdisc_really_really_advanced", "1")
 
 
-itarg = s:taboption("tab_qdisc", Value, "itarget", translate("Latency target for ingress, e.g 5ms [units: s, ms, or  us]; leave empty for default, or auto for automatic selection."))
+itarg = s:taboption("tab_qdisc", Value, "itarget", translate("Latency target for ingress, e.g 5ms [units: s, ms, or  us]; leave empty for automatic selection, put in the word default for the qdisc's default."))
 itarg.datatype = "string"
 itarg.rmempty = true
 itarg:depends("qdisc_really_really_advanced", "1")
 
-etarg = s:taboption("tab_qdisc", Value, "etarget", translate("Latency target for egress, e.g. 5ms [units: s, ms, or  us]; leave empty for default, or auto for automatic selection."))
+etarg = s:taboption("tab_qdisc", Value, "etarget", translate("Latency target for egress, e.g. 5ms [units: s, ms, or  us]; leave empty for automatic selection, put in the word default for the qdisc's default."))
 etarg.datatype = "string"
 etarg.rmempty = true
 etarg:depends("qdisc_really_really_advanced", "1")
index 91e7e982717794de5b17ece9e2f0aedf440f6392..5eaedd2ec53c11db8327f382bf90b35cb24f0f4c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mDNSResponder
-PKG_VERSION:=561.1.1
+PKG_VERSION:=567
 PKG_RELEASE:=1
 
 PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://opensource.apple.com/tarballs/mDNSResponder/
-PKG_MD5SUM:=d4b56e22798d6f45e29b42cd6720ab6e
+PKG_MD5SUM:=6eff6d243a12a3d4b6fca03c05a9893b
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 PKG_LICENSE:=Apache-2.0
 
index ad4eaee445b0656fc32b9cfffc4185fade3b8fce..b1685fc45bb6201c15e4639287dff9671967d0c7 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Clients/Makefile
 +++ b/Clients/Makefile
-@@ -23,6 +23,8 @@
+@@ -27,6 +27,8 @@
  
  #############################################################################
  
@@ -9,22 +9,22 @@
  # On OS X the dns_sd library functions are included in libSystem, which is implicitly linked with every executable
  # If /usr/lib/libSystem.dylib exists, then we're on OS X, so we don't need also to link the "dns_sd" shared library
  ifneq "$(wildcard /usr/lib/libSystem.dylib)" ""
-@@ -42,10 +44,10 @@ build:
+@@ -46,10 +48,10 @@ build:
        mkdir build
  
  build/dns-sd: build dns-sd.c ClientCommon.c
--      cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
+-      $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
 +      $(CC) $(CFLAGS) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
  
  build/dns-sd64: build dns-sd.c ClientCommon.c
--      cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
+-      $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
 +      $(CC) $(CFLAGS) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
  
  # Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we
  # don't, because we don't want or need a 'fat' version of dns-sd, because it will
 --- a/mDNSPosix/Makefile
 +++ b/mDNSPosix/Makefile
-@@ -54,10 +54,11 @@ COREDIR = ../mDNSCore
+@@ -54,11 +54,12 @@ COREDIR = ../mDNSCore
  SHAREDDIR ?= ../mDNSShared
  JDK = /usr/jdk
  
 +CC = @gcc
  BISON = @bison
  FLEX = @flex
+ ST = @strip
 -LD = ld -shared
 +LD = @ld
 +SOOPTS = -shared
  CP = cp
  RM = rm
  LN = ln -s -f
-@@ -82,7 +83,7 @@ else
- CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0 
- OBJDIR ?= objects/prod
- BUILDDIR ?= build/prod
--STRIP = strip -S 
-+STRIP = @strip -S
- endif
- # Configure per-OS peculiarities
-@@ -91,7 +92,7 @@ CFLAGS_DEBUG = -O0 -DMDNS_DEBUGMSGS=0
+@@ -92,7 +93,7 @@ CFLAGS_DEBUG = -O0 -DMDNS_DEBUGMSGS=0
  CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \
         -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -DTARGET_OS_SOLARIS
  CC = gcc
@@ -56,7 +48,7 @@
  LINKOPTS = -lsocket -lnsl -lresolv
  JAVACFLAGS_OS += -I$(JDK)/include/solaris
  ifneq ($(DEBUG),1)
-@@ -147,7 +148,8 @@ CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp
+@@ -148,7 +149,8 @@ CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp
        -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 \
        -D__APPLE_USE_RFC_2292 #-Wunreachable-code
  CC = gcc
@@ -66,7 +58,7 @@
  LINKOPTS = -lSystem
  LDSUFFIX = dylib
  JDK = /System/Library/Frameworks/JavaVM.framework/Home
-@@ -169,8 +171,9 @@ NSSLIBFILE  := $(NSSLIBNAME)-$(NSSVERSIO
+@@ -170,8 +172,9 @@ NSSLIBFILE  := $(NSSLIBNAME)-$(NSSVERSIO
  NSSLINKNAME := $(NSSLIBNAME).so.2
  NSSINSTPATH := /lib
  
@@ -77,7 +69,7 @@
  INSTBASE?=/usr
  STARTUPSCRIPTNAME?=mdns
  
-@@ -256,7 +259,7 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$
+@@ -257,7 +260,7 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$
  CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
  
  $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
@@ -86,7 +78,7 @@
        @$(STRIP) $@
  
  Clients: setup libdns_sd ../Clients/build/dns-sd
-@@ -291,7 +294,7 @@ InstalledManPages: $(MANPATH)/man8/mdnsd
+@@ -292,7 +295,7 @@ InstalledManPages: $(MANPATH)/man8/mdnsd
  InstalledClients: $(INSTBASE)/bin/dns-sd
        @echo $+ " installed"
  
@@ -95,7 +87,7 @@
        @echo $+ " installed"
  
  # Note: If daemon already installed, we make sure it's stopped before overwriting it
-@@ -346,19 +349,21 @@ $(INSTBASE)/bin/dns-sd: ../Clients/build
+@@ -347,19 +350,21 @@ $(INSTBASE)/bin/dns-sd: ../Clients/build
  
  $(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE)
        $(LN) $< $@
index ea598a75d6a2e6014e1eed99548613497a2eb740..51b94848600e1d3265f849a77f6ed7924d7453f0 100644 (file)
@@ -1,3 +1,6 @@
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000..920cdfc
 --- /dev/null
 +++ b/.gitignore
 @@ -0,0 +1,4 @@
@@ -5,6 +8,21 @@
 +mDNSPosix/build
 +mDNSPosix/objects
 +
+diff --git a/Clients/Makefile b/Clients/Makefile
+index 383af31..925c20e 100755
+--- a/Clients/Makefile
++++ b/Clients/Makefile
+@@ -34,7 +34,7 @@ TARGETS = build/dns-sd build/dns-sd64
+ LIBS =
+ else
+ TARGETS = build/dns-sd
+-LIBS = -L../mDNSPosix/build/prod/ -ldns_sd
++LIBS ?= -L../mDNSPosix/build/prod/ -ldns_sd
+ endif
+ all: $(TARGETS)
+diff --git a/mDNSPosix/PosixDaemon.c b/mDNSPosix/PosixDaemon.c
+index 88b3292..e86a6c7 100644
 --- a/mDNSPosix/PosixDaemon.c
 +++ b/mDNSPosix/PosixDaemon.c
 @@ -37,6 +37,11 @@
      if (mStatus_NoError == err)
          err = MainLoop(&mDNSStorage);
  
+diff --git a/mDNSPosix/Responder.c b/mDNSPosix/Responder.c
+index 3996b7b..e58d8eb 100755
 --- a/mDNSPosix/Responder.c
 +++ b/mDNSPosix/Responder.c
-@@ -603,7 +603,8 @@ static mStatus RegisterServicesInFile(co
+@@ -603,7 +603,8 @@ static mStatus RegisterServicesInFile(const char *filePath)
          status = mStatus_UnknownErr;
      }
  
  
      return status;
  }
+diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
+index 6effa12..d3acf99 100755
 --- a/mDNSPosix/mDNSPosix.c
 +++ b/mDNSPosix/mDNSPosix.c
-@@ -136,7 +136,7 @@ mDNSlocal void SockAddrTomDNSAddr(const
+@@ -138,7 +138,7 @@ mDNSlocal void SockAddrTomDNSAddr(const struct sockaddr *const sa, mDNSAddr *ipA
  
  // mDNS core calls this routine when it needs to send a packet.
  mDNSexport mStatus mDNSPlatformSendUDP(const mDNS *const m, const void *const msg, const mDNSu8 *const end,
                                         mDNSIPPort dstPort, mDNSBool useBackgroundTrafficClass)
  {
      int err = 0;
-@@ -574,9 +574,17 @@ mDNSlocal void FreePosixNetworkInterface
+@@ -583,9 +583,17 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf)
  {
      assert(intf != NULL);
      if (intf->intfName != NULL) free((void *)intf->intfName);
 +        assert(rv == 0);
 +      }
  #endif
-     free(intf);
- }
-@@ -703,6 +711,29 @@ mDNSlocal int SetupSocket(struct sockadd
+     // Move interface to the RecentInterfaces list for a minute
+@@ -724,6 +732,29 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
              if (err < 0) { err = errno; perror("setsockopt - IP_MULTICAST_TTL"); }
          }
  
          // And start listening for packets
          if (err == 0)
          {
-@@ -784,6 +815,29 @@ mDNSlocal int SetupSocket(struct sockadd
+@@ -805,6 +836,29 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
              if (err < 0) { err = errno; perror("setsockopt - IPV6_MULTICAST_HOPS"); }
          }
  
          // And start listening for packets
          if (err == 0)
          {
-@@ -815,7 +869,12 @@ mDNSlocal int SetupSocket(struct sockadd
+@@ -836,7 +890,12 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
      }
  
      // Clean up
      assert((err == 0) == (*sktPtr != -1));
      return err;
  }
-@@ -994,7 +1053,7 @@ mDNSlocal mStatus OpenIfNotifySocket(int
+@@ -1026,7 +1085,7 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD)
      /* Subscribe the socket to Link & IP addr notifications. */
      mDNSPlatformMemZero(&snl, sizeof snl);
      snl.nl_family = AF_NETLINK;
      ret = bind(sock, (struct sockaddr *) &snl, sizeof snl);
      if (0 == ret)
          *pFD = sock;
-@@ -1072,11 +1131,18 @@ mDNSlocal mDNSu32       ProcessRoutingNo
+@@ -1104,11 +1163,18 @@ mDNSlocal mDNSu32       ProcessRoutingNotification(int sd)
          PrintNetLinkMsg(pNLMsg);
  #endif
  
  
          // Advance pNLMsg to the next message in the buffer
          if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE)
-@@ -1247,8 +1313,12 @@ mDNSexport mStatus mDNSPlatformInit(mDNS
+@@ -1279,8 +1345,12 @@ mDNSexport mStatus mDNSPlatformInit(mDNS *const m)
      if (err == mStatus_NoError) err = SetupSocket(&sa, zeroIPPort, 0, &m->p->unicastSocket6);
  #endif
  
  
      // Tell mDNS core about DNS Servers
      mDNS_Lock(m);
-@@ -1281,9 +1351,17 @@ mDNSexport void mDNSPlatformClose(mDNS *
+@@ -1313,9 +1383,17 @@ mDNSexport void mDNSPlatformClose(mDNS *const m)
  {
      assert(m != NULL);
      ClearInterfaceList(m);
  #endif
  }
  
-@@ -1533,14 +1611,14 @@ mDNSexport mStatus    mDNSPlatformClearS
+@@ -1571,14 +1649,14 @@ mDNSexport mStatus    mDNSPlatformClearSPSMACAddr(void)
  mDNSexport mDNSu16 mDNSPlatformGetUDPPort(UDPSocket *sock)
  {
      (void) sock; // unused
      return mDNSfalse;
  }
  
+diff --git a/mDNSPosix/mDNSUNP.c b/mDNSPosix/mDNSUNP.c
+index b392fc7..fe800af 100755
 --- a/mDNSPosix/mDNSUNP.c
 +++ b/mDNSPosix/mDNSUNP.c
-@@ -61,154 +61,86 @@
- #endif
+@@ -63,6 +63,7 @@
  #if defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX
--#include <netdb.h>
--#include <arpa/inet.h>
-+#include <sys/types.h>
-+#include <ifaddrs.h>
--/* Converts a prefix length to IPv6 network mask */
--void plen_to_mask(int plen, char *addr) {
--    int i;
--    int colons=7; /* Number of colons in IPv6 address */
--    int bits_in_block=16; /* Bits per IPv6 block */
--    for(i=0; i<=colons; i++) {
--        int block, ones=0xffff, ones_in_block;
--        if (plen>bits_in_block) ones_in_block=bits_in_block;
--        else ones_in_block=plen;
--        block = ones & (ones << (bits_in_block-ones_in_block));
--        i==0 ? sprintf(addr, "%x", block) : sprintf(addr, "%s:%x", addr, block);
--        plen -= ones_in_block;
--    }
--}
--/* Gets IPv6 interface information from the /proc filesystem in linux*/
--struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
-+/* Correct way to deal with this is just to use getifaddrs (glibc
-+ * 2.3.3+ and various BSDs, but BSDs are 'slightly different' just to
-+ * make life interesting). We assume Linux getifaddrs is available,
-+ * and if not, please upgrade. */
-+struct ifi_info *get_ifi_info_linuxv6(int doaliases)
- {
--    struct ifi_info *ifi, *ifihead, **ifipnext, *ifipold, **ifiptr;
--    FILE *fp;
--    char addr[8][5];
--    int flags, myflags, index, plen, scope;
+ #include <netdb.h>
+ #include <arpa/inet.h>
++#include <linux/if_addr.h>
+ /* Converts a prefix length to IPv6 network mask */
+ void plen_to_mask(int plen, char *addr) {
+@@ -86,7 +87,7 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+     FILE *fp;
+     char addr[8][5];
+     int flags, myflags, index, plen, scope;
 -    char ifname[9], lastname[IFNAMSIZ];
--    char addr6[32+7+1]; /* don't forget the seven ':' */
--    struct addrinfo hints, *res0;
--    struct sockaddr_in6 *sin6;
--    struct in6_addr *addrptr;
--    int err;
--    int sockfd = -1;
--    struct ifreq ifr;
--
--    res0=NULL;
--    ifihead = NULL;
--    ifipnext = &ifihead;
--    lastname[0] = 0;
++    char ifname[IFNAMSIZ], lastname[IFNAMSIZ];
+     char addr6[32+7+1]; /* don't forget the seven ':' */
+     struct addrinfo hints, *res0;
+     struct sockaddr_in6 *sin6;
+@@ -94,7 +95,8 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+     int err;
+     int sockfd = -1;
+     struct ifreq ifr;
 -
--    if ((fp = fopen(PROC_IFINET6_PATH, "r")) != NULL) {
--        sockfd = socket(AF_INET6, SOCK_DGRAM, 0);
--        if (sockfd < 0) {
--            goto gotError;
--        }
--        while (fscanf(fp,
++    char mask[64] = "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %";
++    sprintf(mask+strlen(mask), "%ds\n", IFNAMSIZ);
+     res0=NULL;
+     ifihead = NULL;
+     ifipnext = &ifihead;
+@@ -106,11 +108,12 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+             goto gotError;
+         }
+         while (fscanf(fp,
 -                      "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %8s\n",
--                      addr[0],addr[1],addr[2],addr[3],
--                      addr[4],addr[5],addr[6],addr[7],
--                      &index, &plen, &scope, &flags, ifname) != EOF) {
--
--            myflags = 0;
--            if (strncmp(lastname, ifname, IFNAMSIZ) == 0) {
--                if (doaliases == 0)
--                    continue;   /* already processed this interface */
--                myflags = IFI_ALIAS;
--            }
--            memcpy(lastname, ifname, IFNAMSIZ);
--            ifi = (struct ifi_info*)calloc(1, sizeof(struct ifi_info));
--            if (ifi == NULL) {
--                goto gotError;
--            }
--
--            ifipold   = *ifipnext;       /* need this later */
--            ifiptr    = ifipnext;
--            *ifipnext = ifi;            /* prev points to this new one */
--            ifipnext = &ifi->ifi_next;  /* pointer to next one goes here */
--
--            sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
--                    addr[0],addr[1],addr[2],addr[3],
--                    addr[4],addr[5],addr[6],addr[7]);
--
--            /* Add address of the interface */
--            memset(&hints, 0, sizeof(hints));
--            hints.ai_family = AF_INET6;
--            hints.ai_flags = AI_NUMERICHOST;
--            err = getaddrinfo(addr6, NULL, &hints, &res0);
--            if (err) {
--                goto gotError;
--            }
--            ifi->ifi_addr = calloc(1, sizeof(struct sockaddr_in6));
--            if (ifi->ifi_addr == NULL) {
--                goto gotError;
--            }
--            memcpy(ifi->ifi_addr, res0->ai_addr, sizeof(struct sockaddr_in6));
--
--            /* Add netmask of the interface */
--            char ipv6addr[INET6_ADDRSTRLEN];
--            plen_to_mask(plen, ipv6addr);
--            ifi->ifi_netmask = calloc(1, sizeof(struct sockaddr_in6));
--            if (ifi->ifi_addr == NULL) {
--                goto gotError;
--            }
--            sin6=calloc(1, sizeof(struct sockaddr_in6));
--            addrptr=calloc(1, sizeof(struct in6_addr));
--            inet_pton(family, ipv6addr, addrptr);
--            sin6->sin6_family=family;
--            sin6->sin6_addr=*addrptr;
--            sin6->sin6_scope_id=scope;
--            memcpy(ifi->ifi_netmask, sin6, sizeof(struct sockaddr_in6));
--            free(sin6);
--
--
--            /* Add interface name */
--            memcpy(ifi->ifi_name, ifname, IFI_NAME);
--
--            /* Add interface index */
--            ifi->ifi_index = index;
--
--            /* Add interface flags*/
--            memcpy(ifr.ifr_name, ifname, IFNAMSIZ);
--            if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) {
--                if (errno == EADDRNOTAVAIL) {
--                    /*
--                     * If the main interface is configured with no IP address but
--                     * an alias interface exists with an IP address, you get
--                     * EADDRNOTAVAIL for the main interface
--                     */
--                    free(ifi->ifi_addr);
--                    free(ifi);
--                    ifipnext  = ifiptr;
--                    *ifipnext = ifipold;
--                    continue;
--                } else {
--                    goto gotError;
--                }
--            }
--            ifi->ifi_flags = ifr.ifr_flags;
--            freeaddrinfo(res0);
--            res0=NULL;
--        }
--    }
--    goto done;
-+  struct ifaddrs *ifap, *ifa;
-+  struct ifi_info *ifi = NULL, *head = NULL;
--gotError:
--    if (ifihead != NULL) {
--        free_ifi_info(ifihead);
--        ifihead = NULL;
--    }
--    if (res0 != NULL) {
--        freeaddrinfo(res0);
--        res0=NULL;
-+  /* doaliases seems always true in the calls in current code */
-+  assert(doaliases);
-+
-+  if (getifaddrs(&ifap) < 0)
-+    {
-+      return NULL;
++                      mask,
+                       addr[0],addr[1],addr[2],addr[3],
+                       addr[4],addr[5],addr[6],addr[7],
+                       &index, &plen, &scope, &flags, ifname) != EOF) {
++            if (flags & IFA_F_DEPRECATED) continue;
+             myflags = 0;
+             if (strncmp(lastname, ifname, IFNAMSIZ) == 0) {
+                 if (doaliases == 0)
+@@ -205,7 +208,8 @@ gotError:
      }
--done:
--    if (sockfd != -1) {
+ done:
+     if (sockfd != -1) {
 -        assert(close(sockfd) == 0);
-+  for (ifa = ifap ; ifa ; ifa = ifa->ifa_next)
-+    {
-+      /* Care only about IPv6 addresses on non-point-to-point links. */
-+      if (!ifa->ifa_addr
-+          || ifa->ifa_addr->sa_family != AF_INET6)
-+        continue;
-+      ifi = calloc(1, sizeof(*ifi));
-+      if (!ifi)
-+        break;
-+      strncpy(ifi->ifi_name, ifa->ifa_name, IFI_NAME);
-+      /* We ignore ifi_{haddr,hlen}, everyone else does too */
-+      ifi->ifi_flags = ifa->ifa_flags;
-+      /* We ignore ifi_myflags; IFI_ALIAS isn't used anywhere */
-+      ifi->ifi_index = if_nametoindex(ifa->ifa_name);
-+      if (!(ifi->ifi_addr = malloc(sizeof(struct sockaddr_in6))))
-+        break;
-+      memcpy(ifi->ifi_addr, ifa->ifa_addr, sizeof(struct sockaddr_in6));
-+
-+      if (ifa->ifa_netmask)
-+        {
-+          if (!(ifi->ifi_netmask = malloc(sizeof(struct sockaddr_in6))))
-+            break;
-+          memcpy(ifi->ifi_netmask, ifa->ifa_netmask,
-+                 sizeof(struct sockaddr_in6));
-+        }
-+
-+      if (!(ifi->ifi_addr = malloc(sizeof(struct sockaddr_in6))))
-+        break;
-+      memcpy(ifi->ifi_addr, ifa->ifa_addr, sizeof(struct sockaddr_in6));
-+
-+
-+      if (ifa->ifa_flags & IFF_POINTOPOINT && ifa->ifa_dstaddr)
-+        {
-+          if (!(ifi->ifi_dstaddr = malloc(sizeof(struct sockaddr_in6))))
-+            break;
-+          memcpy(ifi->ifi_dstaddr, ifa->ifa_dstaddr,
-+                 sizeof(struct sockaddr_in6));
-+        }
-+      else if (ifa->ifa_broadaddr)
-+        {
-+          if (!(ifi->ifi_brdaddr = malloc(sizeof(struct sockaddr_in6))))
-+            break;
-+          memcpy(ifi->ifi_brdaddr, ifa->ifa_broadaddr,
-+                 sizeof(struct sockaddr_in6));
-+        }
-+      ifi->ifi_next = head;
-+      head = ifi;
-+      ifi = NULL;
-+    };
-+  if (ifi)
-+    {
-+      /* An error occurred. Let's bail out. */
-+      ifi->ifi_next = head;
-+      free_ifi_info(head);
-+      return NULL;
++      int rv = close(sockfd);
++      assert(rv == 0);
      }
--    return(ifihead);    /* pointer to first structure in linked list */
-+  freeifaddrs(ifap);
-+  return head;
+     return(ifihead);    /* pointer to first structure in linked list */
  }
-+
- #endif // defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX
- struct ifi_info *get_ifi_info(int family, int doaliases)
-@@ -229,7 +161,7 @@ struct ifi_info *get_ifi_info(int family
- #endif
- #if defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX
--    if (family == AF_INET6) return get_ifi_info_linuxv6(family, doaliases);
-+    if (family == AF_INET6) return get_ifi_info_linuxv6(doaliases);
- #endif
-     sockfd = -1;
---- a/mDNSPosix/mDNSUNP.h
-+++ b/mDNSPosix/mDNSUNP.h
-@@ -97,8 +97,7 @@ struct ifi_info {
- };
- #if defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX
--#define PROC_IFINET6_PATH "/proc/net/if_inet6"
--extern struct ifi_info  *get_ifi_info_linuxv6(int family, int doaliases);
-+extern struct ifi_info  *get_ifi_info_linuxv6(int doaliases);
- #endif
- #if defined(AF_INET6) && HAVE_IPV6
+diff --git a/mDNSShared/dnsextd_parser.y b/mDNSShared/dnsextd_parser.y
+index 18c5990..d4b63ce 100644
 --- a/mDNSShared/dnsextd_parser.y
 +++ b/mDNSShared/dnsextd_parser.y
 @@ -15,6 +15,8 @@
index f7b0a918c5a359c95f9bcab830c655c33a0170d2..5b015795c3af0f37634d16bc3aba5b7b60379ca4 100644 (file)
@@ -9,14 +9,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mosquitto
-PKG_VERSION:=1.4
+PKG_VERSION:=1.4.1
 PKG_RELEASE:=2
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE.txt
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mosquitto.org/files/source/
-PKG_MD5SUM:=cd879f5964311501ba8e2275add71484
+PKG_MD5SUM:=46008028563eb750c6aa93281ab2e181
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/net/mosquitto/patches/100-libwebsockets-fixes.patch b/net/mosquitto/patches/100-libwebsockets-fixes.patch
deleted file mode 100644 (file)
index 4d107b1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/websockets.c b/src/websockets.c
-index 95f8a81..cf2b5e7 100644
---- a/src/websockets.c
-+++ b/src/websockets.c
-@@ -72,7 +72,7 @@ struct libws_http_data {
-       FILE *fptr;
- };
--#ifndef HTTP_STATUS_NOT_FOUND
-+#ifndef LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_ARG
-       /* This is libwebsockets 1.2.x or earlier, we have to degrade our capabilities.
-        * Once lws 1.3 is widely available this should be removed. */
- #     define LWS_IS_OLD
diff --git a/net/mosquitto/patches/101-qos2-inflight.patch b/net/mosquitto/patches/101-qos2-inflight.patch
new file mode 100644 (file)
index 0000000..61706d3
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/lib/mosquitto.c b/lib/mosquitto.c
+index bd9dbd3..7314248 100644
+--- a/lib/mosquitto.c
++++ b/lib/mosquitto.c
+@@ -594,7 +594,6 @@ int mosquitto_publish(struct mosquitto *mosq, int *mid, const char *topic, int p
+               pthread_mutex_lock(&mosq->out_message_mutex);
+               _mosquitto_message_queue(mosq, message, mosq_md_out);
+               if(mosq->max_inflight_messages == 0 || mosq->inflight_messages < mosq->max_inflight_messages){
+-                      mosq->inflight_messages++;
+                       if(qos == 1){
+                               message->state = mosq_ms_wait_for_puback;
+                       }else if(qos == 2){
index eed2348752f8384e11e6fa955f51f8bd9c2a196e..6656806b5a32e1b70d43d8aeddaa6a41d59539ad 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luci-app-mwan3
-PKG_VERSION:=1.3
-PKG_RELEASE:=5
+PKG_VERSION:=1.4
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
 PKG_LICENSE:=GPLv2
 
index bf524d1df7579ff17f8caa5f93d6a9033e4adba9..cbd8bdd03ed2b2d97e46e678914e040cef3b7677 100644 (file)
@@ -88,6 +88,39 @@ proto = mwan_rule:option(DummyValue, "proto", translate("Protocol"))
                return self.map:get(s, "proto") or "all"
        end
 
+sticky = mwan_rule:option(DummyValue, "sticky", translate("Sticky"))
+       sticky.rawhtml = true
+       function sticky.cfgvalue(self, s)
+               if self.map:get(s, "sticky") == "1" then
+                       stickied = 1
+                       return "Yes"
+               else
+                       stickied = nil
+                       return "No"
+               end
+       end
+
+timeout = mwan_rule:option(DummyValue, "timeout", translate("Sticky timeout"))
+       timeout.rawhtml = true
+       function timeout.cfgvalue(self, s)
+               if stickied then
+                       local timeoutValue = self.map:get(s, "timeout")
+                       if timeoutValue then
+                               return timeoutValue .. "s"
+                       else
+                               return "600s"
+                       end
+               else
+                       return "&#8212;"
+               end
+       end
+
+ipset = mwan_rule:option(DummyValue, "ipset", translate("IPset"))
+       ipset.rawhtml = true
+       function ipset.cfgvalue(self, s)
+               return self.map:get(s, "ipset") or "&#8212;"
+       end
+
 use_policy = mwan_rule:option(DummyValue, "use_policy", translate("Policy assigned"))
        use_policy.rawhtml = true
        function use_policy.cfgvalue(self, s)
index 831ab35b91b3bbadb2ab9af7cb6982b43130dad9..d880a72e2979eb18e715481ffcb027a722ffef7a 100644 (file)
@@ -81,6 +81,19 @@ proto = mwan_rule:option(Value, "proto", translate("Protocol"),
        proto:value("esp")
        cbiAddProtocol(proto)
 
+sticky = mwan_rule:option(ListValue, "sticky", translate("Sticky"),
+       translate("Traffic from the same source IP address that previously matched this rule within the sticky timeout period will use the same WAN interface"))
+       sticky.default = "0"
+       sticky:value("1", translate("Yes"))
+       sticky:value("0", translate("No"))
+
+timeout = mwan_rule:option(Value, "timeout", translate("Sticky timeout"),
+       translate("Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set"))
+       timeout.datatype = "range(1, 1000000)"
+
+ipset = mwan_rule:option(Value, "ipset", translate("IPset"),
+       translate("Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/youtube.com/youtube\")"))
+
 use_policy = mwan_rule:option(Value, "use_policy", translate("Policy assigned"))
        cbiAddPolicy(use_policy)
        use_policy:value("unreachable", translate("unreachable (reject)"))
index c0f720bae5f3978e5ab3ca7db18562b69847bf46..d714d4fe9dcc1f7bee7d8c2d188477edf4f6a990 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mwan3
-PKG_VERSION:=1.5
-PKG_RELEASE:=10
+PKG_VERSION:=1.6
+PKG_RELEASE:=1
 PKG_MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>
 PKG_LICENSE:=GPLv2
 
@@ -19,7 +19,7 @@ define Package/mwan3
    SECTION:=net
    CATEGORY:=Network
    SUBMENU:=Routing and Redirection
-   DEPENDS:=+ip +iptables +iptables-mod-conntrack-extra +iptables-mod-ipopt
+   DEPENDS:=+ip +ipset +iptables +iptables-mod-conntrack-extra +iptables-mod-ipopt
    TITLE:=Multiwan hotplug script with connection tracking support
    MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>
    PKGARCH:=all
index 53f2f9832aea47b7c34de2e8487753cb9a85f3a0..f66c024c0b3560ff0b8480acf43ff607d84c998c 100644 (file)
@@ -61,17 +61,18 @@ config policy 'wan2_wan'
        list use_member 'wan_m2_w3'
        list use_member 'wan2_m1_w2'
 
-config rule 'sticky_even'
-       option src_ip '0.0.0.0/0.0.0.1'
-       option dest_port '443'
+config rule 'youtube'
+       option sticky '1'
+       option ipset 'youtube'
+       option dest_port '80,443'
        option proto 'tcp'
-       option use_policy 'wan_wan2'
+       option use_policy 'balanced'
 
-config rule 'sticky_odd'
-       option src_ip '0.0.0.1/0.0.0.1'
+config rule 'https'
+       option sticky '1'
        option dest_port '443'
        option proto 'tcp'
-       option use_policy 'wan2_wan'
+       option use_policy 'balanced'
 
 config rule 'default_rule'
        option dest_ip '0.0.0.0/0'
index 25044c4d396d96bd38eb90f700126dfc75492e73..f117e49e6bc24a5f4356d438808d328bcbcaba0f 100644 (file)
@@ -12,12 +12,18 @@ mwan3_set_general_iptables()
                $IPT -N mwan3_ifaces
        fi
 
-       if ! $IPT -S mwan3_rules &> /dev/null; then
-               $IPT -N mwan3_rules
-       fi
-
        if ! $IPT -S mwan3_connected &> /dev/null; then
                $IPT -N mwan3_connected
+               $IPS create mwan3_connected hash:net
+               $IPT -A mwan3_connected -m set --match-set mwan3_connected dst -j MARK --set-xmark 0xff00/0xff00
+       fi
+
+       if ! $IPT -S mwan3_track &> /dev/null; then
+               $IPT -N mwan3_track
+       fi
+
+       if ! $IPT -S mwan3_rules &> /dev/null; then
+               $IPT -N mwan3_rules
        fi
 
        if ! $IPT -S mwan3_hook &> /dev/null; then
@@ -25,15 +31,12 @@ mwan3_set_general_iptables()
                $IPT -A mwan3_hook -j CONNMARK --restore-mark --nfmask 0xff00 --ctmask 0xff00
                $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_ifaces
                $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_connected
+               $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_track
                $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_rules
                $IPT -A mwan3_hook -j CONNMARK --save-mark --nfmask 0xff00 --ctmask 0xff00
                $IPT -A mwan3_hook -m mark ! --mark 0xff00/0xff00 -j mwan3_connected
        fi
 
-       if ! $IPT -S mwan3_output_hook &> /dev/null; then
-               $IPT -N mwan3_output_hook
-       fi
-
        if ! $IPT -S PREROUTING | grep mwan3_hook &> /dev/null; then
                $IPT -A PREROUTING -j mwan3_hook
        fi
@@ -42,10 +45,6 @@ mwan3_set_general_iptables()
                $IPT -A OUTPUT -j mwan3_hook
        fi
 
-       if ! $IPT -S OUTPUT | grep mwan3_output_hook &> /dev/null; then
-               $IPT -A OUTPUT -j mwan3_output_hook
-       fi
-
        $IPT -F mwan3_rules
 }
 
@@ -62,28 +61,29 @@ mwan3_set_general_rules()
 
 mwan3_set_connected_iptables()
 {
-       local connected_networks
+       local connected_network
 
        if $IPT -S mwan3_connected &> /dev/null; then
-               $IPT -F mwan3_connected
 
-               for connected_networks in $($IP route | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
-                       $IPT -A mwan3_connected -d $connected_networks -j MARK --set-xmark 0xff00/0xff00
+               $IPS create mwan3_connected_temp hash:net
+
+               for connected_network in $($IP route | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
+                       $IPS -! add mwan3_connected_temp $connected_network
                done
 
-               for connected_networks in $($IP route list table 0 | awk '{print $2}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
-                       $IPT -A mwan3_connected -d $connected_networks -j MARK --set-xmark 0xff00/0xff00
+               for connected_network in $($IP route list table 0 | awk '{print $2}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
+                       $IPS -! add mwan3_connected_temp $connected_network
                done
 
-               $IPT -I mwan3_connected -d 224.0.0.0/3 -j MARK --set-xmark 0xff00/0xff00
-               $IPT -I mwan3_connected -d 127.0.0.0/8 -j MARK --set-xmark 0xff00/0xff00
+               $IPS add mwan3_connected_temp 224.0.0.0/3
+               $IPS swap mwan3_connected_temp mwan3_connected
+               $IPS destroy mwan3_connected_temp
+
        fi
 }
 
 mwan3_set_iface_iptables()
 {
-       local local_net local_nets
-
        if ! $IPT -S mwan3_iface_$INTERFACE &> /dev/null; then
                $IPT -N mwan3_iface_$INTERFACE
        fi
@@ -92,16 +92,7 @@ mwan3_set_iface_iptables()
        $IPT -D mwan3_ifaces -m mark --mark 0x0/0xff00 -j mwan3_iface_$INTERFACE &> /dev/null
 
        if [ $ACTION == "ifup" ]; then
-               local_nets=$($IP route list dev $DEVICE scope link | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}')
-
-               if [ -n "$local_nets" ]; then
-                       for local_net in $local_nets ; do
-                               if [ $ACTION == "ifup" ]; then
-                                       $IPT -I mwan3_iface_$INTERFACE -i $DEVICE -s $local_net -m mark --mark 0x0/0xff00 -m comment --comment "default" -j MARK --set-xmark 0xff00/0xff00
-                               fi
-                       done
-               fi
-
+               $IPT -I mwan3_iface_$INTERFACE -i $DEVICE -m set --match-set mwan3_connected src -m mark --mark 0x0/0xff00 -m comment --comment "default" -j MARK --set-xmark 0xff00/0xff00
                $IPT -A mwan3_iface_$INTERFACE -i $DEVICE -m mark --mark 0x0/0xff00 -m comment --comment "$INTERFACE" -j MARK --set-xmark $(($iface_id*256))/0xff00
                $IPT -A mwan3_ifaces -m mark --mark 0x0/0xff00 -j mwan3_iface_$INTERFACE
        fi
@@ -131,6 +122,17 @@ mwan3_set_iface_rules()
        [ $ACTION == "ifup" ] && $IP rule add pref $(($iface_id+2000)) fwmark $(($iface_id*256))/0xff00 lookup $iface_id
 }
 
+mwan3_set_iface_ipset()
+{
+       local setname entry
+
+       for setname in $(ipset -n list | grep ^mwan3_sticky_); do
+               for entry in $(ipset list $setname | grep "$(echo $(($iface_id*256)) | awk '{ printf "0x%08x", $1; }')" | cut -d ' ' -f 1); do
+                       $IPS del $setname $entry
+               done
+       done
+}
+
 mwan3_track()
 {
        local track_ip track_ips reliability count timeout interval down up
@@ -154,22 +156,23 @@ mwan3_track()
                config_get down $INTERFACE down 5
                config_get up $INTERFACE up 5
 
-               if ! $IPT -S mwan3_track_$INTERFACE &> /dev/null; then
-                       $IPT -N mwan3_track_$INTERFACE
-                       $IPT -A mwan3_output_hook -p icmp -m icmp --icmp-type 8 -m length --length 32 -j mwan3_track_$INTERFACE
-               fi
-
-               $IPT -F mwan3_track_$INTERFACE
+               $IPS -! create mwan3_track_$INTERFACE hash:ip
+               $IPS create mwan3_track_temp_$INTERFACE hash:ip
 
                for track_ip in $track_ips; do
-                       $IPT -A mwan3_track_$INTERFACE -d $track_ip -j MARK --set-xmark 0xff00/0xff00
+                       $IPS -! add mwan3_track_temp_$INTERFACE $track_ip
                done
 
+               $IPS swap mwan3_track_temp_$INTERFACE mwan3_track_$INTERFACE
+               $IPS destroy mwan3_track_temp_$INTERFACE
+
+               $IPT -D mwan3_track -p icmp -m set --match-set mwan3_track_$INTERFACE dst -m icmp --icmp-type 8 -m length --length 32 -j MARK --set-xmark 0xff00/0xff00 &> /dev/null
+               $IPT -A mwan3_track -p icmp -m set --match-set mwan3_track_$INTERFACE dst -m icmp --icmp-type 8 -m length --length 32 -j MARK --set-xmark 0xff00/0xff00
+
                [ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track $INTERFACE $DEVICE $reliability $count $timeout $interval $down $up $track_ips &
        else
-               $IPT -D mwan3_output_hook -p icmp -m icmp --icmp-type 8 -m length --length 32 -j mwan3_track_$INTERFACE &> /dev/null
-               $IPT -F mwan3_track_$INTERFACE &> /dev/null
-               $IPT -X mwan3_track_$INTERFACE &> /dev/null
+               $IPT -D mwan3_track -p icmp -m set --match-set mwan3_track_$INTERFACE dst -m icmp --icmp-type 8 -m length --length 32 -j MARK --set-xmark 0xff00/0xff00 &> /dev/null
+               $IPS destroy mwan3_track_$INTERFACE
        fi
 }
 
@@ -182,7 +185,7 @@ mwan3_set_policy()
        config_get weight $1 weight 1
 
        [ -n "$INTERFACE" ] || return 0
-       
+
        config_foreach mwan3_get_iface_id interface
 
        [ -n "$iface_id" ] || return 0
@@ -200,19 +203,19 @@ mwan3_set_policy()
 
                        total_weight=$(($total_weight+$weight))
                        probability=$(($weight*1000/$total_weight))
-                       
+
                        if [ "$probability" -lt 10 ]; then
                                probability="0.00$probability"
-                               elif [ $probability -lt 100 ]; then
+                       elif [ $probability -lt 100 ]; then
                                probability="0.0$probability"
-                               elif [ $probability -lt 1000 ]; then
+                       elif [ $probability -lt 1000 ]; then
                                probability="0.$probability"
                        else
                                probability="1"
                        fi
 
                        probability="-m statistic --mode random --probability $probability"
-                       
+
                        $IPT -I mwan3_policy_$policy -m mark --mark 0x0/0xff00 $probability -m comment --comment "$INTERFACE $weight $total_weight" -j MARK --set-xmark $(($iface_id*256))/0xff00
                fi
        fi
@@ -254,10 +257,34 @@ mwan3_set_policies_iptables()
        config_list_foreach $policy use_member mwan3_set_policy
 }
 
+mwan3_set_sticky_iptables()
+{
+       local INTERFACE iface_count iface_id
+
+       INTERFACE="$1"
+
+       config_foreach mwan3_get_iface_id interface
+       unset iface_count
+
+       $IPS -! create mwan3_sticky_$rule hash:ip,mark markmask 0xff00 timeout $timeout
+
+       if [ -n "$iface_id" ]; then
+               if [ -n "$($IPT -S mwan3_iface_$1 2> /dev/null)" ]; then
+                       $IPT -I mwan3_rule_$rule -m set ! --match-set mwan3_sticky_$rule src,src -j MARK --set-xmark 0x0/0xff00
+                       $IPT -I mwan3_rule_$rule -m mark --mark 0/0xff00 -j MARK --set-xmark $(($iface_id*256))/0xff00
+               fi
+       fi
+
+       unset iface_id
+}
+
 mwan3_set_user_rules_iptables()
 {
-       local proto src_ip src_port dest_ip dest_port use_policy
+       local ipset proto src_ip src_port sticky dest_ip dest_port use_policy rule timeout
 
+       config_get sticky $1 sticky 0
+       config_get timeout $1 timeout 600
+       config_get ipset $1 ipset
        config_get proto $1 proto all
        config_get src_ip $1 src_ip 0.0.0.0/0
        config_get src_port $1 src_port 0:65535
@@ -265,6 +292,20 @@ mwan3_set_user_rules_iptables()
        config_get dest_port $1 dest_port 0:65535
        config_get use_policy $1 use_policy
 
+       rule="$1"
+
+       if [ "$rule" != $(echo "$rule" | cut -c1-15) ]; then
+               $LOG warn "Rule $rule exceeds max of 15 chars. Not setting rule" && return 0
+       fi
+
+       if [ -n "$ipset" ]; then
+               if [ -z "$($IPS -n list $ipset)" ]; then
+                       $IPS create $ipset hash:ip timeout 3600
+               fi
+
+               ipset="-m set --match-set $ipset dst"
+       fi
+
        if [ -n "$use_policy" ]; then
                if [ "$use_policy" == "default" ]; then
                        use_policy="MARK --set-xmark 0xff00/0xff00"
@@ -273,15 +314,32 @@ mwan3_set_user_rules_iptables()
                elif [ "$use_policy" == "blackhole" ]; then
                        use_policy="MARK --set-xmark 0xfd00/0xff00"
                else
-                       use_policy="mwan3_policy_$use_policy"
+                       if [ "$sticky" -eq 1 ]; then
+
+                               if ! $IPT -S mwan3_rule_$rule &> /dev/null; then
+                                       $IPT -N mwan3_rule_$rule
+                               fi
+
+                               $IPT -F mwan3_rule_$rule
+
+                               config_foreach mwan3_set_sticky_iptables interface
+
+                               $IPT -A mwan3_rule_$rule -m mark --mark 0/0xff00 -j mwan3_policy_$use_policy
+                               $IPT -A mwan3_rule_$rule -m mark ! --mark 0xfc00/0xfc00 -j SET --del-set mwan3_sticky_$rule src,src
+                               $IPT -A mwan3_rule_$rule -m mark ! --mark 0xfc00/0xfc00 -j SET --add-set mwan3_sticky_$rule src,src
+
+                               use_policy="mwan3_rule_$rule"
+                       else
+                               use_policy="mwan3_policy_$use_policy"
+                       fi
                fi
 
                case $proto in
                        tcp|udp)
-                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $use_policy &> /dev/null
+                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $use_policy &> /dev/null
                        ;;
                        *)
-                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip -m mark --mark 0/0xff00 -m comment --comment "$1" -j $use_policy &> /dev/null
+                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/0xff00 -m comment --comment "$1" -j $use_policy &> /dev/null
                        ;;
                esac
        fi
@@ -333,6 +391,7 @@ mwan3_ifupdown()
        mwan3_set_iface_route
        mwan3_set_iface_rules
 
+       [ $ACTION == "ifdown" ] && mwan3_set_iface_ipset
        [ $ACTION == "ifup" ] && mwan3_track
 
        config_foreach mwan3_set_policies_iptables policy
@@ -346,9 +405,15 @@ if [ $ACTION == "ifup" ]; then
        [ -n "$DEVICE" ] || exit 0
 fi
 
-local IP IPT LOG
+[ -x /usr/sbin/ip ] || exit 1
+[ -x /usr/sbin/ipset ] || exit 1
+[ -x /usr/sbin/iptables ] || exit 1
+[ -x /usr/bin/logger ] || exit 1
+
+local IP IPS IPT LOG
 
 IP="/usr/sbin/ip -4"
+IPS="/usr/sbin/ipset"
 IPT="/usr/sbin/iptables -t mangle -w"
 LOG="/usr/bin/logger -t mwan3 -p"
 
index 286603a85a51c12fdaa02d0e1ac4bef6eee33799..c69d94eeb6c6680c2f89a28f1a0466ac4371f987 100755 (executable)
@@ -2,14 +2,15 @@
 . /lib/functions.sh
 
 IP="/usr/sbin/ip -4"
+IPS="/usr/sbin/ipset"
 IPT="/usr/sbin/iptables -t mangle -w"
 
 help()
-{                                                                    
-       cat <<EOF                                                                                      
-Syntax: mwan3 [command]                                                                          
-                                                                                                       
-Available commands:                                                                                    
+{
+       cat <<EOF
+Syntax: mwan3 [command]
+
+Available commands:
        start           Load iptables rules, ip rules and ip routes
        stop            Unload iptables rules, ip rules and ip routes
        restart         Reload iptables rules, ip rules and ip routes
@@ -54,11 +55,11 @@ ifup()
        if [ -n "$2" ]; then
                echo "Too many arguments. Usage: mwan3 ifup <interface>" && exit 0
        fi
-       
+
        config_get enabled "$1" enabled 0
 
        device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
-       
+
        if [ -n "$device" ] ; then
                [ "$enabled" -eq 1 ] && ACTION=ifup INTERFACE=$1 DEVICE=$device /sbin/hotplug-call iface
        fi
@@ -71,14 +72,14 @@ interfaces()
        config_load mwan3
 
        echo "Interface status:"
-       
+
        check_iface_status()
        {
                let iface_id++
                device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
 
                if [ -z "$device" ]; then
-                       echo "Interface $1 is unknown"
+                       echo " interface $1 is unknown"
                        return 0
                fi
 
@@ -92,21 +93,21 @@ interfaces()
 
                if [ -n "$($IP rule | awk '$5 == "'$device'"')" -a -n "$($IPT -S mwan3_iface_$1 2> /dev/null)" -a -n "$($IP route list table $iface_id default dev $device 2> /dev/null)" ]; then
                        if [ -n "$(uci get -p /var/state mwan3.$1.track_ip 2> /dev/null)" ]; then
-                               echo "Interface $1 is online (tracking $tracking)"
+                               echo " interface $1 is online (tracking $tracking)"
                        else
-                               echo "Interface $1 is online"
+                               echo " interface $1 is online"
                        fi
                elif [ -n "$($IP rule | awk '$5 == "'$device'"')" -o -n "$($IPT -S mwan3_iface_$1 2> /dev/null)" -o -n "$($IP route list table $iface_id default dev $device 2> /dev/null)" ]; then
-                       echo "Interface $1 error"
+                       echo " interface $1 error"
                else
                        if [ "$enabled" -eq 1 ]; then
                                if [ -n "$(uci get -p /var/state mwan3.$1.track_ip 2> /dev/null)" ]; then
-                                       echo "Interface $1 is offline (tracking $tracking)"
+                                       echo " interface $1 is offline (tracking $tracking)"
                                else
-                                       echo "Interface $1 is offline"
+                                       echo " interface $1 is offline"
                                fi
                        else
-                               echo "Interface $1 is disabled"
+                               echo " interface $1 is disabled"
                        fi
                fi
        }
@@ -141,17 +142,19 @@ policies()
 }
 rules()
 {
+       local address
+
        if [ -n "$($IPT -S mwan3_connected 2> /dev/null)" ]; then
                echo "Known networks:"
-               echo "destination policy hits" | awk '{ printf "%-19s%-19s%-9s%s\n",$1,$2,$3}' | awk '1; {gsub(".","-")}1'
-               $IPT -L mwan3_connected -n -v 2> /dev/null | tail -n+3 | sed 's/mark.*//' | sed 's/mwan3_policy_//' | awk '{printf "%-19s%-19s%-9s%s\n",$9,"default",$1}'
+               for address in $($IPS list mwan3_connected | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
+                       echo " $address"
+               done
                echo -e
        fi
 
        if [ -n "$($IPT -S mwan3_rules 2> /dev/null)" ]; then
                echo "Active rules:"
-               echo "source destination proto src-port dest-port policy hits" | awk '{ printf "%-19s%-19s%-7s%-14s%-14s%-16s%-9s%s\n",$1,$2,$3,$4,$5,$6,$7}' | awk '1; {gsub(".","-")}1'
-               $IPT -L mwan3_rules -n -v 2> /dev/null | tail -n+3 | sed 's/mark.*//' | sed 's/mwan3_policy_//' | awk '{ printf "%-19s%-19s%-7s%-14s%-14s%-16s%-9s%s\n",$8,$9,$4,$12,$15,$3,$1}'
+               $IPT -L mwan3_rules -n -v 2> /dev/null | tail -n+3 | sed 's/mark.*//' | sed 's/mwan3_policy_/- /' | sed 's/mwan3_rule_/S /'
                echo -e
        fi
 }
@@ -171,7 +174,7 @@ start()
 
 stop()
 {
-       local route rule table
+       local ipset route rule table
 
        killall mwan3track &> /dev/null
        rm /var/run/mwan3track-* &> /dev/null
@@ -186,7 +189,6 @@ stop()
 
        $IPT -D PREROUTING -j mwan3_hook &> /dev/null
        $IPT -D OUTPUT -j mwan3_hook &> /dev/null
-       $IPT -D OUTPUT -j mwan3_output_hook &> /dev/null
 
        for table in $($IPT -S | awk '{print $2}' | grep mwan3 | sort -u); do
                $IPT -F $table &> /dev/null
@@ -195,6 +197,10 @@ stop()
        for table in $($IPT -S | awk '{print $2}' | grep mwan3 | sort -u); do
                $IPT -X $table &> /dev/null
        done
+
+       for ipset in $(ipset -n list | grep mwan3); do
+               $IPS destroy $ipset
+       done
 }
 
 restart() {
index 6fbf1b8bdef567ade8918762e24fb0c64a555b05..5736e0d7d4cc7b87954234b56c47378902ec2c7f 100644 (file)
@@ -216,7 +216,6 @@ define Package/libnetsnmp/install
 endef
 
 define Package/snmpd/conffiles
-/etc/default/snmpd
 /etc/config/snmpd
 endef
 
@@ -225,8 +224,6 @@ define Package/snmpd/install
        $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
        $(INSTALL_DIR) $(1)/etc/snmp
        ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
-       $(INSTALL_DIR) $(1)/etc/default
-       $(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
        $(INSTALL_DIR) $(1)/usr/sbin
@@ -234,7 +231,6 @@ define Package/snmpd/install
 endef
 
 define Package/snmpd-static/conffiles
-/etc/default/snmpd
 /etc/config/snmpd
 endef
 
@@ -243,8 +239,6 @@ define Package/snmpd-static/install
        $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
        $(INSTALL_DIR) $(1)/etc/snmp
        ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
-       $(INSTALL_DIR) $(1)/etc/default
-       $(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
        $(INSTALL_DIR) $(1)/usr/sbin
diff --git a/net/net-snmp/files/snmpd.default b/net/net-snmp/files/snmpd.default
deleted file mode 100644 (file)
index 758c8e4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-OPTIONS="-Lf /dev/null -p /var/run/snmpd.pid"
index 2668b7b3e5dd457b7e3527e7347adbf3b4f53d68..3dd8c41dc2f836a7312c8f3de09077c6c3386c76 100644 (file)
@@ -2,35 +2,35 @@
 # Copyright (C) 2008 OpenWrt.org
 START=50
 
-DEFAULT=/etc/default/snmpd
-LIB_D=/var/lib/snmp
-LOG_D=/var/log
-RUN_D=/var/run
-PID_F=$RUN_D/snmpd.pid
-RUN_C=$RUN_D/snmpd.conf
+USE_PROCD=1
+PROG="/usr/sbin/snmpd"
+
+CONFIGFILE="/var/run/snmpd.conf"
 
 snmpd_agent_add() {
        local cfg="$1"
 
        config_get agentaddress "$cfg" agentaddress
        [ -n "$agentaddress" ] || return 0
-       echo "agentaddress $agentaddress" >> $RUN_C
+       echo "agentaddress $agentaddress" >> $CONFIGFILE
 }
+
 snmpd_system_add() {
        local cfg="$1"
        config_get syslocation "$cfg" sysLocation
-       [ -n "$syslocation" ] && echo "sysLocation $syslocation" >> $RUN_C
+       [ -n "$syslocation" ] && echo "sysLocation $syslocation" >> $CONFIGFILE
        config_get syscontact "$cfg" sysContact
-       [ -n "$syscontact" ] && echo "sysContact $syscontact" >> $RUN_C
+       [ -n "$syscontact" ] && echo "sysContact $syscontact" >> $CONFIGFILE
        config_get sysname "$cfg" sysName
-       [ -n "$sysname" ] && echo "sysName $sysname" >> $RUN_C
+       [ -n "$sysname" ] && echo "sysName $sysname" >> $CONFIGFILE
        config_get sysservice "$cfg" sysService
-       [ -n "$sysservice" ] && echo "sysService $sysservice" >> $RUN_C
+       [ -n "$sysservice" ] && echo "sysService $sysservice" >> $CONFIGFILE
        config_get sysdescr "$cfg" sysDescr
-       [ -n "$sysdescr" ] && echo "sysDescr $sysdescr" >> $RUN_C
+       [ -n "$sysdescr" ] && echo "sysDescr $sysdescr" >> $CONFIGFILE
        config_get sysobjectid "$cfg" sysObjectID
-       [ -n "$sysobjectid" ] && echo "sysObjectID $sysobjectid" >> $RUN_C
+       [ -n "$sysobjectid" ] && echo "sysObjectID $sysobjectid" >> $CONFIGFILE
 }
+
 snmpd_com2sec_add() {
        local cfg="$1"
        config_get secname "$cfg" secname
@@ -39,8 +39,9 @@ snmpd_com2sec_add() {
        [ -n "$source" ] || return 0
        config_get community "$cfg" community
        [ -n "$community" ] || return 0
-       echo "com2sec $secname $source $community" >> $RUN_C
+       echo "com2sec $secname $source $community" >> $CONFIGFILE
 }
+
 snmpd_com2sec6_add() {
        local cfg="$1"
        config_get secname "$cfg" secname
@@ -49,8 +50,9 @@ snmpd_com2sec6_add() {
        [ -n "$source" ] || return 0
        config_get community "$cfg" community
        [ -n "$community" ] || return 0
-       echo "com2sec6 $secname $source $community" >> $RUN_C
+       echo "com2sec6 $secname $source $community" >> $CONFIGFILE
 }
+
 snmpd_group_add() {
        local cfg="$1"
        config_get group "$cfg" group
@@ -59,8 +61,9 @@ snmpd_group_add() {
        [ -n "$version" ] || return 0
        config_get secname "$cfg" secname
        [ -n "$secname" ] || return 0
-       echo "group $group $version $secname" >> $RUN_C
+       echo "group $group $version $secname" >> $CONFIGFILE
 }
+
 snmpd_view_add() {
        local cfg="$1"
        config_get viewname "$cfg" viewname
@@ -71,8 +74,9 @@ snmpd_view_add() {
        [ -n "$oid" ] || return 0
        # optional mask
        config_get mask "$cfg" mask
-       echo "view $viewname $type $oid $mask" >> $RUN_C
+       echo "view $viewname $type $oid $mask" >> $CONFIGFILE
 }
+
 snmpd_access_add() {
        local cfg="$1"
        config_get group "$cfg" group
@@ -92,8 +96,9 @@ snmpd_access_add() {
        [ -n "$write" ] || return 0
        config_get notify "$cfg" notify
        [ -n "$notify" ] || return 0
-       echo "access $group $context $version $level $prefix $read $write $notify" >> $RUN_C
+       echo "access $group $context $version $level $prefix $read $write $notify" >> $CONFIGFILE
 }
+
 snmpd_pass_add() {
        local cfg="$1"
        local pass='pass'
@@ -106,8 +111,9 @@ snmpd_pass_add() {
        [ $persist -ne 0 ] && pass='pass_persist'
        config_get priority "$cfg" priority
        priority=${priority:+-p $priority}
-       echo "$pass $priority $miboid $prog" >> $RUN_C
+       echo "$pass $priority $miboid $prog" >> $CONFIGFILE
 }
+
 snmpd_exec_add() {
        local cfg="$1"
 
@@ -117,8 +123,9 @@ snmpd_exec_add() {
        [ -n "$prog" ] || return 0
        config_get args "$cfg" args
        config_get miboid "$cfg" miboid
-       echo "exec $miboid $name $prog $args" >> $RUN_C
+       echo "exec $miboid $name $prog $args" >> $CONFIGFILE
 }
+
 snmpd_disk_add() {
         local cfg="$1"
         local disk='disk'
@@ -127,13 +134,13 @@ snmpd_disk_add() {
         [ -n "$partition" ] || return 0
         config_get size "$cfg" size
         [ -n "$size" ] || return 0
-        echo "$disk $partition $size" >> $RUN_C
+        echo "$disk $partition $size" >> $CONFIGFILE
 }
-start() {
-       [ -d $LIB_D ] || mkdir -p $LIB_D
-       [ -d $LOG_D ] || mkdir -p $LOG_D
-       [ -d $RUN_D ] || mkdir -p $RUN_D
-       [ -f $RUN_C ] && rm -f $RUN_C
+
+start_service() {
+       [ -f "$CONFIGFILE" ] && rm -f "$CONFIGFILE"
+
+       procd_open_instance
 
        config_load snmpd
 
@@ -148,10 +155,17 @@ start() {
        config_foreach snmpd_exec_add exec
        config_foreach snmpd_disk_add disk
        
-       [ -f $DEFAULT ] && . $DEFAULT
-       $DEBUG /usr/sbin/snmpd $OPTIONS
+       procd_set_param command $PROG -Lf /dev/null -f
+       procd_set_param file $CONFIGFILE
+       procd_set_param respawn
+
+       for iface in $(ls /sys/class/net 2>/dev/null); do
+               procd_append_param netdev "$iface"
+       done
+
+       procd_close_instance
 }
-stop() {
-       [ -f $PID_F ] && kill $(cat $PID_F)
-       [ -f $RUN_C ] && rm -f $RUN_C
+
+stop_service() {
+       [ -f "$CONFIGFILE" ] && rm -f "$CONFIGFILE"
 }
index ba1c1993f2c66e3bfefad4107511bb6a1e489d94..14b2144a4b80e0913b527e616a6340214a109ace 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nsd
-PKG_VERSION:=4.0.3
+PKG_VERSION:=4.1.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/nsd
-PKG_MD5SUM:=9331dd18478295206775433a0b23e490
+PKG_MD5SUM:=73014bab5514b9babaf6c9007a6b36d8
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
index 34a8ddae9a7204c25c811b7daf9c7f0002ea1c7e..46e08f594667dae630814bf6539e6fce009e154d 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ntp
-PKG_VERSION:=4.2.8p1
+PKG_VERSION:=4.2.8p2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
-PKG_MD5SUM:=65d8cdfae4722226fbe29863477641ed
+PKG_MD5SUM:=fa37049383316322d060ec9061ac23a9
 
 PKG_LICENSE:=Unique
 PKG_LICENSE_FILES:=COPYRIGHT html/copyright.html
index 992628f6cf227833d78146e3cc0f7c06b8e3be1a..975be751ec78a189091eaaa7d7c630b09303e5ea 100644 (file)
@@ -1,6 +1,6 @@
 NAME=ntpd
 CONFIG=/etc/ntp.conf
-COMMAND=/usr/sbin/$NAME
+COMMAND=/sbin/$NAME
 
 [ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
         [ -x $COMMAND ] && [ -r $CONFIG ] && {
index b38e9b452a04cfc8fe2e68a341ce191bf0f69a1a..8e0eac766db3b635b4db17d39ea1b16418b88f87 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ocserv
-PKG_VERSION:=0.9.2
+PKG_VERSION:=0.10.3
 PKG_RELEASE:=2
 
 PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL :=ftp://ftp.infradead.org/pub/ocserv/
-PKG_MD5SUM:=9697c37cc81b30be2b178258ee595d97
+PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/ocserv/
+PKG_MD5SUM:=36c947a4e37484487844dc1c977ca870
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
@@ -58,6 +58,7 @@ CONFIGURE_ARGS+= \
        --enable-local-libopts \
        --with-libreadline-prefix="$(STAGING_DIR)/" \
        --without-libnl \
+       --without-gssapi \
        --with-libcrypt-prefix="$(STAGING_DIR)/" \
 
 ifneq ($(CONFIG_OCSERV_PAM),y)
index 1694fd782a76941dfcf13367e177d0a4ee0c7ffa..b5bbec31ed276047af0871d833af2aa1903b5f5a 100644 (file)
@@ -35,7 +35,7 @@ max-clients = |MAX_CLIENTS|
 
 # Limit the number of client connections to one every X milliseconds 
 # (X is the provided value). Set to zero for no limit.
-#rate-limit-ms = 100
+rate-limit-ms = 100
 
 # Limit the number of identical clients (i.e., users connecting 
 # multiple times). Unset or set to zero for unlimited.
@@ -142,6 +142,27 @@ auth-timeout = 40
 # a failed authentication attempt.
 min-reauth-time = 360
 
+# Banning clients in ocserv works with a point system. IP addresses
+# that get a score over that configured number are banned for
+# min-reauth-time seconds. By default a wrong password attempt is 10 points,
+# a KKDCP POST is 1 point, and a connection is 1 point. Note that
+# due to difference processes being involved the count of points
+# will not be real-time precise.
+#
+# Score banning cannot be reliably used when receiving proxied connections
+# locally from an HTTP server (i.e., when listen-clear-file is used).
+#
+# Set to zero to disable.
+max-ban-score = 50
+
+# The time (in seconds) that all score kept for a client is reset.
+ban-reset-time = 300
+
+# In case you'd like to change the default points.
+#ban-points-wrong-password = 10
+#ban-points-connection = 1
+#ban-points-kkdcp = 1
+
 # Cookie timeout (in seconds)
 # which he can reconnect. That cookie will be invalided if not
 # used within this timeout value. On a user disconnection, that
index aee342d685fd39d22f3df84d459e97c8b3667634..fe0718b3b88f9de94ce42788d3b90272fc0c1a90 100644 (file)
@@ -34,7 +34,7 @@ setup_config() {
        ipv6_addr=`echo $ip6addr|cut -d '/' -f 1`
        ipv6_prefix=`echo $ip6addr|cut -d '/' -f 2`
 
-       test $auth = "plain" && authsuffix="\[/var/etc/ocpasswd\]"
+       test $auth = "plain" && authsuffix="\[passwd=/var/etc/ocpasswd\]"
 
        dyndns="false"
        hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 2 2>/dev/null`
diff --git a/net/ocserv/patches/001-correct-session-expiration.patch b/net/ocserv/patches/001-correct-session-expiration.patch
new file mode 100644 (file)
index 0000000..b0c596b
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/src/sec-mod-auth.c b/src/sec-mod-auth.c
+index 4ee6f57..2fc02b5 100644
+--- a/src/sec-mod-auth.c
++++ b/src/sec-mod-auth.c
+@@ -500,7 +500,7 @@ int handle_sec_auth_session_close(int cfd, sec_mod_st *sec, const SecAuthSession
+                               (pack_func) cli_stats_msg__pack);
+       }
+-      if (e->status != PS_AUTH_COMPLETED) {
++      if (e->status < PS_AUTH_COMPLETED) {
+               seclog(sec, LOG_DEBUG, "session close received in unauthenticated client %s "SESSION_STR"!", e->auth_info.username, e->auth_info.psid);
+               return send_msg(e, cfd, SM_CMD_AUTH_CLI_STATS, &rep,
+                               (pack_size_func) cli_stats_msg__get_packed_size,
+@@ -604,7 +604,7 @@ int handle_sec_auth_stats_cmd(sec_mod_st * sec, const CliStatsMsg * req)
+               e->stats.uptime = req->uptime;
+       if (req->has_invalidate_cookie && req->invalidate_cookie != 0) {
+-              seclog(sec, LOG_INFO, "invalidating session user '%s' "SESSION_STR,
++              seclog(sec, LOG_INFO, "invalidating session of user '%s' "SESSION_STR,
+                       e->auth_info.username, e->auth_info.psid);
+               e->status = PS_AUTH_USER_TERM;
+       }
index f6d2f051c1e0bdee6f82a692ae59ffbc9691a92a..7a55da01449958a2d5036e69bd0bc126b58e7934 100644 (file)
@@ -12,6 +12,7 @@ config interface 'MYVPN'
         option serverhash 'AE7FF6A0426F0A0CD0A02EB9EC3C5066FAEB0B25'
         option token_mode 'rsa' # when built with stoken support
         option token_secret 'secret' # when built with stoken support
+       option defaultroute '0'
         option authgroup 'DEFAULT'
 
 The additional files are also used:
index bdac9bc867485e7a9ff71454f2de1f7d3dce46ef..0e22e1b6058a4664829a96f66934764c0c4a2002 100755 (executable)
@@ -13,6 +13,8 @@ proto_openconnect_init_config() {
        proto_config_add_string "token_mode"
        proto_config_add_string "token_secret"
        proto_config_add_string "interface"
+       proto_config_add_string "os"
+       proto_config_add_string "csd_wrapper"
        no_device=1
        available=1
 }
@@ -20,7 +22,7 @@ proto_openconnect_init_config() {
 proto_openconnect_setup() {
        local config="$1"
 
-       json_get_vars server port username serverhash authgroup password interface token_mode token_secret
+       json_get_vars server port username serverhash authgroup password interface token_mode token_secret os csd_wrapper
 
        grep -q tun /proc/modules || insmod tun
 
@@ -68,6 +70,8 @@ proto_openconnect_setup() {
 
        [ -n "$token_mode" ] && append cmdline "--token-mode=$token_mode"
        [ -n "$token_secret" ] && append cmdline "--token-secret=$token_secret"
+       [ -n "$os" ] && append cmdline "--os=$os"
+       [ -n "$csd_wrapper" ] && [ -x "$csd_wrapper" ] && append cmdline "--csd-wrapper=$csd_wrapper"
 
        proto_export INTERFACE="$config"
        logger -t openconnect "executing 'openconnect $cmdline'"
index 055b0030e01b33161d384f3394fb421989a611ef..279fa0ba42523d50d23fd827d1cd895394d3014a 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
-PKG_VERSION:=6.7p1
-PKG_RELEASE:=3
+PKG_VERSION:=6.8p1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
                http://ftp.belnet.be/pub/OpenBSD/OpenSSH/portable/
-PKG_MD5SUM:=3246aa79317b1d23cae783a3bf8275d6
+PKG_MD5SUM:=08f72de6751acfbd0892b5f003922701
 
 PKG_LICENSE:=BSD ISC
 PKG_LICENSE_FILES:=LICENCE
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/openssh/Default
        SECTION:=net
        CATEGORY:=Network
-       DEPENDS:=+libopenssl +zlib +SSP_SUPPORT:libssp
+       DEPENDS:=+libopenssl +zlib
        TITLE:=OpenSSH
        MAINTAINER:=Peter Wagner <tripolar@gmx.at>
        URL:=http://www.openssh.com/
@@ -124,7 +124,8 @@ endef
 define Package/openssh-sftp-server
        $(call Package/openssh/Default)
        TITLE+= SFTP server
-       DEPENDS:=+SSP_SUPPORT:libssp
+       # Strip dependencies to avoid pulling in OpenSSL etc.
+       DEPENDS:=
 endef
 
 define Package/openssh-sftp-server/description
index be8bbcf9c4ade46547cdeaf834fcdd4c859794bf..7d46d20d3a060676b47bfe1b41d3ec8b0912fb50 100644 (file)
@@ -1,6 +1,6 @@
 --- a/includes.h
 +++ b/includes.h
-@@ -59,6 +59,9 @@
+@@ -60,6 +60,9 @@
  /*
   *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively
   */
index 3fb6ca8935b1613cccaaaf0f5a5186c4c0ae67a0..eb37696da12603be20637b113a488d5c4b01ad96 100644 (file)
@@ -11,8 +11,8 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openvswitch
 
-PKG_RELEASE:=2
-PKG_VERSION:=2.3.1
+PKG_RELEASE:=1
+PKG_VERSION:=2.3.90
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=COPYING
@@ -21,9 +21,11 @@ PKG_USE_MIPS16:=0
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/openvswitch/ovs
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=0dfed4ba9c8a16a1f316d709b7831a4e139472d4
+PKG_SOURCE_VERSION:=58be9c9fd732b5bdd3d4c2e9b8cc2313f570094d
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
+SUPPORTED_KERNELS:=LINUX_3_8||LINUX_3_10||LINUX_3_13||LINUX_3_14||LINUX_3_18||LINUX_4_0
+
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/kernel.mk
 $(call include_mk, python-package.mk)
@@ -50,8 +52,7 @@ endef
 define Package/openvswitch
   $(call Package/openvswitch/Default)
   TITLE:=Open vSwitch Userspace Package
-  DEPENDS:=+libpcap +libopenssl +librt +libatomic +kmod-openvswitch \
-           @(LINUX_3_8||LINUX_3_10||LINUX_3_13||LINUX_3_14)
+  DEPENDS:=+libpcap +libopenssl +librt +libatomic +kmod-openvswitch @($(SUPPORTED_KERNELS))
 endef
 
 define Package/openvswitch/description
@@ -95,8 +96,7 @@ define KernelPackage/openvswitch
   SUBMENU:=Network Support
   TITLE:=Open vSwitch Kernel Package
   KCONFIG:=CONFIG_BRIDGE
-  DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan \
-           @(LINUX_3_8||LINUX_3_10||LINUX_3_13||LINUX_3_14)
+  DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan @($(SUPPORTED_KERNELS))
   FILES:= \
        $(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,21,openvswitch)
@@ -149,10 +149,10 @@ define Package/openvswitch/install
        $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
 
        $(INSTALL_DIR) $(1)/usr/lib/
-       $(CP) $(PKG_BUILD_DIR)/lib/.libs/libsflow-$(PKG_VERSION).so  $(1)/usr/lib/
-       $(CP) $(PKG_BUILD_DIR)/lib/.libs/libopenvswitch-$(PKG_VERSION).so  $(1)/usr/lib/
-       $(CP) $(PKG_BUILD_DIR)/ofproto/.libs/libofproto-$(PKG_VERSION).so  $(1)/usr/lib/
-       $(CP) $(PKG_BUILD_DIR)/ovsdb/.libs/libovsdb-$(PKG_VERSION).so  $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/lib/.libs/libsflow.so*  $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/lib/.libs/libopenvswitch.so*  $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/ofproto/.libs/libofproto.so*  $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/ovsdb/.libs/libovsdb.so*  $(1)/usr/lib/
 
        $(INSTALL_DIR) $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-appctl $(1)/usr/bin/
diff --git a/net/openvswitch/patches/0001-netdev-linux-Let-interface-flag-survive-internal-por.patch b/net/openvswitch/patches/0001-netdev-linux-Let-interface-flag-survive-internal-por.patch
deleted file mode 100644 (file)
index 1e79f3a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From b9284f535e93c337ab21f330753e60e1038f9a27 Mon Sep 17 00:00:00 2001
-From: Helmut Schaa <helmut.schaa@googlemail.com>
-Date: Wed, 8 Jan 2014 13:48:49 +0100
-Subject: [PATCH 2/2] netdev-linux: Let interface flag survive internal port
- setup
-
-Due to a race condition when bringing up an internal port on Linux
-some interface flags (e.g. IFF_MULTICAST) are falsely reset. This
-happens because netlink events may be processed after the according
-netdev has been brought up (which sets interface flags).
-
-Fix this by reading the interface flags just before updating them
-if they have not been updated by from the kernel yet.
-
-Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
----
- lib/netdev-linux.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
-index 9eaac33..423e72e 100644
---- a/lib/netdev-linux.c
-+++ b/lib/netdev-linux.c
-@@ -2569,7 +2569,13 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
-     unsigned int old_flags, new_flags;
-     int error = 0;
--    old_flags = netdev->ifi_flags;
-+    if (!(netdev->cache_valid & VALID_DRVINFO)) {
-+        /* Most likely the debvice flags are not in sync yet, fetch them now */
-+        get_flags(&netdev->up, &old_flags);
-+    } else {
-+        old_flags = netdev->ifi_flags;
-+    }
-+
-     *old_flagsp = iff_to_nd_flags(old_flags);
-     new_flags = (old_flags & ~nd_to_iff_flags(off)) | nd_to_iff_flags(on);
-     if (new_flags != old_flags) {
--- 
-1.8.1.4
-
diff --git a/net/openvswitch/patches/0001-netdev-linux-Use-unsigned-int-for-ifi_flags.patch b/net/openvswitch/patches/0001-netdev-linux-Use-unsigned-int-for-ifi_flags.patch
new file mode 100644 (file)
index 0000000..ed537d1
--- /dev/null
@@ -0,0 +1,28 @@
+From 12edcd800d924f69630768eeece842373dee5bb0 Mon Sep 17 00:00:00 2001
+From: Helmut Schaa <helmut.schaa@googlemail.com>
+Date: Wed, 8 Jan 2014 13:48:33 +0100
+Subject: [PATCH 1/2] netdev-linux: Use unsigned int for ifi_flags
+
+ifi_flags is unsigned, the local equivalents should do the same.
+
+Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
+---
+ lib/netdev-linux.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
+index 9bdbbdf..9eaac33 100644
+--- a/lib/netdev-linux.c
++++ b/lib/netdev-linux.c
+@@ -2709,7 +2709,7 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
+              enum netdev_flags on, enum netdev_flags *old_flagsp)
+     OVS_REQUIRES(netdev->mutex)
+ {
+-    int old_flags, new_flags;
++    unsigned int old_flags, new_flags;
+     int error = 0;
+     old_flags = netdev->ifi_flags;
+-- 
+1.8.1.4
+
diff --git a/net/openvswitch/patches/0002-netdev-linux-Let-interface-flag-survive-internal-por.patch b/net/openvswitch/patches/0002-netdev-linux-Let-interface-flag-survive-internal-por.patch
new file mode 100644 (file)
index 0000000..b31816a
--- /dev/null
@@ -0,0 +1,41 @@
+From b9284f535e93c337ab21f330753e60e1038f9a27 Mon Sep 17 00:00:00 2001
+From: Helmut Schaa <helmut.schaa@googlemail.com>
+Date: Wed, 8 Jan 2014 13:48:49 +0100
+Subject: [PATCH 2/2] netdev-linux: Let interface flag survive internal port
+ setup
+
+Due to a race condition when bringing up an internal port on Linux
+some interface flags (e.g. IFF_MULTICAST) are falsely reset. This
+happens because netlink events may be processed after the according
+netdev has been brought up (which sets interface flags).
+
+Fix this by reading the interface flags just before updating them
+if they have not been updated by from the kernel yet.
+
+Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
+---
+ lib/netdev-linux.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
+index 9eaac33..423e72e 100644
+--- a/lib/netdev-linux.c
++++ b/lib/netdev-linux.c
+@@ -2712,7 +2712,13 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
+     unsigned int old_flags, new_flags;
+     int error = 0;
+-    old_flags = netdev->ifi_flags;
++    if (!(netdev->cache_valid & VALID_DRVINFO)) {
++        /* Most likely the debvice flags are not in sync yet, fetch them now */
++        get_flags(&netdev->up, &old_flags);
++    } else {
++        old_flags = netdev->ifi_flags;
++    }
++
+     *old_flagsp = iff_to_nd_flags(old_flags);
+     new_flags = (old_flags & ~nd_to_iff_flags(off)) | nd_to_iff_flags(on);
+     if (new_flags != old_flags) {
+-- 
+1.8.1.4
+
diff --git a/net/openvswitch/patches/0002-netdev-linux-Use-unsigned-int-for-ifi_flags.patch b/net/openvswitch/patches/0002-netdev-linux-Use-unsigned-int-for-ifi_flags.patch
deleted file mode 100644 (file)
index 19c7747..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From 12edcd800d924f69630768eeece842373dee5bb0 Mon Sep 17 00:00:00 2001
-From: Helmut Schaa <helmut.schaa@googlemail.com>
-Date: Wed, 8 Jan 2014 13:48:33 +0100
-Subject: [PATCH 1/2] netdev-linux: Use unsigned int for ifi_flags
-
-ifi_flags is unsigned, the local equivalents should do the same.
-
-Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
----
- lib/netdev-linux.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
-index 9bdbbdf..9eaac33 100644
---- a/lib/netdev-linux.c
-+++ b/lib/netdev-linux.c
-@@ -2566,7 +2566,7 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
-              enum netdev_flags on, enum netdev_flags *old_flagsp)
-     OVS_REQUIRES(netdev->mutex)
- {
--    int old_flags, new_flags;
-+    unsigned int old_flags, new_flags;
-     int error = 0;
-     old_flags = netdev->ifi_flags;
--- 
-1.8.1.4
-
diff --git a/net/openvswitch/patches/0003-lib-util.h-Disable-ovs_assert-when-build-with-NDEBUG.patch b/net/openvswitch/patches/0003-lib-util.h-Disable-ovs_assert-when-build-with-NDEBUG.patch
deleted file mode 100644 (file)
index 2aade29..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-From 34b51e26555d05c00b2320f943a645added5dae4 Mon Sep 17 00:00:00 2001
-From: Helmut Schaa <helmut.schaa@googlemail.com>
-Date: Mon, 9 Dec 2013 14:15:11 +0100
-Subject: [PATCH 5/6] lib/util.h: Disable ovs_assert when build with NDEBUG
-
-Reduces binary size. Use a static inline function instead of
-a macro to not get "unused variable" warning everywhere.
-
-Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
----
- lib/util.h | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/lib/util.h b/lib/util.h
-index 5c23962..9e5866d 100644
---- a/lib/util.h
-+++ b/lib/util.h
-@@ -69,10 +69,15 @@
-  *   - Writes the failure message to the log.
-  *
-  *   - Not affected by NDEBUG. */
-+#ifndef NDEBUG
- #define ovs_assert(CONDITION)                                           \
-     if (!OVS_LIKELY(CONDITION)) {                                       \
-         ovs_assert_failure(SOURCE_LOCATOR, __func__, #CONDITION);       \
-     }
-+#else
-+static inline void ovs_assert(bool cond OVS_UNUSED) {}
-+#endif
-+
- void ovs_assert_failure(const char *, const char *, const char *) NO_RETURN;
- /* Casts 'pointer' to 'type' and issues a compiler warning if the cast changes
--- 
-1.8.1.4
-
diff --git a/net/openvswitch/patches/0004-datapath-Use-ccflags-y-instead-of-deprecated-EXTRA_C.patch b/net/openvswitch/patches/0004-datapath-Use-ccflags-y-instead-of-deprecated-EXTRA_C.patch
deleted file mode 100644 (file)
index 95891a1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From 36fd4f214f9ba74aaf0e5fb3e4ba271b946a1550 Mon Sep 17 00:00:00 2001
-From: Thomas Graf <tgraf@noironetworks.com>
-Date: Wed, 26 Nov 2014 15:52:31 +0100
-Subject: [PATCH] datapath: Use ccflags-y instead of deprecated EXTRA_CFLAGS
-
-This allows users to pass in additional compiler flags through the
-environment variable EXTRA_CFLAGS, e.g.
-
-   make EXTRA_CFLAGS=-Wno-error=foo V=1
-
-Reported-by: Alexandru Ardelean <ardeleanalex@gmail.com>
-Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
-Acked-by: Pravin B Shelar <pshelar@nicira.com>
----
- datapath/linux/Kbuild.in | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/datapath/linux/Kbuild.in b/datapath/linux/Kbuild.in
-index 6f6f65f..cb98c11 100644
---- a/datapath/linux/Kbuild.in
-+++ b/datapath/linux/Kbuild.in
-@@ -7,11 +7,11 @@ export VERSION = @VERSION@
- include $(srcdir)/../Modules.mk
- include $(srcdir)/Modules.mk
--EXTRA_CFLAGS := -DVERSION=\"$(VERSION)\"
--EXTRA_CFLAGS += -I$(srcdir)/..
--EXTRA_CFLAGS += -I$(builddir)/..
--EXTRA_CFLAGS += -g
--EXTRA_CFLAGS += -include $(builddir)/kcompat.h
-+ccflags-y := -DVERSION=\"$(VERSION)\"
-+ccflags-y += -I$(srcdir)/..
-+ccflags-y += -I$(builddir)/..
-+ccflags-y += -g
-+ccflags-y += -include $(builddir)/kcompat.h
- # These include directories have to go before -I$(KSRC)/include.
- # NOSTDINC_FLAGS just happens to be a variable that goes in the
--- 
-2.1.2
-
index 74a78a9bfa43edc17574de0bf4dfffb6925b59c1..646c722dc9dcbe2fd848c6af2dd7eace71a69a30 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pen
-PKG_VERSION:=0.27.2
+PKG_VERSION:=0.27.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://siag.nu/pub/pen/
-PKG_MD5SUM:=79014750cc0ea253437b516716932115
+PKG_MD5SUM:=8430c6941e2047218c55274e3e7d06f2
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
index a829ce8c20a4b2a2977e5dc24a792867c94dc225..4ff6d38adfd7a07f26882e8e24ad72208c8e3d3c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=prosody
-PKG_VERSION:=0.9.7
-PKG_RELEASE:=2
+PKG_VERSION:=0.9.8
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://prosody.im/downloads/source
-PKG_MD5SUM:=47de7f593279e327792df78cfa93e8a7
+PKG_MD5SUM:=5144cd832a1860443e21e336dc560ee7
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=MIT/X11
 
diff --git a/net/radicale/Makefile b/net/radicale/Makefile
new file mode 100644 (file)
index 0000000..329ab68
--- /dev/null
@@ -0,0 +1,138 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=radicale
+PKG_VERSION:=0.10
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Christian Schoenebeck <chris5560@web.de>
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=Radicale-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/R/Radicale/
+PKG_MD5SUM:=32655d8893962956ead0ad690cca6044
+
+# needed for "r"adicale <-> "R"adicale
+PKG_BUILD_DIR:=$(BUILD_DIR)/Radicale-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+# no default dependencies
+PKG_DEFAULT_DEPENDS=
+
+define Package/$(PKG_NAME)/Default
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Web Servers/Proxies
+  URL:=http://radicale.org/
+  PKGARCH:=all
+  USERID:=radicale=5232:radicale=5232
+endef
+define Package/$(PKG_NAME)-py2
+  $(call Package/$(PKG_NAME)/Default)
+  PYTHON_VERSION:=2.7
+  TITLE:=Radicale CalDAV/CardDAV server (Python 2)
+  VARIANT:=python2
+  DEPENDS:=+python-logging +python-openssl +python-xml +python-codecs
+endef
+define Package/$(PKG_NAME)-py3
+  $(call Package/$(PKG_NAME)/Default)
+  PYTHON_VERSION:=3.4
+  TITLE:=Radicale CalDAV/CardDAV server (Python 3)
+  VARIANT:=python3
+  DEPENDS:=+python3-logging +python3-openssl +python3-xml +python3-codecs +python3-email @BROKEN
+endef
+
+# shown in LuCI package description
+define Package/$(PKG_NAME)-py2/description
+Radicale CalDAV/CardDAV server (Python 2) - Homepage: http://radicale.org/
+endef
+define Package/$(PKG_NAME)-py3/description
+Radicale CalDAV/CardDAV server (Python 3) - Homepage: http://radicale.org/
+endef
+
+# shown in make menuconfig <Help>
+define Package/$(PKG_NAME)-py2/config
+    help
+       The Radicale Project is a CalDAV (calendar) and CardDAV (contact) server.
+       It aims to be a light solution, easy to use, easy to install, easy to configure.
+       As a consequence, it requires few software dependances and is pre-configured to work out-of-the-box.
+       !!! Will install and use Python $(PYTHON_VERSION) !!!
+       .
+       Version : $(PKG_VERSION)
+       Homepage: http://radicale.org/
+       .
+       $(PKG_MAINTAINER)
+endef
+Package/$(PKG_NAME)-py3/config = $(Package/$(PKG_NAME)-py2/config)
+
+define Package/$(PKG_NAME)-py2/conffiles
+/etc/config/radicale
+/etc/radicale/users
+/etc/radicale/rights
+endef
+Package/$(PKG_NAME)-py3/conffiles = $(Package/$(PKG_NAME)-py2/conffiles)
+
+define Build/Configure
+endef
+define Build/Compile
+endef
+
+define Package/$(PKG_NAME)-py2/preinst
+       #!/bin/sh
+       [ -n "$${IPKG_INSTROOT}" ] && exit 0    # if run within buildroot exit
+
+       # stop service if PKG_UPGRADE
+       [ "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/$(PKG_NAME) stop >/dev/null 2>&1
+
+       exit 0  # supress errors from stop command
+endef
+define Package/$(PKG_NAME)-py3/preinst
+$(call Package/$(PKG_NAME)-py2/preinst)
+endef
+
+define Package/$(PKG_NAME)-py2/install
+       $(INSTALL_DIR)  $(1)/etc/init.d
+       $(INSTALL_BIN)  ./files/radicale.init $(1)/etc/init.d/radicale
+       $(INSTALL_DIR)  $(1)/etc/hotplug.d/iface
+       $(INSTALL_BIN)  ./files/radicale.hotplug $(1)/etc/hotplug.d/iface/80-radicale
+       $(INSTALL_DIR)  $(1)/etc/config
+       $(INSTALL_CONF) ./files/radicale.config $(1)/etc/config/radicale
+
+       $(INSTALL_DIR)  $(1)/etc/radicale/ssl
+       $(INSTALL_DATA) ./files/config.template  $(1)/etc/radicale/
+       $(INSTALL_DATA) ./files/logging.template $(1)/etc/radicale/
+       $(INSTALL_DATA) ./files/radicale.users   $(1)/etc/radicale/users
+       $(INSTALL_DATA) ./files/radicale.rights  $(1)/etc/radicale/rights
+
+       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/radicale
+       $(CP) \
+               $(PKG_BUILD_DIR)/radicale/* \
+               $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/radicale
+
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/radicale $(1)/usr/bin/
+endef
+define Package/$(PKG_NAME)-py3/install
+       $(call Package/$(PKG_NAME)-py2/install, $(1))
+endef
+
+define Package/$(PKG_NAME)-py2/postinst
+       #!/bin/sh
+       # patch /usr/bin/radicale force run using python2
+       /bin/sed -i 's/python/python2/' $${IPKG_INSTROOT}/usr/bin/radicale
+endef
+define Package/$(PKG_NAME)-py3/postinst
+       #!/bin/sh
+       # patch /usr/bin/radicale force run using python3
+       /bin/sed -i 's/python/python3/' $${IPKG_INSTROOT}/usr/bin/radicale
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)-py2))
+$(eval $(call BuildPackage,$(PKG_NAME)-py3))
diff --git a/net/radicale/files/config.template b/net/radicale/files/config.template
new file mode 100644 (file)
index 0000000..1b8fcf2
--- /dev/null
@@ -0,0 +1,30 @@
+# -*- mode: conf -*-
+# vim:ft=cfg
+
+### AUTO-GENERATED CONFIGURATION
+###      USED BY RADICALE
+###         DO NOT EDIT
+### SEE /etc/config/radicale INSTEAD
+
+[server]
+# daemon               # handled by /etc/init.d/radicale
+# pid                  # handled by /etc/init.d/radicale
+
+[encoding]
+
+[well-known]
+
+[auth]
+# htpasswd_filename    # hard-coded /etc/radicale/users
+
+[git]
+
+[rights]
+# file                 # hard-coded /etc/radicale/rights
+
+[storage]
+
+[logging]
+# config               # hard-coded /var/etc/radicale/logging
+
+[headers]
diff --git a/net/radicale/files/logging.template b/net/radicale/files/logging.template
new file mode 100644 (file)
index 0000000..a730ca0
--- /dev/null
@@ -0,0 +1,47 @@
+# -*- mode: conf -*-
+# vim:ft=cfg
+
+### AUTO-GENERATED CONFIGURATION
+###      USED BY RADICALE
+###         DO NOT EDIT
+### SEE /etc/config/radicale INSTEAD
+
+[loggers]
+keys = root
+
+[handlers]
+keys = console,file,syslog
+
+[formatters]
+keys = simple,full,syslog
+
+[logger_root]
+level = DEBUG
+handlers = console,file,syslog
+
+[handler_console]
+class = StreamHandler
+args = (sys.stdout,)
+formatter = simple
+# level = WARNING                                      # set via /etc/config/radicale
+
+[handler_file]
+class = handlers.RotatingFileHandler
+formatter = full
+# level = INFO                                         # set via /etc/config/radicale
+# args = ('[filename]','a',[maxbytes],[backupcount])   # set via /etc/config/radicale
+
+[handler_syslog]
+class = handlers.SysLogHandler
+args  = ('/dev/log', handlers.SysLogHandler.LOG_DAEMON)
+formatter = syslog
+# level = WARNING                                      # set via /etc/config/radicale
+
+[formatter_simple]
+format = %(message)s
+
+[formatter_full]
+format = %(asctime)s - %(levelname)s: %(message)s
+
+[formatter_syslog]
+format = radicale [%(process)d]: %(message)s
diff --git a/net/radicale/files/radicale.config b/net/radicale/files/radicale.config
new file mode 100644 (file)
index 0000000..ea10bc9
--- /dev/null
@@ -0,0 +1,192 @@
+#
+# You find additional information on Radicale Homepage
+# http://radicale.org
+#
+# OpenWrt's wiki needs to be setup/updated ;-)
+#
+# if setting additional options please remember that UCI does not support
+# section names and option names with "-" (Dash) inside their name
+# to use them anyway replace "-" with "_" (Underscore)
+# Each Radicale's config [section] is setup as UCI config setting 'section'
+#
+
+####################################################
+# Server options
+#
+config setting 'server'
+
+       # hostname:port
+       # IPv4 syntax: address:port
+       # IPv6 syntax: [address]:port
+       # ATTENTION:
+       # only use ports > 1024 (non-privileged Ports)
+       # because this implementation is running as non-root user
+       # Default: 0.0.0.0:5232
+#      list hosts '0.0.0.0:5232'
+#      list hosts 'localhost:5232'
+
+       # SSL flag, enable HTTPS protocol
+       # Default: 0 (disabled)
+#      option ssl '1'
+
+       # SSL Protocol used. See python's ssl module for available values
+       # Default: PROTOCOL_SSLv23
+#      option protocol 'PROTOCOL_SSLv23'
+
+       # Ciphers available. See python's ssl module for available ciphers
+#      option ciphers ''
+
+       # SSL certificate path and file
+#      option certificate '/etc/radicale/ssl/server.crt'
+
+       # SSL private key path and file
+#      option key '/etc/radicale/ssl/server.key'
+
+       # Reverse DNS to resolve client address in logs
+       # Default: 0 (disabled)
+#      option dns_lookup '1'
+
+       # Message displayed in the client when a password is needed
+#      option realm 'Radicale - Password Required'
+
+
+####################################################
+# Encoding options
+#
+config setting 'encoding'
+
+       # Encoding for responding requests
+#      option  request 'utf-8'
+
+       # Encoding for storing local collections
+#      option  stock   'utf-8'
+
+
+####################################################
+# Authentication options
+#
+config setting 'auth'
+
+       # Authentication method
+       # Value: None | htpasswd | IMAP | LDAP | PAM | courier | http | remote_user | custom
+       # Default: None
+       # if setting 'htpasswd' the file /etc/radicale/users is used (hardcoded)
+#      option type 'htpasswd'
+
+       # Htpasswd encryption method
+       # Value: plain | sha1 | ssha | crypt
+#      option htpasswd_encryption 'crypt'
+
+       # for other authenication methods consult Radicale documentation
+       # and set options here
+
+
+####################################################
+# Git default options
+#
+config setting 'git'
+
+       # Git default options
+#      option committer 'Radicale <radicale@example.com>'
+
+
+####################################################
+# Rights backend
+#
+config setting 'rights'
+
+       # Value: None | authenticated | owner_only | owner_write | from_file | custom
+       # Default: None
+       # if setting 'from_file' the file /etc/radicale/rights is used (hardcoded)
+#      option  type    'from_file'
+
+       # Custom rights handler
+#      option custom_handler ''
+
+
+####################################################
+# Storage backend
+# -------
+# WARNING: ONLY "filesystem" IS DOCUMENTED AND TESTED,
+#          OTHER BACKENDS ARE NOT READY FOR PRODUCTION.
+# -------
+#
+config setting 'storage'
+       # Value: filesystem | multifilesystem | database | custom
+       option  type                    'filesystem'
+       option  filesystem_folder       '/srv/radicale'
+
+
+####################################################
+# Additional HTTP headers
+#
+config setting 'headers'
+       # enable all if using CardDavMATE-, CalDavZAP- or InfCloud- WEBclient
+#      list    Access_Control_Allow_Origin     '*'
+#      list    Access_Control_Allow_Methods    'GET'
+#      list    Access_Control_Allow_Methods    'POST'
+#      list    Access_Control_Allow_Methods    'OPTIONS'
+#      list    Access_Control_Allow_Methods    'PROPFIND'
+#      list    Access_Control_Allow_Methods    'PROPPATCH'
+#      list    Access_Control_Allow_Methods    'REPORT'
+#      list    Access_Control_Allow_Methods    'PUT'
+#      list    Access_Control_Allow_Methods    'MOVE'
+#      list    Access_Control_Allow_Methods    'DELETE'
+#      list    Access_Control_Allow_Methods    'LOCK'
+#      list    Access_Control_Allow_Methods    'UNLOCK'
+#      list    Access_Control_Allow_Headers    'User-Agent'
+#      list    Access_Control_Allow_Headers    'Authorization'
+#      list    Access_Control_Allow_Headers    'Content-type'
+#      list    Access_Control_Allow_Headers    'Depth'
+#      list    Access_Control_Allow_Headers    'If-match'
+#      list    Access_Control_Allow_Headers    'If-None-Match'
+#      list    Access_Control_Allow_Headers    'Lock-Token'
+#      list    Access_Control_Allow_Headers    'Timeout'
+#      list    Access_Control_Allow_Headers    'Destination'
+#      list    Access_Control_Allow_Headers    'Overwrite'
+#      list    Access_Control_Allow_Headers    'X-client'
+#      list    Access_Control_Allow_Headers    'X-Requested-With'
+#      list    Access_Control_Expose_Headers   'Etag'
+
+
+####################################################
+# Global logging options
+#
+config setting 'logging'
+
+       # Set the default logging level to debug for all outputs (ignore output level settings)
+       # Default: 0 (disabled)
+#      option  debug   '1'
+       # Log all environment variables (including those set in the shell) when starting
+       # Default: 0 (disabled)
+#      option  full_environment '1'
+
+
+####################################################
+# Spezial logging options
+# !!! not documented in Radicale documentation
+# !!! special settings for this implementation
+#
+config logging 'logger'
+
+       # Level: DEBUG | INFO | WARNING | ERROR | CRITICAL
+       # To nearly disable logging set level to critical
+
+       # log level on console
+#      option  console_level   'ERROR'
+
+       # Here we use Rotating Logfiles in this implementation
+       # !!! if maxbytes and/or backupcount is set to 0  !!!
+       # !!! file rotation is disabled and logfile grows endless !!!
+       # log level
+#      option  file_level      'INFO'
+       # directory where log files are written
+#      option  file_path       '/var/log/radicale'
+       # max size of each logfile (see warning above)
+#      option  file_maxbytes   '8196'
+       # number of backup files to create (see warning above)
+#      option  file_backupcount        '1'
+
+       # log level for syslog logging
+#      option  syslog_level    'WARNING'
+
diff --git a/net/radicale/files/radicale.hotplug b/net/radicale/files/radicale.hotplug
new file mode 100644 (file)
index 0000000..634ad2e
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# only (re-)start on ifup
+[ "$ACTION" = "ifup" ] || exit 0
+
+_PID=$(ps | grep '[p]ython.*[r]adicale' 2>/dev/null | awk '{print \$1}')
+kill -1 $_PID 2>/dev/null
+if [ $? -eq 0 ]; then
+       # only restart if already running
+       logger -p user.info -t "radicale[$_PID]" \
+               "Restart request due to '$ACTION' of interface '$INTERFACE'"
+       /etc/init.d/radicale restart
+else
+       # only start if enabled
+       /etc/init.d/radicale enabled && /etc/init.d/radicale start
+fi
diff --git a/net/radicale/files/radicale.init b/net/radicale/files/radicale.init
new file mode 100755 (executable)
index 0000000..bb35a18
--- /dev/null
@@ -0,0 +1,220 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2015 OpenWrt.org
+
+START=80
+STOP=10
+
+CFGDIR=/var/etc/radicale
+SYSCFG=$CFGDIR/config
+LOGCFG=$CFGDIR/logging
+
+DATADIR="/srv/radicale"
+LOGDIR=""
+
+PGREP="ps | grep '[p]ython.*[r]adicale' 2>/dev/null | awk '{print \$1}' "
+
+# we could start with empty configuration file using defaults
+[ -f /etc/config/radicale ] || touch /etc/config/radicale
+
+_uci2radicale() {
+       local _SYSTMP="$SYSCFG.tmp"
+       local _LOGTMP="$LOGCFG.tmp"
+       local _LOPT                             # list option name
+       local _LVAL                             # list option value
+       local _STYPE                            # section type
+       local _SNAME                            # section name
+       local _console_level="ERROR"            # logging console level
+       local _file_level="INFO"                # logging file level
+       local _file_path="/var/log/radicale"    # logging file path
+       local _file_maxbytes="8196"             # logging file maxBytes
+       local _file_backupcount="1"             # logging file backupCount
+       local _syslog_level="WARNING"           # logging syslog level
+
+       # write list values to config
+       _write_list() {
+               _write_value "$_LOPT" "$_LVAL"  # there might be spaces in _LVAL
+               _LOPT=""
+               _LVAL=""
+       }
+
+       _write_value() {
+               # $1    option
+               # $2    value
+               local __OPT=$1
+               local __VAL=$2
+               # section "server" ignore option "daemon" and "pid"
+               [ "$_SNAME" = "server" -a "$__OPT" = "daemon" ] && return 0
+               [ "$_SNAME" = "server" -a "$__OPT" = "pid" ] && return 0
+               # section "logging" ignore option "config" (logging config file)
+               [ "$_SNAME" = "logging" -a "$__OPT" = "config" ] && return 0
+               # section "auth" ignore option "htpasswd_filename" (htpasswd file)
+               [ "$_SNAME" = "auth" -a "$__OPT" = "htpasswd_filename" ] && return 0
+               # section "rights" ignore option "file" (reg-based rights file)
+               [ "$_SNAME" = "rights" -a "$__OPT" = "file" ] && return 0
+               # section "headers" replace "_" with "-" in option (UCI problem)
+               [ "$_SNAME" = "headers" ] && __OPT=$(echo "$__OPT" | sed -e "s#_#-#g")
+               # save data driectory
+               [ "$_SNAME" = "storage" -a "$__OPT" = "filesystem_folder" ] && DATADIR="$__VAL"
+               # special handling for well-known, value needs single quotes
+               [ "$_SNAME" = "well-known" -a "${__VAL#*\%\(}" != "$__VAL" ] && __VAL="'$__VAL'"
+               # handling of log settings
+               if [ "$_STYPE" = "logging" -a "$_SNAME" = "logger" ]; then
+                       eval "_$__OPT='$__VAL'" # set to environment for later use
+               else
+                       # handle bool
+                       [ "$__VAL" = "0" ] && __VAL="False"
+                       [ "$__VAL" = "1" ] && __VAL="True"
+                       # append data to the corresponding section
+                       sed -i "/\[$_SNAME\]/a $__OPT = $__VAL" $_SYSTMP
+               fi
+       }
+
+       # redefined callback for sections when calling config_load
+       config_cb() {
+               # $1    "Type"
+               # $2    "Name"
+               # write out last list option
+               [ -n "$_LOPT" ] && _write_list
+               # mark invalid
+               _STYPE=""
+               _SNAME=""
+               # check section type
+               [ "$1" = "setting" -o "$1" = "logging" ] && {
+                       _STYPE="$1"
+                       _SNAME="$2"
+               }
+               # translate section name
+               [ "$2" = "well_known" ] && _SNAME="well-known"
+               return 0
+       }
+
+       # redefined callback for lists when calling config_load
+       list_cb() {
+               # $1    name of variable
+               # $2    value
+               # invalid section type then ignore
+               [ -z "$_STYPE" -o -z "$_SNAME" ] && return 0
+               # write out last list option if new list starts
+               [ -n "$_LOPT" -a "$_LOPT" != "$1" ] && _write_list
+               # new list option
+               if [ -z "$_LOPT" ]; then
+                       _LOPT="$1"
+                       _LVAL="$2"
+               else
+                       _LVAL="$_LVAL, $2"
+               fi
+               return 0
+       }
+
+       # redefined callback for options when calling config_load
+       option_cb() {
+               # $1    name of variable
+               # $2    value
+               local __OPT="$1"
+               local __VAL="$2"
+               # invalid section type then ignore
+               [ -z "$_STYPE" -o -z "$_SNAME" ] && return 0
+               # ignore list entrys will be handled by list_cb()
+               [ "${__OPT#*_ITEM}" != "$__OPT" ]   && return 0 # ignore lists *_ITEM*
+               [ "${__OPT#*_LENGTH}" != "$__OPT" ] && return 0 # ignore lists *_LENGTH
+               # write out last list option and clear
+               [ -n "$_LOPT" ] && _write_list
+               # write to file
+               _write_value "$__OPT" "$__VAL"  # there might be spaces in __VAL
+               return 0
+       }
+
+       # temporary config file
+       # radicale need read access
+       mkdir -m0755 -p $CFGDIR
+
+       cp /etc/radicale/config.template  $_SYSTMP
+       config_load radicale    # calling above config_cb()/option_cb()/list_cb() and write into $_SYSTMP
+       sed -i "/\[logging\]/a config = /var/etc/radicale/logging" $_SYSTMP     # hard-code logging config
+       sed -i "/\[auth\]/a htpasswd_filename = /etc/radicale/users" $_SYSTMP   # hard-code htpasswd
+       sed -i "/\[rights\]/a file = /etc/radicale/rights" $_SYSTMP             # hard-code regexp-based rights
+
+       # temporary logging config file
+       cp /etc/radicale/logging.template $_LOGTMP
+       LOGDIR="$_file_path"
+       sed -i "/\[handler_console\]/a level = $_console_level" $_LOGTMP
+       sed -i "/\[handler_file\]/a level = $_file_level" $_LOGTMP
+       sed -i "/\[handler_file\]/a args = ('$_file_path/radicale','a',$_file_maxbytes,$_file_backupcount)" $_LOGTMP
+       sed -i "/\[handler_syslog\]/a level = $_syslog_level" $_LOGTMP
+
+       # move tmp to final
+       mv -f $_SYSTMP $SYSCFG
+       mv -f $_LOGTMP $LOGCFG
+}
+
+_set_permission() {
+       # config file permissions (read access for group)
+       chmod 644 $SYSCFG $LOGCFG
+       chgrp -R radicale $CFGDIR
+       # log directory (full access and owner)
+       [ -d $LOGDIR ] || mkdir -m0755 -p $LOGDIR
+       chown -R radicale:radicale $LOGDIR
+       # data directory does not exist
+       [ -d $DATADIR ] || {
+               logger -p user.error -t "radicale[----]" "Data directory '$DATADIR' does not exists. Startup failed !!!"
+               exit 1
+       }
+       chgrp -R radicale $DATADIR
+}
+
+boot() {
+       return 0        # will be started by "iface" hotplug events
+}
+
+start() {
+       _running() {
+               sleep 2         # give radicale time to completely come up
+               local _PID=$(eval "$PGREP")
+               kill -1 $_PID 2>/dev/null
+               [ $? -eq 0 ] \
+                       && logger -p user.notice -t "radicale[$_PID]" "Service started successfully"\
+                       || logger -p user.warn -t "radicale[----]" "Service failed to start"
+       }
+
+       # if already running do nothing
+       local _PID=$(eval "$PGREP")
+       kill -1 $_PID 2>/dev/null && return 0
+
+       _uci2radicale
+       _set_permission
+
+       radicale --daemon --config=$SYSCFG
+
+       _running &      # check if running and syslog
+
+       return 0
+}
+
+reload() {
+       # reload is also used by luci
+       local _PID=$(eval "$PGREP")
+       kill -1 $_PID 2>/dev/null
+       if [ $? -eq 0 ]; then
+               # only restart if already running
+               restart
+       else
+               # only start if enabled
+               enabled && start
+       fi
+       return 0
+}
+
+stop() {
+       local _PID=$(eval "$PGREP")
+       [ -z "$_PID" ] && return 0      # not running
+       kill -15 $_PID 2>/dev/null
+       sleep 1                 # give time to shutdown
+       local _tmp=$(eval "$PGREP")
+       if [ -z "$_tmp" ]; then
+               logger -p user.notice -t "radicale[$_PID]" "Service shutdown successfully"
+       else
+               kill -9 $_tmp   # Normally never come here
+               logger -p user.warn -t "radicale[----]" "Service shutdown FORCED"
+       fi
+       return 0
+}
diff --git a/net/radicale/files/radicale.rights b/net/radicale/files/radicale.rights
new file mode 100644 (file)
index 0000000..3de3955
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Authentication login is matched against the "user" key, and collection's path is matched against the "collection" key.
+# You can use Python's ConfigParser interpolation values %(login)s and %(path)s.
+# You can also get groups from the user regex in the collection with {0}, {1}, etc.
+#
+# For example, for the "user" key, ".+" means "authenticated user" and ".*" means "anybody" (including anonymous users).
+#
+# Section names are only used for naming the rule.
+# Leading or ending slashes are trimmed from collection's path.
+#
+
+# This means all users starting with "admin" may read any collection
+[admin]
+user: ^admin.*$
+collection: .*
+permission: r
+
+# This means all users may read and write any collection starting with public.
+# We do so by just not testing against the user string.
+[public]
+user: .*
+collection: ^public(/.+)?$
+permission: rw
+
+# A little more complex: give read access to users from a domain for all
+# collections of all the users (ie. user@domain.tld can read domain/\*).
+[domain-wide-access]
+user: ^.+@(.+)\..+$
+collection: ^{0}/.+$
+permission: r
+
+# Allow authenticated user to read all collections
+[allow-everyone-read]
+user: .+
+collection: .*
+permission: r
+
+# Give write access to owners
+[owner-write]
+user: .+
+collection: ^%(login)s(/.+)?$
+permission: rw
+
+# Allow CardDavMATE-, CalDavZAP- or InfCloud- WEBclient to work
+# anonymous users have read access to "/" but no files or subdir
+[infcloud]
+user: .*
+collection: /
+permission: r
diff --git a/net/radicale/files/radicale.users b/net/radicale/files/radicale.users
new file mode 100644 (file)
index 0000000..7722176
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# Sample File
+#
+
+user1:password1
+user2:password2
\ No newline at end of file
diff --git a/net/radicale/patches/010-Run-as-user-group-radicale-radicale.patch b/net/radicale/patches/010-Run-as-user-group-radicale-radicale.patch
new file mode 100644 (file)
index 0000000..e1f1c21
--- /dev/null
@@ -0,0 +1,30 @@
+Subject: [PATCH] Run as user radicale and group radicale
+
+Patch to run Radicale service as radicale:radicale non root user
+
+Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
+---
+ bin/radicale | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/bin/radicale b/bin/radicale
+index 619aca5..7466020 100755
+--- a/bin/radicale
++++ b/bin/radicale
+@@ -26,6 +26,13 @@ Launch the server according to configuration and command-line options.
+ """
++# inserted to run as user radicale
++import pwd, grp, os
++uid = pwd.getpwnam('radicale').pw_uid
++gid = grp.getgrnam('radicale').gr_gid
++os.setegid(gid)
++os.seteuid(uid)
++
+ import radicale.__main__
+-- 
+2.1.0
+
diff --git a/net/siit/Makefile b/net/siit/Makefile
new file mode 100644 (file)
index 0000000..6d6d298
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=siit
+PKG_VERSION:=1.2
+PKG_RELEASE:=1
+PKG_LICENSE:=GPLv2+
+
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/siit
+  SUBMENU:=Network Devices
+  TITLE:=Stateless IP ICMP Translation Algorithm
+  DEPENDS:= @(!(TARGET_ps3||TARGET_pxcab))
+  FILES:=$(PKG_BUILD_DIR)/siit.ko
+  AUTOLOAD:=$(call AutoLoad,50,siit)
+  MAINTAINER=Vladimir Ulrich <admin@evl.su>
+endef
+
+include $(INCLUDE_DIR)/kernel-defaults.mk
+
+define KernelPackage/siit/description
+ Stateless IP ICMP Translation Algorithm
+endef
+
+define Build/Prepare
+       mkdir -p $(PKG_BUILD_DIR)
+       cp src/Makefile src/siit.h src/siit.c $(PKG_BUILD_DIR)/
+endef
+
+define Build/Compile
+       $(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
+endef
+
+$(eval $(call KernelPackage,siit))
diff --git a/net/siit/src/Makefile b/net/siit/src/Makefile
new file mode 100644 (file)
index 0000000..06c36f1
--- /dev/null
@@ -0,0 +1,5 @@
+obj-m   := siit.o
+ifeq ($(MAKING_MODULES),1)
+-include $(TOPDIR)/Rules.make
+endif
+
diff --git a/net/siit/src/siit.c b/net/siit/src/siit.c
new file mode 100644 (file)
index 0000000..a25da9a
--- /dev/null
@@ -0,0 +1,1429 @@
+/*
+ * siit.c: the Stateless IP/ICMP Translator (SIIT) module for Linux.
+ *
+ *
+ */
+
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>       /* printk() */
+#include <linux/slab.h>
+
+#include <linux/errno.h>        /* error codes */
+#include <linux/types.h>        /* size_t */
+#include <linux/interrupt.h>    /* mark_bh */
+#include <linux/random.h>
+#include <linux/in.h>
+#include <linux/netdevice.h>    /* struct device, and other headers */
+#include <linux/etherdevice.h>  /* eth_type_trans */
+#include <net/ip.h>             /* struct iphdr */
+#include <net/icmp.h>           /* struct icmphdr */
+#include <net/ipv6.h>
+#include <net/udp.h>
+#include <linux/skbuff.h>
+#include <linux/in6.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+#include <asm/checksum.h>
+#include <net/ip6_checksum.h>
+#include <linux/in6.h>
+#include "siit.h"
+
+MODULE_AUTHOR("Dmitriy Moscalev, Grigory Klyuchnikov, Felix Fietkau");
+
+/*
+ * If tos_ignore_flag != 0, we don't copy TOS and Traffic Class
+ * from origin paket and set it to 0
+ */
+int tos_ignore_flag = 0;
+
+#define siit_stats(_dev) (&(_dev)->stats)
+
+/*
+ * The Utility  stuff
+ */
+
+#ifdef SIIT_DEBUG
+/* print dump bytes (data point data area sizeof len and message
+ * before dump.
+ */
+static int siit_print_dump(char *data, int len, char *message)
+{
+       int i;
+       int j = 0, k = 1;
+
+       len = len > BUFF_SIZE ? BUFF_SIZE : len;
+       printk("%s:\n", message);
+       for (i=0; i < len; i++, k++) {
+               if( i == len-1 || k == 16) {
+                       printk("%02x\n", (~(~0 << 8) & *(data+i)));
+                       j = 0;
+                       k = 0;
+               }
+               else if (j) {
+                       printk("%02x ", (~(~0 << 8) & *(data+i)));
+                       j--;
+               }
+               else {
+                       printk("%02x", (~(~0 << 8) & *(data+i)));
+                       j++;
+               }
+       }
+       return 0;
+}
+#endif
+
+/*
+ * Open and close
+ */
+static int siit_open(struct net_device *dev)
+{
+       netif_start_queue(dev);
+       return 0;
+}
+
+
+static int siit_release(struct net_device *dev)
+{
+       netif_stop_queue(dev); /* can't transmit any more */
+       return 0;
+}
+
+/*
+ * Translation IPv4 to IPv6 stuff
+ *
+ * ip4_ip6 (src, len, dst, include_flag)
+ *
+ * where
+ * src - buffer with original IPv4 packet,
+ * len - size of original packet,
+ * dst - new buffer for IPv6 packet,
+ * include_flag - if = 1, dst point to IPv4 packet that is ICMP error
+ *                included IP packet, else = 0
+ */
+
+static int ip4_ip6(char *src, int len, char *dst, int include_flag)
+{
+       struct iphdr *ih4 = (struct iphdr *) src; /* point to current IPv4 header struct */
+       struct icmphdr *icmp_hdr;   /* point to current ICMPv4 header struct */
+       struct udphdr *udp_hdr;     /* point to current IPv4 UDP header struct */
+
+       struct ipv6hdr *ih6 = (struct ipv6hdr *) dst; /* point to current IPv6 header struct */
+       struct frag_hdr *ih6_frag = (struct frag_hdr *)(dst+sizeof(struct ipv6hdr));
+                                                                                     /* point to current IPv6 fragment header struct */
+       struct icmp6hdr *icmp6_hdr; /* point to current ICMPv6 header */
+
+       int hdr_len = (int)(ih4->ihl * 4); /* IPv4 header length */
+       int icmp_len;               /* ICMPv4 packet length */
+       int plen;                   /* payload length */
+
+       unsigned int csum;          /* need to calculate ICMPv6 and UDP checksum */
+       int fl_csum = 0;            /* flag to calculate UDP checksum */
+       int icmperr = 1;            /* flag to indicate ICMP error message and to need
+                                                                  translate ICMP included IP packet */
+       int fr_flag = 0;            /* fragment flag, if = 0 - don't add
+                                                                  fragment header */
+       __u16 new_tot_len;          /* need to calculate IPv6 total length */
+       __u8 new_nexthdr;           /* next header code */
+       __u16 icmp_ptr = 0;         /* Pointer field in ICMP_PARAMETERPROB */
+
+#ifdef SIIT_DEBUG              /* print IPv4 header dump */
+       siit_print_dump(src, hdr_len, "siit: ip4_ip6() (in) ip4 header dump");
+#endif
+
+       /* If DF == 1 && MF == 0 && Fragment Offset == 0
+        * or this packet is ICMP included IP packet
+        * we don't need fragment header */
+       if (ntohs(ih4->frag_off) == IP_DF || include_flag ) {
+               /* not fragment and we need not to add Fragment
+                * Header to IPv6 packet. */
+               /* total length = total length from IPv4 packet */
+               new_tot_len = ntohs(ih4->tot_len);
+
+               if (ih4->protocol == IPPROTO_ICMP)
+                       new_nexthdr = NEXTHDR_ICMP;
+               else
+                       new_nexthdr = ih4->protocol;
+       }
+       else {
+               /* need to add Fragment Header */
+               fr_flag = 1;
+               /* total length = total length from IPv4 packet +
+                  length of Fragment Header */
+               new_tot_len = ntohs(ih4->tot_len) + sizeof(struct frag_hdr);
+               /* IPv6 Header NextHeader = NEXTHDR_FRAGMENT */
+               new_nexthdr = NEXTHDR_FRAGMENT;
+               /* Fragment Header NextHeader copy from IPv4 packet */
+               if (ih4->protocol == IPPROTO_ICMP)
+                       ih6_frag->nexthdr = NEXTHDR_ICMP;
+               else
+                       ih6_frag->nexthdr = ih4->protocol;
+
+               /* copy frag offset from IPv4 packet */
+               ih6_frag->frag_off = htons((ntohs(ih4->frag_off) & IP_OFFSET) << 3);
+               /* copy MF flag from IPv4 packet */
+               ih6_frag->frag_off = htons((ntohs(ih6_frag->frag_off) |
+                                                                       ((ntohs(ih4->frag_off) & IP_MF) >> 13)));
+               /* copy Identification field from IPv4 packet */
+               ih6_frag->identification = htonl(ntohs(ih4->id));
+               /* reserved field initialized to zero */
+               ih6_frag->reserved = 0;
+       }
+
+       /* Form rest IPv6 fields */
+
+       /*
+        * At this point we need to add checking of unxpired source
+        * route optin and if it is, send ICMPv4 "destination
+        * unreacheble/source route failes" Type 3/Code 5 and
+        * drop packet. (NOT RELEASED YET)
+        */
+
+       /* IP version = 6 */
+       ih6->version = 6;
+
+       if (tos_ignore_flag) {
+               ih6->priority = 0;
+               ih6->flow_lbl[0] = 0;
+       } else {
+               ih6->priority = (ih4->tos & 0xf0) >> 4;
+               ih6->flow_lbl[0] = (ih4->tos & 0x0f) << 4;
+       }
+       ih6->flow_lbl[1] = 0;
+       ih6->flow_lbl[2] = 0;
+
+       /* Hop Limit = IPv4 TTL */
+       ih6->hop_limit = ih4->ttl;
+
+       /* Translate source destination addresses,
+          for IPv6 host it's IPv4-translated IPv6 address,
+          for IPv4 host it's IPv4-mapped IPv6 address
+
+          !!WARNING!! Instead IPv4-mapped IPv6 addresses we use addreesses
+          with unused prefix ::ffff:ffff:0:0/96, because KAME implementation
+          doesn't support IPv4-mapped addresses in IPv6 packets and discard them.
+
+       */
+
+       if (include_flag) {
+               /*
+                  It's ICMP included IP packet and there is a diffirence
+                  in src/dst addresses then src/dst in normal direction
+                */
+
+               /*
+                  Source address
+                  is IPv4-translated IPv6 address because packet traveled
+                  from IPv6 to IPv4 area
+               */
+               ih6->saddr.in6_u.u6_addr32[0] = 0;
+               ih6->saddr.in6_u.u6_addr32[1] = 0;
+               ih6->saddr.in6_u.u6_addr32[2] = htonl(TRANSLATED_PREFIX); /* to network order bytes */
+               ih6->saddr.in6_u.u6_addr32[3] = ih4->saddr;
+
+               /*
+                  Destination address
+                  is IPv4-mapped address (but it's not IPv4- mapped, we use
+                  prefix ::ffff:ffff:0:0/96
+                */
+               ih6->daddr.in6_u.u6_addr32[0] = 0;
+               ih6->daddr.in6_u.u6_addr32[1] = 0;
+               ih6->daddr.in6_u.u6_addr32[2] = htonl(MAPPED_PREFIX); /* to network order bytes */
+               ih6->daddr.in6_u.u6_addr32[3] = ih4->daddr;
+       }
+       else {
+
+               /*
+                  This is normal case (packet isn't included IP packet)
+
+                  Source address
+                  is IPv4-mapped address (but it's not IPv4- mapped, we use
+                  prefix ::ffff:ffff:0:0/96)
+               */
+               ih6->saddr.in6_u.u6_addr32[0] = 0;
+               ih6->saddr.in6_u.u6_addr32[1] = 0;
+               ih6->saddr.in6_u.u6_addr32[2] = htonl(MAPPED_PREFIX); /* to network order bytes */
+               ih6->saddr.in6_u.u6_addr32[3] = ih4->saddr;
+
+               /* Destination address
+                  is is IPv4-translated IPv6 address
+                */
+               ih6->daddr.in6_u.u6_addr32[0] = 0;
+               ih6->daddr.in6_u.u6_addr32[1] = 0;
+               ih6->daddr.in6_u.u6_addr32[2] = htonl(TRANSLATED_PREFIX); /* to network order bytes */
+               ih6->daddr.in6_u.u6_addr32[3] = ih4->daddr;
+       }
+
+       /* Payload Length */
+       plen = new_tot_len - hdr_len; /* Payload length = IPv4 total len - IPv4 header len */
+       ih6->payload_len = htons(plen);
+
+       /* Next Header */
+       ih6->nexthdr = new_nexthdr; /* Next Header */
+
+       /* Process ICMP protocols data */
+
+       switch (ih4->protocol) {
+       case IPPROTO_ICMP:
+               if ( (ntohs(ih4->frag_off) & IP_OFFSET) != 0 || (ntohs(ih4->frag_off) & IP_MF) != 0 ) {
+                       PDEBUG("ip4_ip6(): don't translate ICMPv4 fragments - packet dropped.\n");
+                       return -1;
+               }
+
+               icmp_hdr = (struct icmphdr *) (src+hdr_len); /* point to ICMPv4 header */
+               csum = 0;
+               icmp_len =  ntohs(ih4->tot_len) - hdr_len; /* ICMPv4 packet length */
+               icmp6_hdr = (struct icmp6hdr *)(dst+sizeof(struct ipv6hdr)
+                                                                           +fr_flag*sizeof(struct frag_hdr)); /* point to ICMPv6 header */
+
+               if (include_flag) {
+                       /* ICMPv4 packet cannot be included in ICMPv4 Error message */
+                       /* !!! May be it's WRONG !!! ICMPv4 QUERY packet can be included
+                          in ICMPv4 Error message */
+                       PDEBUG("ip4_ip6(): It's included ICMPv4 in ICMPv4 Error message - packet dropped.\n");
+                       return -1;
+               }
+
+               /* Check ICMPv4 Type field */
+               switch (icmp_hdr->type) {
+               /* ICMP Error messages */
+               /* Destination Unreachable (Type 3) */
+               case ICMP_DEST_UNREACH:
+                       icmp6_hdr->icmp6_type = ICMPV6_DEST_UNREACH; /* to Type 1 */
+                       icmp6_hdr->icmp6_unused = 0;
+                       switch (icmp_hdr->code)
+                       {
+                       case ICMP_NET_UNREACH: /* Code 0 */
+                       case ICMP_HOST_UNREACH: /* Code 1 */
+                       case ICMP_SR_FAILED: /* Code 5 */
+                       case ICMP_NET_UNKNOWN: /* Code 6 */
+                       case ICMP_HOST_UNKNOWN: /* Code 7 */
+                       case ICMP_HOST_ISOLATED: /* Code 8 */
+                       case ICMP_NET_UNR_TOS: /* Code 11 */
+                       case ICMP_HOST_UNR_TOS: /* Code 12 */
+                               icmp6_hdr->icmp6_code = ICMPV6_NOROUTE; /* to Code 0 */
+                               break;
+                       case ICMP_PROT_UNREACH: /* Code 2 */
+                               icmp6_hdr->icmp6_type = ICMPV6_PARAMPROB; /* to Type 4 */
+                               icmp6_hdr->icmp6_code = ICMPV6_UNK_NEXTHDR; /* to Code 1 */
+                               /* Set pointer filed to 6, it's octet offset IPv6 Next Header field */
+                               icmp6_hdr->icmp6_pointer = htonl(6);
+                               break;
+                       case ICMP_PORT_UNREACH: /* Code 3 */
+                               icmp6_hdr->icmp6_code = ICMPV6_PORT_UNREACH; /* to Code 4 */
+                               break;
+                       case ICMP_FRAG_NEEDED: /* Code 4 */
+                               icmp6_hdr->icmp6_type = ICMPV6_PKT_TOOBIG; /* to Type 2 */
+                               icmp6_hdr->icmp6_code = 0;
+                               /* Correct MTU  */
+                               if (icmp_hdr->un.frag.mtu == 0)
+                                       /* we use minimum MTU for IPv4 PMTUv4 RFC1191, section 5;
+                                          IPv6 implementation wouldn't accept Path MTU < 1280,
+                                          but it records info correctly to always include
+                                          a fragment header */
+                                       icmp6_hdr->icmp6_mtu = htonl(576);
+                               else
+                                       /* needs to adjusted for difference between IPv4/IPv6 headers
+                                        * SIIT RFC2765, section 3.3,
+                                        * we assume that difference is 20 bytes */
+                                       icmp6_hdr->icmp6_mtu = htonl(ntohs(icmp_hdr->un.frag.mtu)+IP4_IP6_HDR_DIFF);
+
+                               break;
+                       case ICMP_NET_ANO: /* Code 9 */
+                       case ICMP_HOST_ANO: /* Code 10 */
+                               icmp6_hdr->icmp6_code = ICMPV6_ADM_PROHIBITED; /* to Code 1 */
+                               break;
+                       default: /* discard any other Code */
+                               PDEBUG("ip4_ip6(): Unknown ICMPv4 Type %d Code %d - packet dropped.\n",
+                                          ICMP_DEST_UNREACH, icmp_hdr->code);
+                               return -1;
+                       }
+                       break;
+                       /* Time Exceeded (Type 11) */
+               case ICMP_TIME_EXCEEDED:
+                       icmp6_hdr->icmp6_type = ICMPV6_TIME_EXCEED;
+                       icmp6_hdr->icmp6_code = icmp_hdr->code;
+                       break;
+                       /* Parameter Problem (Type 12) */
+               case ICMP_PARAMETERPROB:
+                       icmp6_hdr->icmp6_type = ICMPV6_PARAMPROB;
+                       icmp6_hdr->icmp6_code = icmp_hdr->code;
+
+                       icmp_ptr = ntohs(icmp_hdr->un.echo.id) >> 8;
+                       switch (icmp_ptr) {
+                       case 0:
+                               icmp6_hdr->icmp6_pointer = 0; /* IPv4 Version -> IPv6 Version */
+                               break;
+                       case 2:
+                               icmp6_hdr->icmp6_pointer = __constant_htonl(4); /* IPv4 length -> IPv6 Payload Length */
+                               break;
+                       case 8:
+                               icmp6_hdr->icmp6_pointer = __constant_htonl(7); /* IPv4 TTL -> IPv6 Hop Limit */
+                               break;
+                       case 9:
+                               icmp6_hdr->icmp6_pointer = __constant_htonl(6); /* IPv4 Protocol -> IPv6 Next Header */
+                               break;
+                       case 12:
+                               icmp6_hdr->icmp6_pointer = __constant_htonl(8); /* IPv4 Src Addr -> IPv6 Src Addr */
+                               break;
+                       case 16:
+                               icmp6_hdr->icmp6_pointer = __constant_htonl(24); /* IPv4 Dst Addr -> IPv6 Dst Addr */
+                               break;
+                       default:
+                               icmp6_hdr->icmp6_pointer = 0xffffffff; /* set to all ones in any other cases */
+                               break;
+                       }
+                       break;
+               case ICMP_ECHO:
+                       icmperr = 0;
+                       icmp6_hdr->icmp6_type = ICMPV6_ECHO_REQUEST;
+                       icmp6_hdr->icmp6_code = 0;
+                       /* Copy rest ICMP data to new IPv6 packet without changing */
+                       memcpy(((char *)icmp6_hdr)+4, ((char *)icmp_hdr)+4, len - hdr_len - 4);
+                       break;
+
+               case ICMP_ECHOREPLY:
+                       icmperr = 0;
+                       icmp6_hdr->icmp6_type = ICMPV6_ECHO_REPLY;
+                       icmp6_hdr->icmp6_code = 0;
+                       /* Copy rest ICMP data to new IPv6 packet without changing */
+                       memcpy(((char *)icmp6_hdr)+4, ((char *)icmp_hdr)+4, len - hdr_len - 4);
+                       break;
+
+                       /* Discard any other ICMP messages */
+               default:
+                       PDEBUG("ip4_ip6(): Unknown ICMPv4 packet Type %x - packet dropped.\n", icmp_hdr->type);
+                       return -1;
+               }
+
+               /* Now if it's ICMPv4 Error message we must translate included IP packet */
+
+               if (icmperr) {
+                       /* Call our ip4_ip6() to translate included IP packet */
+                       if (ip4_ip6(src+hdr_len+sizeof(struct icmphdr), len - hdr_len - sizeof(struct icmphdr),
+                                               dst+sizeof(struct ipv6hdr)+fr_flag*sizeof(struct frag_hdr)
+                                               +sizeof(struct icmp6hdr), 1) == -1) {
+                               PDEBUG("ip4_ip6(): Uncorrect translation of ICMPv4 Error message - packet dropped.\n");
+                               return -1;
+                       }
+                       /* correct ICMPv6 packet length for diffirence between IPv4 and IPv6 headers
+                          in included IP packet
+                          */
+                       icmp_len += 20;
+                       /* and correct Payload length for diffirence between IPv4 and IPv6 headers */
+                       plen += 20;
+                       ih6->payload_len = htons(plen);
+               }
+
+               /* Calculate ICMPv6 checksum */
+
+               icmp6_hdr->icmp6_cksum = 0;
+               csum = 0;
+
+               csum = csum_partial((u_char *)icmp6_hdr, icmp_len, csum);
+               icmp6_hdr->icmp6_cksum = csum_ipv6_magic(&ih6->saddr, &ih6->daddr, icmp_len,
+                                                                                IPPROTO_ICMPV6, csum);
+               break;
+
+       /* Process TCP protocols data */
+       case IPPROTO_TCP:
+               /* Copy TCP data to new IPv6 packet without changing */
+               memcpy(dst+sizeof(struct ipv6hdr)+fr_flag*sizeof(struct frag_hdr),
+                                  src+hdr_len, len - hdr_len);
+               break;
+
+       /* Process UDP protocols data */
+       case IPPROTO_UDP:
+               udp_hdr = (struct udphdr *)(src+hdr_len);
+               if ((ntohs(ih4->frag_off) & IP_OFFSET) == 0) {
+                       if ((ntohs(ih4->frag_off) & IP_MF) != 0) {
+                               /* It's a first fragment */
+                               if (udp_hdr->check == 0) {
+                                       /* System management event */
+                                       printk("siit: First fragment of UDP with zero checksum - packet droped\n");
+                                       printk("siit: addr: %x src port: %d dst port: %d\n",
+                                                  htonl(ih4->saddr), htons(udp_hdr->source), htons(udp_hdr->dest));
+                                       return -1;
+                               }
+                       }
+                       else if (udp_hdr->check == 0)
+                               fl_csum = 1;
+               }
+
+               /* Copy UDP data to new IPv6 packet */
+               udp_hdr = (struct udphdr *)(dst+sizeof(struct ipv6hdr)
+                                                                       + fr_flag*sizeof(struct frag_hdr));
+               memcpy((char *)udp_hdr, src+hdr_len, len - hdr_len);
+
+               /* Calculate UDP checksum if UDP checksum in IPv4 packet was ZERO
+                  and if it isn't included IP packet
+                */
+               if (fl_csum && (!include_flag)) {
+                       udp_hdr->check = 0;
+                       csum = 0;
+                       csum = csum_partial((unsigned char *)udp_hdr, plen - fr_flag*sizeof(struct frag_hdr), csum);
+                       udp_hdr->check = csum_ipv6_magic(&ih6->saddr, &ih6->daddr, plen -
+                                                                                    fr_flag*sizeof(struct frag_hdr), IPPROTO_UDP, csum);
+               }
+               break;
+
+       /* Discard packets with any other protocol */
+       default:
+               PDEBUG("ip4_ip6(): Unknown upper protocol - packet dropped.\n");
+               return -1;
+       }
+
+#ifdef SIIT_DEBUG
+       siit_print_dump(dst, sizeof(struct ipv6hdr), "siit: ip4_ip6(): (out) ipv6 header dump");
+#endif
+
+       return 0;
+}
+
+/*
+ * Translation IPv6 to IPv4 stuff
+ *
+ * ip6_ip4(src, len, dst, include_flag)
+ *
+ * where
+ * src - buffer with original IPv6 packet,
+ * len - size of original packet,
+ * dst - new buffer for IPv4 packet,
+ * include_flag - if = 1, dst point to IPv6 packet that is ICMP error
+ *                included IP packet, else = 0
+ *
+ */
+
+static int ip6_ip4(char *src, int len, char *dst, int include_flag)
+{
+       struct ipv6hdr *ip6_hdr;    /* point to current IPv6 header struct */
+       struct iphdr *ip_hdr;       /* point to current IPv4 header struct */
+       int opts_len = 0;           /* to sum Option Headers length */
+       int icmperr = 1;            /* if = 1, indicate that packet is ICMP Error message, else = 0 */
+       int ntot_len = 0;           /* to calculate IPv6 Total Length field */
+       int real_len;
+       int len_delta;
+       int ip6_payload_len;
+       int inc_opts_len = 0;       /* to sum Option Headers length in ICMP included IP packet */
+       __u8 next_hdr;              /* Next Header */
+
+#ifdef SIIT_DEBUG
+       siit_print_dump(src, sizeof(struct ipv6hdr), "siit: ip6_ip4(): (in) ipv6 header dump");
+#endif
+
+       if ( (len_delta = len - sizeof(struct ipv6hdr)) >= 0)
+       {
+               ip6_hdr = (struct ipv6hdr *)src;
+               ip_hdr = (struct iphdr *)dst;
+
+               real_len = sizeof(struct iphdr);
+
+               /* Check validation of Saddr & Daddr? is a packet to fall under our translation? */
+               if (include_flag) { /* It's ICMP included IP packet,
+                                                          about process include_flag see comment in ip4_ip6() */
+                       if (ip6_hdr->saddr.s6_addr32[2] != htonl(MAPPED_PREFIX)) {
+                               PDEBUG("ip6_ip4(): Included IP packet Src addr isn't mapped addr: %x%x%x%x, packet dropped.\n",
+                                          ip6_hdr->saddr.s6_addr32[0], ip6_hdr->saddr.s6_addr32[1],
+                                          ip6_hdr->saddr.s6_addr32[2], ip6_hdr->saddr.s6_addr32[3]);
+                               return -1;
+                       }
+                       if ( ip6_hdr->daddr.s6_addr32[2] != htonl(TRANSLATED_PREFIX)) {
+                               PDEBUG("ip6_ip4(): Included IP packet Dst addr isn't translated addr: %x%x%x%x, packet dropped.\n",
+                                          ip6_hdr->daddr.s6_addr32[0], ip6_hdr->daddr.s6_addr32[1],
+                                          ip6_hdr->daddr.s6_addr32[2], ip6_hdr->daddr.s6_addr32[3]);
+                               return -1;
+                       }
+               }
+               else { /* It's normal IP packet (not included in ICMP) */
+                       if (ip6_hdr->saddr.s6_addr32[2] != htonl(TRANSLATED_PREFIX)) {
+                               PDEBUG("ip6_ip4(): Src addr isn't translated addr: %x%x%x%x, packet dropped.\n",
+                                          ip6_hdr->saddr.s6_addr32[0], ip6_hdr->saddr.s6_addr32[1],
+                                          ip6_hdr->saddr.s6_addr32[2], ip6_hdr->saddr.s6_addr32[3]);
+                               return -1;
+                       }
+                       if ( ip6_hdr->daddr.s6_addr32[2] != htonl(MAPPED_PREFIX)) {
+                               PDEBUG("ip6_ip4(): Dst addr isn't mapped addr: %x%x%x%x, packet dropped.\n",
+                                          ip6_hdr->daddr.s6_addr32[0], ip6_hdr->daddr.s6_addr32[1],
+                                          ip6_hdr->daddr.s6_addr32[2], ip6_hdr->daddr.s6_addr32[3]);
+                               return -1;
+                       }
+               }
+
+               /* Set IPv4 Fragment Offset and ID to 0
+                  before process any Option Headers */
+               ip_hdr->frag_off = 0;
+               ip_hdr->id = 0;
+
+               /*
+                * We process only Fragment Header. Any other options headers
+                * are ignored, i.e. there is no attempt to translate them.
+                * However, the Total Length field and the Protocol field would
+                * have to be adjusted to "skip" these extension headers.
+                */
+
+               next_hdr = ip6_hdr->nexthdr;
+
+               /* Hop_by_Hop options header (ip6_hdr->nexthdr = 0). It must
+                * appear only in IPv6 header's Next Header field.
+                */
+               if (next_hdr == NEXTHDR_HOP) {
+                       if ( (len_delta - sizeof(struct ipv6_opt_hdr)) >= 0)
+                       {
+                               struct ipv6_opt_hdr *ip6h =
+                                       (struct ipv6_opt_hdr *)(src+sizeof(struct ipv6hdr) + opts_len);
+                               if ( (len_delta -= ip6h->hdrlen*8 + 8) >= 0)
+                               {
+                                       opts_len += ip6h->hdrlen*8 + 8;  /* See  RFC 2460 page 11:
+                                                       Hdr Ext Len  8-bit unsigned integer.  Length of the Hop-by-
+                                                                                Hop Options header in 8-octet units, not
+                                                                                including the first 8 octets.
+                                                       */
+                                       next_hdr = ip6h->nexthdr;
+                               }
+                               else
+                               {
+                                       PDEBUG("ip6_ip4(): hop_by_hop header error, packet droped");
+                                       /* Generate ICMP Parameter Problem */
+                                       return -1;
+                               }
+                       }
+               }
+
+               if (len_delta > 0)
+               {
+                       while(next_hdr != NEXTHDR_ICMP && next_hdr != NEXTHDR_TCP
+                                 && next_hdr != NEXTHDR_UDP)
+                       {
+                               /* Destination options header */
+                               if (next_hdr == NEXTHDR_DEST)
+                               {
+                                       if ( (len_delta - sizeof(struct ipv6_opt_hdr)) >= 0)
+                                       {
+                                               struct ipv6_opt_hdr *ip6d =
+                                                       (struct ipv6_opt_hdr *)(src + sizeof(struct ipv6hdr) + opts_len);
+                                               if ( (len_delta -= ip6d->hdrlen*8 + 8) >= 0)
+                                               {
+                                                       opts_len += ip6d->hdrlen*8 + 8;
+                                                       next_hdr = ip6d->nexthdr;
+                                               }
+                                       }
+                                       else
+                                       {
+                                               PDEBUG("ip6_ip4(): destination header error, packet droped");
+                                               /* Generate ICMP Parameter Problem */
+                                               return -1;
+                                       }
+                               }
+                               /* Routing options header */
+                               else if (next_hdr == NEXTHDR_ROUTING)
+                               {
+                                       if ( (len_delta - sizeof(struct ipv6_rt_hdr)) >= 0)
+                                       {
+                                               struct ipv6_rt_hdr *ip6rt =
+                                                       (struct ipv6_rt_hdr *)(src+sizeof(struct ipv6hdr) + opts_len);
+                                               /* RFC 2765 SIIT, 4.1:
+                                                  If a routing header with a non-zero Segments Left field is present
+                                                  then the packet MUST NOT be translated, and an ICMPv6 "parameter
+                                                  problem/ erroneous header field encountered" (Type 4/Code 0) error
+                                                  message, with the Pointer field indicating the first byte of the
+                                                  Segments Left field, SHOULD be returned to the sender.
+                                                  */
+                                               if (ip6rt->segments_left != 0) {
+                                                       /* Build ICMPv6 "Parameter Problem/Erroneous Header
+                                                          Field Encountered" & drop the packet */
+                                                       /* !!! We don't send ICMPv6 "Parameter Problem" !!! */
+                                                       PDEBUG("ip6_ip4(): routing header type != 0\n");
+                                                       return -1;
+                                               }
+                                               if ( (len_delta -= ip6rt->hdrlen*8 + 8) >= 0)
+                                               {
+                                                       opts_len += ip6rt->hdrlen*8 + 8;
+                                                       next_hdr = ip6rt->nexthdr;
+                                               }
+                                               else
+                                               {
+                                                       PDEBUG("ip6_ip4(): routing header error, packet droped");
+                                                       /* Generate ICMP Parameter Problem */
+                                                       return -1;
+                                               }
+                                       }
+                               }
+                               /* Fragment options header */
+                               else if (next_hdr == NEXTHDR_FRAGMENT)
+                               {
+                                       if ( (len_delta -= sizeof(struct frag_hdr)) >= 0)
+                                       {
+                                               struct frag_hdr *ip6f =
+                                                       (struct frag_hdr *)(src+sizeof(struct ipv6hdr)+opts_len);
+
+                                               opts_len += sizeof(struct frag_hdr);      /* Frag Header Length = 8 */
+                                               ip_hdr->id = htons(ntohl(ip6f->identification)); /* ID field */
+                                               ip_hdr->frag_off = htons((ntohs(ip6f->frag_off) & IP6F_OFF_MASK) >> 3);
+                                                                                                                  /* fragment offset */
+                                               ip_hdr->frag_off = htons(ntohs(ip_hdr->frag_off) |
+                                                                                        ((ntohs(ip6f->frag_off) & IP6F_MORE_FRAG) << 13));
+                                                                                                                 /* more fragments flag */
+                                               next_hdr = ip6f->nexthdr;
+                                       }
+                                       else
+                                       {
+                                               PDEBUG("ip6_ip4(): fragment header error, packet droped");
+                                               /* Generate ICMP Parameter Problem */
+                                               return -1;
+                                       }
+                               }
+                               /* No Next Header */
+                               else if (next_hdr == NEXTHDR_NONE)
+                               {
+                                       /* RFC 2460 IPv6 Specification, 4.7
+                                          4.7 No Next Header
+
+                                          The value 59 in the Next Header field of an IPv6 header or any
+                                          extension header indicates that there is nothing following that
+                                          header.  If the Payload Length field of the IPv6 header indicates the
+                                          presence of octets past the end of a header whose Next Header field
+                                          contains 59, those octets must be ignored, and passed on unchanged if
+                                          the packet is forwarded.
+                                          */
+                                       break;
+                               }
+                               else if (next_hdr == NEXTHDR_ESP || next_hdr == NEXTHDR_AUTH)
+                               {
+                                       PDEBUG("ip6_ip4(): cannot translate AUTH or ESP extention header, packet dropped\n");
+                                       return -1;
+                               }
+                               else if (next_hdr == NEXTHDR_IPV6)
+                               {
+                                       PDEBUG("ip6_ip4(): cannot translate IPv6-IPv6 packet, packet dropped\n");
+                                       return -1;
+                               }
+                               else if (next_hdr == 0)
+                               {
+                                       /* As say RFC 2460 (IPv6 Spec) we should discard the packet and send an
+                                          ICMP Parameter Problem message to the source of the packet, with an
+                                          ICMP Code value of 1 ("unrecognized Next Header type encountered")
+                                          and the ICMP Pointer field containing the offset of the unrecognized
+                                          value within the original packet
+                                          */
+                                       /* NOT IMPLEMENTED */
+                                       PDEBUG("ip6_ip4(): NEXTHDR in extention header = 0, packet dropped\n");
+                                       return -1;
+                               }
+                               else
+                               {
+                                       PDEBUG("ip6_ip4(): cannot translate extention header = %d, packet dropped\n", next_hdr);
+                                       return -1;
+                               }
+                       }
+               }
+       }
+       else
+       {
+          PDEBUG("ip6_ip4(): error packet len, packet dropped.\n");
+          return -1;
+       }
+
+       /* Building ipv4 packet */
+
+       ip_hdr->version = IPVERSION;
+       ip_hdr->ihl = 5;
+
+       /* TOS see comment about TOS in ip4_ip6() */
+       if (tos_ignore_flag)
+               ip_hdr->tos = 0;
+       else {
+               ip_hdr->tos = ip6_hdr->priority << 4;
+               ip_hdr->tos = ip_hdr->tos | (ip6_hdr->flow_lbl[0] >> 4);
+       }
+
+       /* IPv4 Total Len = IPv6 Payload Len +
+          IPv4 Header Len (without options) - Options Headers Len */
+       ip6_payload_len = ntohs(ip6_hdr->payload_len);
+
+       if (ip6_payload_len == 0)
+               ntot_len = 0;
+       else
+               ntot_len = ip6_payload_len + IP4_IP6_HDR_DIFF - opts_len;
+
+       ip_hdr->tot_len = htons(ntot_len);
+
+       /* IPv4 TTL = IPv6 Hop Limit */
+       ip_hdr->ttl = ip6_hdr->hop_limit;
+
+       /* IPv4 Protocol = Next Header that will point to upper layer protocol */
+       ip_hdr->protocol = next_hdr;
+
+       /* IPv4 Src addr = last 4 bytes from IPv6 Src addr */
+       ip_hdr->saddr = ip6_hdr->saddr.s6_addr32[3];
+       /* IPv4 Dst addr = last 4 bytes from IPv6 Dst addr */
+       ip_hdr->daddr = ip6_hdr->daddr.s6_addr32[3];
+
+       /* Calculate IPv4 header checksum */
+       ip_hdr->check = 0;
+       ip_hdr->check = ip_fast_csum((unsigned char *)ip_hdr, ip_hdr->ihl);
+
+       if (len_delta > 0)
+       {
+               /* PROCESS ICMP */
+
+               if (next_hdr == NEXTHDR_ICMP)
+               {
+                       struct icmp6hdr *icmp6_hdr;
+                       struct icmphdr *icmp_hdr;
+
+                       if ((len_delta -= sizeof(struct icmp6hdr)) >= 0)
+                       {
+                               icmp6_hdr = (struct icmp6hdr *)(src + sizeof(struct ipv6hdr) + opts_len);
+                               icmp_hdr = (struct icmphdr *)(dst + sizeof(struct iphdr));
+
+                               real_len += len_delta + sizeof(struct icmphdr);
+
+                               /* There is diffirent between ICMPv4/ICMPv6 protocol codes
+                                  IPPROTO_ICMP = 1
+                                  IPPROTO_ICMPV6 = 58        */
+                               ip_hdr->protocol = IPPROTO_ICMP;
+
+                               if (include_flag) {
+                                       /* !!! Warnig !!! We discard ICMP packets with any ICMP as included
+                                          in ICMP Error. But ICMP Error messages can include ICMP Query message
+                                          */
+                                       if (icmp6_hdr->icmp6_type != ICMPV6_ECHO_REQUEST)
+                                       {
+                                               PDEBUG("ip6_ip4(): included ICMPv6 in ICMPv6 Error message, packet dropped\n");
+                                               return -1;
+                                       }
+                               }
+
+                       /* Translate ICMPv6 to ICMPv4 */
+                               switch (icmp6_hdr->icmp6_type)
+                               {
+/* ICMP Error messages */
+                       /* Destination Unreachable (Type 1) */
+                               case ICMPV6_DEST_UNREACH: /* Type 1 */
+                                       icmp_hdr->type = ICMP_DEST_UNREACH; /* to Type 3 */
+                                       icmp_hdr->un.echo.id = 0;
+                                       icmp_hdr->un.echo.sequence = 0;
+                                       switch (icmp6_hdr->icmp6_code)
+                                       {
+                                       case ICMPV6_NOROUTE: /* Code 0 */
+                                       case ICMPV6_NOT_NEIGHBOUR: /* Code 2 */
+                                       case ICMPV6_ADDR_UNREACH: /* Code 3  */
+                                               icmp_hdr->code = ICMP_HOST_UNREACH; /* To Code 1 */
+                                               break;
+                                       case ICMPV6_ADM_PROHIBITED: /* Code 1 */
+                                               icmp_hdr->code = ICMP_HOST_ANO; /* To Code 10 */
+                                               break;
+                                       case ICMPV6_PORT_UNREACH: /* Code 4 */
+                                               icmp_hdr->code = ICMP_PORT_UNREACH; /* To Code 3 */
+
+                                               break;
+                                       default:            /* discard any other codes */
+                                               PDEBUG("ip6_ip4(): Unknown ICMPv6 Type %d Code %d - packet dropped.\n",
+                                                          ICMPV6_DEST_UNREACH, icmp6_hdr->icmp6_code);
+                                               return -1;
+                                       }
+                                       break;
+                       /* Packet Too Big (Type 2) */
+                               case ICMPV6_PKT_TOOBIG: /* Type 2 */
+                                       icmp_hdr->type = ICMP_DEST_UNREACH; /* to Type 3  */
+                                       icmp_hdr->code = ICMP_FRAG_NEEDED; /*  to Code 4 */
+                                       /* Change MTU, RFC 2765 (SIIT), 4.2:
+                                          The MTU field needs to be adjusted for the difference between
+                                          the IPv4 and IPv6 header sizes taking into account whether or
+                                          not the packet in error includes a Fragment header.
+                                          */
+                                       /* !!! Don't implement !!! */
+                                       icmp_hdr->un.frag.mtu = (__u16) icmp6_hdr->icmp6_mtu;
+                                       break;
+                       /* Time Exceeded (Type 3) */
+                               case ICMPV6_TIME_EXCEED:
+                                       icmp_hdr->type = ICMP_TIME_EXCEEDED; /* to Type 11 */
+                                       icmp_hdr->code = icmp6_hdr->icmp6_code; /* Code unchanged */
+                                       break;
+                       /* Parameter Problem (Type 4) */
+                               case ICMPV6_PARAMPROB:
+                                       switch (icmp6_hdr->icmp6_code) {
+                                       case ICMPV6_UNK_NEXTHDR: /* Code 1 */
+                                               icmp_hdr->type = ICMP_DEST_UNREACH; /* to Type 3 */
+                                               icmp_hdr->code = ICMP_PROT_UNREACH; /* to Code 2 */
+                                               break;
+                                       default: /* if Code != 1 */
+                                               icmp_hdr->type = ICMP_PARAMETERPROB; /* to Type 12 */
+                                               icmp_hdr->code = 0; /* to Code 0 */
+                                               /* Update Pointer field
+                                                  RFC 2765 (SIIT), 4.2:
+                                                  The Pointer needs to be updated to point to the corresponding
+                                                  field in the translated include IP header.
+                                                  */
+                                               switch (ntohl(icmp6_hdr->icmp6_pointer))
+                                               {
+                                               case 0: /* IPv6 Version -> IPv4 Version */
+                                                       icmp_hdr->un.echo.id = 0;
+                                                       break;
+                                               case 4: /* IPv6 PayloadLength -> IPv4 Total Length */
+                                                       icmp_hdr->un.echo.id = 0x0002; /* 2 */
+                                                       break;
+                                               case 6: /* IPv6 Next Header-> IPv4 Protocol */
+                                                       icmp_hdr->un.echo.id = 0x0009; /* 9 */
+                                                       break;
+                                               case 7: /* IPv6 Hop Limit -> IPv4 TTL */
+                                                       icmp_hdr->un.echo.id = 0x0008; /* 8 */
+                                                       break;
+                                               case 8: /* IPv6 Src addr -> IPv4 Src addr */
+                                                       icmp_hdr->un.echo.id = 0x000c; /* 12 */
+                                                       break;
+                                               case 24: /* IPv6 Dst addr -> IPv4 Dst addr*/
+                                                       icmp_hdr->un.echo.id = 0x0010; /* 16 */
+                                                       break;
+                                               default: /* set all ones in other cases */
+                                                       icmp_hdr->un.echo.id = 0xff;
+                                                       break;
+                                               }
+                                               break;
+                                       }
+                                       break;
+
+/* End of ICMP Error messages */
+
+                       /* Echo Request and Echo Reply (Type 128 and 129)  */
+                               case ICMPV6_ECHO_REQUEST:
+                                       icmperr = 0;        /* not error ICMP message */
+                                       icmp_hdr->type = ICMP_ECHO; /* to Type 8 */
+                                       icmp_hdr->code = 0; /* to Code 0 */
+                                       icmp_hdr->un.echo.id = icmp6_hdr->icmp6_identifier;
+                                       icmp_hdr->un.echo.sequence = icmp6_hdr->icmp6_sequence;
+                                       /* copy rest of ICMP data to result packet */
+                                       if (len_delta > 0)
+                                               memcpy(((char *)icmp_hdr) + sizeof(struct icmphdr),
+                                                          ((char *)icmp6_hdr) + sizeof(struct icmp6hdr), len_delta);
+                                       break;
+                               case ICMPV6_ECHO_REPLY:
+                                       icmperr = 0;        /* not error ICMP message */
+                                       icmp_hdr->type = ICMP_ECHOREPLY; /* to Type 0 */
+                                       icmp_hdr->code = 0; /* to Code 0 */
+                                       icmp_hdr->un.echo.id = icmp6_hdr->icmp6_identifier;
+                                       icmp_hdr->un.echo.sequence = icmp6_hdr->icmp6_sequence;
+                                       /* copy rest of ICMP data */
+                                       if (len_delta > 0)
+                                               memcpy(((char *)icmp_hdr) + sizeof(struct icmphdr),
+                                                          ((char *)icmp6_hdr) + sizeof(struct icmp6hdr), len_delta);
+                                       break;
+                               default:
+                                       /* Unknown error messages. Silently drop. */
+                                       PDEBUG("ip6_ip4(): unknown ICMPv6 Type %d, packet dropped.\n", icmp6_hdr->icmp6_type);
+                                       return -1;
+                               }
+
+                               if (icmperr)
+                               {
+                                       /* If ICMP Error message, we translate IP included packet*/
+                                       if (len_delta >= sizeof(struct ipv6hdr))
+                                       {
+                                               if((inc_opts_len = ip6_ip4((char *)icmp6_hdr + sizeof(struct icmp6hdr), len_delta,
+                                                                                          (char *)icmp_hdr + sizeof(struct icmphdr), 1)) == -1) {
+                                                       PDEBUG("ip6_ip4(): incorrect translation of ICMPv6 Error message, packet dropped\n");
+                                                       return -1;
+                                               }
+                                               /* correct IPv4 Total Len that = old Total Len
+                                                  - Options Headers Len in included IP packet
+                                                  - diffirence between IPv6 Header Len and IPv4 Header Len
+                                                  */
+                                               if (ntot_len != 0)
+                                                       ip_hdr->tot_len = htons(ntot_len - inc_opts_len - IP4_IP6_HDR_DIFF);
+                                               real_len = real_len - inc_opts_len - IP4_IP6_HDR_DIFF;
+                                       }
+                                       else if (len_delta > 0)
+                                       {
+                                               /* May be it need set 0x0 to rest area in result IPv4 packet,
+                                                * but we copy rest data unchanged
+                                                */
+                                               memcpy(((char *)icmp_hdr) + sizeof(struct icmphdr),
+                                                          ((char *)icmp6_hdr) + sizeof(struct icmp6hdr), len_delta);
+                                       }
+                               }
+
+                               /* Calculate IPv4 Header checksum */
+                               ip_hdr->check = 0;
+                               ip_hdr->check = ip_fast_csum((unsigned char *)ip_hdr, ip_hdr->ihl);
+
+                               /* Calculate ICMPv4 checksum */
+                               if (ntot_len != 0)
+                               {
+                                       icmp_hdr->checksum = 0;
+                                       icmp_hdr->checksum = ip_compute_csum((unsigned char *)icmp_hdr, ntohs(ip_hdr->tot_len)
+                                                                                            - sizeof(struct iphdr));
+                               }
+                       }
+                       else
+                       {
+                               PDEBUG("ip6_ip4(): error length ICMP packet, packet dropped.\n");
+                               return -1;
+                       }
+
+               }
+               /* PROCESS TCP and UDP (and rest data) */
+
+               else {
+                       real_len += len_delta;
+                       /* we copy rest data to IPv4 packet without changing */
+                       memcpy(dst+sizeof(struct iphdr), src + sizeof(struct ipv6hdr) + opts_len, len_delta);
+               }
+       }
+
+       if (include_flag)           /* if it's included IP packet */
+               return opts_len;        /* return options headers length */
+       else
+               return real_len; /* result packet len */
+}
+
+/*
+ * ip4_fragment(skb, len, hdr_len, dev, eth_h)
+ * to fragment original IPv4 packet if result IPv6 packet will be > 1280
+ */
+
+static int ip4_fragment(struct sk_buff *skb, int len, int hdr_len, struct net_device *dev, struct ethhdr *eth_h)
+{
+       struct sk_buff *skb2 = NULL;       /* pointer to new struct sk_buff for transleded packet */
+       char buff[FRAG_BUFF_SIZE+hdr_len]; /* buffer to form new fragment packet */
+       char *cur_ptr = skb->data+hdr_len; /* pointter to current packet data with len = frag_len */
+       struct iphdr *ih4 = (struct iphdr *) skb->data;
+       struct iphdr *new_ih4 = (struct iphdr *) buff; /* point to new IPv4 hdr */
+       struct ethhdr *new_eth_h;   /* point to ether hdr, need to set hard header data in fragment */
+       int data_len = len - hdr_len; /* origin packet data len */
+       int rest_len = data_len;    /* rest data to fragment */
+       int frag_len = 0;           /* current fragment len */
+       int last_frag = 0;          /* last fragment flag, if = 1, it's last fragment */
+       int flag_last_mf = 0;
+       __u16 new_id = 0;           /* to generate identification field */
+       __u16 frag_offset = 0;      /* fragment offset */
+       unsigned int csum;
+       unsigned short udp_len;
+
+#ifdef SIIT_DEBUG
+       printk("siit: it's DF == 0 and result IPv6 packet will be > 1280\n");
+       siit_print_dump(skb->data, hdr_len, "siit: (orig) ipv4_hdr dump");
+#endif
+
+       if ((ntohs(ih4->frag_off) & IP_MF) == 0 )
+               /* it's a case we'll clear MF flag in our last packet */
+               flag_last_mf = 1;
+
+       if (ih4->protocol == IPPROTO_UDP) {
+               if ( (ntohs(ih4->frag_off) & IP_OFFSET) == 0) {
+                       struct udphdr *udp_hdr = (struct udphdr *)((char *)ih4 + hdr_len);
+                       if (!flag_last_mf) {
+                               if (udp_hdr->check == 0) {
+                                       /* it's a first fragment with ZERO checksum and we drop packet */
+                                       printk("siit: First fragment of UDP with zero checksum - packet droped\n");
+                                       printk("siit: addr: %x src port: %d dst port: %d\n",
+                                                  htonl(ih4->saddr), htons(udp_hdr->source), htons(udp_hdr->dest));
+                                       return -1;
+                               }
+                       }
+                       else if (udp_hdr->check == 0) {
+                               /* Calculate UDP checksum only if it's not fragment */
+                               udp_len = ntohs(udp_hdr->len);
+                               csum = 0;
+                               csum = csum_partial((unsigned char *)udp_hdr, udp_len, csum);
+                               udp_hdr->check = csum_tcpudp_magic(ih4->saddr, ih4->daddr, udp_len, IPPROTO_UDP, csum);
+                       }
+               }
+       }
+
+       frag_offset = ntohs(ih4->frag_off) & IP_OFFSET;
+
+       new_id = ih4->id;
+
+       while(1) {
+               if (rest_len <= FRAG_BUFF_SIZE) {
+                       /* it's last fragmen */
+                       frag_len = rest_len; /* rest data */
+                       last_frag = 1;
+               }
+               else
+                       frag_len = FRAG_BUFF_SIZE;
+
+               /* copy IP header to buffer */
+               memcpy(buff, skb->data, hdr_len);
+               /* copy data to buffer with len = frag_len */
+               memcpy(buff + hdr_len, cur_ptr, frag_len);
+
+               /* set id field in new IPv4 header*/
+               new_ih4->id = new_id;
+
+               /* is it last fragmet */
+               if(last_frag && flag_last_mf)
+                       /* clear MF flag */
+                       new_ih4->frag_off = htons(frag_offset & (~IP_MF));
+               else
+                       /* set MF flag */
+                       new_ih4->frag_off = htons(frag_offset | IP_MF);
+
+               /* change packet total length */
+               new_ih4->tot_len = htons(frag_len+hdr_len);
+
+               /* rebuild the header checksum (IP needs it) */
+               new_ih4->check = 0;
+               new_ih4->check = ip_fast_csum((unsigned char *)new_ih4,new_ih4->ihl);
+
+               /* Allocate new sk_buff to compose translated packet */
+               skb2 = dev_alloc_skb(frag_len+hdr_len+dev->hard_header_len+IP4_IP6_HDR_DIFF+IP6_FRAGMENT_SIZE);
+               if (!skb2) {
+                       printk(KERN_DEBUG "%s: alloc_skb failure - packet dropped.\n", dev->name);
+                       dev_kfree_skb(skb2);
+                       return -1;
+               }
+               /* allocate skb->data portion for IP header len, fragment data len and ether header len
+                * and copy to head ether header from origin skb
+                */
+               memcpy(skb_put(skb2, frag_len+hdr_len+dev->hard_header_len+IP4_IP6_HDR_DIFF+IP6_FRAGMENT_SIZE), (char *) eth_h,
+                          dev->hard_header_len);
+               /* correct ether header data, ether protocol field to ETH_P_IPV6 */
+               new_eth_h = (struct ethhdr *)skb2->data;
+               new_eth_h->h_proto = htons(ETH_P_IPV6);
+
+               /* reset the mac header */
+               skb_reset_mac_header(skb2);
+
+               /* pull ether header from new skb->data */
+               skb_pull(skb2, dev->hard_header_len);
+               /* set skb protocol to IPV6 */
+               skb2->protocol = htons(ETH_P_IPV6);
+
+               /* call translation function */
+               if ( ip4_ip6(buff, frag_len+hdr_len, skb2->data, 0) == -1) {
+                       dev_kfree_skb(skb2);
+                       return -1;
+               }
+
+               /*
+                * Set needed fields in new sk_buff
+                */
+               skb2->dev = dev;
+               skb2->ip_summed = CHECKSUM_UNNECESSARY;
+               skb2->pkt_type = PACKET_HOST;
+
+               /* Add transmit statistic */
+               siit_stats(dev)->tx_packets++;
+               siit_stats(dev)->tx_bytes += skb2->len;
+
+               /* send packet to upper layer */
+               netif_rx(skb2);
+
+               /* exit if it was last fragment */
+               if (last_frag)
+                       break;
+
+               /* correct current data pointer */
+               cur_ptr += frag_len;
+               /* rest data len */
+               rest_len -= frag_len;
+               /* current fragment offset */
+               frag_offset = (frag_offset*8 + frag_len)/8;
+       }
+
+       return 0;
+}
+/*
+ * Transmit a packet (called by the kernel)
+ *
+ * siit_xmit(skb, dev)
+ *
+ * where
+ * skb - pointer to struct sk_buff with incomed packet
+ * dev - pointer to struct device on which packet revieved
+ *
+ * Statistic:
+ * for all incoming packes:
+ *            stats.rx_bytes+=skb->len
+ *            stats.rx_packets++
+ * for packets we can't transle:
+ *            stats.tx_errors++
+ * device busy:
+ *            stats.tx_errors++
+ * for packets we can't allocate sk_buff:
+ *            stats.tx_dropped++
+ * for outgoing packes:
+ *            stats.tx_packets++
+ *            stats.tx_bytes+=skb2->len !!! But we don't set skb2->len !!!
+ */
+
+static int siit_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+       struct sk_buff *skb2 = NULL;/* pointer to new struct sk_buff for transleded packet */
+       struct ethhdr *eth_h;       /* pointer to incoming Ether header */
+       int len;                    /* original packets length */
+       int new_packet_len;
+       int skb_delta = 0;          /* delta size for allocate new skb */
+       char new_packet_buff[2048];
+
+       /* Check pointer to sk_buff and device structs */
+       if (skb == NULL || dev == NULL)
+               return -EINVAL;
+
+       /* Add receive statistic */
+       siit_stats(dev)->rx_bytes += skb->len;
+       siit_stats(dev)->rx_packets++;
+
+       dev->trans_start = jiffies;
+
+       /* Upper layer (IP) protocol forms sk_buff for outgoing packet
+        * and sets IP header + Ether header too. IP layer sets outgoing
+        * device in sk_buff->dev.
+        * In function (from linux/net/core/dev.c) ther is a call to
+        * device transmit function (dev->hard_start_xmit):
+        *
+        *    dev_queue_xmit(struct sk_buff *skb)
+        *    {
+        *    ...
+        *          device *dev = skb->dev;
+        *    ...
+        *          dev->hard_start_xmit(skb, dev);
+        *    ...
+        *    }
+        * We save pointer to ether header in eth_h and skb_pull ether header
+        * from data field of skb_buff
+        */
+
+       eth_h = (struct ethhdr *)skb->data; /* point to incoming packet Ether Header */
+
+#ifdef SIIT_DEBUG
+       siit_print_dump(skb->data, ETH_HLEN, "siit: eth_hdr dump");
+#endif
+
+       /* Remove hardware header from origin sk_buff */
+       skb_pull(skb,dev->hard_header_len);
+
+       /*
+        * Process IPv4 paket
+        */
+       if (ntohs(skb->protocol) == ETH_P_IP) {
+               int hdr_len;            /* IPv4 header length */
+               int data_len;           /* IPv4 data length */
+               struct iphdr *ih4;      /* pointer to IPv4 header */
+               struct icmphdr *icmp_hdr;   /* point to current ICMPv4 header struct */
+
+               ih4 = (struct iphdr *)skb->data; /* point to incoming packet's IPv4 header */
+
+               /* Check IPv4 Total Length */
+               if (skb->len != ntohs(ih4->tot_len)) {
+                       PDEBUG("siit_xmit(): Different skb_len %x and ip4 tot_len %x - packet dropped.\n",
+                                  skb->len, ih4->tot_len);
+                       siit_stats(dev)->tx_errors++;
+                       dev_kfree_skb(skb);
+                       return 0;
+               }
+
+               len = skb->len;     /* packet's total len */
+               hdr_len = (int)(ih4->ihl * 4); /* packet's header len */
+               data_len = len - hdr_len; /* packet's data len */
+
+               /* If DF == 0 */
+               if ( (ntohs(ih4->frag_off) & IP_DF) == 0 ) {
+                       /* If result IPv6 packet will be > 1280
+                          we need to fragment original IPv4 packet
+                       */
+                       if ( data_len > FRAG_BUFF_SIZE ) {
+                               /* call function that fragment packet and translate to IPv6 each fragment
+                                * and send to upper layer
+                                */
+                               if ( ip4_fragment(skb, len, hdr_len, dev, eth_h) == -1) {
+                                       siit_stats(dev)->tx_errors++;
+                               }
+                               /* Free incoming skb */
+                               dev_kfree_skb(skb);
+                               /* Device can accept a new packet */
+
+                               return 0;
+
+                       }
+               }
+               /* If DF == 1 && MF == 0 && Fragment Offset == 0
+                * we don't include fragment header
+                */
+               if ( ntohs(ih4->frag_off) == IP_DF )
+                       skb_delta = IP4_IP6_HDR_DIFF; /* delta is +20 */
+               else
+                       skb_delta = IP4_IP6_HDR_DIFF + IP6_FRAGMENT_SIZE; /* delta is +20 and +8 */
+
+               /* If it's ICMP, check is it included IP packet in it */
+               if ( ih4->protocol == IPPROTO_ICMP) {
+                       icmp_hdr = (struct icmphdr *) (skb->data+hdr_len); /* point to ICMPv4 header */
+                       if ( icmp_hdr->type != ICMP_ECHO && icmp_hdr->type != ICMP_ECHOREPLY) {
+                               /*
+                                * It's ICMP Error that has included IP packet
+                                * we'll add only +20 because we don't include Fragment Header
+                                * into translated included IP packet
+                                */
+                               skb_delta += IP4_IP6_HDR_DIFF;
+                       }
+               }
+
+               /* Allocate new sk_buff to compose translated packet */
+               skb2 = dev_alloc_skb(len+dev->hard_header_len+skb_delta);
+               if (!skb2) {
+                       printk(KERN_DEBUG "%s: alloc_skb failure - packet dropped.\n", dev->name);
+                       dev_kfree_skb(skb);
+                       siit_stats(dev)->rx_dropped++;
+
+                       return 0;
+               }
+               /* allocate skb->data portion = IPv4 packet len + ether header len
+                * + skb_delta (max = two times (diffirence between IPv4 header and
+                * IPv6 header + Frag Header), second for included packet,
+                * and copy to head of skb->data ether header from origin skb
+                */
+               memcpy(skb_put(skb2, len+dev->hard_header_len+skb_delta), (char *)eth_h, dev->hard_header_len);
+               /* correct ether header data, ether protocol field to ETH_P_IPV6 */
+               eth_h = (struct ethhdr *)skb2->data;
+               eth_h->h_proto = htons(ETH_P_IPV6);
+               skb_reset_mac_header(skb2);
+               /* remove ether header from new skb->data,
+                * NOTE! data will rest, pointer to data and data len will change
+                */
+               skb_pull(skb2,dev->hard_header_len);
+               /* set skb protocol to IPV6 */
+               skb2->protocol = htons(ETH_P_IPV6);
+
+               /* call translation function */
+               if (ip4_ip6(skb->data, len, skb2->data, 0) == -1 ) {
+                       dev_kfree_skb(skb);
+                       dev_kfree_skb(skb2);
+                       siit_stats(dev)->rx_errors++;
+
+                       return 0;
+               }
+       }
+       /*
+        * IPv6 paket
+        */
+       else if (ntohs(skb->protocol) == ETH_P_IPV6) {
+
+#ifdef SIIT_DEBUG
+               siit_print_dump(skb->data, sizeof(struct ipv6hdr), "siit: (in) ip6_hdr dump");
+#endif
+               /* packet len = skb->data len*/
+               len = skb->len;
+
+               /* call translation function */
+               if ((new_packet_len = ip6_ip4(skb->data, len, new_packet_buff, 0)) == -1 )
+               {
+                       PDEBUG("siit_xmit(): error translation ipv6->ipv4, packet dropped.\n");
+                       siit_stats(dev)->rx_dropped++;
+                       goto end;
+               }
+
+               /* Allocate new sk_buff to compose translated packet */
+               skb2 = dev_alloc_skb(new_packet_len + dev->hard_header_len);
+               if (!skb2) {
+                       printk(KERN_DEBUG "%s: alloc_skb failure, packet dropped.\n", dev->name);
+                       siit_stats(dev)->rx_dropped++;
+                       goto end;
+               }
+               memcpy(skb_put(skb2, new_packet_len + dev->hard_header_len), (char *)eth_h, dev->hard_header_len);
+               eth_h = (struct ethhdr *)skb2->data;
+               eth_h->h_proto = htons(ETH_P_IP);
+               skb_reset_mac_header(skb2);
+               skb_pull(skb2, dev->hard_header_len);
+               memcpy(skb2->data, new_packet_buff, new_packet_len);
+               skb2->protocol = htons(ETH_P_IP);
+       }
+       else {
+               PDEBUG("siit_xmit(): unsupported protocol family %x, packet dropped.\n", skb->protocol);
+               goto end;
+       }
+
+       /*
+        * Set needed fields in new sk_buff
+        */
+       skb2->pkt_type = PACKET_HOST;
+       skb2->dev = dev;
+       skb2->ip_summed = CHECKSUM_UNNECESSARY;
+
+       /* Add transmit statistic */
+       siit_stats(dev)->tx_packets++;
+       siit_stats(dev)->tx_bytes += skb2->len;
+
+       /* Send packet to upper layer protocol */
+       netif_rx(skb2);
+
+end:
+       dev_kfree_skb(skb);
+
+       return 0;
+}
+
+static bool header_ops_init = false;
+static struct header_ops siit_header_ops ____cacheline_aligned;
+
+static const struct net_device_ops siit_netdev_ops = {
+       .ndo_open               = siit_open,
+       .ndo_stop               = siit_release,
+       .ndo_start_xmit         = siit_xmit,
+};
+
+/*
+ * The init function initialize of the SIIT device..
+ * It is invoked by register_netdev()
+ */
+
+static void
+siit_init(struct net_device *dev)
+{
+       ether_setup(dev);    /* assign some of the fields */
+       random_ether_addr(dev->dev_addr);
+
+       /*
+        * Assign device function.
+        */
+       dev->netdev_ops = &siit_netdev_ops;
+       dev->flags           |= IFF_NOARP;     /* ARP not used */
+       dev->tx_queue_len = 10;
+
+       if (!header_ops_init) {
+               memcpy(&siit_header_ops, dev->header_ops, sizeof(struct header_ops));
+               siit_header_ops.cache = NULL;
+       }
+       dev->header_ops = &siit_header_ops;
+}
+
+/*
+ * Finally, the module stuff
+ */
+static struct net_device *siit_dev = NULL;
+
+int init_module(void)
+{
+       int res = -ENOMEM;
+       int priv_size;
+
+       priv_size = sizeof(struct header_ops);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+       siit_dev = alloc_netdev(priv_size, "siit%d", NET_NAME_UNKNOWN, siit_init);
+#else
+       siit_dev = alloc_netdev(priv_size, "siit%d", siit_init);
+#endif
+       if (!siit_dev)
+               goto err_alloc;
+
+       res = register_netdev(siit_dev);
+       if (res)
+               goto err_register;
+
+       return 0;
+
+err_register:
+       free_netdev(siit_dev);
+err_alloc:
+       printk(KERN_ERR "Error creating siit device: %d\n", res);
+       return res;
+}
+
+void cleanup_module(void)
+{
+       unregister_netdev(siit_dev);
+       free_netdev(siit_dev);
+}
+
+MODULE_LICENSE("GPL");
diff --git a/net/siit/src/siit.h b/net/siit/src/siit.h
new file mode 100644 (file)
index 0000000..47cf776
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * siit.h -- definitions for the SIIT module
+ *
+ *
+ */
+
+/*
+ * Constants
+ */
+
+/* SIIT_ETH control the name of SIIT interface:
+ * 0 - interface name is siit0,
+ * 1 - interface name is ethX.
+ */
+#define SIIT_ETH 0
+
+#define BUFF_SIZE 4096
+#define FRAG_BUFF_SIZE 1232     /* IPv6 max fragment size without IPv6 header 
+                                 * to fragmanet IPv4 if result IPv6 packet will be > 1280
+                                 */
+
+#define TRANSLATED_PREFIX 0x0000ffff /* third byte in IPv4-translated addr prefix */
+#define MAPPED_PREFIX 0x0000ffff     /* third byte in IPv4-mapped addr prefix */
+
+#define IP4_IP6_HDR_DIFF 20     /* diffirence between IPv4 and IPv6 headers */
+#define IP6_FRAGMENT_SIZE 8     /* size of Fragment Header */
+
+/* IPv6 header fields masks */
+#define IP6F_OFF_MASK       0xfff8  /* mask out offset from frag_off */
+#define IP6F_RESERVED_MASK  0x0006  /* reserved bits in frag_off */
+#define IP6F_MORE_FRAG      0x0001  /* more-fragments flag */
+
+
+
+/*
+ * Macros to help debugging
+ */
+
+#undef PDEBUG             /* undef it, just in case */
+#ifdef SIIT_DEBUG
+#  ifdef __KERNEL__
+     /* This one if debugging is on, and kernel space */
+#    define PDEBUG(fmt, args...) printk(KERN_DEBUG "siit: " fmt, ## args)
+#  else
+     /* This one for user space */
+#    define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
+#  endif
+#else
+#  define PDEBUG(fmt, args...) /* not debugging: nothing */
+#endif
+
+#undef PDEBUGG
+#define PDEBUGG(fmt, args...)
+
+
+
+
+
+
+
+
diff --git a/net/snort/Config.in b/net/snort/Config.in
new file mode 100644 (file)
index 0000000..433557c
--- /dev/null
@@ -0,0 +1,25 @@
+menu "Configuration"
+       depends on PACKAGE_snort
+
+config SNORT_MYSQL
+       bool "Enable MySQL support"
+       default n
+       help
+           This option enables support for logging to a MySQL database.
+           Disabled by default.
+
+config SNORT_PGSQL
+       bool "Enable PostgreSQL support"
+       default n
+       help
+           This option enables support for logging to a PostgreSQL database.
+           Disabled by default.
+
+config SNORT_LZMA
+       bool "Enable LZMA support"
+       default n
+       help
+           This option enables LZMA decompression.
+           Disabled by default.
+
+endmenu
index 2c948665cd9ffd636511facfd0cbe1ea4a2478bb..9b8fea7e764a0f90d3a3c9f91ebaf9cbf62b2233 100644 (file)
@@ -8,30 +8,31 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=snort
-PKG_VERSION:=2.9.7.0
-PKG_RELEASE:=1
+PKG_VERSION:=2.9.7.2
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/
-PKG_MD5SUM:=c2a45bc56441ee9456478f219dd8d1e2
+PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
 
 PKG_BUILD_DEPENDS:=librpc
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/snort/Default
+define Package/snort
   SUBMENU:=Firewall
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+libdaq +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib
+  DEPENDS:=+libdaq +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib +SNORT_MYSQL:libmysqlclient +SNORT_PGSQL:libpq +SNORT_PGSQL:libuuid +SNORT_LZMA:liblzma
   TITLE:=Lightweight Network Intrusion Detection System
   URL:=http://www.snort.org/
+  MENU:=1
 endef
 
-define Package/snort/Default/description
+define Package/snort/description
   Snort is an open source network intrusion detection and prevention system.
   It is capable of performing real-time traffic analysis, alerting, blocking
   and packet logging on IP networks.  It utilizes a combination of protocol
@@ -39,37 +40,8 @@ define Package/snort/Default/description
   attacks.
 endef
 
-define Package/snort
-  $(call Package/snort/Default)
-  VARIANT:=basic
-endef
-
-define Package/snort/description
-  $(call Package/snort/Default/description)
-endef
-
-define Package/snort-mysql
-  $(call Package/snort/Default)
-  DEPENDS+= +libmysqlclient
-  TITLE+= (MySQL)
-  VARIANT:=mysql
-endef
-
-define Package/snort-mysql/description
-  $(call Package/snort/Default/description)
-  This package contains snort with support for logging to a MySQL database.
-endef
-
-define Package/snort-pgsql
-  $(call Package/snort/Default)
-  DEPENDS+= +libpq +libuuid
-  TITLE+= (PostgreSQL)
-  VARIANT:=pgsql
-endef
-
-define Package/snort-pgsql/description
-  $(call Package/snort/Default/description)
-  This package contains snort with support for logging to a PostgreSQL database.
+define Package/snort/config
+       source "$(SOURCE)/Config.in"
 endef
 
 CONFIGURE_ARGS += \
@@ -85,6 +57,21 @@ CONFIGURE_ARGS += \
        --with-daq-libraries="$(STAGING_DIR)/usr/lib" \
        --disable-static-daq
 
+ifeq ($(CONFIG_SNORT_MYSQL),)
+CONFIGURE_ARGS += \
+       --without-mysql
+endif
+
+ifeq ($(CONFIG_PGSQL),)
+CONFIGURE_ARGS += \
+       --without-postgresql
+endif
+
+ifeq ($(CONFIG_SNORT_LZMA),)
+CONFIGURE_ARGS += \
+       --disable-lzma
+endif
+
 CONFIGURE_VARS += \
        CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
        LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
@@ -93,24 +80,6 @@ CONFIGURE_VARS += \
 MAKE_FLAGS += \
        extra_incl=""
 
-ifeq ($(BUILD_VARIANT),basic)
-  CONFIGURE_ARGS += \
-       --without-mysql \
-       --without-postgresql
-endif
-ifeq ($(BUILD_VARIANT),mysql)
-  CONFIGURE_VARS += \
-       mysql_has_reconnect=yes
-  CONFIGURE_ARGS += \
-       --with-mysql="$(STAGING_DIR)/usr" \
-       --without-postgresql
-endif
-ifeq ($(BUILD_VARIANT),pgsql)
-  CONFIGURE_ARGS += \
-       --without-mysql \
-       --with-postgresql="$(STAGING_DIR)/usr"
-endif
-
 define Build/InstallDev
        $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
        $(CP) \
@@ -135,12 +104,6 @@ define Package/snort/conffiles
 /etc/snort/snort.conf
 endef
 
-Package/snort-mysql/conffiles = $(Package/snort/conffiles)
-Package/snort-mysql/install = $(Package/snort/install)
-
-Package/snort-pgsql/conffiles = $(Package/snort/conffiles)
-Package/snort-pgsql/install = $(Package/snort/install)
-
 define Package/snort/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) \
@@ -198,5 +161,4 @@ define Package/snort/install
 endef
 
 $(eval $(call BuildPackage,snort))
-$(eval $(call BuildPackage,snort-mysql))
-$(eval $(call BuildPackage,snort-pgsql))
+
diff --git a/net/spawn-fcgi/Makefile b/net/spawn-fcgi/Makefile
new file mode 100644 (file)
index 0000000..54c9ab7
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=spawn-fcgi
+PKG_VERSION:=1.6.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://download.lighttpd.net/spawn-fcgi/releases-1.6.x/
+PKG_MD5SUM:=a67c098a50cd625fd12adf61b5dd4c32
+
+PKG_LICENSE:=BSD-3c
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/spawn-fcgi
+  SUBMENU:=Web Servers/Proxies
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Tool to spawn fastcgi applications
+  URL:=http://redmine.lighttpd.net/projects/spawn-fcgi
+endef
+
+define Package/spawn-fcgi/description
+       spawn-fcgi is used to spawn fastcgi applications
+endef
+
+define Package/spawn-fcgi/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/spawn-fcgi $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,spawn-fcgi))
index 79112227dec38adaf903e3dccc26a49fd33e8c10..3fa5e365b1d5ec97a05ee2049eb19fff6d1b9795 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sqm-scripts
 PKG_VERSION:=8
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_LICENSE:=GPLv2
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
@@ -20,7 +20,7 @@ define Package/sqm-scripts
   SECTION:=net
   CATEGORY:=Base system
   DEPENDS:=+tc +kmod-sched +kmod-ifb iptables +ip \
-       +iptables-mod-filter +iptables-mod-ipopt +iptables-mod-conntrack-extra
+       +iptables-mod-ipopt +iptables-mod-conntrack-extra
   TITLE:=SQM Scripts (QoS)
   PKGARCH:=all
   MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
index 99796021d944e2afc5c701e69846afa10637d645..439307e3103cd1355d97674e4fed8bfdf62d554b 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-[ "$ACTION" = ifup ] && /usr/lib/sqm/run.sh interface ${DEVICE}
+[ "$ACTION" = ifup ] && /usr/lib/sqm/run.sh start ${DEVICE}
index 70307a6e1e7365433de76bc96443ff7248db2af8..2a40afb5aa5a2fde618859fcd3b9f02591a52a16 100755 (executable)
@@ -4,7 +4,7 @@ START=50
 
 reload()
 {
-/usr/lib/sqm/run.sh
+/usr/lib/sqm/run.sh start
 }
 
 restart()
index 3411b8f31ec095ac8ec3d60e04f1ef40590fdc8d..a0b2c6ffde1230954c8a9fd627708cb020a5c11e 100644 (file)
@@ -253,8 +253,8 @@ get_target() {
        # either e.g. 100ms or auto
        CUR_TARGET_VALUE=$( echo ${CUR_TARGET} | grep -o -e \^'[[:digit:]]\+' )
        CUR_TARGET_UNIT=$( echo ${CUR_TARGET} | grep -o -e '[[:alpha:]]\+'\$ )
-#      [ ! -z "$CUR_TARGET" ] && sqm_logger "CUR_TARGET_VALUE: $CUR_TARGET_VALUE"
-#      [ ! -z "$CUR_TARGET" ] && sqm_logger "CUR_TARGET_UNIT: $CUR_TARGET_UNIT"
+       #[ ! -z "$CUR_TARGET" ] && sqm_logger "CUR_TARGET_VALUE: $CUR_TARGET_VALUE"
+       #[ ! -z "$CUR_TARGET" ] && sqm_logger "CUR_TARGET_UNIT: $CUR_TARGET_UNIT"
        
        AUTO_TARGET=
        UNIT_VALID=
@@ -271,14 +271,42 @@ get_target() {
                                        ;;
                            esac
                        fi
-                       case ${CUR_TARGET_UNIT} in
-                           auto|Auto|AUTO) 
+                       # empty field in GUI or undefined GUI variable now defaults to auto
+                       if [ -z "${CUR_TARGET_VALUE}" -a -z "${CUR_TARGET_UNIT}" ];
+                       then                    
                                if [ ! -z "${CUR_LINK_KBPS}" ];
                                then
                                    TMP_TARGET_US=$( adapt_target_to_slow_link $CUR_LINK_KBPS )
                                    TMP_INTERVAL_STRING=$( adapt_interval_to_slow_link $TMP_TARGET_US )
                                    CUR_TARGET_STRING="target ${TMP_TARGET_US}us ${TMP_INTERVAL_STRING}"
                                    AUTO_TARGET="1"
+                                   sqm_logger "get_target defaulting to auto." 
+                               else
+                                   sqm_logger "required link bandwidth in kbps not passed to get_target()." 
+                               fi
+                       fi
+                       # but still allow explicit use of the keyword auto for backward compatibility
+                        case ${CUR_TARGET_UNIT} in
+                            auto|Auto|AUTO)
+                                if [ ! -z "${CUR_LINK_KBPS}" ];
+                                then
+                                    TMP_TARGET_US=$( adapt_target_to_slow_link $CUR_LINK_KBPS )
+                                    TMP_INTERVAL_STRING=$( adapt_interval_to_slow_link $TMP_TARGET_US )
+                                    CUR_TARGET_STRING="target ${TMP_TARGET_US}us ${TMP_INTERVAL_STRING}"
+                                    AUTO_TARGET="1"
+                                else
+                                    sqm_logger "required link bandwidth in kbps not passed to get_target()."
+                                fi
+                            ;;
+                        esac
+                       
+                       case ${CUR_TARGET_UNIT} in
+                           default|Default|DEFAULT) 
+                               if [ ! -z "${CUR_LINK_KBPS}" ];
+                               then
+                                   CUR_TARGET_STRING=""        # return nothing so the default target is not over-ridden...
+                                   AUTO_TARGET="1"
+                                   #sqm_logger "get_target using qdisc default, no explicit target string passed."
                                else
                                    sqm_logger "required link bandwidth in kbps not passed to get_target()." 
                                fi
@@ -288,7 +316,7 @@ get_target() {
                            then
                            if [ -z "${CUR_TARGET_VALUE}" -o -z "${UNIT_VALID}" ];
                            then 
-                               [ -z "$AUTO_TARGET" ] && sqm_logger "${CUR_TARGET} is not a well formed tc target specifier; e.g.: 5ms (or s, us), or the string auto."
+                               [ -z "$AUTO_TARGET" ] && sqm_logger "${CUR_TARGET} is not a well formed tc target specifier; e.g.: 5ms (or s, us), or one of the strings auto or default."
                            fi
                        fi
                    ;;
index 968292bcd37061edfa0cf8e593e7b7ac53f16224..7aa20ddbabc313b100c063865fa12a0d6743c3fa 100755 (executable)
@@ -13,29 +13,39 @@ STOP=
 ACTIVE_STATE_PREFIX="SQM_active_on_"
 ACTIVE_STATE_FILE_DIR="/var/run/SQM"
 mkdir -p ${ACTIVE_STATE_FILE_DIR}
-PROTO_STATE_FILE_LIST=$( ls ${ACTIVE_STATE_FILE_DIR}/${ACTIVE_STATE_PREFIX}* 2> /dev/null )
+
+
+START_ON_IF=$2 # only process this interface
+# TODO if $2 is empty select all interfaces with running sqm instance
+if [ -z ${START_ON_IF} ] ;
+then
+    # find all interfaces with active sqm instance
+    logger -t SQM -s "Trying to start/stop SQM on all interfaces."
+    PROTO_STATE_FILE_LIST=$( ls ${ACTIVE_STATE_FILE_DIR}/${ACTIVE_STATE_PREFIX}* 2> /dev/null )
+else
+    # only try to restart the just hotplugged interface, so reduce the list of interfaces to stop to the specified one
+    logger -t SQM -s "Trying to start/stop SQM on interface ${START_ON_IF}"
+    PROTO_STATE_FILE_LIST=${ACTIVE_STATE_FILE_DIR}/${ACTIVE_STATE_PREFIX}${START_ON_IF}
+fi
+
+
 
 
 case ${1} in
+    start)
+       # just run through, same as passing no argument
+       ;;
     stop)
         logger -t SQM -s "run.sh stop"
        STOP=$1
         ;;
-    interface)
-       START_ON_IF=$2  # only process this interface
-       logger -t SQM -s "Trying to re-start SQM on interface ${START_ON_IF}"
-       # TODO if $2 is empty just bail...
-       if [ -z ${START_ON_IF} ] ;
-       then
-           logger -t SQM -s "Interface name missing, nothing to do, bailing out"
-           return 0
-       fi
-       # only try to restart the just hotplugged interface, so reduce the list of interfaces to stop to the specified one
-       PROTO_STATE_FILE_LIST=${ACTIVE_STATE_FILE_DIR}/${ACTIVE_STATE_PREFIX}${START_ON_IF}
-       ;;
 esac
 
 
+
+
+
+
 # the current uci config file does not necessarily contain sections for all interfaces with active
 # SQM instances, so use the ACTIVE_STATE_FILES to detect the interfaces on which to stop SQM.
 # Currently the .qos scripts start with stopping any existing traffic shaping so this should not
index e4481c9eac6cd609f315e8181ad526d7704cdeaf..5a2e0fac0f07feb44f9b3e80fed1a4ed05201d0d 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=strongswan
-PKG_VERSION:=5.2.2
-PKG_RELEASE:=2
+PKG_VERSION:=5.3.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
-PKG_MD5SUM:=7ee1a33060b2bde35be0f6d78a1d26d0
+PKG_MD5SUM:=c52d4228231c2025d9c320d0e9990327
 PKG_LICENSE:=GPL-2.0+
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 
@@ -407,7 +407,7 @@ endef
 
 define Plugin/updown/install
        $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{_updown,_updown_espmark} $(1)/usr/lib/ipsec/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/_updown $(1)/usr/lib/ipsec/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-updown.so $(1)/usr/lib/ipsec/plugins/
        $(INSTALL_DIR) $(1)/etc
        $(INSTALL_CONF) ./files/ipsec.user $(1)/etc/
@@ -435,7 +435,7 @@ $(eval $(call BuildPlugin,aes,AES crypto,))
 $(eval $(call BuildPlugin,af-alg,AF_ALG crypto interface to Linux Crypto API,+kmod-crypto-user))
 $(eval $(call BuildPlugin,agent,SSH agent signing,))
 $(eval $(call BuildPlugin,attr,file based config,))
-$(eval $(call BuildPlugin,attr-sql,SQL based config,+strongswan-mod-sql))
+$(eval $(call BuildPlugin,attr-sql,SQL based config,+strongswan-mod-sql +strongswan-charon))
 $(eval $(call BuildPlugin,blowfish,Blowfish crypto,))
 $(eval $(call BuildPlugin,ccm,CCM AEAD wrapper crypto,))
 $(eval $(call BuildPlugin,cmac,CMAC crypto,))
diff --git a/net/strongswan/patches/001-ikev1-fix.patch b/net/strongswan/patches/001-ikev1-fix.patch
deleted file mode 100644 (file)
index a48b0ac..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From 627f870ee6256b4b2e36e9ca768fc578febbccef Mon Sep 17 00:00:00 2001
-From: Tobias Brunner <tobias@strongswan.org>
-Date: Tue, 10 Feb 2015 19:03:44 +0100
-Subject: [PATCH] ikev1: Set protocol ID and SPIs in INITIAL-CONTACT
- notification payloads
-
-The payload we sent before is not compliant with RFC 2407 and thus some
-peers might abort negotiation (e.g. with an INVALID-PROTOCOL-ID error).
----
- src/libcharon/sa/ikev1/tasks/main_mode.c | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/src/libcharon/sa/ikev1/tasks/main_mode.c b/src/libcharon/sa/ikev1/tasks/main_mode.c
-index 5065e70ffc25..3ea4a2a85e4f 100644
---- a/src/libcharon/sa/ikev1/tasks/main_mode.c
-+++ b/src/libcharon/sa/ikev1/tasks/main_mode.c
-@@ -213,6 +213,10 @@ static void add_initial_contact(private_main_mode_t *this, message_t *message,
- {
-       identification_t *idr;
-       host_t *host;
-+      notify_payload_t *notify;
-+      ike_sa_id_t *ike_sa_id;
-+      u_int64_t spi_i, spi_r;
-+      chunk_t spi;
-       idr = this->ph1->get_id(this->ph1, this->peer_cfg, FALSE);
-       if (idr && !idr->contains_wildcards(idr))
-@@ -224,8 +228,15 @@ static void add_initial_contact(private_main_mode_t *this, message_t *message,
-                       if (!charon->ike_sa_manager->has_contact(charon->ike_sa_manager,
-                                                                               idi, idr, host->get_family(host)))
-                       {
--                              message->add_notify(message, FALSE, INITIAL_CONTACT_IKEV1,
--                                                                      chunk_empty);
-+                              notify = notify_payload_create_from_protocol_and_type(
-+                                                              PLV1_NOTIFY, PROTO_IKE, INITIAL_CONTACT_IKEV1);
-+                              ike_sa_id = this->ike_sa->get_id(this->ike_sa);
-+                              spi_i = ike_sa_id->get_initiator_spi(ike_sa_id);
-+                              spi_r = ike_sa_id->get_responder_spi(ike_sa_id);
-+                              spi = chunk_cata("cc", chunk_from_thing(spi_i),
-+                                                               chunk_from_thing(spi_r));
-+                              notify->set_spi_data(notify, spi);
-+                              message->add_payload(message, (payload_t*)notify);
-                       }
-               }
-       }
--- 
-1.9.1
-
index d96e84492e1d7f5f30eb7bfcc350d2aaceb73bef..6835e02fe936a2e4fb7e781add8aa9133320fcd7 100644 (file)
@@ -13,5 +13,5 @@
 +
 +[ -e /etc/ipsec.user ] && . /etc/ipsec.user "$1"
  
- # things that this script gets (from ipsec_pluto(8) man page)
- #
+ #      PLUTO_VERSION
+ #              indicates  what  version of this interface is being
diff --git a/net/stunnel/Makefile b/net/stunnel/Makefile
new file mode 100644 (file)
index 0000000..0b928b7
--- /dev/null
@@ -0,0 +1,77 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=stunnel
+PKG_VERSION:=5.14
+PKG_RELEASE:=1
+
+PKG_LICENSE:=GPL-2.0+
+PKG_MAINTAINER:=Michael Haas <haas@computerlinguist.org>
+PKG_LICENSE_FILES:=COPYING COPYRIGHT.GPL
+
+PKG_SOURCE_URL:=http://stunnel.cybermirror.org/archive/5.x/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=e716501960dc6856d80f92547298f724
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/stunnel
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libopenssl
+  TITLE:=SSL TCP Wrapper
+  URL:=http://www.stunnel.org/
+endef
+
+define Package/stunnel/description
+       Stunnel is a program that allows you to encrypt arbitrary TCP
+       connections inside SSL (Secure Sockets Layer) available on both Unix
+       and Windows. Stunnel can allow you to secure non-SSL aware daemons and
+       protocols (like POP, IMAP, LDAP, etc) by having Stunnel provide the
+       encryption, requiring no changes to the daemon's code.
+endef
+
+define Package/stunnel/conffiles
+/etc/stunnel/stunnel.conf
+endef
+
+
+CONFIGURE_ARGS+= \
+       --with-random=/dev/urandom \
+       --with-threads=fork \
+       --with-ssl=$(STAGING_DIR)/usr \
+       --disable-libwrap \
+       --disable-systemd
+
+ifeq ($(CONFIG_IPV6),n)
+CONFIGURE_ARGS+= \
+       --disable-ipv6
+endif
+
+define Build/Compile
+       mkdir -p $(PKG_INSTALL_DIR)/etc/stunnel
+       echo '#dummy' > $(PKG_INSTALL_DIR)/etc/stunnel/stunnel.pem
+       $(call Build/Compile/Default)
+endef
+
+define Package/stunnel/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stunnel $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/stunnel
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/stunnel/libstunnel.so $(1)/usr/lib/stunnel/
+       $(INSTALL_DIR) $(1)/etc/stunnel
+       $(INSTALL_CONF) ./files/stunnel.conf $(1)/etc/stunnel/stunnel.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/stunnel.init $(1)/etc/init.d/stunnel
+endef
+
+$(eval $(call BuildPackage,stunnel))
diff --git a/net/stunnel/files/stunnel.conf b/net/stunnel/files/stunnel.conf
new file mode 100644 (file)
index 0000000..2f10800
--- /dev/null
@@ -0,0 +1,45 @@
+; Drop privileges
+setuid = nobody 
+setgid = nogroup
+
+; When running under procd, stay in foreground
+foreground = yes
+
+; Don't log to stderr, use syslog
+syslog = yes
+
+; 1-7. Use 7 for greatest verbosity
+;debug = 5
+
+; Starting here, enter your services or uncomment the examples
+
+; Example:
+; If your local httpd does not support HTTPS, use stunnel in remote
+; mode to forward TLS connections coming in on port 443 to non-TLS
+; on port 80.
+; Make sure that the cert is available.
+;[httpd]
+;accept = 443
+;connect = 127.0.0.1:80
+;cert = /etc/stunnel/stunnel.pem
+
+; Example:
+; If your local email client does not support TLS,
+; use stunnel in client mode to forward non-TLS connections on
+; port 143 to TLS-enabled servername:993.
+;[imap]
+;client = yes
+;accept = 143
+;connect = servername:993
+; Disable peer verification - be sure to understand the limitations of peer
+; verification in stunnel when enabling.
+;verify = 0
+
+; Default client section:
+; stunnel requires at least one section to start successfully.
+; You can safely remove this section once you have configured
+; your own. We use client mode here as server requires a certificate.
+[dummy]
+client = yes
+accept = localhost:6000
+connect = localhost:6001
diff --git a/net/stunnel/files/stunnel.init b/net/stunnel/files/stunnel.init
new file mode 100644 (file)
index 0000000..e622205
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2008 OpenWrt.org
+
+START=90
+USE_PROCD=1
+
+start_service() {
+       procd_open_instance
+       procd_set_param command /usr/bin/stunnel /etc/stunnel/stunnel.conf
+       procd_set_param respawn # respawn automatically if something died
+       procd_close_instance
+}
diff --git a/net/stunnel/patches/010_fix_getnameinfo.patch b/net/stunnel/patches/010_fix_getnameinfo.patch
new file mode 100644 (file)
index 0000000..03acfaf
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/src/prototypes.h
++++ b/src/prototypes.h
+@@ -590,7 +590,7 @@ extern GETNAMEINFO s_getnameinfo;
+ #endif /* USE_WIN32 */
+-int getnameinfo(const struct sockaddr *, int, char *, int, char *, int, int);
++int getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, unsigned int);
+ #endif /* !defined HAVE_GETNAMEINFO */
+--- a/src/resolver.c
++++ b/src/resolver.c
+@@ -538,8 +538,9 @@ const char *s_gai_strerror(int err) {
+ /* implementation is limited to functionality needed by stunnel */
+ #ifndef HAVE_GETNAMEINFO
+-int getnameinfo(const struct sockaddr *sa, int salen,
+-    char *host, int hostlen, char *serv, int servlen, int flags) {
++int getnameinfo(const struct sockaddr *sa, socklen_t salen,
++    char *host, socklen_t hostlen, char *serv, socklen_t servlen,
++    unsigned int flags) {
+ #if defined(USE_WIN32) && !defined(_WIN32_WCE)
+     if(s_getnameinfo)
diff --git a/net/stunnel/patches/011_disable_ssp_linking.patch b/net/stunnel/patches/011_disable_ssp_linking.patch
new file mode 100644 (file)
index 0000000..459c016
--- /dev/null
@@ -0,0 +1,140 @@
+--- a/configure
++++ b/configure
+@@ -5646,66 +5646,66 @@ done
+-for flag in -fstack-protector; do
+-  as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
+-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
+-if eval \${$as_CACHEVAR+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-
+-  ax_check_save_flags=$CFLAGS
+-  CFLAGS="$CFLAGS  $flag"
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-int
+-main ()
+-{
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-  eval "$as_CACHEVAR=yes"
+-else
+-  eval "$as_CACHEVAR=no"
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-  CFLAGS=$ax_check_save_flags
+-fi
+-eval ac_res=\$$as_CACHEVAR
+-             { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+-$as_echo "$ac_res" >&6; }
+-if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
+-  if ${CFLAGS+:} false; then :
+-  case " $CFLAGS " in
+-    *" $flag "*)
+-      { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5
+-  (: CFLAGS already contains $flag) 2>&5
+-  ac_status=$?
+-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+-  test $ac_status = 0; }
+-      ;;
+-    *)
+-      { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5
+-  (: CFLAGS="$CFLAGS $flag") 2>&5
+-  ac_status=$?
+-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+-  test $ac_status = 0; }
+-      CFLAGS="$CFLAGS $flag"
+-      ;;
+-   esac
+-else
+-  CFLAGS="$flag"
+-fi
+-
+-else
+-  :
+-fi
+-
+-done
++#for flag in -fstack-protector; do
++#  as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
++#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
++#$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
++#if eval \${$as_CACHEVAR+:} false; then :
++#  $as_echo_n "(cached) " >&6
++#else
++#
++#  ax_check_save_flags=$CFLAGS
++#  CFLAGS="$CFLAGS  $flag"
++#  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++#/* end confdefs.h.  */
++
++#int
++#main ()
++#{
++#
++#  ;
++#  return 0;
++#}
++#_ACEOF
++#if ac_fn_c_try_compile "$LINENO"; then :
++#  eval "$as_CACHEVAR=yes"
++#else
++#  eval "$as_CACHEVAR=no"
++#fi
++#rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++#  CFLAGS=$ax_check_save_flags
++#fi
++#eval ac_res=\$$as_CACHEVAR
++#            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
++#$as_echo "$ac_res" >&6; }
++#if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
++#  if ${CFLAGS+:} false; then :
++#  case " $CFLAGS " in
++#    *" $flag "*)
++#      { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5
++#  (: CFLAGS already contains $flag) 2>&5
++#  ac_status=$?
++#  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++#  test $ac_status = 0; }
++#      ;;
++#    *)
++#      { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5
++#  (: CFLAGS="$CFLAGS $flag") 2>&5
++#  ac_status=$?
++#  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++#  test $ac_status = 0; }
++#      CFLAGS="$CFLAGS $flag"
++#      ;;
++#   esac
++#else
++#  CFLAGS="$flag"
++#fi
++#
++#else
++#  :
++#fi
++#
++#done
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,7 +71,7 @@ AX_APPEND_COMPILE_FLAGS([-Wformat=2])
+ AX_APPEND_COMPILE_FLAGS([-Wconversion])
+ AX_APPEND_COMPILE_FLAGS([-Wno-long-long])
+ AX_APPEND_COMPILE_FLAGS([-Wno-deprecated-declarations])
+-AX_APPEND_COMPILE_FLAGS([-fstack-protector])
++#AX_APPEND_COMPILE_FLAGS([-fstack-protector])
+ AX_APPEND_COMPILE_FLAGS([-fPIE])
+ AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2])
+ AX_APPEND_LINK_FLAGS([-fPIE -pie])
index 6ffcf43bd21fcbf6e172c30b1b59d42a6005f297..8550f83581e7e254726df041f4d7063a066fb476 100644 (file)
@@ -41,7 +41,7 @@ endef
 define Package/tor
 $(call Package/tor/Default)
   TITLE:=An anonymous Internet communication system
-  DEPENDS:=+libevent2 +libopenssl +libpthread +librt +SSP_SUPPORT:libssp
+  DEPENDS:=+libevent2 +libopenssl +libpthread +librt
 endef
 
 define Package/tor/description
index df74fd566e75a5cac19547208b4029763972f9c9..1facadaf8dbb463b1e9b76abcbeb02761fefc165 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=transmission
 PKG_VERSION:=2.84
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://download-origin.transmissionbt.com/files/ http://mirrors.m0k.org/transmission/files
index d4f82fc2cd16a807bc98995d755ecad28dc8286b..e46a1ad98fe7bd5412049475edc5a7c6c25bb84c 100644 (file)
@@ -1,12 +1,14 @@
---- a/libtransmission/fdlimit.c        2014-07-01 20:08:59.000000000 +0300
-+++ b/libtransmission/fdlimit.c        2014-07-13 13:30:17.000000000 +0300
-@@ -22,7 +22,8 @@
+--- a/libtransmission/fdlimit.c
++++ b/libtransmission/fdlimit.c
+@@ -22,11 +22,6 @@
   #include <fcntl.h>
  #endif
+
 -#ifdef HAVE_FALLOCATE64
-+/* no need to define fallocate64 in glibc/eglibc case */
-+#if defined(__UCLIBC__) && (HAVE_FALLOCATE64)
-   /* FIXME can't find the right #include voodoo to pick up the declaration.. */
-   extern int fallocate64 (int fd, int mode, uint64_t offset, uint64_t len);
+-  /* FIXME can't find the right #include voodoo to pick up the declaration.. */
+-  extern int fallocate64 (int fd, int mode, uint64_t offset, uint64_t len);
+-#endif
+-
+ #ifdef HAVE_XFS_XFS_H
+  #include <xfs/xfs.h>
  #endif
diff --git a/net/transmission/patches/030-fix-musl-build.patch b/net/transmission/patches/030-fix-musl-build.patch
new file mode 100644 (file)
index 0000000..badf673
--- /dev/null
@@ -0,0 +1,34 @@
+Index: transmission-2.84/libtransmission/bitfield.c
+===================================================================
+--- transmission-2.84.orig/libtransmission/bitfield.c
++++ transmission-2.84/libtransmission/bitfield.c
+@@ -7,6 +7,8 @@
+  * $Id: bitfield.c 14302 2014-06-29 01:42:38Z jordan $
+  */
++#define __NEED_ssize_t
++
+ #include <assert.h>
+ #include <stdlib.h> /* realloc () */
+ #include <string.h> /* memset */
+@@ -15,6 +17,7 @@
+ #include "bitfield.h"
+ #include "utils.h" /* tr_new0 () */
++
+ const tr_bitfield TR_BITFIELD_INIT = { NULL, 0, 0, 0, false, false };
+ /****
+Index: transmission-2.84/libtransmission/fdlimit.h
+===================================================================
+--- transmission-2.84.orig/libtransmission/fdlimit.h
++++ transmission-2.84/libtransmission/fdlimit.h
+@@ -11,6 +11,8 @@
+  #error only libtransmission should #include this header.
+ #endif
++#define __NEED_off_t
++
+ #include "transmission.h"
+ #include "net.h"
index a04aca633cb66b603f5e3318a75e8966ed6a2ae0..bc54bb75f3cdaa955282204dacb58e600106e7ec 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010-2014 OpenWrt.org
+# Copyright (C) 2010-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unbound
-PKG_VERSION:=1.5.1
+PKG_VERSION:=1.5.3
 PKG_RELEASE:=1
 
 PKG_LICENSE:=BSD-3-Clause
@@ -17,7 +17,7 @@ PKG_MAINTAINER:=Michael Hanselmann <public@hansmi.ch>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.unbound.net/downloads
-PKG_MD5SUM:=ed4c46476dcfb8a507cc08b1ba12a8f1
+PKG_MD5SUM:=1e95fdcbaaf5dc87432d898006a5eb13
 
 PKG_BUILD_DEPENDS:=libexpat
 PKG_BUILD_PARALLEL:=1
index 0d53615e2b93eaca0813ad2d0c1aba98abdb11db..a795532c0f227da6665b78b8bcc8321b3be0e065 100644 (file)
@@ -1,3 +1,5 @@
+diff --git a/doc/example.conf.in b/doc/example.conf.in
+index 60ed5c8..abd85f9 100644
 --- a/doc/example.conf.in
 +++ b/doc/example.conf.in
 @@ -38,6 +38,8 @@ server:
@@ -66,7 +68,7 @@
  
        # the time to live (TTL) value lower bound, in seconds. Default 0.
        # If more than an hour could easily give trouble due to stale data.
-@@ -143,9 +154,11 @@ server:
+@@ -146,9 +157,11 @@ server:
        # the number of slabs must be a power of 2.
        # more slabs reduce lock contention, but fragment memory usage.
        # infra-cache-slabs: 4
@@ -78,7 +80,7 @@
  
        # Enable IPv4, "yes" or "no".
        # do-ip4: yes
-@@ -178,6 +191,8 @@ server:
+@@ -181,6 +194,8 @@ server:
        # access-control: ::0/0 refuse
        # access-control: ::1 allow
        # access-control: ::ffff:127.0.0.1 allow
@@ -87,7 +89,7 @@
  
        # if given, a chroot(2) is done to the given directory.
        # i.e. you can chroot to the working directory, for example,
-@@ -208,6 +223,7 @@ server:
+@@ -211,6 +226,7 @@ server:
        # and the given username is assumed. Default is user "unbound".
        # If you give "" no privileges are dropped.
        # username: "@UNBOUND_USERNAME@"
@@ -95,7 +97,7 @@
  
        # the working directory. The relative files in this config are 
        # relative to this directory. If you give "" the working directory
-@@ -230,10 +246,12 @@ server:
+@@ -233,10 +249,12 @@ server:
  
        # the pid file. Can be an absolute path outside of chroot/work dir.
        # pidfile: "@UNBOUND_PIDFILE@"
  
        # enable to not answer id.server and hostname.bind queries.
        # hide-identity: no
-@@ -256,12 +274,15 @@ server:
+@@ -259,12 +277,15 @@ server:
        #       positive value: fetch that many targets opportunistically.
        # Enclose the list of numbers between quotes ("").
        # target-fetch-policy: "3 2 1 0 0"
  
        # Harden against out of zone rrsets, to avoid spoofing attempts. 
        # harden-glue: yes
-@@ -342,7 +363,7 @@ server:
+@@ -345,7 +366,7 @@ server:
        # you start unbound (i.e. in the system boot scripts).  And enable:
        # Please note usage of unbound-anchor root anchor is at your own risk
        # and under the terms of our LICENSE (see that file in the source).
  
        # File with DLV trusted keys. Same format as trust-anchor-file.
        # There can be only one DLV configured, it is trusted from root down.
-@@ -428,15 +449,18 @@ server:
+@@ -431,15 +452,18 @@ server:
        # the amount of memory to use for the key cache.
        # plain value in bytes or you can append k, m or G. default is "4Mb". 
        # key-cache-size: 4m
        # plain value in bytes or you can append k, m or G. default is "1Mb". 
        # neg-cache-size: 1m
 +      neg-cache-size: 10k
-       
        # By default, for a number of zones a small default 'nothing here'
        # reply is built-in.  Query traffic is thus blocked.  If you
index c132622014c342ccceed4bd8d80b08b996f0be24..feb197dfcbb3a35c77b2feb08da5049815153a6f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2014 OpenWrt.org
+# Copyright (C) 2008-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,14 +9,16 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wavemon
 PKG_VERSION:=0.7.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://eden-feed.erg.abdn.ac.uk/wavemon/stable-releases
-PKG_MD5SUM:=c60e25feb8b1785cf14371556f0613f4
+PKG_SOURCE:=v$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/uoaerg/wavemon/archive
+PKG_MD5SUM:=cd0049f174745d32b4fdf3b63d897bad
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
 
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -24,11 +26,10 @@ include $(INCLUDE_DIR)/package.mk
 define Package/wavemon
   SECTION:=net
   CATEGORY:=Network
-  PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
   TITLE:=N-curses based wireless network devices monitor
   DEPENDS:=+libncurses +libpthread
   SUBMENU:=wireless
-  URL:=http://eden-feed.erg.abdn.ac.uk/wavemon/
+  URL:=https://github.com/uoaerg/wavemon/releases
 endef
 
 define Package/wavemon/description
@@ -48,7 +49,7 @@ MAKE_FLAGS += \
 
 define Package/wavemon/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/wavemon $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wavemon $(1)/usr/bin/
 endef
 
 $(eval $(call BuildPackage,wavemon))
index e8f71b77982071b31a5d03b11457d785b6fca202..a146a01ef737a53613c5eac591d39d63747ba529 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2014 OpenWrt.org
+# Copyright (C) 2007-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wget
-PKG_VERSION:=1.16.2
+PKG_VERSION:=1.16.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=50b67a11971ecc6d142e634e8436fc0f
+PKG_MD5SUM:=d2e4455781a70140ae83b54ca594ce21
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
diff --git a/net/wifidog/Makefile b/net/wifidog/Makefile
new file mode 100644 (file)
index 0000000..ade7606
--- /dev/null
@@ -0,0 +1,103 @@
+#
+# Copyright (C) 2006,2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=wifidog
+PKG_VERSION:=1.2.1
+PKG_RELEASE=1
+
+
+PKG_LICENSE:=GPL-2.0
+# Note: Packaging is maintained upstream at
+# https://github.com/wifidog/packages
+PKG_MAINTAINER:=Michael Haas <haas@computerlinguist.org>
+PKG_LICENSE_FILES:=COPYING
+
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/wifidog/wifidog-gateway.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=1.2.1
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_FIXUP:=autoreconf
+# do not run make install
+PKG_INSTALL:=0
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/wifidog/Default
+  SUBMENU:=Captive Portals
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iptables-mod-extra +iptables-mod-ipopt +iptables-mod-nat-extra +libpthread
+  TITLE:=A wireless captive portal solution
+  URL:=http://www.wifidog.org
+endef
+
+define Package/wifidog
+$(call Package/wifidog/Default)
+  VARIANT:=normal
+endef
+
+define Package/wifidog-tls
+$(call Package/wifidog/Default)
+  DEPENDS+= +libcyassl
+  VARIANT:=tls
+endef
+
+
+define Package/wifidog/description
+       The Wifidog project is a complete and embeddable captive
+       portal solution for wireless community groups or individuals
+       who wish to open a free Hotspot while still preventing abuse
+       of their Internet connection.
+endef
+
+define Package/wifidog-tls/description
+$(call Package/wifidog/description)
+
+This variant can talk TLS to the auth server.
+endef
+
+define Package/wifidog/conffiles
+/etc/wifidog.conf
+endef
+
+Package/wifidog-tls/conffiles = $(Package/wifidog/conffiles)
+
+
+define Package/wifidog/configure
+       $(call Build/Configure/Default)
+endef
+
+ifeq ($(BUILD_VARIANT),tls)
+
+CONFIGURE_ARGS += \
+  --enable-cyassl
+
+endif
+
+define Package/wifidog/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wifidog $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wdctl $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhttpd.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/wifidog.conf $(1)/etc/
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/wifidog-msg.html $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/wifidog.init $(1)/etc/init.d/wifidog
+endef
+
+Package/wifidog-tls/install = $(Package/wifidog/install)
+
+$(eval $(call BuildPackage,wifidog))
+$(eval $(call BuildPackage,wifidog-tls))
diff --git a/net/wifidog/files/wifidog.init b/net/wifidog/files/wifidog.init
new file mode 100644 (file)
index 0000000..6ebf64f
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=65
+
+USE_PROCD=1
+
+EXTRA_COMMANDS="status"
+EXTRA_HELP="        status Print the status of the service"
+
+start_service() {
+    procd_open_instance
+    # -s: log to syslog
+    # -f: run in foreground
+    procd_set_param command /usr/bin/wifidog -s -f
+    procd_set_param respawn # respawn automatically if something died
+    procd_set_param file /etc/wifidog.conf
+    procd_close_instance
+}
+
+status() {
+    /usr/bin/wdctl status
+}
diff --git a/net/xl2tpd/patches/120-no-bsd-signal-in-musl.patch b/net/xl2tpd/patches/120-no-bsd-signal-in-musl.patch
new file mode 100644 (file)
index 0000000..dba544c
--- /dev/null
@@ -0,0 +1,13 @@
+Index: xl2tpd-1.3.6/xl2tpd.c
+===================================================================
+--- xl2tpd-1.3.6.orig/xl2tpd.c
++++ xl2tpd-1.3.6/xl2tpd.c
+@@ -30,7 +30,7 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <time.h>
+-#if (__GLIBC__ < 2)
++#if defined (__GLIBC__) && (__GLIBC__ < 2)
+ # if defined(FREEBSD) || defined(OPENBSD)
+ #  include <sys/signal.h>
+ # elif defined(LINUX)
index 9681c47333ee7237a270f3ddcd9d3f6104ab5f28..8e39a380a237a738f859d4a1a1222db65a334f1d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=znc
 PKG_VERSION:=1.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://znc.in/releases \
@@ -20,6 +20,7 @@ PKG_MAINTAINER:=Jonas Gorski <jogo@openwrt.org>
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
 
+PKG_USE_MIPS16:=0
 PKG_BUILD_PARALLEL:=1
 
 
diff --git a/sound/pianod/Makefile b/sound/pianod/Makefile
new file mode 100644 (file)
index 0000000..0c66894
--- /dev/null
@@ -0,0 +1,110 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pianod
+PKG_VERSION:=173
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://deviousfish.com/Downloads/pianod/
+PKG_MD5SUM:=be0cec19ea6df1c4bc6c1cac8e253445
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=MIT VARIOUS
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pianod
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+libao +libfaad2 +libmad +libpolarssl +libjson-c +libgcrypt +libpthread
+  TITLE:=Pandora radio daemon
+  USERID:=pianod=88:pianod=88
+  URL:=http://deviousfish.com/pianod/
+endef
+
+define Package/pianod/description
+  pianod is a Pandora music player client with line-oriented and Websocket control interfaces.
+  A simple protocol makes for easy clients, mix scripting, integration with a
+  home automation system, use as multiple-user music system for home or office.
+  Documentation and configuration information can be found at:
+      http://deviousfish.com/pianod/
+endef
+
+define Package/pianod-client
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+pianod
+  TITLE:=Pandora radio daemon WebUI
+  URL:=http://deviousfish.com/pianod/
+endef
+
+define Package/pianod-client/description
+  Web client UI and remote player viewer for pianod
+  Examples --- (Note: The viewer.* files need not be on the pianod host)
+  Main interface: http://pianod-host:4446/pianod
+  Remote viewer: file:///<path>/viewer.html?server=pianod-host:4446  --or--
+                 http://pianod-host:4446/pianod/viewer.html?server=pianod-host:4446
+endef
+
+CONFIGURE_ARGS+= --with-polarssl
+
+PIANOD_CLIENT:=pianod-client-compiled-51.tar.gz
+
+define Download/pianod-client
+  URL:=$(PKG_SOURCE_URL)
+  FILE:=$(PIANOD_CLIENT)
+  MD5SUM:=abbdee5627bcee6a00c8304da8b4e2e7
+endef
+
+define Package/pianod/conffiles
+/etc/pianod/startscript
+/etc/pianod/users
+endef
+
+define Build/Prepare
+    $(call Build/Prepare/Default)
+    ifneq ($(CONFIG_PACKAGE_pianod-client),)
+       $(eval $(call Download,pianod-client))
+       mkdir -p $(PKG_BUILD_DIR)/pianod-client
+       $(TAR) -xf $(DL_DIR)/$(PIANOD_CLIENT) --strip=1 -C $(PKG_BUILD_DIR)/pianod-client
+    endif
+endef
+
+define Package/pianod-client/Configure
+endef
+
+define Package/pianod-client/Compile
+endef
+
+define Package/pianod/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pianod $(1)/usr/bin/
+# These scripts need ksh (install mksh and link)
+#      $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/piano $(1)/usr/bin/
+#      $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/runmix $(1)/usr/bin/
+
+       $(INSTALL_DIR) $(1)/etc/pianod
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/contrib/startscript-example $(1)/etc/pianod/startscript
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/pianod.init $(1)/etc/init.d/pianod
+endef
+
+define Package/pianod-client/install
+       $(INSTALL_DIR) $(1)/www/pianod
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/pianod-client/*.{html,js,gif,jpeg,css} $(1)/www/pianod/
+endef
+
+$(eval $(call BuildPackage,pianod))
+$(eval $(call BuildPackage,pianod-client))
diff --git a/sound/pianod/files/pianod.init b/sound/pianod/files/pianod.init
new file mode 100644 (file)
index 0000000..b232944
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+NAME=pianod
+START=95
+
+USE_PROCD=1
+
+PD_USER=$NAME
+PD_STARTSCRIPT=/etc/$NAME/startscript
+PD_PASSWDFILE=/etc/$NAME/users
+PD_WEBUI=/www/$NAME
+
+start_service() {
+       # Take group ownership of audio devices
+       chown root:$NAME /dev/snd/* /dev/mixer /dev/dsp
+       chmod 664 /dev/snd/* /dev/mixer /dev/dsp
+
+       procd_open_instance
+
+       procd_set_param command "/usr/bin/$NAME"
+
+       procd_append_param command -n $PD_USER
+       procd_append_param command -i "$PD_STARTSCRIPT"
+       procd_append_param command -u "$PD_PASSWDFILE"
+       [ -d "$PD_WEBUI" ] && procd_append_param command -c "$PD_WEBUI"
+       # No HTTPS support without certificates
+       procd_append_param command -s 0
+
+       procd_close_instance
+}
+
+# Wait for service to exit and release sockets
+reload_service() {
+       stop
+       sleep 2
+       start
+}
+
+restart() {
+       reload_service
+}
diff --git a/sound/pianod/patches/005-Fix_IPV6_socket_handling.patch b/sound/pianod/patches/005-Fix_IPV6_socket_handling.patch
new file mode 100644 (file)
index 0000000..883495a
--- /dev/null
@@ -0,0 +1,75 @@
+--- a/src/libwaitress/waitress.c
++++ b/src/libwaitress/waitress.c
+@@ -805,34 +805,37 @@ static WaitressReturn_t WaitressConnect
+                       int pollres;
+                       /* we need shorter timeouts for connect() */
+-                      fcntl (sock, F_SETFL, O_NONBLOCK);
++                      pollres = fcntl (sock, F_SETFL, O_NONBLOCK);
++                      assert (pollres != -1);
+-                      /* increase socket receive buffer */
+-                      const int sockopt = 256*1024;
+-                      setsockopt (sock, SOL_SOCKET, SO_RCVBUF, &sockopt,
+-                                      sizeof (sockopt));
+-
+-                      /* non-blocking connect will return immediately */
+-                      connect (sock, gacurr->ai_addr, gacurr->ai_addrlen);
+-
+-                      pollres = WaitressPollLoop (sock, POLLOUT, waith->timeout);
+-                      if (pollres == 0) {
+-                              ret = WAITRESS_RET_TIMEOUT;
+-                      } else if (pollres == -1) {
+-                              ret = WAITRESS_RET_ERR;
+-                      } else {
+-                              /* check connect () return value */
+-                              socklen_t pollresSize = sizeof (pollres);
+-                              getsockopt (sock, SOL_SOCKET, SO_ERROR, &pollres,
+-                                              &pollresSize);
+-                              if (pollres != 0) {
+-                                      ret = WAITRESS_RET_CONNECT_REFUSED;
++                      if (connect (sock, gacurr->ai_addr, gacurr->ai_addrlen) != -1) {
++                              /* working */
++                              waith->request.sockfd = sock;
++                              break;
++                      } else if (errno == EINPROGRESS) {
++                              /* wait for connect to succeed */
++                              pollres = WaitressPollLoop (sock, POLLOUT, waith->timeout);
++                              if (pollres == 0) {
++                                      ret = WAITRESS_RET_TIMEOUT;
++                              } else if (pollres == -1) {
++                                      ret = WAITRESS_RET_ERR;
+                               } else {
+-                                      /* this one is working */
+-                                      waith->request.sockfd = sock;
+-                                      break;
++                                      /* check connect () return value */
++                                      socklen_t pollresSize = sizeof (pollres);
++                                      getsockopt (sock, SOL_SOCKET, SO_ERROR, &pollres,
++                                                      &pollresSize);
++                                      if (pollres != 0) {
++                                              ret = WAITRESS_RET_CONNECT_REFUSED;
++                                      } else {
++                                              /* this one is working */
++                                              waith->request.sockfd = sock;
++                                              break;
++                                      }
+                               }
++                      } else {
++                              ret = WAITRESS_RET_ERR;
+                       }
++
+                       close (sock);
+               }
+       }
+--- a/src/libfootball/fb_service.c
++++ b/src/libfootball/fb_service.c
+@@ -111,6 +111,8 @@ static bool fb_setup_socket (FB_SERVICE
+               service->socket [which] = 0;
+       } else {
+         fb_perror ("socket");
++        // Element must be zero (not -1)
++        service->socket [which] = 0;
+       };
+       return false;
+ }
diff --git a/sound/pianod/patches/010-Configure_add_SSL_options.patch b/sound/pianod/patches/010-Configure_add_SSL_options.patch
new file mode 100644 (file)
index 0000000..2c26779
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -31,8 +31,6 @@ AC_CHECK_LIB([pthread], [pthread_create]
+ # with it, but don't consider it an error.
+ # PKG_CHECK_MODULES only validates that pkg-config returns stuff; it doesn't
+ # validate that these are correct, so check lib to make sure they're right.
+-PKG_CHECK_MODULES([gnutls], [gnutls],,
+-      [AC_MSG_WARN([No pkg-config for libgnutls])])
+ PKG_CHECK_MODULES([ao], [ao],,
+       [AC_MSG_WARN([No pkg-config for libao])])
+ PKG_CHECK_MODULES([mad], [mad],,
+@@ -42,12 +40,28 @@ PKG_CHECK_MODULES([json], [json-c],,
+               [PKG_CHECK_MODULES([json], [json0],,
+                       [AC_MSG_WARN([No pkg-config for json-c (aka libjson0, libjson)])])])])
++
+ # Network communication stuff:
+ AC_CHECK_LIB([gcrypt], [gcry_cipher_open],,
+       [AC_MSG_ERROR([Cannot find required library: libgcrypt],1)])
+-AC_CHECK_LIB([gnutls], [gnutls_record_recv],,
++# Check for SSL option
++AC_ARG_WITH(polarssl, [  --with-polarssl      Build waitress with PolarSSL (default GNUTLS)], [
++  AC_MSG_RESULT(>>Using PolarSSL)
++  HAS_POLARSSL=1
++  AC_DEFINE([USE_POLARSSL], 1, [Build for PolarSSL])
++  PKG_CHECK_MODULES([polarssl], [polarssl],,
++              [AC_MSG_WARN([No pkg-config for libpolarssl])])
++  AC_CHECK_LIB([polarssl], [ssl_set_session],,
++              [AC_MSG_ERROR([Cannot find required library: libpolarssl (aka polarssl)],1)])] )
++AM_CONDITIONAL([USE_POLARSSL],[test "x$HAS_POLARSSL" = "x1"])
++
++if test "x$HAS_POLARSSL" != x1 ; then
++  PKG_CHECK_MODULES([gnutls], [gnutls],,
++      [AC_MSG_WARN([No pkg-config for libgnutls])])
++  AC_CHECK_LIB([gnutls], [gnutls_record_recv],,
+       [AC_MSG_ERROR([Cannot find required library: libgnutls (aka gnutls)],1)])
+-AC_CHECK_FUNCS(gnutls_transport_set_int2 gnutls_sec_param_to_pk_bits)
++  AC_CHECK_FUNCS(gnutls_transport_set_int2 gnutls_sec_param_to_pk_bits)
++fi
+ # Bloody json library may be linked via -ljson, or -ljson-c depending on
+ # the platform.  Try both.
diff --git a/sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch b/sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch
new file mode 100644 (file)
index 0000000..228710b
--- /dev/null
@@ -0,0 +1,59 @@
+--- a/src/libpiano/config.h
++++ /dev/null
+@@ -1 +0,0 @@
+-#define PACKAGE "libpiano"
+--- a/src/libwaitress/config.h
++++ /dev/null
+@@ -1 +0,0 @@
+-#define PACKAGE "libwaitress"
+--- a/src/libpiano/piano.h
++++ b/src/libpiano/piano.h
+@@ -39,6 +39,8 @@ THE SOFTWARE.
+  * http://pan-do-ra-api.wikia.com
+  */
++#define LIBPIANO_NAME "libpiano"
++
+ #define PIANO_RPC_HOST "tuner.pandora.com"
+ #define PIANO_RPC_PATH "/services/json/?"
+--- a/src/libwaitress/waitress.c
++++ b/src/libwaitress/waitress.c
+@@ -918,14 +918,14 @@ static WaitressReturn_t WaitressSendRequ
+       if (WaitressProxyEnabled (waith) && !waith->url.tls) {
+               snprintf (buf, WAITRESS_BUFFER_SIZE,
+                       "%s http://%s:%s/%s HTTP/" WAITRESS_HTTP_VERSION "\r\n"
+-                      "Host: %s\r\nUser-Agent: " PACKAGE "\r\nConnection: Close\r\n",
++                      "Host: %s\r\nUser-Agent: " LIBWAITRESS_NAME "\r\nConnection: Close\r\n",
+                       (waith->method == WAITRESS_METHOD_GET ? "GET" : "POST"),
+                       waith->url.host,
+                       WaitressDefaultPort (&waith->url), path, waith->url.host);
+       } else {
+               snprintf (buf, WAITRESS_BUFFER_SIZE,
+                       "%s /%s HTTP/" WAITRESS_HTTP_VERSION "\r\n"
+-                      "Host: %s\r\nUser-Agent: " PACKAGE "\r\nConnection: Close\r\n",
++                      "Host: %s\r\nUser-Agent: " LIBWAITRESS_NAME "\r\nConnection: Close\r\n",
+                       (waith->method == WAITRESS_METHOD_GET ? "GET" : "POST"),
+                       path, waith->url.host);
+       }
+--- a/src/libwaitress/waitress.h
++++ b/src/libwaitress/waitress.h
+@@ -29,6 +29,8 @@ THE SOFTWARE.
+ #include <stdbool.h>
+ #include <gnutls/gnutls.h>
++#define LIBWAITRESS_NAME "libwaitress"
++
+ #define WAITRESS_BUFFER_SIZE 10*1024
+ typedef enum {
+--- a/src/libpiano/request.c
++++ b/src/libpiano/request.c
+@@ -40,6 +40,7 @@ THE SOFTWARE.
+ #include <stdio.h>
+ #include <string.h>
+ /* needed for urlencode */
++#include <config.h>
+ #include <waitress.h>
+ #include "piano.h"
diff --git a/sound/pianod/patches/030-Waitress_add_polarssl_variant.patch b/sound/pianod/patches/030-Waitress_add_polarssl_variant.patch
new file mode 100644 (file)
index 0000000..b2a6576
--- /dev/null
@@ -0,0 +1,333 @@
+--- a/src/libwaitress/waitress.h
++++ b/src/libwaitress/waitress.h
+@@ -27,7 +27,12 @@ THE SOFTWARE.
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <stdbool.h>
++
++#if defined(USE_POLARSSL)
++typedef struct _polarssl_ctx polarssl_ctx;
++#else
+ #include <gnutls/gnutls.h>
++#endif
+ #define LIBWAITRESS_NAME "libwaitress"
+@@ -102,8 +107,9 @@ typedef struct {
+       WaitressUrl_t url;
+       WaitressUrl_t proxy;
++#if !defined(USE_POLARSSL)
+       gnutls_certificate_credentials_t tlsCred;
+-
++#endif
+       /* per-request data */
+       struct {
+               int sockfd;
+@@ -121,7 +127,11 @@ typedef struct {
+               WaitressReturn_t (*read) (void *, char *, const size_t, size_t *);
+               WaitressReturn_t (*write) (void *, const char *, const size_t);
++#if defined(USE_POLARSSL)
++              polarssl_ctx* sslCtx;
++#else
+               gnutls_session_t tlsSession;
++#endif
+       } request;
+ } WaitressHandle_t;
+--- a/src/pianod.c
++++ b/src/pianod.c
+@@ -531,8 +531,11 @@ static bool initialize_libraries (APPSTA
+       gcry_check_version (NULL);
+       gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
+       gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
++
++#if !defined(USE_POLARSSL)
+       int crystatus = gnutls_global_init ();
+       if (crystatus == GNUTLS_E_SUCCESS) {
++#endif
+               PianoReturn_t status = PianoInit (&app->ph, app->settings.partnerUser, app->settings.partnerPassword,
+                                                                                 app->settings.device, app->settings.inkey, app->settings.outkey);
+               if (status == PIANO_RET_OK) {
+@@ -545,11 +548,13 @@ static bool initialize_libraries (APPSTA
+               } else {
+                       flog (LOG_ERROR, "initialize_libraries: PianoInit: %s", PianoErrorToStr (status));
+               }
++#if !defined(USE_POLARSSL)
+               gnutls_global_deinit ();
+       } else {
+               flog (LOG_ERROR, "initialize_libraries: gnutls_global_init: %s", gcry_strerror (crystatus));
+       }
++#endif
+       return false;
+ }
+@@ -728,7 +733,9 @@ int main (int argc, char **argv) {
+               PianoDestroyPlaylist (app.song_history);
+               PianoDestroyPlaylist (app.playlist);
+               WaitressFree (&app.waith);
++#if !defined(USE_POLARSSL)
+               gnutls_global_deinit ();
++#endif
+               settings_destroy (&app.settings);
+       }
+       
+--- a/src/libwaitress/waitress.c
++++ b/src/libwaitress/waitress.c
+@@ -41,11 +41,33 @@ THE SOFTWARE.
+ #include <assert.h>
+ #include <stdint.h>
+-#include <gnutls/x509.h>
+ #include "config.h"
+ #include "waitress.h"
++#if defined(USE_POLARSSL)
++
++#include <polarssl/ssl.h>
++#include <polarssl/entropy.h>
++#include <polarssl/ctr_drbg.h>
++#include <polarssl/x509.h>
++#include <polarssl/sha1.h>
++
++struct _polarssl_ctx
++{
++      ssl_context             ssl;
++      ssl_session             session;
++      entropy_context         entrophy;
++      ctr_drbg_context        rnd;
++};
++
++#else
++
++// Use gnutls by default (USE_POLARSSL not defined)
++#include <gnutls/x509.h>
++
++#endif
++
+ #define strcaseeq(a,b) (strcasecmp(a,b) == 0)
+ #define WAITRESS_HTTP_VERSION "1.1"
+@@ -56,6 +78,13 @@ typedef struct {
+ static WaitressReturn_t WaitressReceiveHeaders (WaitressHandle_t *, size_t *);
++// gnutls wants (void *) and polarssl want (unsigned char *)
++#if defined(USE_POLARSSL)
++#define BUFFER_CAST unsigned char
++#else
++#define BUFFER_CAST void
++#endif
++
+ #define READ_RET(buf, count, size) \
+               if ((wRet = waith->request.read (waith, buf, count, size)) != \
+                               WAITRESS_RET_OK) { \
+@@ -444,7 +473,7 @@ static int WaitressPollLoop (int fd, sho
+  *    @param write count bytes
+  *    @return number of written bytes or -1 on error
+  */
+-static ssize_t WaitressPollWrite (void *data, const void *buf, size_t count) {
++static ssize_t WaitressPollWrite (void *data, const BUFFER_CAST *buf, size_t count) {
+       int pollres = -1;
+       ssize_t retSize;
+       WaitressHandle_t *waith = data;
+@@ -478,13 +507,20 @@ static WaitressReturn_t WaitressOrdinary
+       return waith->request.readWriteRet;
+ }
+-static WaitressReturn_t WaitressGnutlsWrite (void *data, const char *buf,
++static WaitressReturn_t WaitressTlsWrite (void *data, const char *buf,
+               const size_t size) {
+       WaitressHandle_t *waith = data;
++#if defined(USE_POLARSSL)
++
++      if (ssl_write (&waith->request.sslCtx->ssl, buf, size) < 0) {
++              return WAITRESS_RET_TLS_WRITE_ERR;
++      }
++#else
+       if (gnutls_record_send (waith->request.tlsSession, buf, size) < 0) {
+               return WAITRESS_RET_TLS_WRITE_ERR;
+       }
++#endif
+       return waith->request.readWriteRet;
+ }
+@@ -494,7 +530,7 @@ static WaitressReturn_t WaitressGnutlsWr
+  *    @param buffer size
+  *    @return number of read bytes or -1 on error
+  */
+-static ssize_t WaitressPollRead (void *data, void *buf, size_t count) {
++static ssize_t WaitressPollRead (void *data, BUFFER_CAST *buf, size_t count) {
+       int pollres = -1;
+       ssize_t retSize;
+       WaitressHandle_t *waith = data;
+@@ -531,16 +567,34 @@ static WaitressReturn_t WaitressOrdinary
+       return waith->request.readWriteRet;
+ }
+-static WaitressReturn_t WaitressGnutlsRead (void *data, char *buf,
++static WaitressReturn_t WaitressTlsRead (void *data, char *buf,
+               const size_t size, size_t *retSize) {
+       WaitressHandle_t *waith = data;
++#if defined(USE_POLARSSL)
++      int ret;
++
++      *retSize = 0;
++      waith->request.readWriteRet = WAITRESS_RET_OK;
++      ret = ssl_read (&waith->request.sslCtx->ssl, buf, size);
++
++      if (ret < 0) {
++              if (ret != POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY) {
++                      waith->request.readWriteRet = WAITRESS_RET_TLS_READ_ERR;
++              }
++
++              return waith->request.readWriteRet;
++      }
++
++      *retSize = ret;
++#else
+       ssize_t ret = gnutls_record_recv (waith->request.tlsSession, buf, size);
+       if (ret < 0) {
+               return WAITRESS_RET_TLS_READ_ERR;
+       } else {
+               *retSize = ret;
+       }
++#endif
+       return waith->request.readWriteRet;
+ }
+@@ -727,10 +781,28 @@ static int WaitressParseStatusline (cons
+ /*    verify server certificate
+  */
+ static WaitressReturn_t WaitressTlsVerify (const WaitressHandle_t *waith) {
++
++#if defined(USE_POLARSSL)
++      unsigned char fingerprint[20];
++
++      const x509_crt* cert = ssl_get_peer_cert (&waith->request.sslCtx->ssl);
++
++      if (NULL == cert) {
++              return WAITRESS_RET_TLS_HANDSHAKE_ERR;
++      }
++
++      sha1 (cert->raw.p, cert->raw.len, fingerprint);
++
++      if (memcmp (fingerprint, waith->tlsFingerprint, sizeof (fingerprint)) != 0) {
++              return WAITRESS_RET_TLS_FINGERPRINT_MISMATCH;
++      }
++
++#else
+       gnutls_session_t session = waith->request.tlsSession;
+       unsigned int certListSize;
+       const gnutls_datum_t *certList;
+       gnutls_x509_crt_t cert;
++      char fingerprint[20];
+       if (gnutls_certificate_type_get (session) != GNUTLS_CRT_X509) {
+               return WAITRESS_RET_TLS_HANDSHAKE_ERR;
+@@ -750,7 +822,6 @@ static WaitressReturn_t WaitressTlsVerif
+               return WAITRESS_RET_TLS_HANDSHAKE_ERR;
+       }
+-      char fingerprint[20];
+       size_t fingerprintSize = sizeof (fingerprint);
+       if (gnutls_x509_crt_get_fingerprint (cert, GNUTLS_DIG_SHA1, fingerprint,
+                       &fingerprintSize) != 0) {
+@@ -763,7 +834,7 @@ static WaitressReturn_t WaitressTlsVerif
+       }
+       gnutls_x509_crt_deinit (cert);
+-
++#endif
+       return WAITRESS_RET_OK;
+ }
+@@ -876,6 +947,12 @@ static WaitressReturn_t WaitressConnect
+                       }
+               }
++#if defined(USE_POLARSSL)
++              ssl_set_hostname (&waith->request.sslCtx->ssl, waith->url.host);
++              if (ssl_handshake (&waith->request.sslCtx->ssl) != 0) {
++                      return WAITRESS_RET_TLS_HANDSHAKE_ERR;
++              }
++#else
+               /* Ignore return code as connection will likely still succeed */
+               gnutls_server_name_set (waith->request.tlsSession, GNUTLS_NAME_DNS,
+                               waith->url.host, strlen (waith->url.host));
+@@ -883,14 +960,15 @@ static WaitressReturn_t WaitressConnect
+               if (gnutls_handshake (waith->request.tlsSession) != GNUTLS_E_SUCCESS) {
+                       return WAITRESS_RET_TLS_HANDSHAKE_ERR;
+               }
++#endif
+               if ((wRet = WaitressTlsVerify (waith)) != WAITRESS_RET_OK) {
+                       return wRet;
+               }
+               /* now we can talk encrypted */
+-              waith->request.read = WaitressGnutlsRead;
+-              waith->request.write = WaitressGnutlsWrite;
++              waith->request.read = WaitressTlsRead;
++              waith->request.write = WaitressTlsWrite;
+       }
+       return WAITRESS_RET_OK;
+@@ -1116,6 +1194,21 @@ WaitressReturn_t WaitressFetchCall (Wait
+       waith->request.contentLengthKnown = false;
+       if (waith->url.tls) {
++#if defined(USE_POLARSSL)
++              waith->request.sslCtx = calloc (1, sizeof(polarssl_ctx));
++
++              entropy_init (&waith->request.sslCtx->entrophy);
++              ctr_drbg_init (&waith->request.sslCtx->rnd, entropy_func, &waith->request.sslCtx->entrophy, "libwaitress", 11);
++              ssl_init (&waith->request.sslCtx->ssl);
++
++              ssl_set_endpoint (&waith->request.sslCtx->ssl, SSL_IS_CLIENT);
++              ssl_set_authmode (&waith->request.sslCtx->ssl, SSL_VERIFY_NONE);
++              ssl_set_rng (&waith->request.sslCtx->ssl, ctr_drbg_random, &waith->request.sslCtx->rnd);
++              ssl_set_session (&waith->request.sslCtx->ssl, &waith->request.sslCtx->session);
++              ssl_set_bio (&waith->request.sslCtx->ssl,
++                           WaitressPollRead, waith,
++                           WaitressPollWrite, waith);
++#else
+               gnutls_init (&waith->request.tlsSession, GNUTLS_CLIENT);
+               gnutls_set_default_priority (waith->request.tlsSession);
+@@ -1133,6 +1226,7 @@ WaitressReturn_t WaitressFetchCall (Wait
+                               WaitressPollRead);
+               gnutls_transport_set_push_function (waith->request.tlsSession,
+                               WaitressPollWrite);
++#endif
+       }
+       /* buffer is required for connect already */
+@@ -1144,15 +1238,22 @@ WaitressReturn_t WaitressFetchCall (Wait
+               if ((wRet = WaitressSendRequest (waith)) == WAITRESS_RET_OK) {
+                       wRet = WaitressReceiveResponse (waith);
+               }
++#if !defined(USE_POLARSSL)
+               if (waith->url.tls) {
+                       gnutls_bye (waith->request.tlsSession, GNUTLS_SHUT_RDWR);
+               }
++#endif
+       }
+       /* cleanup */
+       if (waith->url.tls) {
++#if defined(USE_POLARSSL)
++              ssl_free (&waith->request.sslCtx->ssl);
++              free (waith->request.sslCtx);
++#else
+               gnutls_deinit (waith->request.tlsSession);
+               gnutls_certificate_free_credentials (waith->tlsCred);
++#endif
+       }
+       if (waith->request.sockfd != -1) {
+               close (waith->request.sockfd);
index e75e2c80c06c00a598a9b84bb35ad256d1249837..a4a449b7cccae92579d634e9c8e41b0b5e508f77 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pulseaudio
 PKG_VERSION:=6.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
@@ -27,12 +27,11 @@ PKG_INSTALL = 1
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 
-#TODO: split pulse into executable and library (or even better into several libraries since they're used as loadable modules, so not linked into)
 define Package/pulseaudio/Default
   SECTION:=sound
   CATEGORY:=Sound
   DEPENDS:=+libspeexdsp +libsndfile +libltdl +libpthread \
-       +librt +alsa-lib +libjson +libopenssl +libwrap +libcap $(ICONV_DEPENDS) $(INTL_DEPENDS)
+       +librt +alsa-lib +libopenssl +libwrap +libcap $(ICONV_DEPENDS) $(INTL_DEPENDS)
   TITLE:=Network sound server
   MAINTAINER:=Peter Wagner <tripolar@gmx.at>
   URL:=http://www.pulseaudio.org
@@ -42,6 +41,7 @@ endef
 
 define Package/pulseaudio-daemon
   $(call Package/pulseaudio/Default)
+  DEPENDS+= +libjson-c
 endef
 
 define Package/pulseaudio/Default/description
@@ -62,7 +62,7 @@ endef
 define Package/pulseaudio-tools
   SECTION:=sound
   CATEGORY:=Sound
-  DEPENDS:=+libsndfile pulseaudio
+  DEPENDS:=+libsndfile +pulseaudio
   TITLE:=Tools for Pulseaudio
   URL:=http://www.pulseaudio.org
 endef
diff --git a/utils/avrdude/Makefile b/utils/avrdude/Makefile
new file mode 100644 (file)
index 0000000..97db6f7
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=avrdude
+PKG_VERSION:=6.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/avrdude
+PKG_MD5SUM:=9db8c25b935d34234b9b1ba16ad55fd5
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/avrdude
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=AVR Downloader/UploaDEr
+  URL:=http://www.nongnu.org/avrdude/
+  DEPENDS:=+libncurses +libreadline +libusb-compat +libftdi1
+endef
+
+define Package/avrdude/description
+ AVRDUDE is a full featured program for programming Atmel's AVR CPU's.
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-doc \
+       --disable-parport \
+
+define Package/avrdude/conffiles
+/etc/avrdude.conf
+endef
+
+define Package/avrdude/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/avrdude.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/avrdude $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,avrdude))
diff --git a/utils/avrdude/patches/010-configure-fixups.patch b/utils/avrdude/patches/010-configure-fixups.patch
new file mode 100644 (file)
index 0000000..b945ecb
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -35,6 +35,7 @@ AC_CONFIG_HEADERS(ac_cfg.h)
+ # Checks for programs.
+ AC_PROG_CC
++AC_PROG_CPP
+ AC_PROG_INSTALL
+ AC_PROG_SED
+ AC_PROG_YACC
+@@ -183,6 +184,7 @@ fi
+ AC_SUBST(LIBPTHREAD, $LIBPTHREAD)
+ # Checks for header files.
+ AC_CHECK_HEADERS([limits.h stdlib.h string.h])
++AC_CHECK_HEADERS([inttypes.h stdint.h])
+ AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h])
+ AC_CHECK_HEADERS([ddk/hidsdi.h],,,[#include <windows.h>
+ #include <setupapi.h>])
index 550df30c1316f66e0bd73115a66d9642ff058ee9..4865698f2afa33df48ba7e184835a7c4e6c6dd76 100644 (file)
@@ -8,17 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bluez
-PKG_VERSION:=5.28
+PKG_VERSION:=5.30
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth/
-PKG_MD5SUM:=bc20a8285530758c68f6a60e4ca62a15
+PKG_MD5SUM:=24ba1d1e8e7ef5b8f4033a3059d7600e
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
+PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -29,6 +30,18 @@ define Package/bluez/Default
   URL:=http://www.bluez.org/
 endef
 
+define Package/bluez-examples
+$(call Package/bluez/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= python example apps
+  DEPENDS:=+python
+endef
+
+define Package/bluez-examples/description
+  contains many examples apps for bluetooth, requiring python
+endef
+
 define Package/bluez-libs
 $(call Package/bluez/Default)
   SECTION:=libs
@@ -42,12 +55,14 @@ $(call Package/bluez/Default)
   SECTION:=utils
   CATEGORY:=Utilities
   TITLE+= utilities
-  DEPENDS:=+bluez-libs +libpthread +dbus +glib2 +libical +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
+  DEPENDS:=+bluez-libs +libpthread +librt +dbus +glib2 +libical +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
 endef
 
 define Package/bluez-utils/conffiles
-/etc/bluetooth/hcid.conf
-/etc/bluetooth/rfcomm.conf
+/etc/bluetooth/main.conf
+/etc/bluetooth/network.conf
+/etc/bluetooth/input.conf
+/etc/bluetooth/proximity.conf
 /etc/config/bluetooth
 endef
 
@@ -82,6 +97,11 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/
 endef
 
+define Package/bluez-examples/install
+       $(INSTALL_DIR) $(1)/usr/bin/bluez
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/* $(1)/usr/bin/bluez/
+endef
+
 define Package/bluez-libs/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/
@@ -90,13 +110,22 @@ endef
 define Package/bluez-utils/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
        $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
        $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
+       $(INSTALL_DIR) $(1)/etc/bluetooth
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf
        $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/bluez-utils.init $(1)/etc/init.d/bluez-utils
+       $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
 endef
 
+$(eval $(call BuildPackage,bluez-examples))
 $(eval $(call BuildPackage,bluez-libs))
 $(eval $(call BuildPackage,bluez-utils))
index 42f390c670aa2b2b0a4fad168fc7f9e042a83eca..6f23617a4fd32e717666a26ed42e40992ed9d7ad 100644 (file)
@@ -1,5 +1,5 @@
-config hcid
-#      option config   /etc/bluetooth/hcid.conf
+config bluetoothd
+#      option config   /etc/bluetooth/main.conf
        option enabled  1
 
 config hciattach
@@ -13,20 +13,3 @@ config hciattach
 config rfcomm
 #      option config   /etc/bluetooth/rfcomm.conf
        option enabled  0
-
-config dund
-       option listen   true
-       option persist  true
-       option msdun    true
-       option interface dund
-       option unit     1
-       option pppdopts "ktune proxyarp 192.168.1.1:192.168.1.2 ms-dns 192.168.1.1"
-       option enabled  0
-
-config pand
-       option listen   true
-       option autozap  true
-       option role     "NAP"
-       option master   true
-       option persist  true
-       option enabled  0
diff --git a/utils/bluez/files/bluetoothd.init b/utils/bluez/files/bluetoothd.init
new file mode 100644 (file)
index 0000000..75f4d96
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2007 OpenWrt.org
+
+#start after dbus (60)
+START=62
+USE_PROCD=1
+PROG=/usr/bin/bluetoothd
+
+start_service() {
+       procd_open_instance
+       procd_set_param command "$PROG" -n
+       procd_close_instance
+}
diff --git a/utils/bluez/files/bluez-utils.init b/utils/bluez/files/bluez-utils.init
deleted file mode 100644 (file)
index e9320ae..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2007 OpenWrt.org
-
-#start after dbus (60)
-START=62
-
-append_bool() {
-       local section="$1"
-       local option="$2"
-       local value="$3"
-       local _val
-       config_get_bool _val "$section" "$option" '0'
-       [ $_val -gt 0 ] && append args "$3"
-}
-
-append_string() {
-       local section="$1"
-       local option="$2"
-       local value="$3"
-       local default="$4"
-       local _val
-       config_get _val "$section" "$option" "$default"
-       [ -n "$_val" ] && append args "$3 $_val"
-}
-
-hcid_config() {
-       local cfg="$1"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ $enabled -gt 0 ] || return 1
-       args=""
-       append_bool "$cfg" nodaemon "-n"
-       append_string "$cfg" config "-f"
-       service_start /usr/sbin/hcid $args
-}
-
-hciattach_config() {
-       local cfg="$1"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ $enabled -gt 0 ] || return 1
-       args=""
-       append_string "$cfg" initspeed "-s" "115200"
-       append_string "$cfg" tty " " "ttyS1"
-       append_string "$cfg" type " " "csr"
-       append_string "$cfg" speed " " "115200"
-       append_string "$cfg" flow " " "noflow"
-       service_start /usr/sbin/hciattach $args
-}
-
-rfcomm_config() {
-       local cfg="$1"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ $enabled -gt 0 ] || return 1
-       args=""
-       append_string "$cfg" config "-f"
-       /usr/bin/rfcomm $args bind all
-}
-
-dund_config() {
-       local cfg="$1"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ $enabled -gt 0 ] || return 1
-       args=""
-       append_bool "$cfg" listen "--listen"
-       append_string "$cfg" connect "--connect"
-       append_string "$cfg" mrouter "--mrouter"
-       append_bool "$cfg" search "--search"
-       append_string "$cfg" channel "--channel"
-       append_string "$cfg" device "--device"
-       append_bool "$cfg" nosdp "--nosdp"
-       append_bool "$cfg" auth "--auth"
-       append_bool "$cfg" encrypt "--encrypt"
-       append_bool "$cfg" secure "--secure"
-       append_bool "$cfg" master "--master"
-       append_bool "$cfg" nodetach "--nodetach"
-       append_bool "$cfg" persist "--persist"
-       append_string "$cfg" pppd "--pppd"
-       append_bool "$cfg" msdun "--msdun"
-       append_bool "$cfg" activesync "--activesync"
-       append_bool "$cfg" cache "--cache"
-
-       append_string "$cfg" pppdopts ""
-       config_get ifn "$cfg" interface
-       if [ -n "$ifn" ]; then
-               config_get unit "$cfg" unit
-               [ -z "$unit" ] || append args "unit $unit ipparam $ifn linkname $ifn"
-       fi
-
-       service_start /usr/bin/dund $args
-}
-
-pand_config() {
-       local cfg="$1"
-       config_get_bool enabled "$cfg" "enabled" '1'
-       [ $enabled -gt 0 ] || return 1
-       args=""
-       append_bool "$cfg" listen "--listen"
-       append_string "$cfg" connect "--connect"
-       append_bool "$cfg" autozap "--autozap"
-       append_bool "$cfg" search "--search"
-       append_string "$cfg" role "--role"
-       append_string "$cfg" service "--service"
-       append_string "$cfg" ethernet "--ethernet"
-       append_string "$cfg" device "--device"
-       append_bool "$cfg" nosdp "-D"
-       append_bool "$cfg" auth "-A"
-       append_bool "$cfg" encrypt "-E"
-       append_bool "$cfg" secure "-S"
-       append_bool "$cfg" master "-M"
-       append_bool "$cfg" nodetach "-n"
-       append_bool "$cfg" persist "--persist"
-       append_bool "$cfg" cache "--cache"
-       append_string "$cfg" pidfile "--pidfile"
-       service_start /usr/bin/pand $args
-}
-
-start() {
-       config_load bluetooth
-       config_foreach hcid_config hcid
-       config_foreach hciattach_config hciattach
-       config_foreach rfcomm_config rfcomm
-       config_foreach dund_config dund
-       config_foreach pand_config pand
-}
-
-stop() {
-       service_stop /usr/bin/dund
-       service_stop /usr/bin/pand
-       /usr/bin/rfcomm release all
-       service_stop /usr/sbin/hciattach
-       service_stop /usr/sbin/hcid
-}
index 9d5bec016030b8760d7667a4da3f9051bdce19e6..58396dcb01b3ee9a34e9fc3af55b1dba15a5e873 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -2038,7 +2038,7 @@ unit_tests = $(am__append_32) unit/test-
+@@ -2055,7 +2055,7 @@ unit_tests = $(am__append_32) unit/test-
  @CLIENT_TRUE@                                 monitor/uuid.h monitor/uuid.c
  
  @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \
@@ -9,7 +9,16 @@
  
  @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
  @MONITOR_TRUE@                                monitor/display.h monitor/display.c \
-@@ -2245,13 +2245,13 @@ unit_tests = $(am__append_32) unit/test-
+@@ -2226,7 +2226,7 @@ unit_tests = $(am__append_32) unit/test-
+ @EXPERIMENTAL_TRUE@tools_hcieventmask_LDADD = lib/libbluetooth-internal.la
+ @EXPERIMENTAL_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c
+ @EXPERIMENTAL_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \
+-@EXPERIMENTAL_TRUE@                           -lreadline
++@EXPERIMENTAL_TRUE@                           -lreadline -lncurses
+ @EXPERIMENTAL_TRUE@tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h
+ @EXPERIMENTAL_TRUE@tools_btinfo_LDADD = src/libshared-mainloop.la
+@@ -2266,13 +2266,13 @@ unit_tests = $(am__append_32) unit/test-
  @READLINE_TRUE@                               client/display.h
  
  @READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
@@ -25,7 +34,7 @@
  
  @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
  @READLINE_TRUE@                                               tools/obex-server-tool.c
-@@ -2261,13 +2261,13 @@ unit_tests = $(am__append_32) unit/test-
+@@ -2282,13 +2282,13 @@ unit_tests = $(am__append_32) unit/test-
  @READLINE_TRUE@                               client/display.h client/display.c
  
  @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
index ea486b9a4ad3866106c14a4dcdef7da93e5e2907..12513e15dce5dc86b8df91673a49ed9135c914d1 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=btrfs-progs
-PKG_VERSION:=3.17.3
-PKG_RELEASE:=2
+PKG_VERSION:=3.19.1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs/
-PKG_MD5SUM:=6716b4b109dd909af63ab3becbad67a6
+PKG_MD5SUM:=ec3b3c99df18633ddc9e41f0680c5a51
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
 
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
@@ -24,13 +24,15 @@ PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=libacl
 
+PKG_FIXUP:=autoreconf
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/btrfs-progs
   SECTION:=utils
   CATEGORY:=Utilities
   SUBMENU:=Filesystem
-  DEPENDS:=+libattr +libuuid +zlib +libext2fs +libblkid +liblzo +libpthread
+  DEPENDS:=+libattr +libuuid +zlib +libblkid +liblzo +libpthread
   TITLE:=Btrfs filesystems utilities
   URL:=http://btrfs.wiki.kernel.org/
 endef
@@ -42,25 +44,20 @@ define Package/btrfs-progs/description
  GPL and open for contribution from anyone.
 endef
 
-progs = btrfs btrfsck btrfs-convert btrfs-debug-tree btrfs-find-root \
-       btrfs-image btrfs-map-logical btrfs-show-super btrfstune \
-       btrfs-zero-log fsck.btrfs mkfs.btrfs
-
+progs = btrfs btrfs-debug-tree btrfs-find-root btrfs-image btrfs-map-logical \
+       btrfs-show-super btrfstune btrfs-zero-log fsck.btrfs mkfs.btrfs
 
-MAKE_FLAGS+=\
-       CC="$(TARGET_CC)" \
-       CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
-       LDFLAGS="$(TARGET_LDFLAGS)" \
-       prefix=/usr \
-       DESTDIR=$(PKG_INSTALL_DIR) \
-       DISABLE_BACKTRACE=1 \
-       DISABLE_DOCUMENTATION=1
+CONFIGURE_ARGS += \
+       --disable-backtrace \
+       --disable-convert \
+       --disable-documentation
 
 define Package/btrfs-progs/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs.so* $(1)/usr/lib
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(addprefix $(PKG_INSTALL_DIR)/usr/bin/, $(progs)) $(1)/usr/bin/
+       $(LN) btrfs $(1)/usr/bin/btrfsck
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/etc/init.d/btrfs-scan
 endef
index 0e3216952bd426cdfc78525243e0d25f9157a5e5..aff55855b5649c5778d2e71a0a5d1fe2d5a7835c 100644 (file)
@@ -1,16 +1,20 @@
---- a/mkfs.c
-+++ b/mkfs.c
-@@ -34,7 +34,7 @@
+Index: btrfs-progs-v3.19.1/mkfs.c
+===================================================================
+--- btrfs-progs-v3.19.1.orig/mkfs.c
++++ btrfs-progs-v3.19.1/mkfs.c
+@@ -31,7 +31,7 @@
  #include <getopt.h>
  #include <uuid/uuid.h>
  #include <ctype.h>
 -#include <sys/xattr.h>
 +#include <attr/xattr.h>
+ #include <limits.h>
+ #include <linux/limits.h>
  #include <blkid/blkid.h>
- #include <ftw.h>
- #include "ctree.h"
---- a/props.c
-+++ b/props.c
+Index: btrfs-progs-v3.19.1/props.c
+===================================================================
+--- btrfs-progs-v3.19.1.orig/props.c
++++ btrfs-progs-v3.19.1/props.c
 @@ -17,7 +17,7 @@
  #include <sys/stat.h>
  #include <sys/ioctl.h>
  #include <fcntl.h>
  #include <unistd.h>
  
---- a/cmds-receive.c
-+++ b/cmds-receive.c
-@@ -39,7 +39,7 @@
+Index: btrfs-progs-v3.19.1/cmds-receive.c
+===================================================================
+--- btrfs-progs-v3.19.1.orig/cmds-receive.c
++++ btrfs-progs-v3.19.1/cmds-receive.c
+@@ -34,7 +34,7 @@
  #include <sys/ioctl.h>
  #include <sys/time.h>
  #include <sys/types.h>
  #include <uuid/uuid.h>
  
  #include "ctree.h"
---- a/cmds-restore.c
-+++ b/cmds-restore.c
-@@ -34,7 +34,7 @@
+Index: btrfs-progs-v3.19.1/cmds-restore.c
+===================================================================
+--- btrfs-progs-v3.19.1.orig/cmds-restore.c
++++ btrfs-progs-v3.19.1/cmds-restore.c
+@@ -32,7 +32,7 @@
  #include <regex.h>
  #include <getopt.h>
  #include <sys/types.h>
  
  #include "ctree.h"
  #include "disk-io.h"
---- a/Makefile
-+++ b/Makefile
-@@ -26,7 +26,7 @@ TESTS = fsck-tests.sh convert-tests.sh
- INSTALL = install
- prefix ?= /usr/local
- bindir = $(prefix)/bin
--lib_LIBS = -luuid -lblkid -lm -lz -llzo2 -L.
-+lib_LIBS = -lattr -luuid -lblkid -lm -lz -llzo2 -L.
- libdir ?= $(prefix)/lib
- incdir = $(prefix)/include/btrfs
- LIBS = $(lib_LIBS) $(libs_static)
+Index: btrfs-progs-v3.19.1/Makefile.in
+===================================================================
+--- btrfs-progs-v3.19.1.orig/Makefile.in
++++ btrfs-progs-v3.19.1/Makefile.in
+@@ -21,7 +21,7 @@ CFLAGS = @CFLAGS@ \
+ LDFLAGS = @LDFLAGS@ \
+         -rdynamic
+-LIBS = @UUID_LIBS@ @BLKID_LIBS@ @ZLIB_LIBS@ @LZO2_LIBS@ -L. -pthread
++LIBS = @ATTR_LIBS@ @UUID_LIBS@ @BLKID_LIBS@ @ZLIB_LIBS@ @LZO2_LIBS@ -L. -pthread
+ LIBBTRFS_LIBS = $(LIBS)
+ # Static compilation flags
+Index: btrfs-progs-v3.19.1/configure.ac
+===================================================================
+--- btrfs-progs-v3.19.1.orig/configure.ac
++++ btrfs-progs-v3.19.1/configure.ac
+@@ -115,6 +115,9 @@ dnl
+ dnl The default PKG_CHECK_MODULES() action-if-not-found is end the
+ dnl execution with error. The static libs are optional.
++PKG_CHECK_MODULES(ATTR, [libattr])
++PKG_STATIC(BLKID_LIBS_STATIC, [libattr])
++
+ PKG_CHECK_MODULES(BLKID, [blkid])
+ PKG_STATIC(BLKID_LIBS_STATIC, [blkid])
index c633344cfc963a1111ef8e86c710d399a4f8b5d7..493ccc9317fe53c811d4232fe76f44f7dbc94028 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bzip2
 PKG_VERSION:=1.0.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.bzip.org/$(PKG_VERSION)
@@ -21,12 +21,17 @@ PKG_LICENSE_FILES:=LICENSE
 
 include $(INCLUDE_DIR)/package.mk
 
+define Package/bzip2/Default
+  SUBMENU:=Compression
+  URL:=http://www.bzip.org/
+endef
+
 define Package/libbz2
+$(call Package/bzip2/Default)
   SECTION:=libs
   CATEGORY:=Libraries
   DEPENDS:=
   TITLE:=bzip2 library.
-  URL:=http://www.bzip.org/
 endef
 
 define Package/libbz2/description
@@ -35,11 +40,11 @@ define Package/libbz2/description
 endef
 
 define Package/bzip2
+$(call Package/bzip2/Default)
   SECTION:=utils
   CATEGORY:=Utilities
   DEPENDS:=+libbz2
   TITLE:=bzip2 is a compression utility.
-  URL:=http://www.bzip.org/
 endef
 
 define Package/bzip2/description
@@ -47,13 +52,15 @@ define Package/bzip2/description
        data compressor. This package provides the binary.
 endef
 
-TARGET_CFLAGS += $(FPIC)
+TARGET_CFLAGS += \
+       $(FPIC) \
+       $(TARGET_LDFLAGS)
+
 CONFIGURE_ARGS += --prefix=/usr
 
 MAKE_FLAGS += \
        -f Makefile-libbz2_so \
        CFLAGS="$(TARGET_CFLAGS)" \
-       LDFLAGS="$(TARGET_LDLAGS)" \
        all
 
 define Build/InstallDev
index 330c4ecb6fcd37a9f0f33a443946a932a032b662..fb7fc1211ba6b1a63432be886e3bc2e34af1a948 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cryptsetup
-PKG_VERSION:=1.6.6
+PKG_VERSION:=1.6.7
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING COPYING.LGPL
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v1.6
-PKG_MD5SUM:=179c0781de59838a4e39f61b2df5ea48
+PKG_MD5SUM:=918406eb5d2e2f5a7348c432ea9b1473
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
index b47d40be44d257612b0deb1c38fd863fa4426846..2b5081ea2ca180e2583f6e6ce01eadd9091e9497 100644 (file)
@@ -9,15 +9,16 @@ include $(TOPDIR)/rules.mk
 
 # Make sure to also update the dbus-x package
 PKG_NAME:=dbus
-PKG_VERSION:=1.9.10
+PKG_VERSION:=1.9.14
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://dbus.freedesktop.org/releases/dbus/
-PKG_MD5SUM:=72390a741009017258c00a3268daa728
+PKG_MD5SUM:=32cd0d16067422bfd691e2f647b432b0
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 PKG_LICENSE:=AFL-2.1
 
+PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
index f5b2f94d7b1230d458b9ca927b28a2d613767ff4..41483f2ef7370f812f8ac7e545c4b26788f1ae56 100644 (file)
@@ -71,7 +71,7 @@ endef
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                $(TARGET_CONFIGURE_OPTS) \
-               OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64" \
+               OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE" \
                PREFIX="/usr" \
                SBINDIR="/usr/sbin" \
                LDFLAGS="$(LDFLAGS)" \
index 89cfa4ab5bbd752cbb8d891848c5beb2d9f7e14a..1d58625e1184366ae2a33c59cbbff4131224130c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2009 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haserl
-PKG_VERSION:=0.9.34
+PKG_VERSION:=0.9.35
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/haserl
-PKG_MD5SUM:=cae2240f25040c7a0a270c35cf7abda4
+PKG_MD5SUM:=918f0b4f6cec0b438c8b5c78f2989010
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/utils/hfsprogs/Makefile b/utils/hfsprogs/Makefile
new file mode 100644 (file)
index 0000000..9c44a35
--- /dev/null
@@ -0,0 +1,81 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=hfsprogs
+PKG_VERSION:=332.25
+PKG_RELEASE:=1
+
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://archive.ubuntu.com/ubuntu/pool/universe/h/$(PKG_NAME)
+PKG_BUILD_DIR:=$(BUILD_DIR)/diskdev_cmds-$(PKG_VERSION)
+PKG_MD5SUM:=261c3de5ec0dcf5244e3f60d79c1d6f1
+PKG_LICENSE:=APSL 2.0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/hfsprogs/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=Filesystem
+  DEPENDS:=+libopenssl
+endef
+
+define Package/hfsfsck
+  $(call Package/hfsprogs/Default)
+  TITLE:=fsck (fsck.hfs) utility from hfsprogs
+endef
+
+define Package/mkhfs
+  $(call Package/hfsprogs/Default)
+  TITLE:=mkfs (mkfs.hfs) utility from hfsprogs
+endef
+
+define Package/hfsfsck/description
+       Utilities to create and check HFS/HFS+ filesystems.
+       (fsck.hfs and fsck.hfsplus for checking integrity of HFS/HFS+ volumes)
+endef
+
+define Package/mkhfs/description
+       Utilities to create and check HFS/HFS+ filesystems.
+       (mkfs.hfs and mkfs.hfsplus for creating HFS/HFS+ volumes)
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               -f Makefile.lnx \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS+="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1" \
+               all
+endef
+
+define Package/hfsfsck/install
+       $(INSTALL_DIR) $(1)/lib/functions/fsck
+       $(INSTALL_DATA) ./files/hfsfsck.sh $(1)/lib/functions/fsck/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/fsck_hfs.tproj/fsck_hfs $(1)/usr/sbin/fsck.hfsplus
+       (cd $(1)/usr/sbin; ln -sf fsck.hfsplus fsck.hfs;)
+endef
+
+define Package/mkhfs/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/newfs_hfs.tproj/newfs_hfs $(1)/usr/sbin/mkfs.hfsplus
+       (cd $(1)/usr/sbin; ln -sf mkfs.hfsplus mkfs.hfs;)
+endef
+
+$(eval $(call BuildPackage,hfsfsck))
+$(eval $(call BuildPackage,mkhfs))
diff --git a/utils/hfsprogs/files/hfsfsck.sh b/utils/hfsprogs/files/hfsfsck.sh
new file mode 100644 (file)
index 0000000..8bcd2c1
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright 2015 OpenWrt.org
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+fsck_hfsfsck() {
+       hfsfsck "$device" 2>&1 | logger -t "fstab: hfsfsck ($device)"
+       local status="$?"
+       case "$status" in
+               0) ;; #success
+               4) reboot;;
+               8) echo "hfsfsck ($device): Warning! Uncorrected errors."| logger -t fstab
+                       return 1
+                       ;;
+               *) echo "hfsfsck ($device): Error $status. Check not complete."| logger -t fstab;;
+       esac
+       return 0
+}
+
+fsck_hfs() {
+       fsck_hfsfsck "$@"
+}
+
+fsck_hfsplus() {
+       fsck_hfsfsck "$@"
+}
+
+append libmount_known_fsck "hfs"
+append libmount_known_fsck "hfsplus"
diff --git a/utils/hfsprogs/patches/0001-Create-short-Makefiles-for-Debian.patch b/utils/hfsprogs/patches/0001-Create-short-Makefiles-for-Debian.patch
new file mode 100644 (file)
index 0000000..a8c4193
--- /dev/null
@@ -0,0 +1,93 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Create short Makefiles for Debian
+
+Create short Makefiles for compiling just the necessary parts for a
+Debian-based (and possibly other distributions) HFS+ filesystem
+utilities.
+---
+ Makefile.lnx                       |  8 ++++++++
+ fsck_hfs.tproj/Makefile.lnx        | 16 ++++++++++++++++
+ fsck_hfs.tproj/dfalib/Makefile.lnx | 15 +++++++++++++++
+ newfs_hfs.tproj/Makefile.lnx       | 12 ++++++++++++
+ 4 files changed, 51 insertions(+)
+ create mode 100644 Makefile.lnx
+ create mode 100644 fsck_hfs.tproj/Makefile.lnx
+ create mode 100644 fsck_hfs.tproj/dfalib/Makefile.lnx
+ create mode 100644 newfs_hfs.tproj/Makefile.lnx
+
+diff --git a/Makefile.lnx b/Makefile.lnx
+new file mode 100644
+index 0000000..687d1e7
+--- /dev/null
++++ b/Makefile.lnx
+@@ -0,0 +1,8 @@
++CC := gcc
++CFLAGS += -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1
++SUBDIRS := newfs_hfs.tproj fsck_hfs.tproj
++
++all clean:
++      for d in $(SUBDIRS); do $(MAKE) -C $$d -f Makefile.lnx $@; done
++
++export CC CFLAGS
+diff --git a/fsck_hfs.tproj/Makefile.lnx b/fsck_hfs.tproj/Makefile.lnx
+new file mode 100644
+index 0000000..977d7e8
+--- /dev/null
++++ b/fsck_hfs.tproj/Makefile.lnx
+@@ -0,0 +1,16 @@
++CFILES = fsck_hfs.c strings.c utilities.c cache.c fsck_debug.c
++OFILES = $(CFILES:.c=.o)
++
++all: fsck_hfs
++
++fsck_hfs: $(OFILES) dfalib/libdfa.a
++      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES) dfalib/libdfa.a
++
++dfalib/libdfa.a: FORCE
++      $(MAKE) -C dfalib -f Makefile.lnx CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" libdfa.a
++
++clean:
++      $(RM) fsck_hfs $(OFILES)
++      $(MAKE) -C dfalib -f Makefile.lnx clean
++
++.PHONY : FORCE clean
+diff --git a/fsck_hfs.tproj/dfalib/Makefile.lnx b/fsck_hfs.tproj/dfalib/Makefile.lnx
+new file mode 100644
+index 0000000..8c07196
+--- /dev/null
++++ b/fsck_hfs.tproj/dfalib/Makefile.lnx
+@@ -0,0 +1,15 @@
++CFILES = hfs_endian.c BlockCache.c\
++         BTree.c BTreeAllocate.c BTreeMiscOps.c \
++         BTreeNodeOps.c BTreeScanner.c BTreeTreeOps.c\
++         CatalogCheck.c HardLinkCheck.c\
++         SBTree.c SControl.c SVerify1.c SVerify2.c\
++         SRepair.c SRebuildCatalogBTree.c\
++         SUtils.c SKeyCompare.c SDevice.c SExtents.c SAllocate.c\
++         SCatalog.c SStubs.c VolumeBitmapCheck.c
++OFILES = $(CFILES:.c=.o)
++
++libdfa.a: $(OFILES)
++      ar rc $@ $?
++
++clean:
++      $(RM) $(OFILES) libdfa.a
+diff --git a/newfs_hfs.tproj/Makefile.lnx b/newfs_hfs.tproj/Makefile.lnx
+new file mode 100644
+index 0000000..58e6700
+--- /dev/null
++++ b/newfs_hfs.tproj/Makefile.lnx
+@@ -0,0 +1,12 @@
++CFILES = hfs_endian.c makehfs.c newfs_hfs.c
++OFILES = $(CFILES:.c=.o)
++
++all: newfs_hfs
++
++newfs_hfs: $(OFILES)
++      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES) -lcrypto
++
++clean:
++      $(RM) newfs_hfs $(OFILES)
++
++.PHONY : FORCE clean
diff --git a/utils/hfsprogs/patches/0002-Add-exclude-Darwin-specific-code.patch b/utils/hfsprogs/patches/0002-Add-exclude-Darwin-specific-code.patch
new file mode 100644 (file)
index 0000000..0046c36
--- /dev/null
@@ -0,0 +1,1407 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Add/exclude Darwin-specific code
+
+Modify some of the files so that they can be compiled without the
+Apple owned frameworks in a Debian system (and possibly others).
+---
+ fsck_hfs.tproj/cache.c              |   4 ++
+ fsck_hfs.tproj/dfalib/BTree.c       |   2 +
+ fsck_hfs.tproj/dfalib/BlockCache.c  |   3 +
+ fsck_hfs.tproj/dfalib/SBTree.c      |   2 +
+ fsck_hfs.tproj/dfalib/SDevice.c     |  92 ++++++++++++++++++++---------
+ fsck_hfs.tproj/dfalib/SKeyCompare.c |   2 +
+ fsck_hfs.tproj/dfalib/SRepair.c     |   2 +
+ fsck_hfs.tproj/dfalib/SRuntime.h    |   7 ++-
+ fsck_hfs.tproj/dfalib/SUtils.c      |   5 +-
+ fsck_hfs.tproj/dfalib/SVerify2.c    |   7 +++
+ fsck_hfs.tproj/dfalib/Scavenger.h   |  11 +++-
+ fsck_hfs.tproj/dfalib/hfs_endian.c  |   4 ++
+ fsck_hfs.tproj/dfalib/hfs_endian.h  |   7 ++-
+ fsck_hfs.tproj/fsck_hfs.c           |  61 +++++++++++++++----
+ fsck_hfs.tproj/utilities.c          |   8 ++-
+ include/missing.h                   | 115 ++++++++++++++++++++++++++++++++++++
+ newfs_hfs.tproj/hfs_endian.c        |   5 ++
+ newfs_hfs.tproj/hfs_endian.h        |   5 ++
+ newfs_hfs.tproj/makehfs.c           |  72 ++++++++++++++++------
+ newfs_hfs.tproj/newfs_hfs.c         |  74 ++++++++++++++++++++---
+ newfs_hfs.tproj/newfs_hfs.h         |  26 ++++----
+ 21 files changed, 429 insertions(+), 85 deletions(-)
+ create mode 100644 include/missing.h
+
+diff --git a/fsck_hfs.tproj/cache.c b/fsck_hfs.tproj/cache.c
+index be46195..527088a 100644
+--- a/fsck_hfs.tproj/cache.c
++++ b/fsck_hfs.tproj/cache.c
+@@ -26,7 +26,11 @@
+ #include <stdlib.h>
+ #include <sys/mman.h>
+ #include <sys/stat.h>
++#if LINUX
++#include "missing.h"
++#else
+ #include <sys/types.h>
++#endif /* __LINUX__ */
+ #include <sys/uio.h>
+ #include <unistd.h>
+ #include <string.h>
+diff --git a/fsck_hfs.tproj/dfalib/BTree.c b/fsck_hfs.tproj/dfalib/BTree.c
+index edd8301..7ad9fe0 100644
+--- a/fsck_hfs.tproj/dfalib/BTree.c
++++ b/fsck_hfs.tproj/dfalib/BTree.c
+@@ -1705,7 +1705,9 @@ OSStatus BTGetInformation        (SFCB                                   *filePtr,
+                                                                UInt16                                  version,
+                                                                BTreeInfoRec                   *info )
+ {
++#if !LINUX
+ #pragma unused (version)
++#endif
+       BTreeControlBlockPtr    btreePtr;
+diff --git a/fsck_hfs.tproj/dfalib/BlockCache.c b/fsck_hfs.tproj/dfalib/BlockCache.c
+index 1bb952f..e3a28a2 100644
+--- a/fsck_hfs.tproj/dfalib/BlockCache.c
++++ b/fsck_hfs.tproj/dfalib/BlockCache.c
+@@ -20,6 +20,9 @@
+  * @APPLE_LICENSE_HEADER_END@
+  */
++#if LINUX
++#include "missing.h"
++#endif
+ #include "SRuntime.h"
+ #include "Scavenger.h"
+ #include "../cache.h"
+diff --git a/fsck_hfs.tproj/dfalib/SBTree.c b/fsck_hfs.tproj/dfalib/SBTree.c
+index 2fbcd1d..cd81b13 100644
+--- a/fsck_hfs.tproj/dfalib/SBTree.c
++++ b/fsck_hfs.tproj/dfalib/SBTree.c
+@@ -322,7 +322,9 @@ ErrorExit:
+ OSStatus
+ SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
+ {
++#if !LINUX
+ #pragma unused (maxEOF)
++#endif
+       OSStatus        result;
+       UInt32          actualSectorsAdded;
+diff --git a/fsck_hfs.tproj/dfalib/SDevice.c b/fsck_hfs.tproj/dfalib/SDevice.c
+index bf6f61c..9a46023 100644
+--- a/fsck_hfs.tproj/dfalib/SDevice.c
++++ b/fsck_hfs.tproj/dfalib/SDevice.c
+@@ -2,7 +2,7 @@
+  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+  *
+  * @APPLE_LICENSE_HEADER_START@
+- * 
++ *
+  * "Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+  * Reserved.  This file contains Original Code and/or Modifications of
+  * Original Code as defined in and that are subject to the Apple Public
+@@ -10,7 +10,7 @@
+  * except in compliance with the License.  Please obtain a copy of the
+  * License at http://www.apple.com/publicsource and read it before using
+  * this file.
+- * 
++ *
+  * The Original Code and all software distributed under the License are
+  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+@@ -18,7 +18,7 @@
+  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
+  * License for the specific language governing rights and limitations
+  * under the License."
+- * 
++ *
+  * @APPLE_LICENSE_HEADER_END@
+  */
+ #include "SRuntime.h"
+@@ -28,33 +28,71 @@
+ #include <unistd.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
+-
++#if LINUX
++#include <fcntl.h>
++#include <sys/stat.h>
++#else
+ #include <IOKit/storage/IOMediaBSDClient.h>
+-
++#endif /* LINUX */
+ #else
+-
+ #include <Files.h>
+ #include <Device.h>
+ #include <Disks.h>
+ #endif
+-
+ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
+ {
+ #if BSD
+       UInt64 devBlockCount = 0;
+       int devBlockSize = 0;
++#if LINUX
++      struct stat stbuf;
++
++      devBlockSize = 512;
++#ifndef BLKGETSIZE
++#define BLKGETSIZE              _IO(0x12,96)
++#endif
++#ifndef BLKGETSIZE64
++#define BLKGETSIZE64            _IOR(0x12,114,size_t)
++#endif
++      if (fstat(driveRefNum, &stbuf) < 0){
++              printf("Error: %s\n", strerror(errno));
++              return(-1);
++      }
++
++        if (S_ISREG(stbuf.st_mode)) {
++                devBlockCount = stbuf.st_size / 512;
++        }
++        else if (S_ISBLK(stbuf.st_mode)) {
++                unsigned long size;
++                u_int64_t size64;
++                if (!ioctl(driveRefNum, BLKGETSIZE64, &size64))
++                        devBlockCount = size64 / 512;
++                else if (!ioctl(driveRefNum, BLKGETSIZE, &size))
++                        devBlockCount = size;
++                else{
++                        printf("Error: %s\n", strerror(errno));
++                      return(-1);
++              }
++
++        }
++        else{
++                printf("Device is not a block device");
++              return(-1);
++      }
++#elif BSD
+       if (ioctl(driveRefNum, DKIOCGETBLOCKCOUNT, &devBlockCount) < 0) {
+               printf("ioctl(DKIOCGETBLOCKCOUNT) for fd %d: %s\n", driveRefNum, strerror(errno));
+               return (-1);
+       }
+-      
++
+       if (ioctl(driveRefNum, DKIOCGETBLOCKSIZE, &devBlockSize) < 0) {
+               printf("ioctl(DKIOCGETBLOCKSIZE) for fd %d: %s\n", driveRefNum, strerror(errno));
+               return (-1);
+       }
++#endif /* BSD */
+       if (devBlockSize != 512) {
+               *numBlocks = (devBlockCount * (UInt64)devBlockSize) / 512;
+@@ -70,24 +108,24 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
+       {
+               /* return format list status code */
+               kFmtLstCode = 6,
+-              
++
+               /* reference number of .SONY driver */
+               kSonyRefNum = 0xfffb,
+-              
++
+               /* values returned by DriveStatus in DrvSts.twoSideFmt */
+               kSingleSided = 0,
+               kDoubleSided = -1,
+               kSingleSidedSize = 800,         /* 400K */
+               kDoubleSidedSize = 1600,        /* 800K */
+-              
++
+               /* values in DrvQEl.qType */
+               kWordDrvSiz = 0,
+               kLongDrvSiz = 1,
+-              
++
+               /* more than enough formatListRecords */
+               kMaxFormatListRecs = 16
+       };
+-      
++
+       ParamBlockRec   pb;
+       FormatListRec   formatListRecords[kMaxFormatListRecs];
+       DrvSts                  status;
+@@ -95,22 +133,22 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
+       OSErr                   result;
+       unsigned long   blocks                  = 0;
+-      
++
+       /* Attempt to get the drive's format list. */
+       /* (see the Technical Note "What Your Sony Drives For You") */
+-      
++
+       pb.cntrlParam.ioVRefNum = driveQElementPtr->dQDrive;
+       pb.cntrlParam.ioCRefNum = driveQElementPtr->dQRefNum;
+       pb.cntrlParam.csCode = kFmtLstCode;
+       pb.cntrlParam.csParam[0] = kMaxFormatListRecs;
+       *(long *)&pb.cntrlParam.csParam[1] = (long)&formatListRecords[0];
+-      
++
+       result = PBStatusSync(&pb);
+-      
++
+       if ( result == noErr )
+       {
+               /* The drive supports ReturnFormatList status call. */
+-              
++
+               /* Get the current disk's size. */
+               for( formatListRecIndex = 0;
+                        formatListRecIndex < pb.cntrlParam.csParam[0];
+@@ -131,7 +169,7 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
+       else if ( driveQElementPtr->dQRefNum == (short)kSonyRefNum )
+       {
+               /* The drive is a non-SuperDrive floppy which only supports 400K and 800K disks */
+-              
++
+               result = DriveStatus(driveQElementPtr->dQDrive, &status);
+               if ( result == noErr )
+               {
+@@ -140,11 +178,11 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
+                               case kSingleSided:
+                                       blocks = kSingleSidedSize;
+                                       break;
+-                                      
++
+                               case kDoubleSided:
+                                       blocks = kDoubleSidedSize;
+                                       break;
+-                                      
++
+                               default:                //      This should never happen
+                                       result = paramErr;
+                                       break;
+@@ -155,20 +193,20 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
+       {
+               /* The drive is not a floppy and it doesn't support ReturnFormatList */
+               /* so use the dQDrvSz field(s) */
+-              
++
+               result = noErr; /* reset result */
+-              
++
+               switch ( driveQElementPtr->qType )
+               {
+                       case kWordDrvSiz:
+                               blocks = driveQElementPtr->dQDrvSz;
+                               break;
+-                              
++
+                       case kLongDrvSiz:
+                               blocks = ((unsigned long)driveQElementPtr->dQDrvSz2 << 16) +
+                                                driveQElementPtr->dQDrvSz;
+                               break;
+-                              
++
+                       default:                //      This should never happen
+                               result = paramErr;
+                               break;
+@@ -177,7 +215,7 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
+       *numBlocks = blocks;
+       *blockSize = 512;
+-      
++
+       return( result );
+ #endif
+ }
+@@ -188,7 +226,7 @@ OSErr DeviceRead(int device, int drive, void* buffer, SInt64 offset, UInt32 reqB
+ #if BSD
+       off_t seek_off;
+       ssize_t nbytes;
+-      
++
+       *actBytes = 0;
+       seek_off = lseek(device, offset, SEEK_SET);
+diff --git a/fsck_hfs.tproj/dfalib/SKeyCompare.c b/fsck_hfs.tproj/dfalib/SKeyCompare.c
+index 46e145f..18d99c5 100644
+--- a/fsck_hfs.tproj/dfalib/SKeyCompare.c
++++ b/fsck_hfs.tproj/dfalib/SKeyCompare.c
+@@ -454,7 +454,9 @@ SInt32 CompareExtentKeysPlus( const HFSPlusExtentKey *searchKey, const HFSPlusEx
+  * The name portion of the key is compared using a 16-bit binary comparison. 
+  * This is called from the b-tree code.
+  */
++#if !LINUX
+ __private_extern__
++#endif
+ SInt32
+ CompareAttributeKeys(const AttributeKey *searchKey, const AttributeKey *trialKey)
+ {
+diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
+index 01c1a10..8eb759c 100644
+--- a/fsck_hfs.tproj/dfalib/SRepair.c
++++ b/fsck_hfs.tproj/dfalib/SRepair.c
+@@ -1617,7 +1617,9 @@ Output:
+ static        OSErr   FixWrapperExtents( SGlobPtr GPtr, RepairOrderPtr p )
+ {
++#if !LINUX
+ #pragma unused (p)
++#endif
+       OSErr                                           err;
+       HFSMasterDirectoryBlock         *mdb;
+diff --git a/fsck_hfs.tproj/dfalib/SRuntime.h b/fsck_hfs.tproj/dfalib/SRuntime.h
+index 646917b..770e3ef 100644
+--- a/fsck_hfs.tproj/dfalib/SRuntime.h
++++ b/fsck_hfs.tproj/dfalib/SRuntime.h
+@@ -27,8 +27,11 @@
+ #define __SRUNTIME__
+ #if BSD
+-
++#if LINUX
++#include "missing.h"
++#else
+ #include <sys/types.h>
++#endif
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+@@ -91,10 +94,12 @@ typedef const unsigned char *      ConstStr255Param;
+ typedef u_int32_t     HFSCatalogNodeID;
++#if !LINUX
+ enum {
+       false           = 0,
+       true            = 1
+ };
++#endif
+ /* OS error codes */
+ enum {
+diff --git a/fsck_hfs.tproj/dfalib/SUtils.c b/fsck_hfs.tproj/dfalib/SUtils.c
+index 72035f0..6e9253e 100644
+--- a/fsck_hfs.tproj/dfalib/SUtils.c
++++ b/fsck_hfs.tproj/dfalib/SUtils.c
+@@ -380,7 +380,8 @@ void       InvalidateCalculatedVolumeBitMap( SGlobPtr GPtr )
+ //                            GPtr->realVCB                   Real in-memory vcb
+ //------------------------------------------------------------------------------
+-#if !BSD      
++#if BSD
++#if !LINUX
+ OSErr GetVolumeFeatures( SGlobPtr GPtr )
+ {
+       OSErr                                   err;
+@@ -418,7 +419,7 @@ OSErr GetVolumeFeatures( SGlobPtr GPtr )
+       return( noErr );
+ }
+ #endif
+-
++#endif
+ /*-------------------------------------------------------------------------------
+diff --git a/fsck_hfs.tproj/dfalib/SVerify2.c b/fsck_hfs.tproj/dfalib/SVerify2.c
+index 6a47935..c68f3d8 100644
+--- a/fsck_hfs.tproj/dfalib/SVerify2.c
++++ b/fsck_hfs.tproj/dfalib/SVerify2.c
+@@ -32,7 +32,9 @@
+ */
+ #include <sys/ioctl.h>
++#if !LINUX
+ #include <sys/disk.h>
++#endif
+ #include "BTree.h"
+ #include "BTreePrivate.h"
+@@ -1354,8 +1356,13 @@ OSErr CompareVolumeHeader( SGlobPtr GPtr, HFSPlusVolumeHeader *volumeHeader )
+        * clump size for read-only media is irrelevant we skip the clump size 
+        * check to avoid non useful warnings. 
+        */
++#if LINUX
++      // FIXME
++      isWriteable = 1;
++#else
+       isWriteable = 0;
+       ioctl( GPtr->DrvNum, DKIOCISWRITABLE, &isWriteable );
++#endif
+       if ( isWriteable != 0 && 
+                volumeHeader->catalogFile.clumpSize != vcb->vcbCatalogFile->fcbClumpSize ) {
+               PrintError(GPtr, E_InvalidClumpSize, 0);
+diff --git a/fsck_hfs.tproj/dfalib/Scavenger.h b/fsck_hfs.tproj/dfalib/Scavenger.h
+index cf53970..edb3a80 100644
+--- a/fsck_hfs.tproj/dfalib/Scavenger.h
++++ b/fsck_hfs.tproj/dfalib/Scavenger.h
+@@ -37,11 +37,16 @@
+ #include "../fsck_debug.h"
+ #include <assert.h>
++#if LINUX
++#define XATTR_MAXNAMELEN 127
++#include <limits.h>
++#else
+ #include <sys/xattr.h>
+ #include <sys/acl.h>
+ #include <sys/kauth.h>
+-#include <sys/errno.h>
+ #include <sys/syslimits.h>
++#endif
++#include <sys/errno.h>
+ #ifdef __cplusplus
+ extern        "C" {
+@@ -1465,4 +1470,8 @@ extern int       AllocateContigBitmapBits (SVCB *vcb, UInt32 numBlocks, UInt32 *actua
+ };
+ #endif
++/* #if LINUX
++#undef XATTR_MAXNAMELEN
++#endif */
++
+ #endif /* __SCAVENGER__ */
+diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.c b/fsck_hfs.tproj/dfalib/hfs_endian.c
+index 7fa5385..69500c1 100755
+--- a/fsck_hfs.tproj/dfalib/hfs_endian.c
++++ b/fsck_hfs.tproj/dfalib/hfs_endian.c
+@@ -31,7 +31,11 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#if LINUX
++#include "missing.h"
++#else
+ #include <architecture/byte_order.h>
++#endif
+ #include <hfs/hfs_format.h>
+ #include "Scavenger.h"
+diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.h b/fsck_hfs.tproj/dfalib/hfs_endian.h
+index 52d0c3a..0763d9d 100755
+--- a/fsck_hfs.tproj/dfalib/hfs_endian.h
++++ b/fsck_hfs.tproj/dfalib/hfs_endian.h
+@@ -27,9 +27,14 @@
+  *
+  * This file prototypes endian swapping routines for the HFS/HFS Plus
+  * volume format.
+- */
++*/
+ #include <hfs/hfs_format.h>
++#if LINUX
++#include <endian.h>
++#include <byteswap.h>
++#else
+ #include <architecture/byte_order.h>
++#endif
+ #include "SRuntime.h"
+ /*********************/
+diff --git a/fsck_hfs.tproj/fsck_hfs.c b/fsck_hfs.tproj/fsck_hfs.c
+index 90532fd..f1a18bd 100644
+--- a/fsck_hfs.tproj/fsck_hfs.c
++++ b/fsck_hfs.tproj/fsck_hfs.c
+@@ -24,10 +24,14 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
++#if !LINUX
+ #include <sys/ucred.h>
++#endif
+ #include <sys/mount.h>
+ #include <sys/ioctl.h>
++#if !LINUX
+ #include <sys/disk.h>
++#endif
+ #include <hfs/hfs_mount.h>
+@@ -195,8 +199,12 @@ main(argc, argv)
+       if (guiControl)
+               debug = 0; /* debugging is for command line only */
++#if LINUX
++// FIXME
++#else
+       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
+               (void)signal(SIGINT, catch);
++#endif
+       if (argc < 1) {
+               (void) fprintf(stderr, "%s: missing special-device\n", progname);
+@@ -218,7 +226,9 @@ checkfilesys(char * filesys)
+       int chkLev, repLev, logLev;
+       int blockDevice_fd, canWrite;
+       char *unraw, *mntonname;
++#if !LINUX
+       struct statfs *fsinfo;
++#endif
+       int fs_fd=-1;  // fd to the root-dir of the fs we're checking (only w/lfag == 1)
+       flags = 0;
+@@ -227,7 +237,9 @@ checkfilesys(char * filesys)
+       canWrite = 0;
+       unraw = NULL;
+       mntonname = NULL;
+-
++#if LINUX
++      // FIXME
++#else
+       if (lflag) {
+               result = getmntinfo(&fsinfo, MNT_NOWAIT);
+@@ -257,10 +269,10 @@ checkfilesys(char * filesys)
+                   }
+               }
+       }
+-
++#endif
+       if (debug && preen)
+               pwarn("starting\n");
+-      
++
+       if (setup( filesys, &blockDevice_fd, &canWrite ) == 0) {
+               if (preen)
+                       pfatal("CAN'T CHECK FILE SYSTEM.");
+@@ -278,7 +290,7 @@ checkfilesys(char * filesys)
+       repLev = kMajorRepairs;
+       logLev = kVerboseLog;
+-      if (yflag)      
++      if (yflag)
+               repLev = kMajorRepairs;
+       if (quick) {
+@@ -298,16 +310,16 @@ checkfilesys(char * filesys)
+       if (nflag)
+               repLev = kNeverRepair;
+-              
++
+       if ( rebuildCatalogBtree ) {
+               chkLev = kPartialCheck;
+               repLev = kForceRepairs;  // this will force rebuild of catalog B-Tree file
+       }
+-              
++
+       /*
+        * go check HFS volume...
+        */
+-      result = CheckHFS(      fsreadfd, fswritefd, chkLev, repLev, logLev, 
++      result = CheckHFS(      fsreadfd, fswritefd, chkLev, repLev, logLev,
+                                               guiControl, lostAndFoundMode, canWrite, &fsmodified );
+       if (!hotroot) {
+               ckfini(1);
+@@ -330,6 +342,9 @@ checkfilesys(char * filesys)
+                       }
+               }
+       } else {
++#if LINUX
++      // FIXME
++#else
+               struct statfs stfs_buf;
+               /*
+                * Check to see if root is mounted read-write.
+@@ -339,19 +354,25 @@ checkfilesys(char * filesys)
+               else
+                       flags = 0;
+               ckfini(flags & MNT_RDONLY);
++#endif
+       }
+       /* XXX free any allocated memory here */
+       if (hotroot && fsmodified) {
++#if !LINUX
+               struct hfs_mount_args args;
++#endif
+               /*
+                * We modified the root.  Do a mount update on
+                * it, unless it is read-write, so we can continue.
+                */
+               if (!preen)
+                       printf("\n***** FILE SYSTEM WAS MODIFIED *****\n");
+-              if (flags & MNT_RDONLY) {               
++#if LINUX
++              // FIXME
++#else
++              if (flags & MNT_RDONLY) {
+                       bzero(&args, sizeof(args));
+                       flags |= MNT_UPDATE | MNT_RELOAD;
+                       if (mount("hfs", "/", flags, &args) == 0) {
+@@ -359,6 +380,7 @@ checkfilesys(char * filesys)
+                               goto ExitThisRoutine;
+                       }
+               }
++#endif
+               if (!preen)
+                       printf("\n***** REBOOT NOW *****\n");
+               sync();
+@@ -367,7 +389,7 @@ checkfilesys(char * filesys)
+       }
+       result = (result == 0) ? 0 : EEXIT;
+-      
++
+ ExitThisRoutine:
+       if (lflag) {
+           fcntl(fs_fd, F_THAW_FS, NULL);
+@@ -401,16 +423,18 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
+       fswritefd = -1;
+       *blockDevice_fdPtr = -1;
+       *canWritePtr = 0;
+-      
++
+       if (stat(dev, &statb) < 0) {
+               printf("Can't stat %s: %s\n", dev, strerror(errno));
+               return (0);
+       }
++#if !LINUX
+       if ((statb.st_mode & S_IFMT) != S_IFCHR) {
+               pfatal("%s is not a character device", dev);
+               if (reply("CONTINUE") == 0)
+                       return (0);
+       }
++#endif
+       if ((fsreadfd = open(dev, O_RDONLY)) < 0) {
+               printf("Can't open %s: %s\n", dev, strerror(errno));
+               return (0);
+@@ -419,7 +443,7 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
+       /* attempt to get write access to the block device and if not check if volume is */
+       /* mounted read-only.  */
+       getWriteAccess( dev, blockDevice_fdPtr, canWritePtr );
+-      
++
+       if (preen == 0 && !guiControl)
+               printf("** %s", dev);
+       if (nflag || (fswritefd = open(dev, O_WRONLY)) < 0) {
+@@ -433,10 +457,14 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
+               printf("\n");
+       /* Get device block size to initialize cache */
++#if LINUX
++      devBlockSize = 512;
++#else
+       if (ioctl(fsreadfd, DKIOCGETBLOCKSIZE, &devBlockSize) < 0) {
+               pfatal ("Can't get device block size\n");
+               return (0);
+       }
++#endif
+        /* calculate the cache block size and total blocks */
+       if (CalculateCacheSize(userCacheSize, &cacheBlockSize, &cacheTotalBlocks, debug) != 0) {
+@@ -463,11 +491,15 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
+ static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
+ {
++#if !LINUX
+       int                                     i;
+       int                                     myMountsCount;
++#endif
+       void *                          myPtr;
+       char *                          myCharPtr;
++#if !LINUX
+       struct statfs *         myBufPtr;
++#endif
+       void *                          myNamePtr;
+       myPtr = NULL;
+@@ -490,6 +522,9 @@ static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr
+       }
+       
+       // get count of mounts then get the info for each 
++#if LINUX
++      // FIXME
++#else
+       myMountsCount = getfsstat( NULL, 0, MNT_NOWAIT );
+       if ( myMountsCount < 0 )
+               goto ExitThisRoutine;
+@@ -513,8 +548,8 @@ static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr
+               }
+               myBufPtr++;
+       }
+-      *canWritePtr = 1;  // single user will get us here, f_mntfromname is not /dev/diskXXXX 
+-      
++#endif
++      *canWritePtr = 1;  // single user will get us here, f_mntfromname is not /dev/diskXXXX
+ ExitThisRoutine:
+       if ( myPtr != NULL )
+               free( myPtr );
+diff --git a/fsck_hfs.tproj/utilities.c b/fsck_hfs.tproj/utilities.c
+index ee41bef..8e1cd77 100644
+--- a/fsck_hfs.tproj/utilities.c
++++ b/fsck_hfs.tproj/utilities.c
+@@ -183,12 +183,14 @@ retry:
+                       printf("Can't stat %s\n", raw);
+                       return (origname);
+               }
++#if !LINUX
+               if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
+                       return (raw);
+               } else {
+                       printf("%s is not a character device\n", raw);
+                       return (origname);
+               }
++#endif
+       } else if ((stblock.st_mode & S_IFMT) == S_IFCHR && !retried) {
+               newname = unrawname(newname);
+               retried++;
+@@ -214,7 +216,11 @@ rawname(char *name)
+       *dp = 0;
+       (void)strcpy(rawbuf, name);
+       *dp = '/';
+-      (void)strcat(rawbuf, "/r");
++#if LINUX
++      (void)strcat(rawbuf, "/");
++#else
++      (void)strcat(rawbuf,"/r");
++#endif
+       (void)strcat(rawbuf, &dp[1]);
+       return (rawbuf);
+diff --git a/include/missing.h b/include/missing.h
+new file mode 100644
+index 0000000..0a859c4
+--- /dev/null
++++ b/include/missing.h
+@@ -0,0 +1,114 @@
++#ifndef _MISSING_H_
++#define _MISSING_H_
++
++#include <endian.h>
++#include <byteswap.h>
++#include <errno.h>
++#include <stdint.h>
++#include <string.h>
++
++#define MAXBSIZE              (256 * 4096)
++
++#ifndef true
++#define true                  1
++#endif
++#ifndef false
++#define false                 0
++#endif
++
++/* Mac types */
++
++/* 8 Bit */
++#ifndef UInt8
++#define UInt8                 uint8_t
++#endif
++#ifndef u_int8_t
++#define u_int8_t              UInt8
++#endif
++#ifndef SInt8
++#define SInt8                 int8_t
++#endif
++
++/* 16 Bit */
++#ifndef UInt16
++#define UInt16                        uint16_t
++#endif
++#ifndef u_int16_t
++#define u_int16_t             UInt16
++#endif
++#ifndef SInt16
++#define SInt16                        int16_t
++#endif
++
++/* 32 Bit */
++#ifndef UInt32
++#define UInt32                        uint32_t
++#endif
++#ifndef u_int32_t
++#define u_int32_t             UInt32
++#endif
++#ifndef SInt32
++#define SInt32                        int32_t
++#endif
++
++/* 64 Bit */
++#ifndef UInt64
++#define UInt64                        uint64_t
++#endif
++#ifndef u_int64_t
++#define u_int64_t             UInt64
++#endif
++#ifndef SInt64
++#define SInt64                        int64_t
++#endif
++
++#define UniChar                       u_int16_t
++#define Boolean                       u_int8_t
++
++#define UF_NODUMP     0x00000001
++
++/* syslimits.h */
++#define NAME_MAX      255
++
++/* Byteswap stuff */
++#define NXSwapHostLongToBig(x)                cpu_to_be64(x)
++#define NXSwapBigShortToHost(x)       be16_to_cpu(x)
++#define OSSwapBigToHostInt16(x)               be16_to_cpu(x)
++#define NXSwapBigLongToHost(x)                be32_to_cpu(x)
++#define OSSwapBigToHostInt32(x)               be32_to_cpu(x)
++#define NXSwapBigLongLongToHost(x)    be64_to_cpu(x)
++#define OSSwapBigToHostInt64(x)               be64_to_cpu(x)
++
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++/* Big Endian Swaps */
++#ifndef be16_to_cpu
++#define be16_to_cpu(x) bswap_16(x)
++#endif
++#ifndef be32_to_cpu
++#define be32_to_cpu(x) bswap_32(x)
++#endif
++#ifndef be64_to_cpu
++#define be64_to_cpu(x) bswap_64(x)
++#endif
++#ifndef cpu_to_be64
++#define cpu_to_be64(x) bswap_64(x)
++#endif
++#elif __BYTE_ORDER == __BIG_ENDIAN
++/* Big endian doesn't swap */
++#ifndef be16_to_cpu
++#define be16_to_cpu(x)        (x)
++#endif
++#ifndef be32_to_cpu
++#define be32_to_cpu(x)        (x)
++#endif
++#ifndef be64_to_cpu
++#define be64_to_cpu(x)        (x)
++#endif
++#ifndef cpu_to_be64
++#define cpu_to_be64(x)        (x)
++#endif
++#endif
++
++#define KAUTH_FILESEC_XATTR "com.apple.system.Security"
++
++#endif
+diff --git a/newfs_hfs.tproj/hfs_endian.c b/newfs_hfs.tproj/hfs_endian.c
+index 117b7f8..fdf7353 100644
+--- a/newfs_hfs.tproj/hfs_endian.c
++++ b/newfs_hfs.tproj/hfs_endian.c
+@@ -30,7 +30,12 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#if LINUX
++#include "missing.h"
++#else
+ #include <architecture/byte_order.h>
++#endif
++
+ #include <hfs/hfs_format.h>
+ #include "hfs_endian.h"
+diff --git a/newfs_hfs.tproj/hfs_endian.h b/newfs_hfs.tproj/hfs_endian.h
+index 8d9d01d..5c7ff57 100644
+--- a/newfs_hfs.tproj/hfs_endian.h
++++ b/newfs_hfs.tproj/hfs_endian.h
+@@ -29,7 +29,12 @@
+  * volume format.
+  */
+ #include <hfs/hfs_format.h>
++#if LINUX
++#include <endian.h>
++#include <byteswap.h>
++#else
+ #include <architecture/byte_order.h>
++#endif
+ /*********************/
+ /* BIG ENDIAN Macros */
+diff --git a/newfs_hfs.tproj/makehfs.c b/newfs_hfs.tproj/makehfs.c
+index 085222f..7609779 100644
+--- a/newfs_hfs.tproj/makehfs.c
++++ b/newfs_hfs.tproj/makehfs.c
+@@ -31,10 +31,16 @@
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
++#if LINUX
++#include <time.h>
++#include "missing.h"
++#endif
+ #include <sys/errno.h>
+ #include <sys/stat.h>
+ #include <sys/sysctl.h>
++#if !LINUX
+ #include <sys/vmmeter.h>
++#endif
+ #include <err.h>
+ #include <errno.h>
+@@ -47,13 +53,14 @@
+ #include <openssl/sha.h>
++#if !LINUX
+ #include <architecture/byte_order.h>
+ #include <CoreFoundation/CFString.h>
+ #include <CoreFoundation/CFStringEncodingExt.h>
+ extern Boolean _CFStringGetFileSystemRepresentation(CFStringRef string, UInt8 *buffer, CFIndex maxBufLen);
+-
++#endif
+ #include <hfs/hfs_format.h>
+ #include <hfs/hfs_mount.h>
+@@ -129,7 +136,9 @@ static UInt32 Largest __P((UInt32 a, UInt32 b, UInt32 c, UInt32 d ));
+ static void MarkBitInAllocationBuffer __P((HFSPlusVolumeHeader *header,
+               UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector));
++#if !LINUX
+ static UInt32 GetDefaultEncoding();
++#endif
+ static UInt32 UTCToLocal __P((UInt32 utcTime));
+@@ -158,11 +167,14 @@ void SETOFFSET (void *buffer, UInt16 btNodeSize, SInt16 recOffset, SInt16 vecOff
+ #define ROUNDUP(x, u) (((x) % (u) == 0) ? (x) : ((x)/(u) + 1) * (u))
+-#define ENCODING_TO_BIT(e)                               \
++#if LINUX
++#define ENCODING_TO_BIT(e)       (e)
++#else
++#define ENCODING_TO_BIT(e)
+           ((e) < 48 ? (e) :                              \
+           ((e) == kCFStringEncodingMacUkrainian ? 48 :   \
+           ((e) == kCFStringEncodingMacFarsi ? 49 : 0)))
+-
++#endif
+ /*
+  * make_hfs
+  *    
+@@ -528,6 +540,7 @@ InitMDB(hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp)
+        * Map UTF-8 input into a Mac encoding.
+        * On conversion errors "untitled" is used as a fallback.
+        */
++#if !LINUX
+       {
+               UniChar unibuf[kHFSMaxVolumeNameChars];
+               CFStringRef cfstr;
+@@ -553,7 +566,11 @@ InitMDB(hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp)
+               bcopy(&mdbp->drVN[1], defaults->volumeName, mdbp->drVN[0]);
+               defaults->volumeName[mdbp->drVN[0]] = '\0';
+       }
++#endif
+       /* Save the encoding hint in the Finder Info (field 4). */
++      mdbp->drVN[0] = strlen(defaults->volumeName);
++      bcopy(defaults->volumeName,&mdbp->drVN[1],mdbp->drVN[0]);
++
+       mdbp->drFndrInfo[4] = SET_HFS_TEXT_ENCODING(defaults->encodingHint);
+       mdbp->drWrCnt = kWriteSeqNum;
+@@ -1100,9 +1117,11 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header
+       UInt16                                  nodeSize;
+       SInt16                                  offset;
+       UInt32                                  unicodeBytes;
++#if !LINUX
+       UInt8 canonicalName[256];
+       CFStringRef cfstr;
+       Boolean cfOK;
++#endif
+       int index = 0;
+       nodeSize = dp->catalogNodeSize;
+@@ -1122,7 +1141,9 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header
+        * First record is always the root directory...
+        */
+       ckp = (HFSPlusCatalogKey *)((UInt8 *)buffer + offset);
+-      
++#if LINUX
++      ConvertUTF8toUnicode(dp->volumeName, sizeof(ckp->nodeName.unicode), ckp->nodeName.unicode, &ckp->nodeName.length);
++#else
+       /* Use CFString functions to get a HFSPlus Canonical name */
+       cfstr = CFStringCreateWithCString(kCFAllocatorDefault, (char *)dp->volumeName, kCFStringEncodingUTF8);
+       cfOK = _CFStringGetFileSystemRepresentation(cfstr, canonicalName, sizeof(canonicalName));
+@@ -1139,6 +1160,7 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header
+                     dp->volumeName, kDefaultVolumeNameStr);
+       }
+       CFRelease(cfstr);
++#endif
+       ckp->nodeName.length = SWAP_BE16 (ckp->nodeName.length);
+       unicodeBytes = sizeof(UniChar) * SWAP_BE16 (ckp->nodeName.length);
+@@ -1821,15 +1843,15 @@ WriteBuffer(const DriveInfo *driveInfo, UInt64 startingSector, UInt32 byteCount,
+       off_t sector;
+       if ((byteCount % driveInfo->sectorSize) != 0)
+-              errx(1, "WriteBuffer: byte count %ld is not sector size multiple", byteCount);
++              errx(1, "WriteBuffer: byte count %i is not sector size multiple", byteCount);
+       sector = driveInfo->sectorOffset + startingSector;
+       if (lseek(driveInfo->fd, sector * driveInfo->sectorSize, SEEK_SET) < 0)
+-              err(1, "seek (sector %qd)", sector);
++              err(1, "seek (sector %lld)", sector);
+       if (write(driveInfo->fd, buffer, byteCount) != byteCount)
+-              err(1, "write (sector %qd, %ld bytes)", sector, byteCount);
++              err(1, "write (sector %lld, %i bytes)", sector, byteCount);
+ }
+@@ -1913,7 +1935,7 @@ DivideAndRoundUp(UInt32 numerator, UInt32 denominator)
+       return quotient;
+ }
+-
++#if !LINUX
+ #define __kCFUserEncodingFileName ("/.CFUserTextEncoding")
+ static UInt32
+@@ -1939,7 +1961,7 @@ GetDefaultEncoding()
+     }
+     return 0;
+ }
+-
++#endif
+ static int
+ ConvertUTF8toUnicode(const UInt8* source, UInt32 bufsize, UniChar* unibuf,
+@@ -2006,6 +2028,9 @@ ConvertUTF8toUnicode(const UInt8* source, UInt32 bufsize, UniChar* unibuf,
+ static int
+ getencodinghint(unsigned char *name)
+ {
++#if LINUX
++      return(0);
++#else
+         int mib[3];
+         size_t buflen = sizeof(int);
+         struct vfsconf vfc;
+@@ -2023,7 +2048,8 @@ getencodinghint(unsigned char *name)
+       return (hint);
+ error:
+       hint = GetDefaultEncoding();
+-      return (hint);
++      return (0);
++#endif
+ }
+@@ -2034,12 +2060,14 @@ void GenerateVolumeUUID(VolumeUUID *newVolumeID) {
+       unsigned char digest[20];
+       time_t now;
+       clock_t uptime;
+-      int mib[2];
+-      int sysdata;
+-      char sysctlstring[128];
+       size_t datalen;
+       double sysloadavg[3];
++#if !LINUX
++      int sysdata;
++      int mib[2];
++      char sysctlstring[128];
+       struct vmtotal sysvmtotal;
++#endif
+       
+       do {
+               /* Initialize the SHA-1 context for processing: */
+@@ -2052,52 +2080,58 @@ void GenerateVolumeUUID(VolumeUUID *newVolumeID) {
+               SHA1_Update(&context, &uptime, sizeof(uptime));
+               
+               /* The kernel's boot time: */
++#if !LINUX
+               mib[0] = CTL_KERN;
+               mib[1] = KERN_BOOTTIME;
+               datalen = sizeof(sysdata);
+               sysctl(mib, 2, &sysdata, &datalen, NULL, 0);
+               SHA1_Update(&context, &sysdata, datalen);
+-              
++#endif
+               /* The system's host id: */
++#if !LINUX
+               mib[0] = CTL_KERN;
+               mib[1] = KERN_HOSTID;
+               datalen = sizeof(sysdata);
+               sysctl(mib, 2, &sysdata, &datalen, NULL, 0);
+               SHA1_Update(&context, &sysdata, datalen);
+-
++#endif
+               /* The system's host name: */
++#if !LINUX
+               mib[0] = CTL_KERN;
+               mib[1] = KERN_HOSTNAME;
+               datalen = sizeof(sysctlstring);
+               sysctl(mib, 2, sysctlstring, &datalen, NULL, 0);
+               SHA1_Update(&context, sysctlstring, datalen);
+-
++#endif
+               /* The running kernel's OS release string: */
++#if !LINUX
+               mib[0] = CTL_KERN;
+               mib[1] = KERN_OSRELEASE;
+               datalen = sizeof(sysctlstring);
+               sysctl(mib, 2, sysctlstring, &datalen, NULL, 0);
+               SHA1_Update(&context, sysctlstring, datalen);
+-
++#endif
+               /* The running kernel's version string: */
++#if !LINUX
+               mib[0] = CTL_KERN;
+               mib[1] = KERN_VERSION;
+               datalen = sizeof(sysctlstring);
+               sysctl(mib, 2, sysctlstring, &datalen, NULL, 0);
+               SHA1_Update(&context, sysctlstring, datalen);
+-
++#endif
+               /* The system's load average: */
+               datalen = sizeof(sysloadavg);
+               getloadavg(sysloadavg, 3);
+               SHA1_Update(&context, &sysloadavg, datalen);
+               /* The system's VM statistics: */
++#if !LINUX
+               mib[0] = CTL_VM;
+               mib[1] = VM_METER;
+               datalen = sizeof(sysvmtotal);
+               sysctl(mib, 2, &sysvmtotal, &datalen, NULL, 0);
+               SHA1_Update(&context, &sysvmtotal, datalen);
+-
++#endif
+               /* The current GMT (26 ASCII characters): */
+               time(&now);
+               strncpy(randomInputBuffer, asctime(gmtime(&now)), 26);  /* "Mon Mar 27 13:46:26 2000" */
+diff --git a/newfs_hfs.tproj/newfs_hfs.c b/newfs_hfs.tproj/newfs_hfs.c
+index c4176a9..bf2ed21 100644
+--- a/newfs_hfs.tproj/newfs_hfs.c
++++ b/newfs_hfs.tproj/newfs_hfs.c
+@@ -38,8 +38,13 @@
+ #include <sys/mount.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
++#if LINUX
++#include <time.h>
++#endif
++#if !LINUX
+ #include <IOKit/storage/IOMediaBSDClient.h>
++#endif
+ #include <hfs/hfs_format.h>
+ #include "newfs_hfs.h"
+@@ -73,7 +78,9 @@ static void usage __P((void));
+ char  *progname;
+ char  gVolumeName[kHFSPlusMaxFileNameChars + 1] = {kDefaultVolumeNameStr};
++#if !LINUX
+ char  rawdevice[MAXPATHLEN];
++#endif
+ char  blkdevice[MAXPATHLEN];
+ UInt32        gBlockSize = 0;
+ UInt32        gNextCNID = kHFSFirstUserCatalogNodeID;
+@@ -158,8 +165,10 @@ main(argc, argv)
+       extern int optind;
+       int ch;
+       int forceHFS;
++#if !LINUX
+       char *cp, *special;
+       struct statfs *mp;
++#endif
+       int n;
+       
+       if ((progname = strrchr(*argv, '/')))
+@@ -260,16 +269,19 @@ main(argc, argv)
+                       usage();
+               }
+-      argc -= optind;
+-      argv += optind;
++              argc -= optind;
++              argv += optind;
+-      if (gPartitionSize != 0) {
+-              if (argc != 0)
+-                      usage();
+-      } else {
+-              if (argc != 1)
+-                      usage();
++              if (gPartitionSize != 0) {
++                      if (argc != 0)
++                              usage();
++              } else {
++                      if (argc != 1)
++                              usage();
++#if LINUX
++              (void) sprintf(blkdevice, "%s", argv[0]);
++#else
+               special = argv[0];
+               cp = strrchr(special, '/');
+               if (cp != 0)
+@@ -278,6 +290,7 @@ main(argc, argv)
+                       special++;
+               (void) sprintf(rawdevice, "%sr%s", _PATH_DEV, special);
+               (void) sprintf(blkdevice, "%s%s", _PATH_DEV, special);
++#endif
+       }
+       if (forceHFS && gJournaled) {
+@@ -301,6 +314,9 @@ main(argc, argv)
+               /*
+                * Check if target device is aready mounted
+                */
++#if LINUX
++      // FIXME
++#else
+               n = getmntinfo(&mp, MNT_NOWAIT);
+               if (n == 0)
+                       fatal("%s: getmntinfo: %s", blkdevice, strerror(errno));
+@@ -310,15 +326,20 @@ main(argc, argv)
+                               fatal("%s is mounted on %s", blkdevice, mp->f_mntonname);
+                       ++mp;
+               }
++#endif
+       }
+-      if (hfs_newfs(rawdevice, forceHFS, true) < 0) {
++      if (hfs_newfs(blkdevice, forceHFS, true) < 0) {
++#if LINUX
++              err(1, NULL);
++#else
+               /* On ENXIO error use the block device (to get de-blocking) */
+               if (errno == ENXIO) {
+                       if (hfs_newfs(blkdevice, forceHFS, false) < 0)
+                               err(1, NULL);
+               } else
+                       err(1, NULL);
++#endif
+       }
+       exit(0);
+@@ -506,7 +527,9 @@ hfs_newfs(char *device, int forceHFS, int isRaw)
+       int fso = 0;
+       int retval = 0;
+       hfsparams_t defaults = {0};
++#if !LINUX
+       u_int64_t maxSectorsPerIO;
++#endif
+       if (gPartitionSize) {
+                       dip.sectorSize = kBytesPerSector;
+@@ -526,6 +549,34 @@ hfs_newfs(char *device, int forceHFS, int isRaw)
+       
+               if (fstat( fso, &stbuf) < 0)
+                       fatal("%s: %s", device, strerror(errno));
++#if LINUX
++              dip.sectorSize = 512;
++              dip.sectorsPerIO = 256;
++
++#     ifndef  BLKGETSIZE
++#     define  BLKGETSIZE              _IO(0x12,96)
++#     endif
++
++#     ifndef  BLKGETSIZE64
++#     define BLKGETSIZE64             _IOR(0x12,114,size_t)
++#     endif
++
++              if (S_ISREG(stbuf.st_mode)) {
++                      dip.totalSectors = stbuf.st_size / 512;
++              }
++              else if (S_ISBLK(stbuf.st_mode)) {
++                      unsigned long size;
++                      u_int64_t size64;
++                      if (!ioctl(fso, BLKGETSIZE64, &size64))
++                              dip.totalSectors = size64 / 512;
++                      else if (!ioctl(fso, BLKGETSIZE, &size))
++                              dip.totalSectors = size;
++                      else
++                              fatal("%s: %s", device, strerror(errno));
++              }
++              else
++                      fatal("%s: is not a block device", device);
++#else
+       
+               if (ioctl(fso, DKIOCGETBLOCKCOUNT, &dip.totalSectors) < 0)
+                       fatal("%s: %s", device, strerror(errno));
+@@ -537,11 +588,14 @@ hfs_newfs(char *device, int forceHFS, int isRaw)
+                       dip.sectorsPerIO = (128 * 1024) / dip.sectorSize;  /* use 128K as default */
+               else
+                       dip.sectorsPerIO = MIN(maxSectorsPerIO, (1024 * 1024) / dip.sectorSize);
++#endif
++
+               /*
+                * The make_hfs code currentlydoes 512 byte sized I/O.
+                * If the sector size is bigger than 512, start over
+                * using the block device (to get de-blocking).
+                */       
++#if !LINUX
+               if (dip.sectorSize != kBytesPerSector) {
+                       if (isRaw) {
+                               close(fso);
+@@ -556,7 +610,9 @@ hfs_newfs(char *device, int forceHFS, int isRaw)
+                               dip.sectorSize = kBytesPerSector;
+                       }
+               }
++#endif
+       }
++
+       dip.sectorOffset = 0;
+       time(&createtime);
+diff --git a/newfs_hfs.tproj/newfs_hfs.h b/newfs_hfs.tproj/newfs_hfs.h
+index 968ff10..5680a34 100644
+--- a/newfs_hfs.tproj/newfs_hfs.h
++++ b/newfs_hfs.tproj/newfs_hfs.h
+@@ -19,8 +19,12 @@
+  * 
+  * @APPLE_LICENSE_HEADER_END@
+  */
+- 
++
++#if LINUX
++#include "missing.h"
++#else
+ #include <CoreFoundation/CFBase.h>
++#endif
+ /*
+  * Mac OS Finder flags
+@@ -122,33 +126,33 @@ enum {
+ #define kDTDF_FileID  16
+ #define kDTDF_Name    "Desktop DF"
+ #define kDTDF_Chars   10
+-#define kDTDF_Type    'DTFL'
+-#define kDTDF_Creator 'DMGR'
++#define kDTDF_Type    0x4454464C /* 'DTFL' */
++#define kDTDF_Creator 0x444D4752 /* 'DMGR' */
+ #define kDTDB_FileID  17
+ #define kDTDB_Name    "Desktop DB"
+ #define kDTDB_Chars   10
+-#define kDTDB_Type    'BTFL'
+-#define kDTDB_Creator 'DMGR'
++#define kDTDB_Type    0x4254464C /* 'BTFL' */
++#define kDTDB_Creator 0x444D4752 /* 'DMGR' */
+ #define kDTDB_Size    1024
+ #define kReadMe_FileID        18
+ #define kReadMe_Name  "ReadMe"
+ #define kReadMe_Chars 6
+-#define kReadMe_Type  'ttro'
+-#define kReadMe_Creator       'ttxt'
++#define kReadMe_Type  0x7474726F /* 'ttro' */
++#define kReadMe_Creator       0x74747974 /* 'ttxt' */
+ #define kFinder_FileID        19
+ #define kFinder_Name  "Finder"
+ #define kFinder_Chars 6
+-#define kFinder_Type  'FNDR'
+-#define kFinder_Creator       'MACS'
++#define kFinder_Type  0x464E4452 /* 'FNDR' */
++#define kFinder_Creator       0x4D414353 /* 'MACS' */
+ #define kSystem_FileID        20
+ #define kSystem_Name  "System"
+ #define kSystem_Chars 6
+-#define kSystem_Type  'zsys'
+-#define kSystem_Creator       'MACS'
++#define kSystem_Type  0x7A737973 /* 'zsys' */
++#define kSystem_Creator       0x4D414353 /* 'MACS' */
diff --git a/utils/hfsprogs/patches/0003-Add-helper-include-files-absent-from-the-upstream-pa.patch b/utils/hfsprogs/patches/0003-Add-helper-include-files-absent-from-the-upstream-pa.patch
new file mode 100644 (file)
index 0000000..003f844
--- /dev/null
@@ -0,0 +1,1024 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Add helper include files absent from the upstream package
+
+Add some include files from an Apple system that contain the definition of
+the data structures used by the programs that manipulate the filesystems.
+---
+ include/bitstring.h        | 164 +++++++++++
+ include/hfs/hfs_format.h   | 689 +++++++++++++++++++++++++++++++++++++++++++++
+ include/hfs/hfs_mount.h    |  78 +++++
+ include/sys/appleapiopts.h |  52 ++++
+ 4 files changed, 983 insertions(+)
+ create mode 100644 include/bitstring.h
+ create mode 100644 include/hfs/hfs_format.h
+ create mode 100644 include/hfs/hfs_mount.h
+ create mode 100644 include/sys/appleapiopts.h
+
+diff --git a/include/bitstring.h b/include/bitstring.h
+new file mode 100644
+index 0000000..fbecfbe
+--- /dev/null
++++ b/include/bitstring.h
+@@ -0,0 +1,164 @@
++/*
++ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
++ *
++ * @APPLE_LICENSE_HEADER_START@
++ *
++ * The contents of this file constitute Original Code as defined in and
++ * are subject to the Apple Public Source License Version 1.1 (the
++ * "License").  You may not use this file except in compliance with the
++ * License.  Please obtain a copy of the License at
++ * http://www.apple.com/publicsource and read it before using this file.
++ *
++ * This Original Code and all software distributed under the License are
++ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
++ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
++ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
++ * License for the specific language governing rights and limitations
++ * under the License.
++ *
++ * @APPLE_LICENSE_HEADER_END@
++ */
++/*
++ * Copyright (c) 1989, 1993
++ *    The Regents of the University of California.  All rights reserved.
++ *
++ * This code is derived from software contributed to Berkeley by
++ * Paul Vixie.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. 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.
++ * 3. All advertising materials mentioning features or use of this software
++ *    must display the following acknowledgement:
++ *    This product includes software developed by the University of
++ *    California, Berkeley and its contributors.
++ * 4. Neither the name of the University nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
++ *
++ *    @(#)bitstring.h 8.1 (Berkeley) 7/19/93
++ */
++
++#ifndef _BITSTRING_H_
++#define       _BITSTRING_H_
++
++typedef       unsigned char bitstr_t;
++
++/* internal macros */
++                              /* byte of the bitstring bit is in */
++#define       _bit_byte(bit) \
++      ((bit) >> 3)
++
++                              /* mask for the bit within its byte */
++#define       _bit_mask(bit) \
++      (1 << ((bit)&0x7))
++
++/* external macros */
++                              /* bytes in a bitstring of nbits bits */
++#define       bitstr_size(nbits) \
++      ((((nbits) - 1) >> 3) + 1)
++
++                              /* allocate a bitstring */
++#define       bit_alloc(nbits) \
++      (bitstr_t *)calloc(1, \
++          (unsigned int)bitstr_size(nbits) * sizeof(bitstr_t))
++
++                              /* allocate a bitstring on the stack */
++#define       bit_decl(name, nbits) \
++      (name)[bitstr_size(nbits)]
++
++                              /* is bit N of bitstring name set? */
++#define       bit_test(name, bit) \
++      ((name)[_bit_byte(bit)] & _bit_mask(bit))
++
++                              /* set bit N of bitstring name */
++#define       bit_set(name, bit) \
++      (name)[_bit_byte(bit)] |= _bit_mask(bit)
++
++                              /* clear bit N of bitstring name */
++#define       bit_clear(name, bit) \
++      (name)[_bit_byte(bit)] &= ~_bit_mask(bit)
++
++                              /* clear bits start ... stop in bitstring */
++#define       bit_nclear(name, start, stop) { \
++      register bitstr_t *_name = name; \
++      register int _start = start, _stop = stop; \
++      register int _startbyte = _bit_byte(_start); \
++      register int _stopbyte = _bit_byte(_stop); \
++      if (_startbyte == _stopbyte) { \
++              _name[_startbyte] &= ((0xff >> (8 - (_start&0x7))) | \
++                                    (0xff << ((_stop&0x7) + 1))); \
++      } else { \
++              _name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \
++              while (++_startbyte < _stopbyte) \
++                      _name[_startbyte] = 0; \
++              _name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \
++      } \
++}
++
++                              /* set bits start ... stop in bitstring */
++#define       bit_nset(name, start, stop) { \
++      register bitstr_t *_name = name; \
++      register int _start = start, _stop = stop; \
++      register int _startbyte = _bit_byte(_start); \
++      register int _stopbyte = _bit_byte(_stop); \
++      if (_startbyte == _stopbyte) { \
++              _name[_startbyte] |= ((0xff << (_start&0x7)) & \
++                                  (0xff >> (7 - (_stop&0x7)))); \
++      } else { \
++              _name[_startbyte] |= 0xff << ((_start)&0x7); \
++              while (++_startbyte < _stopbyte) \
++                      _name[_startbyte] = 0xff; \
++              _name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \
++      } \
++}
++
++                              /* find first bit clear in name */
++#define       bit_ffc(name, nbits, value) { \
++      register bitstr_t *_name = name; \
++      register int _byte, _nbits = nbits; \
++      register int _stopbyte = _bit_byte(_nbits), _value = -1; \
++      for (_byte = 0; _byte <= _stopbyte; ++_byte) \
++              if (_name[_byte] != 0xff) { \
++                      _value = _byte << 3; \
++                      for (_stopbyte = _name[_byte]; (_stopbyte&0x1); \
++                          ++_value, _stopbyte >>= 1); \
++                      break; \
++              } \
++      *(value) = _value; \
++}
++
++                              /* find first bit set in name */
++#define       bit_ffs(name, nbits, value) { \
++      register bitstr_t *_name = name; \
++      register int _byte, _nbits = nbits; \
++      register int _stopbyte = _bit_byte(_nbits), _value = -1; \
++      for (_byte = 0; _byte <= _stopbyte; ++_byte) \
++              if (_name[_byte]) { \
++                      _value = _byte << 3; \
++                      for (_stopbyte = _name[_byte]; !(_stopbyte&0x1); \
++                          ++_value, _stopbyte >>= 1); \
++                      break; \
++              } \
++      *(value) = _value; \
++}
++
++#endif /* !_BITSTRING_H_ */
+diff --git a/include/hfs/hfs_format.h b/include/hfs/hfs_format.h
+new file mode 100644
+index 0000000..d820329
+--- /dev/null
++++ b/include/hfs/hfs_format.h
+@@ -0,0 +1,689 @@
++/*
++ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
++ *
++ * @APPLE_LICENSE_HEADER_START@
++ *
++ * The contents of this file constitute Original Code as defined in and
++ * are subject to the Apple Public Source License Version 1.1 (the
++ * "License").  You may not use this file except in compliance with the
++ * License.  Please obtain a copy of the License at
++ * http://www.apple.com/publicsource and read it before using this file.
++ *
++ * This Original Code and all software distributed under the License are
++ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
++ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
++ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
++ * License for the specific language governing rights and limitations
++ * under the License.
++ *
++ * @APPLE_LICENSE_HEADER_END@
++ */
++#ifndef __HFS_FORMAT__
++#define __HFS_FORMAT__
++
++#include "missing.h"
++
++#include <sys/appleapiopts.h>
++
++/*
++ * hfs_format.c
++ *
++ * This file describes the on-disk format for HFS and HFS Plus volumes.
++ * The HFS Plus volume format is desciibed in detail in Apple Technote 1150.
++ *
++ * http://developer.apple.com/technotes/tn/tn1150.html
++ *
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* some on-disk hfs structures have 68K alignment (misaligned) */
++
++#define PACKED_S      __attribute__((packed))
++
++/* Signatures used to differentiate between HFS and HFS Plus volumes */
++enum {
++      kHFSSigWord             = 0x4244,       /* 'BD' in ASCII */
++      kHFSPlusSigWord         = 0x482B,       /* 'H+' in ASCII */
++      kHFSXSigWord            = 0x4858,       /* 'HX' in ASCII */
++
++      kHFSPlusVersion         = 0x0004,       /* 'H+' volumes are version 4 only */
++      kHFSXVersion            = 0x0005,       /* 'HX' volumes start with version 5 */
++
++      kHFSPlusMountVersion    = 0x31302E30,   /* '10.0' for Mac OS X */
++      kHFSJMountVersion       = 0x4846534a,   /* 'HFSJ' for journaled HFS+ on OS X */
++      kFSKMountVersion        = 0x46534b21    /* 'FSK!' for failed journal replay */
++}PACKED_S;
++
++
++#if 1
++/*
++ * Mac OS X has a special directory for linked and unlinked files (HFS Plus only).
++ * This directory and its contents are never exported from the filesystem under
++ * Mac OS X.
++ *
++ * To make this folder name sort last,  it has embedded null prefix.
++ * (0xC0, 0x80 in UTF-8)
++ */
++#define HFSPLUSMETADATAFOLDER  "\xC0\x80\xC0\x80\xC0\x80\xC0\x80HFS+ Private Data"
++
++/*
++ * Files in the HFS Private Data folder have one of the following prefixes
++ * followed by a decimal number (no leading zeros).  For indirect nodes this
++ * number is a 32 bit random number.  For unlinked (deleted) files that are
++ * still open, the number is the file ID for that file.
++ *
++ * e.g.  iNode7182000 and temp3296
++ */
++#define HFS_INODE_PREFIX      "iNode"
++#define HFS_DELETE_PREFIX     "temp"
++
++#endif /* __APPLE_API_PRIVATE */
++
++/*
++ * Indirect link files (hard links) have the following type/creator.
++ */
++enum {
++      kHardLinkFileType = 0x686C6E6B,  /* 'hlnk' */
++      kHFSPlusCreator   = 0x6866732B   /* 'hfs+' */
++}PACKED_S;
++
++
++#ifndef _HFSUNISTR255_DEFINED_
++#define _HFSUNISTR255_DEFINED_
++/* Unicode strings are used for HFS Plus file and folder names */
++struct HFSUniStr255 {
++      u_int16_t       length;         /* number of unicode characters */
++      u_int16_t       unicode[255];   /* unicode characters */
++} PACKED_S;
++typedef struct HFSUniStr255 HFSUniStr255;
++typedef const HFSUniStr255 *ConstHFSUniStr255Param;
++#endif /* _HFSUNISTR255_DEFINED_ */
++
++enum {
++      kHFSMaxVolumeNameChars          = 27,
++      kHFSMaxFileNameChars            = 31,
++      kHFSPlusMaxFileNameChars        = 255
++}PACKED_S;
++
++
++/* Extent overflow file data structures */
++
++/* HFS Extent key */
++struct HFSExtentKey {
++      u_int8_t        keyLength;      /* length of key, excluding this field */
++      u_int8_t        forkType;       /* 0 = data fork, FF = resource fork */
++      u_int32_t       fileID;         /* file ID */
++      u_int16_t       startBlock;     /* first file allocation block number in this extent */
++}PACKED_S;
++typedef struct HFSExtentKey HFSExtentKey;
++
++/* HFS Plus Extent key */
++struct HFSPlusExtentKey {
++      u_int16_t       keyLength;              /* length of key, excluding this field */
++      u_int8_t        forkType;               /* 0 = data fork, FF = resource fork */
++      u_int8_t        pad;                    /* make the other fields align on 32-bit boundary */
++      u_int32_t       fileID;                 /* file ID */
++      u_int32_t       startBlock;             /* first file allocation block number in this extent */
++}PACKED_S;
++typedef struct HFSPlusExtentKey HFSPlusExtentKey;
++
++/* Number of extent descriptors per extent record */
++enum {
++      kHFSExtentDensity       = 3,
++      kHFSPlusExtentDensity   = 8
++}PACKED_S;
++
++/* HFS extent descriptor */
++struct HFSExtentDescriptor {
++      u_int16_t       startBlock;             /* first allocation block */
++      u_int16_t       blockCount;             /* number of allocation blocks */
++}PACKED_S;
++typedef struct HFSExtentDescriptor HFSExtentDescriptor;
++
++/* HFS Plus extent descriptor */
++struct HFSPlusExtentDescriptor {
++      u_int32_t       startBlock;             /* first allocation block */
++      u_int32_t       blockCount;             /* number of allocation blocks */
++}PACKED_S;
++typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor;
++
++/* HFS extent record */
++typedef HFSExtentDescriptor HFSExtentRecord[3];
++
++/* HFS Plus extent record */
++typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8];
++
++
++/* Finder information */
++struct FndrFileInfo {
++      u_int32_t       fdType;         /* file type */
++      u_int32_t       fdCreator;      /* file creator */
++      u_int16_t       fdFlags;        /* Finder flags */
++      struct {
++          int16_t     v;              /* file's location */
++          int16_t     h;
++      } PACKED_S fdLocation;
++      int16_t         opaque;
++}PACKED_S;
++typedef struct FndrFileInfo FndrFileInfo;
++
++struct FndrDirInfo {
++      struct {                        /* folder's window rectangle */
++          int16_t     top;
++          int16_t     left;
++          int16_t     bottom;
++          int16_t     right;
++      }PACKED_S frRect;
++      unsigned short  frFlags;        /* Finder flags */
++      struct {
++          u_int16_t   v;              /* folder's location */
++          u_int16_t   h;
++      }PACKED_S frLocation;
++      int16_t         opaque;
++}PACKED_S;
++typedef struct FndrDirInfo FndrDirInfo;
++
++struct FndrOpaqueInfo {
++      int8_t opaque[16];
++}PACKED_S;
++typedef struct FndrOpaqueInfo FndrOpaqueInfo;
++
++
++/* HFS Plus Fork data info - 80 bytes */
++struct HFSPlusForkData {
++      u_int64_t               logicalSize;    /* fork's logical size in bytes */
++      u_int32_t               clumpSize;      /* fork's clump size in bytes */
++      u_int32_t               totalBlocks;    /* total blocks used by this fork */
++      HFSPlusExtentRecord     extents;        /* initial set of extents */
++}PACKED_S;
++typedef struct HFSPlusForkData HFSPlusForkData;
++
++
++/* Mac OS X has 16 bytes worth of "BSD" info.
++ *
++ * Note:  Mac OS 9 implementations and applications
++ * should preserve, but not change, this information.
++ */
++struct HFSPlusBSDInfo {
++      u_int32_t       ownerID;        /* user or group ID of file/folder owner */
++      u_int32_t       groupID;        /* additional user of group ID */
++      u_int8_t        adminFlags;     /* super-user changeable flags */
++      u_int8_t        ownerFlags;     /* owner changeable flags */
++      u_int16_t       fileMode;       /* file type and permission bits */
++      union {
++          u_int32_t   iNodeNum;       /* indirect node number (hard links only) */
++          u_int32_t   linkCount;      /* links that refer to this indirect node */
++          u_int32_t   rawDevice;      /* special file device (FBLK and FCHR only) */
++      }PACKED_S special;
++}PACKED_S;
++typedef struct HFSPlusBSDInfo HFSPlusBSDInfo;
++
++
++/* Catalog file data structures */
++
++enum {
++      kHFSRootParentID                = 1,    /* Parent ID of the root folder */
++      kHFSRootFolderID                = 2,    /* Folder ID of the root folder */
++      kHFSExtentsFileID               = 3,    /* File ID of the extents file */
++      kHFSCatalogFileID               = 4,    /* File ID of the catalog file */
++      kHFSBadBlockFileID              = 5,    /* File ID of the bad allocation block file */
++      kHFSAllocationFileID            = 6,    /* File ID of the allocation file (HFS Plus only) */
++      kHFSStartupFileID               = 7,    /* File ID of the startup file (HFS Plus only) */
++      kHFSAttributesFileID            = 8,    /* File ID of the attribute file (HFS Plus only) */
++      kHFSRepairCatalogFileID         = 14,   /* Used when rebuilding Catalog B-tree */
++      kHFSBogusExtentFileID           = 15,   /* Used for exchanging extents in extents file */
++      kHFSFirstUserCatalogNodeID      = 16
++}PACKED_S;
++
++/* HFS catalog key */
++struct HFSCatalogKey {
++      u_int8_t        keyLength;              /* key length (in bytes) */
++      u_int8_t        reserved;               /* reserved (set to zero) */
++      u_int32_t       parentID;               /* parent folder ID */
++      u_int8_t        nodeName[kHFSMaxFileNameChars + 1]; /* catalog node name */
++}PACKED_S;
++typedef struct HFSCatalogKey HFSCatalogKey;
++
++/* HFS Plus catalog key */
++struct HFSPlusCatalogKey {
++      u_int16_t               keyLength;      /* key length (in bytes) */
++      u_int32_t               parentID;       /* parent folder ID */
++      HFSUniStr255            nodeName;       /* catalog node name */
++}PACKED_S;
++typedef struct HFSPlusCatalogKey HFSPlusCatalogKey;
++
++/* Catalog record types */
++enum {
++      /* HFS Catalog Records */
++      kHFSFolderRecord                = 0x0100,       /* Folder record */
++      kHFSFileRecord                  = 0x0200,       /* File record */
++      kHFSFolderThreadRecord          = 0x0300,       /* Folder thread record */
++      kHFSFileThreadRecord            = 0x0400,       /* File thread record */
++
++      /* HFS Plus Catalog Records */
++      kHFSPlusFolderRecord            = 1,            /* Folder record */
++      kHFSPlusFileRecord              = 2,            /* File record */
++      kHFSPlusFolderThreadRecord      = 3,            /* Folder thread record */
++      kHFSPlusFileThreadRecord        = 4             /* File thread record */
++}PACKED_S;
++
++
++/* Catalog file record flags */
++enum {
++      kHFSFileLockedBit       = 0x0000,       /* file is locked and cannot be written to */
++      kHFSFileLockedMask      = 0x0001,
++
++      kHFSThreadExistsBit     = 0x0001,       /* a file thread record exists for this file */
++      kHFSThreadExistsMask    = 0x0002,
++
++      kHFSHasAttributesBit    = 0x0002,       /* object has extended attributes */
++      kHFSHasAttributesMask   = 0x0004,
++
++      kHFSHasSecurityBit      = 0x0003,       /* object has security data (ACLs) */
++      kHFSHasSecurityMask     = 0x0008
++}PACKED_S;
++
++
++/* HFS catalog folder record - 70 bytes */
++struct HFSCatalogFolder {
++      int16_t                 recordType;             /* == kHFSFolderRecord */
++      u_int16_t               flags;                  /* folder flags */
++      u_int16_t               valence;                /* folder valence */
++      u_int32_t               folderID;               /* folder ID */
++      u_int32_t               createDate;             /* date and time of creation */
++      u_int32_t               modifyDate;             /* date and time of last modification */
++      u_int32_t               backupDate;             /* date and time of last backup */
++      FndrDirInfo             userInfo;               /* Finder information */
++      FndrOpaqueInfo          finderInfo;             /* additional Finder information */
++      u_int32_t               reserved[4];            /* reserved - initialized as zero */
++}PACKED_S;
++typedef struct HFSCatalogFolder HFSCatalogFolder;
++
++/* HFS Plus catalog folder record - 88 bytes */
++struct HFSPlusCatalogFolder {
++      int16_t                 recordType;             /* == kHFSPlusFolderRecord */
++      u_int16_t               flags;                  /* file flags */
++      u_int32_t               valence;                /* folder's valence (limited to 2^16 in Mac OS) */
++      u_int32_t               folderID;               /* folder ID */
++      u_int32_t               createDate;             /* date and time of creation */
++      u_int32_t               contentModDate;         /* date and time of last content modification */
++      u_int32_t               attributeModDate;       /* date and time of last attribute modification */
++      u_int32_t               accessDate;             /* date and time of last access (MacOS X only) */
++      u_int32_t               backupDate;             /* date and time of last backup */
++      HFSPlusBSDInfo          bsdInfo;                /* permissions (for MacOS X) */
++      FndrDirInfo             userInfo;               /* Finder information */
++      FndrOpaqueInfo          finderInfo;             /* additional Finder information */
++      u_int32_t               textEncoding;           /* hint for name conversions */
++      u_int32_t               attrBlocks;             /* cached count of attribute data blocks */
++}PACKED_S;
++typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder;
++
++/* HFS catalog file record - 102 bytes */
++struct HFSCatalogFile {
++      int16_t                 recordType;             /* == kHFSFileRecord */
++      u_int8_t                flags;                  /* file flags */
++      int8_t                  fileType;               /* file type (unused ?) */
++      FndrFileInfo            userInfo;               /* Finder information */
++      u_int32_t               fileID;                 /* file ID */
++      u_int16_t               dataStartBlock;         /* not used - set to zero */
++      int32_t                 dataLogicalSize;        /* logical EOF of data fork */
++      int32_t                 dataPhysicalSize;       /* physical EOF of data fork */
++      u_int16_t               rsrcStartBlock;         /* not used - set to zero */
++      int32_t                 rsrcLogicalSize;        /* logical EOF of resource fork */
++      int32_t                 rsrcPhysicalSize;       /* physical EOF of resource fork */
++      u_int32_t               createDate;             /* date and time of creation */
++      u_int32_t               modifyDate;             /* date and time of last modification */
++      u_int32_t               backupDate;             /* date and time of last backup */
++      FndrOpaqueInfo          finderInfo;             /* additional Finder information */
++      u_int16_t               clumpSize;              /* file clump size (not used) */
++      HFSExtentRecord         dataExtents;            /* first data fork extent record */
++      HFSExtentRecord         rsrcExtents;            /* first resource fork extent record */
++      u_int32_t               reserved;               /* reserved - initialized as zero */
++}PACKED_S;
++typedef struct HFSCatalogFile HFSCatalogFile;
++
++/* HFS Plus catalog file record - 248 bytes */
++struct HFSPlusCatalogFile {
++      int16_t                 recordType;             /* == kHFSPlusFileRecord */
++      u_int16_t               flags;                  /* file flags */
++      u_int32_t               reserved1;              /* reserved - initialized as zero */
++      u_int32_t               fileID;                 /* file ID */
++      u_int32_t               createDate;             /* date and time of creation */
++      u_int32_t               contentModDate;         /* date and time of last content modification */
++      u_int32_t               attributeModDate;       /* date and time of last attribute modification */
++      u_int32_t               accessDate;             /* date and time of last access (MacOS X only) */
++      u_int32_t               backupDate;             /* date and time of last backup */
++      HFSPlusBSDInfo          bsdInfo;                /* permissions (for MacOS X) */
++      FndrFileInfo            userInfo;               /* Finder information */
++      FndrOpaqueInfo          finderInfo;             /* additional Finder information */
++      u_int32_t               textEncoding;           /* hint for name conversions */
++      u_int32_t               attrBlocks;             /* cached count of attribute data blocks */
++
++      /* Note: these start on double long (64 bit) boundry */
++      HFSPlusForkData         dataFork;               /* size and block data for data fork */
++      HFSPlusForkData         resourceFork;           /* size and block data for resource fork */
++}PACKED_S;
++typedef struct HFSPlusCatalogFile HFSPlusCatalogFile;
++
++/* HFS catalog thread record - 46 bytes */
++struct HFSCatalogThread {
++      int16_t         recordType;             /* == kHFSFolderThreadRecord or kHFSFileThreadRecord */
++      int32_t         reserved[2];            /* reserved - initialized as zero */
++      u_int32_t       parentID;               /* parent ID for this catalog node */
++      u_int8_t        nodeName[kHFSMaxFileNameChars + 1]; /* name of this catalog node */
++}PACKED_S;
++typedef struct HFSCatalogThread HFSCatalogThread;
++
++/* HFS Plus catalog thread record -- 264 bytes */
++struct HFSPlusCatalogThread {
++      int16_t         recordType;             /* == kHFSPlusFolderThreadRecord or kHFSPlusFileThreadRecord */
++      int16_t         reserved;               /* reserved - initialized as zero */
++      u_int32_t       parentID;               /* parent ID for this catalog node */
++      HFSUniStr255    nodeName;               /* name of this catalog node (variable length) */
++}PACKED_S;
++typedef struct HFSPlusCatalogThread HFSPlusCatalogThread;
++
++#ifdef __APPLE_API_UNSTABLE
++/*
++      These are the types of records in the attribute B-tree.  The values were
++      chosen so that they wouldn't conflict with the catalog record types.
++*/
++enum {
++      kHFSPlusAttrInlineData  = 0x10,    /* if size <  kAttrOverflowSize */
++      kHFSPlusAttrForkData    = 0x20,    /* if size >= kAttrOverflowSize */
++      kHFSPlusAttrExtents     = 0x30     /* overflow extents for large attributes */
++}PACKED_S;
++
++
++/*
++      HFSPlusAttrForkData
++      For larger attributes, whose value is stored in allocation blocks.
++      If the attribute has more than 8 extents, there will be additonal
++      records (of type HFSPlusAttrExtents) for this attribute.
++*/
++struct HFSPlusAttrForkData {
++      u_int32_t       recordType;             /* == kHFSPlusAttrForkData*/
++      u_int32_t       reserved;
++      HFSPlusForkData theFork;                /* size and first extents of value*/
++}PACKED_S;
++typedef struct HFSPlusAttrForkData HFSPlusAttrForkData;
++
++/*
++      HFSPlusAttrExtents
++      This record contains information about overflow extents for large,
++      fragmented attributes.
++*/
++struct HFSPlusAttrExtents {
++      u_int32_t               recordType;     /* == kHFSPlusAttrExtents*/
++      u_int32_t               reserved;
++      HFSPlusExtentRecord     extents;        /* additional extents*/
++}PACKED_S;
++typedef struct HFSPlusAttrExtents HFSPlusAttrExtents;
++
++/*
++ * Atrributes B-tree Data Record
++ *
++ * For small attributes, whose entire value is stored
++ * within a single B-tree record.
++ */
++struct HFSPlusAttrData {
++      u_int32_t    recordType;   /* == kHFSPlusAttrInlineData */
++      u_int32_t    reserved[2];
++      u_int32_t    attrSize;     /* size of attribute data in bytes */
++      u_int8_t     attrData[2];  /* variable length */
++}PACKED_S;
++typedef struct HFSPlusAttrData HFSPlusAttrData;
++
++
++/* HFSPlusAttrInlineData is obsolete use HFSPlusAttrData instead */
++struct HFSPlusAttrInlineData {
++      u_int32_t       recordType;
++      u_int32_t       reserved;
++      u_int32_t       logicalSize;
++      u_int8_t        userData[2];
++}PACKED_S;
++typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData;
++
++
++/*    A generic Attribute Record*/
++union HFSPlusAttrRecord {
++      u_int32_t               recordType;
++      HFSPlusAttrInlineData   inlineData;   /* NOT USED */
++      HFSPlusAttrData         attrData;
++      HFSPlusAttrForkData     forkData;
++      HFSPlusAttrExtents      overflowExtents;
++}PACKED_S;
++typedef union HFSPlusAttrRecord HFSPlusAttrRecord;
++
++/* Attribute key */
++enum { kHFSMaxAttrNameLen = 127 };
++struct HFSPlusAttrKey {
++      u_int16_t     keyLength;       /* key length (in bytes) */
++      u_int16_t     pad;             /* set to zero */
++      u_int32_t     fileID;          /* file associated with attribute */
++      u_int32_t     startBlock;      /* first attribue allocation block number for extents */
++      u_int16_t     attrNameLen;     /* number of unicode characters */
++      u_int16_t     attrName[127];   /* attribute name (Unicode) */
++}PACKED_S;
++typedef struct HFSPlusAttrKey HFSPlusAttrKey;
++
++#define kHFSPlusAttrKeyMaximumLength   (sizeof(HFSPlusAttrKey) - sizeof(u_int16_t))
++#define kHFSPlusAttrKeyMinimumLength   (kHFSPlusAttrKeyMaximumLength - (127 * sizeof(u_int16_t)))
++
++#endif /* __APPLE_API_UNSTABLE */
++
++
++/* Key and node lengths */
++enum {
++      kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(u_int16_t),
++      kHFSExtentKeyMaximumLength      = sizeof(HFSExtentKey) - sizeof(u_int8_t),
++      kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(u_int16_t),
++      kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(u_int16_t),
++      kHFSCatalogKeyMaximumLength     = sizeof(HFSCatalogKey) - sizeof(u_int8_t),
++      kHFSCatalogKeyMinimumLength     = kHFSCatalogKeyMaximumLength - (kHFSMaxFileNameChars + 1) + sizeof(u_int8_t),
++      kHFSPlusCatalogMinNodeSize      = 4096,
++      kHFSPlusExtentMinNodeSize       = 512,
++      kHFSPlusAttrMinNodeSize         = 4096
++}PACKED_S;
++
++/* HFS and HFS Plus volume attribute bits */
++enum {
++                                                      /* Bits 0-6 are reserved (always cleared by MountVol call) */
++      kHFSVolumeHardwareLockBit       = 7,            /* volume is locked by hardware */
++      kHFSVolumeUnmountedBit          = 8,            /* volume was successfully unmounted */
++      kHFSVolumeSparedBlocksBit       = 9,            /* volume has bad blocks spared */
++      kHFSVolumeNoCacheRequiredBit = 10,              /* don't cache volume blocks (i.e. RAM or ROM disk) */
++      kHFSBootVolumeInconsistentBit = 11,             /* boot volume is inconsistent (System 7.6 and later) */
++      kHFSCatalogNodeIDsReusedBit = 12,
++      kHFSVolumeJournaledBit = 13,                    /* this volume has a journal on it */
++      kHFSVolumeInconsistentBit = 14,                 /* serious inconsistencies detected at runtime */
++      kHFSVolumeSoftwareLockBit       = 15,           /* volume is locked by software */
++
++      kHFSVolumeHardwareLockMask      = 1 << kHFSVolumeHardwareLockBit,
++      kHFSVolumeUnmountedMask         = 1 << kHFSVolumeUnmountedBit,
++      kHFSVolumeSparedBlocksMask      = 1 << kHFSVolumeSparedBlocksBit,
++      kHFSVolumeNoCacheRequiredMask = 1 << kHFSVolumeNoCacheRequiredBit,
++      kHFSBootVolumeInconsistentMask = 1 << kHFSBootVolumeInconsistentBit,
++      kHFSCatalogNodeIDsReusedMask = 1 << kHFSCatalogNodeIDsReusedBit,
++      kHFSVolumeJournaledMask = 1 << kHFSVolumeJournaledBit,
++      kHFSVolumeInconsistentMask = 1 << kHFSVolumeInconsistentBit,
++      kHFSVolumeSoftwareLockMask      = 1 << kHFSVolumeSoftwareLockBit,
++      kHFSMDBAttributesMask           = 0x8380
++}PACKED_S;
++
++
++/* HFS Master Directory Block - 162 bytes */
++/* Stored at sector #2 (3rd sector) and second-to-last sector. */
++struct HFSMasterDirectoryBlock {
++      u_int16_t               drSigWord;      /* == kHFSSigWord */
++      u_int32_t               drCrDate;       /* date and time of volume creation */
++      u_int32_t               drLsMod;        /* date and time of last modification */
++      u_int16_t               drAtrb;         /* volume attributes */
++      u_int16_t               drNmFls;        /* number of files in root folder */
++      u_int16_t               drVBMSt;        /* first block of volume bitmap */
++      u_int16_t               drAllocPtr;     /* start of next allocation search */
++      u_int16_t               drNmAlBlks;     /* number of allocation blocks in volume */
++      u_int32_t               drAlBlkSiz;     /* size (in bytes) of allocation blocks */
++      u_int32_t               drClpSiz;       /* default clump size */
++      u_int16_t               drAlBlSt;       /* first allocation block in volume */
++      u_int32_t               drNxtCNID;      /* next unused catalog node ID */
++      u_int16_t               drFreeBks;      /* number of unused allocation blocks */
++      u_int8_t                drVN[kHFSMaxVolumeNameChars + 1];  /* volume name */
++      u_int32_t               drVolBkUp;      /* date and time of last backup */
++      u_int16_t               drVSeqNum;      /* volume backup sequence number */
++      u_int32_t               drWrCnt;        /* volume write count */
++      u_int32_t               drXTClpSiz;     /* clump size for extents overflow file */
++      u_int32_t               drCTClpSiz;     /* clump size for catalog file */
++      u_int16_t               drNmRtDirs;     /* number of directories in root folder */
++      u_int32_t               drFilCnt;       /* number of files in volume */
++      u_int32_t               drDirCnt;       /* number of directories in volume */
++      u_int32_t               drFndrInfo[8];  /* information used by the Finder */
++      u_int16_t               drEmbedSigWord; /* embedded volume signature (formerly drVCSize) */
++      HFSExtentDescriptor     drEmbedExtent;  /* embedded volume location and size (formerly drVBMCSize and drCtlCSize) */
++      u_int32_t               drXTFlSize;     /* size of extents overflow file */
++      HFSExtentRecord         drXTExtRec;     /* extent record for extents overflow file */
++      u_int32_t               drCTFlSize;     /* size of catalog file */
++      HFSExtentRecord         drCTExtRec;     /* extent record for catalog file */
++}PACKED_S;
++typedef struct HFSMasterDirectoryBlock        HFSMasterDirectoryBlock;
++
++
++#ifdef __APPLE_API_UNSTABLE
++#define SET_HFS_TEXT_ENCODING(hint)  \
++      (0x656e6300 | ((hint) & 0xff))
++#define GET_HFS_TEXT_ENCODING(hint)  \
++      (((hint) & 0xffffff00) == 0x656e6300 ? (hint) & 0x000000ff : 0xffffffffU)
++#endif /* __APPLE_API_UNSTABLE */
++
++
++/* HFS Plus Volume Header - 512 bytes */
++/* Stored at sector #2 (3rd sector) and second-to-last sector. */
++struct HFSPlusVolumeHeader {
++      u_int16_t       signature;              /* == kHFSPlusSigWord */
++      u_int16_t       version;                /* == kHFSPlusVersion */
++      u_int32_t       attributes;             /* volume attributes */
++      u_int32_t       lastMountedVersion;     /* implementation version which last mounted volume */
++      u_int32_t       journalInfoBlock;       /* block addr of journal info (if volume is journaled, zero otherwise) */
++
++      u_int32_t       createDate;             /* date and time of volume creation */
++      u_int32_t       modifyDate;             /* date and time of last modification */
++      u_int32_t       backupDate;             /* date and time of last backup */
++      u_int32_t       checkedDate;            /* date and time of last disk check */
++
++      u_int32_t       fileCount;              /* number of files in volume */
++      u_int32_t       folderCount;            /* number of directories in volume */
++
++      u_int32_t       blockSize;              /* size (in bytes) of allocation blocks */
++      u_int32_t       totalBlocks;            /* number of allocation blocks in volume (includes this header and VBM*/
++      u_int32_t       freeBlocks;             /* number of unused allocation blocks */
++
++      u_int32_t       nextAllocation;         /* start of next allocation search */
++      u_int32_t       rsrcClumpSize;          /* default resource fork clump size */
++      u_int32_t       dataClumpSize;          /* default data fork clump size */
++      u_int32_t       nextCatalogID;          /* next unused catalog node ID */
++
++      u_int32_t       writeCount;             /* volume write count */
++      u_int64_t       encodingsBitmap;        /* which encodings have been use  on this volume */
++
++      u_int8_t        finderInfo[32];         /* information used by the Finder */
++
++      HFSPlusForkData  allocationFile;        /* allocation bitmap file */
++      HFSPlusForkData  extentsFile;           /* extents B-tree file */
++      HFSPlusForkData  catalogFile;           /* catalog B-tree file */
++      HFSPlusForkData  attributesFile;        /* extended attributes B-tree file */
++      HFSPlusForkData  startupFile;           /* boot file (secondary loader) */
++}PACKED_S;
++typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader;
++
++
++/* B-tree structures */
++
++enum BTreeKeyLimits{
++      kMaxKeyLength   = 520
++}PACKED_S;
++
++union BTreeKey{
++      u_int8_t        length8;
++      u_int16_t       length16;
++      u_int8_t        rawData [kMaxKeyLength+2];
++}PACKED_S;
++typedef union BTreeKey BTreeKey;
++
++/* BTNodeDescriptor -- Every B-tree node starts with these fields. */
++struct BTNodeDescriptor {
++      u_int32_t       fLink;                  /* next node at this level*/
++      u_int32_t       bLink;                  /* previous node at this level*/
++      int8_t          kind;                   /* kind of node (leaf, index, header, map)*/
++      u_int8_t        height;                 /* zero for header, map; child is one more than parent*/
++      u_int16_t       numRecords;             /* number of records in this node*/
++      u_int16_t       reserved;               /* reserved - initialized as zero */
++}PACKED_S;
++typedef struct BTNodeDescriptor BTNodeDescriptor;
++
++/* Constants for BTNodeDescriptor kind */
++enum {
++      kBTLeafNode     = -1,
++      kBTIndexNode    = 0,
++      kBTHeaderNode   = 1,
++      kBTMapNode      = 2
++}PACKED_S;
++
++/* BTHeaderRec -- The first record of a B-tree header node */
++struct BTHeaderRec {
++      u_int16_t       treeDepth;              /* maximum height (usually leaf nodes) */
++      u_int32_t       rootNode;               /* node number of root node */
++      u_int32_t       leafRecords;            /* number of leaf records in all leaf nodes */
++      u_int32_t       firstLeafNode;          /* node number of first leaf node */
++      u_int32_t       lastLeafNode;           /* node number of last leaf node */
++      u_int16_t       nodeSize;               /* size of a node, in bytes */
++      u_int16_t       maxKeyLength;           /* reserved */
++      u_int32_t       totalNodes;             /* total number of nodes in tree */
++      u_int32_t       freeNodes;              /* number of unused (free) nodes in tree */
++      u_int16_t       reserved1;              /* unused */
++      u_int32_t       clumpSize;              /* reserved */
++      u_int8_t        btreeType;              /* reserved */
++      u_int8_t        keyCompareType;         /* Key string Comparison Type */
++      u_int32_t       attributes;             /* persistent attributes about the tree */
++      u_int32_t       reserved3[16];          /* reserved */
++}PACKED_S;
++typedef struct BTHeaderRec BTHeaderRec;
++
++/* Constants for BTHeaderRec attributes */
++enum {
++      kBTBadCloseMask          = 0x00000001,  /* reserved */
++      kBTBigKeysMask           = 0x00000002,  /* key length field is 16 bits */
++      kBTVariableIndexKeysMask = 0x00000004   /* keys in index nodes are variable length */
++}PACKED_S;
++
++
++/* Catalog Key Name Comparison Type */
++enum {
++      kHFSCaseFolding   = 0xCF,  /* case folding (case-insensitive) */
++      kHFSBinaryCompare = 0xBC  /* binary compare (case-sensitive) */
++}PACKED_S;
++
++/* JournalInfoBlock - Structure that describes where our journal lives */
++struct JournalInfoBlock {
++      u_int32_t       flags;
++      u_int32_t       device_signature[8];  // signature used to locate our device.
++      u_int64_t       offset;               // byte offset to the journal on the device
++      u_int64_t       size;                 // size in bytes of the journal
++      u_int32_t       reserved[32];
++}PACKED_S;
++typedef struct JournalInfoBlock JournalInfoBlock;
++
++enum {
++    kJIJournalInFSMask          = 0x00000001,
++    kJIJournalOnOtherDeviceMask = 0x00000002,
++    kJIJournalNeedInitMask      = 0x00000004
++}PACKED_S;
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* __HFS_FORMAT__ */
+diff --git a/include/hfs/hfs_mount.h b/include/hfs/hfs_mount.h
+new file mode 100644
+index 0000000..ad729f2
+--- /dev/null
++++ b/include/hfs/hfs_mount.h
+@@ -0,0 +1,78 @@
++/*
++ * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
++ *
++ * @APPLE_LICENSE_HEADER_START@
++ *
++ * The contents of this file constitute Original Code as defined in and
++ * are subject to the Apple Public Source License Version 1.1 (the
++ * "License").  You may not use this file except in compliance with the
++ * License.  Please obtain a copy of the License at
++ * http://www.apple.com/publicsource and read it before using this file.
++ *
++ * This Original Code and all software distributed under the License are
++ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
++ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
++ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
++ * License for the specific language governing rights and limitations
++ * under the License.
++ *
++ * @APPLE_LICENSE_HEADER_END@
++ */
++/*
++ * Copyright (c) 1997-2002 Apple Computer, Inc. All Rights Reserved
++ *
++ */
++
++#ifndef _HFS_MOUNT_H_
++#define _HFS_MOUNT_H_
++
++#include <sys/appleapiopts.h>
++
++#include <sys/mount.h>
++#include <sys/time.h>
++
++/*
++ * Arguments to mount HFS-based filesystems
++ */
++
++#define OVERRIDE_UNKNOWN_PERMISSIONS 0
++
++#define UNKNOWNUID ((uid_t)99)
++#define UNKNOWNGID ((gid_t)99)
++#define UNKNOWNPERMISSIONS (S_IRWXU | S_IROTH | S_IXOTH)              /* 705 */
++
++#ifdef __APPLE_API_UNSTABLE
++struct hfs_mount_args {
++#ifndef KERNEL
++      char    *fspec;                 /* block special device to mount */
++#endif
++      uid_t   hfs_uid;                /* uid that owns hfs files (standard HFS only) */
++      gid_t   hfs_gid;                /* gid that owns hfs files (standard HFS only) */
++      mode_t  hfs_mask;               /* mask to be applied for hfs perms  (standard HFS only) */
++      u_int32_t hfs_encoding;         /* encoding for this volume (standard HFS only) */
++      struct  timezone hfs_timezone;  /* user time zone info (standard HFS only) */
++      int             flags;                  /* mounting flags, see below */
++      int     journal_tbuffer_size;   /* size in bytes of the journal transaction buffer */
++      int             journal_flags;          /* flags to pass to journal_open/create */
++      int             journal_disable;        /* don't use journaling (potentially dangerous) */
++};
++
++#define HFSFSMNT_NOXONFILES   0x1     /* disable execute permissions for files */
++#define HFSFSMNT_WRAPPER      0x2     /* mount HFS wrapper (if it exists) */
++#define HFSFSMNT_EXTENDED_ARGS  0x4     /* indicates new fields after "flags" are valid */
++
++/*
++ * Sysctl values for HFS
++ */
++#define HFS_ENCODINGBIAS      1           /* encoding matching CJK bias */
++#define HFS_EXTEND_FS         2
++#define HFS_ENCODINGHINT      3           /* guess encoding for string */
++#define HFS_ENABLE_JOURNALING   0x082969
++#define HFS_DISABLE_JOURNALING  0x031272
++#define HFS_GET_JOURNAL_INFO    0x6a6e6c69
++#define HFS_SET_PKG_EXTENSIONS  0x121031
++
++#endif /* __APPLE_API_UNSTABLE */
++
++#endif /* ! _HFS_MOUNT_H_ */
+diff --git a/include/sys/appleapiopts.h b/include/sys/appleapiopts.h
+new file mode 100644
+index 0000000..4d2061f
+--- /dev/null
++++ b/include/sys/appleapiopts.h
+@@ -0,0 +1,52 @@
++/*
++ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
++ *
++ * @APPLE_LICENSE_HEADER_START@
++ *
++ * The contents of this file constitute Original Code as defined in and
++ * are subject to the Apple Public Source License Version 1.1 (the
++ * "License").  You may not use this file except in compliance with the
++ * License.  Please obtain a copy of the License at
++ * http://www.apple.com/publicsource and read it before using this file.
++ *
++ * This Original Code and all software distributed under the License are
++ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
++ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
++ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
++ * License for the specific language governing rights and limitations
++ * under the License.
++ *
++ * @APPLE_LICENSE_HEADER_END@
++ */
++
++#ifndef __SYS_APPLEAPIOPTS_H__
++#define __SYS_APPLEAPIOPTS_H__
++
++
++#ifndef __APPLE_API_STANDARD
++#define __APPLE_API_STANDARD
++#endif /* __APPLE_API_STANDARD */
++
++#ifndef __APPLE_API_STABLE
++#define __APPLE_API_STABLE
++#endif /* __APPLE_API_STABLE */
++
++#ifndef __APPLE_API_STRICT_CONFORMANCE
++
++#ifndef __APPLE_API_EVOLVING
++#define __APPLE_API_EVOLVING
++#endif /* __APPLE_API_EVOLVING */
++
++#ifndef __APPLE_API_UNSTABLE
++#define __APPLE_API_UNSTABLE
++#endif /* __APPLE_API_UNSTABLE */
++
++#ifndef __APPLE_API_OBSOLETE
++#define __APPLE_API_OBSOLETE
++#endif /* __APPLE_API_OBSOLETE */
++
++#endif /* __APPLE_API_STRICT_CONFORMANCE */
++
++#endif /* __SYS_APPLEAPIOPTS_H__ */
++
diff --git a/utils/hfsprogs/patches/0004-Fix-compilation-on-64-bit-arches.patch b/utils/hfsprogs/patches/0004-Fix-compilation-on-64-bit-arches.patch
new file mode 100644 (file)
index 0000000..57f6011
--- /dev/null
@@ -0,0 +1,131 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Fix compilation on 64-bit arches
+
+---
+ fsck_hfs.tproj/dfalib/BTreePrivate.h |  5 ++++-
+ fsck_hfs.tproj/dfalib/SControl.c     |  8 ++++----
+ fsck_hfs.tproj/dfalib/SVerify1.c     | 14 +++++++-------
+ fsck_hfs.tproj/dfalib/hfs_endian.c   |  2 +-
+ 4 files changed, 16 insertions(+), 13 deletions(-)
+
+diff --git a/fsck_hfs.tproj/dfalib/BTreePrivate.h b/fsck_hfs.tproj/dfalib/BTreePrivate.h
+index 058c75b..2fc2f28 100644
+--- a/fsck_hfs.tproj/dfalib/BTreePrivate.h
++++ b/fsck_hfs.tproj/dfalib/BTreePrivate.h
+@@ -104,6 +104,9 @@ typedef enum {
+ ///////////////////////////////////// Types /////////////////////////////////////
++// Forward declaration from Scavenger.h
++struct BTreeExtensionsRec;
++
+ typedef struct BTreeControlBlock {                                    // fields specific to BTree CBs
+       UInt8           keyCompareType;   /* Key string Comparison Type */
+@@ -144,7 +147,7 @@ typedef struct BTreeControlBlock {                                 // fields specific to BTree CBs
+       UInt32                                           numPossibleHints;      // Looks like a formated hint
+       UInt32                                           numValidHints;         // Hint used to find correct record.
+       
+-      UInt32                                           refCon;                        //      Used by DFA to point to private data.
++      struct BTreeExtensionsRec                       *refCon;                        //      Used by DFA to point to private data.
+       SFCB                                            *fcbPtr;                // fcb of btree file
+       
+ } BTreeControlBlock, *BTreeControlBlockPtr;
+diff --git a/fsck_hfs.tproj/dfalib/SControl.c b/fsck_hfs.tproj/dfalib/SControl.c
+index 37eb242..4ce9e16 100644
+--- a/fsck_hfs.tproj/dfalib/SControl.c
++++ b/fsck_hfs.tproj/dfalib/SControl.c
+@@ -1034,7 +1034,7 @@ static int ScavTerm( SGlobPtr GPtr )
+               btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
+               if ( btcbP != nil)
+               {
+-                      if( btcbP->refCon != (UInt32)nil )
++                      if( btcbP->refCon != nil )
+                       {
+                               if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
+                               {
+@@ -1043,13 +1043,13 @@ static int ScavTerm( SGlobPtr GPtr )
+                               }
+                               DisposeMemory( (Ptr)btcbP->refCon );
+                               err = MemError();
+-                              btcbP->refCon = (UInt32)nil;
++                              btcbP->refCon = nil;
+                       }
+                               
+                       fcbP = GPtr->calculatedCatalogFCB;      //      release catalog BTree bit map
+                       btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
+                               
+-                      if( btcbP->refCon != (UInt32)nil )
++                      if( btcbP->refCon != nil )
+                       {
+                               if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
+                               {
+@@ -1058,7 +1058,7 @@ static int ScavTerm( SGlobPtr GPtr )
+                               }
+                               DisposeMemory( (Ptr)btcbP->refCon );
+                               err = MemError();
+-                              btcbP->refCon = (UInt32)nil;
++                              btcbP->refCon = nil;
+                       }
+               }
+       }
+diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
+index c272d4d..a273bf3 100644
+--- a/fsck_hfs.tproj/dfalib/SVerify1.c
++++ b/fsck_hfs.tproj/dfalib/SVerify1.c
+@@ -789,8 +789,8 @@ OSErr      CreateExtentsBTreeControlBlock( SGlobPtr GPtr )
+       //
+       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
+       //
+-      btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) );                      // allocate space for our BTCB extensions
+-      if ( btcb->refCon == (UInt32) nil ) {
++      btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
++      if ( btcb->refCon == nil ) {
+               err = R_NoMem;
+               goto exit;
+       }
+@@ -1144,8 +1144,8 @@ OSErr    CreateCatalogBTreeControlBlock( SGlobPtr GPtr )
+       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
+       //
+-      btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) );                      // allocate space for our BTCB extensions
+-      if ( btcb->refCon == (UInt32)nil ) {
++      btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
++      if ( btcb->refCon == nil ) {
+               err = R_NoMem;
+               goto exit;
+       }
+@@ -1779,8 +1779,8 @@ OSErr    CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
+       //
+       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
+       //
+-      btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) );                      // allocate space for our BTCB extensions
+-      if ( btcb->refCon == (UInt32)nil ) {
++      btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
++      if ( btcb->refCon == nil ) {
+               err = R_NoMem;
+               goto exit;
+       }
+@@ -1793,7 +1793,7 @@ OSErr    CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
+       }
+       else
+       {
+-              if ( btcb->refCon == (UInt32)nil ) {
++              if ( btcb->refCon == nil ) {
+                       err = R_NoMem;
+                       goto exit;
+               }
+diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.c b/fsck_hfs.tproj/dfalib/hfs_endian.c
+index 69500c1..3cc9eb4 100755
+--- a/fsck_hfs.tproj/dfalib/hfs_endian.c
++++ b/fsck_hfs.tproj/dfalib/hfs_endian.c
+@@ -437,7 +437,7 @@ hfs_swap_HFSPlusBTInternalNode (
+     BTNodeDescriptor *srcDesc = src->buffer;
+     UInt16 *srcOffs = (UInt16 *)((char *)src->buffer + (src->blockSize - (srcDesc->numRecords * sizeof (UInt16))));
+       char *nextRecord;       /*  Points to start of record following current one */
+-    UInt32 i;
++    int i;
+     UInt32 j;
+     if (fileID == kHFSExtentsFileID) {
diff --git a/utils/hfsprogs/patches/0005-Remove-Apple-specific-p-from-strings.patch b/utils/hfsprogs/patches/0005-Remove-Apple-specific-p-from-strings.patch
new file mode 100644 (file)
index 0000000..318fd60
--- /dev/null
@@ -0,0 +1,291 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Remove (Apple-specific?) \p from strings
+
+Modify the way that debug messages are sent to the user, by eliminating one
+character of them.
+---
+ fsck_hfs.tproj/dfalib/BTreeTreeOps.c | 48 ++++++++++++++++++------------------
+ fsck_hfs.tproj/dfalib/SBTree.c       | 14 +++++------
+ 2 files changed, 31 insertions(+), 31 deletions(-)
+
+diff --git a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
+index b812b14..37fb170 100644
+--- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
++++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
+@@ -223,7 +223,7 @@ OSStatus   SearchTree      (BTreeControlBlockPtr    btreePtr,
+         //
+         if (curNodeNum == 0)
+         {
+-//          Panic("\pSearchTree: curNodeNum is zero!");
++            Panic("SearchTree: curNodeNum is zero!");
+             err = fsBTInvalidNodeErr;
+             goto ErrorExit;
+         }
+@@ -433,7 +433,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
+               M_ExitOnError (err);
+               
+               if ( DEBUG_BUILD && updateParent && newRoot )
+-                      DebugStr("\p InsertLevel: New root from primary key, update from secondary key...");
++                      DebugStr("InsertLevel: New root from primary key, update from secondary key...");
+       }
+       //////////////////////// Update Parent(s) ///////////////////////////////
+@@ -448,7 +448,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
+               
+               secondaryKey = nil;
+               
+-              PanicIf ( (level == btreePtr->treeDepth), "\p InsertLevel: unfinished insert!?");
++              PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?");
+               ++level;
+@@ -456,7 +456,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
+               index = treePathTable [level].index;
+               parentNodeNum = treePathTable [level].node;
+-              PanicIf ( parentNodeNum == 0, "\p InsertLevel: parent node is zero!?");
++              PanicIf ( parentNodeNum == 0, "InsertLevel: parent node is zero!?");
+               err = GetNode (btreePtr, parentNodeNum, &parentNode);   // released as target node in next level up
+               M_ExitOnError (err);
+@@ -470,7 +470,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
+               {
+                       //¥¥Êdebug: check if ptr == targetNodeNum
+                       GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize);
+-                      PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p InsertLevel: parent ptr doesn't match target node!");
++                      PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "InsertLevel: parent ptr doesn't match target node!");
+                       
+                       // need to delete and re-insert this parent key/ptr
+                       // we delete it here and it gets re-inserted in the
+@@ -532,7 +532,7 @@ ErrorExit:
+       (void) ReleaseNode (btreePtr, targetNode);
+       (void) ReleaseNode (btreePtr, &siblingNode);
+-      Panic ("\p InsertLevel: an error occured!");
++      Panic ("InsertLevel: an error occured!");
+       return  err;
+@@ -566,7 +566,7 @@ static OSErr       InsertNode      (BTreeControlBlockPtr    btreePtr,
+       *rootSplit = false;
+       
+-      PanicIf ( targetNode->buffer == siblingNode->buffer, "\p InsertNode: targetNode == siblingNode, huh?");
++      PanicIf ( targetNode->buffer == siblingNode->buffer, "InsertNode: targetNode == siblingNode, huh?");
+       
+       leftNodeNum = ((NodeDescPtr) targetNode->buffer)->bLink;
+       rightNodeNum = ((NodeDescPtr) targetNode->buffer)->fLink;
+@@ -606,7 +606,7 @@ static OSErr       InsertNode      (BTreeControlBlockPtr    btreePtr,
+       
+       if ( leftNodeNum > 0 )
+       {
+-              PanicIf ( siblingNode->buffer != nil, "\p InsertNode: siblingNode already aquired!");
++              PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!");
+               if ( siblingNode->buffer == nil )
+               {
+@@ -614,7 +614,7 @@ static OSErr       InsertNode      (BTreeControlBlockPtr    btreePtr,
+                       M_ExitOnError (err);
+               }
+-              PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "\p InsertNode, RotateLeft: invalid sibling link!" );
++              PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "InsertNode, RotateLeft: invalid sibling link!" );
+               if ( !key->skipRotate )         // are rotates allowed?
+               {
+@@ -703,7 +703,7 @@ OSStatus   DeleteTree                      (BTreeControlBlockPtr            btreePtr,
+       targetNodeNum = treePathTable[level].node;
+       targetNodePtr = targetNode->buffer;
+-      PanicIf (targetNodePtr == nil, "\pDeleteTree: targetNode has nil buffer!");
++      PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!");
+       DeleteRecord (btreePtr, targetNodePtr, index);
+               
+@@ -797,7 +797,7 @@ OSStatus   DeleteTree                      (BTreeControlBlockPtr            btreePtr,
+                        
+                       //¥¥Êdebug: check if ptr == targetNodeNum
+                       GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize);
+-                      PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p DeleteTree: parent ptr doesn't match targetNodeNum!!");
++                      PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, " DeleteTree: parent ptr doesn't match targetNodeNum!!");
+                       
+                       // need to delete and re-insert this parent key/ptr
+                       DeleteRecord (btreePtr, parentNode.buffer, index);
+@@ -1018,7 +1018,7 @@ static OSStatus  RotateLeft              (BTreeControlBlockPtr            btreePtr,
+                                                                               keyPtr, keyLength, recPtr, recSize);
+                       if ( !didItFit )
+                       {
+-                              Panic ("\pRotateLeft: InsertKeyRecord (left) returned false!");
++                              Panic ("RotateLeft: InsertKeyRecord (left) returned false!");
+                               err = fsBTBadRotateErr;
+                               goto ErrorExit;
+                       }
+@@ -1031,7 +1031,7 @@ static OSStatus  RotateLeft              (BTreeControlBlockPtr            btreePtr,
+                       didItFit = RotateRecordLeft (btreePtr, leftNode, rightNode);
+                       if ( !didItFit )
+                       {
+-                              Panic ("\pRotateLeft: RotateRecordLeft returned false!");
++                              Panic ("RotateLeft: RotateRecordLeft returned false!");
+                               err = fsBTBadRotateErr;
+                               goto ErrorExit;
+                       }
+@@ -1048,7 +1048,7 @@ static OSStatus  RotateLeft              (BTreeControlBlockPtr            btreePtr,
+                                                                       keyPtr, keyLength, recPtr, recSize);
+               if ( !didItFit )
+               {
+-                      Panic ("\pRotateLeft: InsertKeyRecord (right) returned false!");
++                      Panic ("RotateLeft: InsertKeyRecord (right) returned false!");
+                       err = fsBTBadRotateErr;
+                       goto ErrorExit;
+               }
+@@ -1117,7 +1117,7 @@ static OSStatus  SplitLeft               (BTreeControlBlockPtr            btreePtr,
+       right = rightNode->buffer;
+       left  = leftNode->buffer;
+       
+-      PanicIf ( right->bLink != 0 && left == 0, "\p SplitLeft: left sibling missing!?" );
++      PanicIf ( right->bLink != 0 && left == 0, " SplitLeft: left sibling missing!?" );
+       
+       //¥¥ type should be kLeafNode or kIndexNode
+       
+@@ -1240,8 +1240,8 @@ static OSStatus  AddNewRootNode  (BTreeControlBlockPtr    btreePtr,
+       Boolean                         didItFit;
+       UInt16                          keyLength;      
+       
+-      PanicIf (leftNode == nil, "\pAddNewRootNode: leftNode == nil");
+-      PanicIf (rightNode == nil, "\pAddNewRootNode: rightNode == nil");
++      PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil");
++      PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil");
+       
+       
+       /////////////////////// Initialize New Root Node ////////////////////////////
+@@ -1264,7 +1264,7 @@ static OSStatus  AddNewRootNode  (BTreeControlBlockPtr    btreePtr,
+       didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 0, keyPtr, keyLength,
+                                                                (UInt8 *) &rightNode->bLink, 4 );
+-      PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for left index record");
++      PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for left index record");
+       //////////////////// Insert Right Node Index Record /////////////////////////
+@@ -1275,7 +1275,7 @@ static OSStatus  AddNewRootNode  (BTreeControlBlockPtr    btreePtr,
+       didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 1, keyPtr, keyLength,
+                                                                (UInt8 *) &leftNode->fLink, 4 );
+-      PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for right index record");
++      PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for right index record");
+ #if DEBUG_TREEOPS
+@@ -1355,7 +1355,7 @@ static OSStatus  SplitRight              (BTreeControlBlockPtr            btreePtr,
+       }
+       rightPtr = rightNodePtr->buffer;
+       
+-      PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "\p SplitRight: right sibling missing!?" );
++      PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "SplitRight: right sibling missing!?" );
+       
+       //¥¥ type should be kLeafNode or kIndexNode
+       
+@@ -1557,7 +1557,7 @@ static OSStatus  RotateRight             (BTreeControlBlockPtr            btreePtr,
+                                                                       keyPtr, keyLength, recPtr, recSize);
+               if ( !didItFit )
+               {
+-                      Panic ("\pRotateRight: InsertKeyRecord (left) returned false!");
++                      Panic ("RotateRight: InsertKeyRecord (left) returned false!");
+                       err = fsBTBadRotateErr;
+                       goto ErrorExit;
+               }
+@@ -1572,7 +1572,7 @@ static OSStatus  RotateRight             (BTreeControlBlockPtr            btreePtr,
+               didItFit = RotateRecordRight( btreePtr, leftNodePtr, rightNodePtr );
+               if ( !didItFit )
+               {
+-                      Panic ("\pRotateRight: RotateRecordRight returned false!");
++                      Panic ("RotateRight: RotateRecordRight returned false!");
+                       err = fsBTBadRotateErr;
+                       goto ErrorExit;
+               }
+@@ -1583,7 +1583,7 @@ static OSStatus  RotateRight             (BTreeControlBlockPtr            btreePtr,
+                                                                               keyPtr, keyLength, recPtr, recSize);
+                       if ( !didItFit )
+                       {
+-                              Panic ("\pRotateRight: InsertKeyRecord (left) returned false!");
++                              Panic ("RotateRight: InsertKeyRecord (left) returned false!");
+                               err = fsBTBadRotateErr;
+                               goto ErrorExit;
+                       }
+@@ -1607,7 +1607,7 @@ static OSStatus  RotateRight             (BTreeControlBlockPtr            btreePtr,
+                                                                       keyPtr, keyLength, recPtr, recSize);
+               if ( !didItFit )
+               {
+-                      Panic ("\pRotateRight: InsertKeyRecord (right) returned false!");
++                      Panic ("RotateRight: InsertKeyRecord (right) returned false!");
+                       err = fsBTBadRotateErr;
+                       goto ErrorExit;
+               }
+diff --git a/fsck_hfs.tproj/dfalib/SBTree.c b/fsck_hfs.tproj/dfalib/SBTree.c
+index cd81b13..eeb4e8c 100644
+--- a/fsck_hfs.tproj/dfalib/SBTree.c
++++ b/fsck_hfs.tproj/dfalib/SBTree.c
+@@ -103,7 +103,7 @@ OSErr SearchBTreeRecord(SFCB *fcb, const void* key, UInt32 hint, void* foundKey,
+                       CopyMemory(&resultIterator->key, foundKey, CalcKeySize(btcb, &resultIterator->key));    //¥¥ warning, this could overflow user's buffer!!!
+               if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) )
+-                      DebugStr("\pSearchBTreeRecord: bad record?");
++                      DebugStr("SearchBTreeRecord: bad record?");
+       }
+ ErrorExit:
+@@ -211,7 +211,7 @@ OSErr GetBTreeRecord(SFCB *fcb, SInt16 selectionIndex, void* key, void* data, UI
+               CopyMemory(&iterator->key, key, CalcKeySize(btcb, &iterator->key));     //¥¥ warning, this could overflow user's buffer!!!
+               
+               if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) )
+-                      DebugStr("\pGetBTreeRecord: bad record?");
++                      DebugStr("GetBTreeRecord: bad record?");
+       }
+       
+@@ -243,7 +243,7 @@ OSErr InsertBTreeRecord(SFCB *fcb, const void* key, const void* data, UInt16 dat
+       CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key));    //¥¥ should we range check against maxkeylen?
+       if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, dataSize) )
+-              DebugStr("\pInsertBTreeRecord: bad record?");
++              DebugStr("InsertBTreeRecord: bad record?");
+       result = BTInsertRecord( fcb, &iterator, &btRecord, dataSize );
+@@ -305,7 +305,7 @@ OSErr ReplaceBTreeRecord(SFCB *fcb, const void* key, UInt32 hint, void *newData,
+       CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key));            //¥¥ should we range check against maxkeylen?
+       if ( DEBUG_BUILD && !ValidHFSRecord(newData, btcb, dataSize) )
+-              DebugStr("\pReplaceBTreeRecord: bad record?");
++              DebugStr("ReplaceBTreeRecord: bad record?");
+       result = BTReplaceRecord( fcb, &iterator, &btRecord, dataSize );
+@@ -344,7 +344,7 @@ SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
+       else
+       {
+               if ( DEBUG_BUILD )
+-                      DebugStr("\pSetEndOfForkProc: minEOF is smaller than current size!");
++                      DebugStr("SetEndOfForkProc: minEOF is smaller than current size!");
+               return -1;
+       }
+@@ -370,7 +370,7 @@ SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
+       //      Make sure we got at least as much space as we needed
+       //
+       if (filePtr->fcbLogicalSize < minEOF) {
+-              Panic("\pSetEndOfForkProc: disk too full to extend B-tree file");
++              Panic("SetEndOfForkProc: disk too full to extend B-tree file");
+               return dskFulErr;
+       }
+       
+@@ -442,7 +442,7 @@ static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb)
+       if ( (keyLen < 6) || (keyLen > btcb->maxKeyLength) )
+       {
+               if ( DEBUG_BUILD )
+-                      DebugStr("\pCheckBTreeKey: bad key length!");
++                      DebugStr("CheckBTreeKey: bad key length!");
+               return fsBTInvalidKeyLengthErr;
+       }
+       
diff --git a/utils/hfsprogs/patches/0006-Adjust-types-for-printing.patch b/utils/hfsprogs/patches/0006-Adjust-types-for-printing.patch
new file mode 100644 (file)
index 0000000..09efbb6
--- /dev/null
@@ -0,0 +1,37 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Adjust types for printing
+
+Try to address the issues of a given integral type having different sizes
+in 32 and 64-bit architectures.
+---
+ fsck_hfs.tproj/dfalib/SControl.c   | 2 +-
+ fsck_hfs.tproj/dfalib/hfs_endian.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fsck_hfs.tproj/dfalib/SControl.c b/fsck_hfs.tproj/dfalib/SControl.c
+index 4ce9e16..8b03ece 100644
+--- a/fsck_hfs.tproj/dfalib/SControl.c
++++ b/fsck_hfs.tproj/dfalib/SControl.c
+@@ -776,7 +776,7 @@ static int ScavSetUp( SGlob *GPtr)
+               pointer = (ScavStaticStructures *) AllocateClearMemory( sizeof(ScavStaticStructures) );
+               if ( pointer == nil ) {
+                       if ( GPtr->logLevel >= kDebugLog ) {
+-                              printf( "\t error %d - could not allocate %ld bytes of memory \n",
++                              printf( "\t error %d - could not allocate %i bytes of memory \n",
+                                       R_NoMem, sizeof(ScavStaticStructures) );
+                       }
+                       return( R_NoMem );
+diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.c b/fsck_hfs.tproj/dfalib/hfs_endian.c
+index 3cc9eb4..6ca2ac1 100755
+--- a/fsck_hfs.tproj/dfalib/hfs_endian.c
++++ b/fsck_hfs.tproj/dfalib/hfs_endian.c
+@@ -563,7 +563,7 @@ hfs_swap_HFSPlusBTInternalNode (
+             /* Make sure name length is consistent with key length */
+             if (keyLength < sizeof(srcKey->parentID) + sizeof(srcKey->nodeName.length) +
+                 srcKey->nodeName.length*sizeof(srcKey->nodeName.unicode[0])) {
+-                              if (debug) printf("hfs_swap_HFSPlusBTInternalNode: catalog record #%d keyLength=%d expected=%lu\n",
++                              if (debug) printf("hfs_swap_HFSPlusBTInternalNode: catalog record #%d keyLength=%d expected=%i\n",
+                                       srcDesc->numRecords-i, keyLength, sizeof(srcKey->parentID) + sizeof(srcKey->nodeName.length) +
+                     srcKey->nodeName.length*sizeof(srcKey->nodeName.unicode[0]));
+                               WriteError(fcb->fcbVolume->vcbGPtr, E_KeyLen, fcb->fcbFileID, src->blockNum);
diff --git a/utils/hfsprogs/patches/0007-Fix-path-for-HFS-wrapper-block.patch b/utils/hfsprogs/patches/0007-Fix-path-for-HFS-wrapper-block.patch
new file mode 100644 (file)
index 0000000..f92bb22
--- /dev/null
@@ -0,0 +1,23 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Fix path for HFS wrapper block
+
+Fix the installation of the HFS wrapper block to be compliant in Linux
+systems (since it is arch independent).
+---
+ newfs_hfs.tproj/makehfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/newfs_hfs.tproj/makehfs.c b/newfs_hfs.tproj/makehfs.c
+index 7609779..2233ef7 100644
+--- a/newfs_hfs.tproj/makehfs.c
++++ b/newfs_hfs.tproj/makehfs.c
+@@ -70,7 +70,7 @@ extern Boolean _CFStringGetFileSystemRepresentation(CFStringRef string, UInt8 *b
+ #include "readme.h"
+-#define HFS_BOOT_DATA "/usr/share/misc/hfsbootdata"
++#define HFS_BOOT_DATA "/usr/share/hfsprogs/hfsbootdata"
+ #define HFS_JOURNAL_FILE      ".journal"
+ #define HFS_JOURNAL_INFO      ".journal_info_block"
diff --git a/utils/hfsprogs/patches/0008-Provide-command-line-option-a.patch b/utils/hfsprogs/patches/0008-Provide-command-line-option-a.patch
new file mode 100644 (file)
index 0000000..366dbbc
--- /dev/null
@@ -0,0 +1,40 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Provide command line option -a
+
+Create a new command line option (-a) for the fsck.hfsplus that has the same
+behavior that the -p option has, for greater compatibility with other tools.
+---
+ fsck_hfs.tproj/fsck_hfs.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/fsck_hfs.tproj/fsck_hfs.c b/fsck_hfs.tproj/fsck_hfs.c
+index f1a18bd..6117698 100644
+--- a/fsck_hfs.tproj/fsck_hfs.c
++++ b/fsck_hfs.tproj/fsck_hfs.c
+@@ -104,7 +104,7 @@ main(argc, argv)
+       else
+               progname = *argv;
+-      while ((ch = getopt(argc, argv, "c:D:dfglm:npqruy")) != EOF) {
++      while ((ch = getopt(argc, argv, "c:D:dfglm:napqruy")) != EOF) {
+               switch (ch) {
+               case 'c':
+                       /* Cache size to use in fsck_hfs */
+@@ -169,6 +169,7 @@ main(argc, argv)
+                       yflag = 0;
+                       break;
++              case 'a':
+               case 'p':
+                       preen++;
+                       break;
+@@ -572,7 +573,7 @@ usage()
+       (void) fprintf(stderr, "  l = live fsck (lock down and test-only)\n");
+       (void) fprintf(stderr, "  m arg = octal mode used when creating lost+found directory \n");
+       (void) fprintf(stderr, "  n = assume a no response \n");
+-      (void) fprintf(stderr, "  p = just fix normal inconsistencies \n");
++      (void) fprintf(stderr, "  p, a = just fix normal inconsistencies \n");
+       (void) fprintf(stderr, "  q = quick check returns clean, dirty, or failure \n");
+       (void) fprintf(stderr, "  r = rebuild catalog btree \n");
+       (void) fprintf(stderr, "  u = usage \n");
diff --git a/utils/hfsprogs/patches/0009-Rename-dprintf-to-dbg_printf.patch b/utils/hfsprogs/patches/0009-Rename-dprintf-to-dbg_printf.patch
new file mode 100644 (file)
index 0000000..23f8518
--- /dev/null
@@ -0,0 +1,187 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Rename dprintf to dbg_printf
+
+---
+ fsck_hfs.tproj/dfalib/SRepair.c  | 18 +++++++++---------
+ fsck_hfs.tproj/dfalib/SVerify1.c |  6 +++---
+ fsck_hfs.tproj/fsck_debug.c      | 10 +++++-----
+ fsck_hfs.tproj/fsck_debug.h      | 10 +++++-----
+ 4 files changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
+index 8eb759c..89c12d6 100644
+--- a/fsck_hfs.tproj/dfalib/SRepair.c
++++ b/fsck_hfs.tproj/dfalib/SRepair.c
+@@ -1825,13 +1825,13 @@ static OSErr FixAttrSize(SGlobPtr GPtr, RepairOrderPtr p)
+       result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator, 
+                               kInvalidMRUCacheKey, &btRecord, &recSize, &iterator);
+       if (result) {
+-              dprintf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
++              dbg_printf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
+               goto out;
+       }
+       /* We should only get record of type kHFSPlusAttrForkData */
+       if (record.recordType != kHFSPlusAttrForkData) {
+-              dprintf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
++              dbg_printf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
+               result = btNotFound;
+               goto out;
+       }
+@@ -1862,7 +1862,7 @@ static OSErr FixAttrSize(SGlobPtr GPtr, RepairOrderPtr p)
+               result = BTReplaceRecord(GPtr->calculatedAttributesFCB, &iterator,
+                                       &btRecord, recSize);
+               if (result) {
+-                      dprintf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
++                      dbg_printf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
+                       goto out;
+               }
+       }
+@@ -2058,7 +2058,7 @@ del_overflow_extents:
+               /* Delete the extent record */ 
+               err = DeleteBTreeRecord(GPtr->calculatedExtentsFCB, &extentKey);
+-              dprintf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
++              dbg_printf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
+               if (err) {
+                       goto create_symlink;
+               }
+@@ -3227,12 +3227,12 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
+                                                                                         &extentData, &recordSize, &foundExtentIndex);
+                               foundLocation = extentsBTree;
+                               if (err != noErr) {
+-                                      dprintf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
++                                      dbg_printf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
+                                       goto out;
+                               }
+                       } else {
+                               /* No more extents exist for this file */
+-                              dprintf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
++                              dbg_printf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
+                               goto out;
+                       }
+               }
+@@ -3241,7 +3241,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
+       err = CopyDiskBlocks(GPtr, extentInfo->startBlock, extentInfo->blockCount, 
+                                                extentInfo->newStartBlock);
+       if (err != noErr) {
+-              dprintf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
++              dbg_printf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
+               goto out;
+       }
+       
+@@ -3260,7 +3260,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
+       }
+       if (err != noErr) {
+-              dprintf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
++              dbg_printf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
+               goto out;
+       }
+@@ -3491,7 +3491,7 @@ static OSErr SearchExtentInAttributeBT(SGlobPtr GPtr, ExtentInfo *extentInfo,
+       result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator, 
+                               kInvalidMRUCacheKey, &btRecord, recordSize, &iterator);
+       if (result) {
+-              dprintf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
++              dbg_printf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
+               goto out;       
+       }
+       
+diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
+index a273bf3..39bda5c 100644
+--- a/fsck_hfs.tproj/dfalib/SVerify1.c
++++ b/fsck_hfs.tproj/dfalib/SVerify1.c
+@@ -2157,9 +2157,9 @@ CheckAttributeRecord(SGlobPtr GPtr, const HFSPlusAttrKey *key, const HFSPlusAttr
+       
+       if (doDelete == true) {
+               result = DeleteBTreeRecord(GPtr->calculatedAttributesFCB, key);
+-              dprintf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
++              dbg_printf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
+               if (result) {
+-                      dprintf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
++                      dbg_printf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
+               }
+               
+               /* Set flags to mark header and map dirty */
+@@ -3034,7 +3034,7 @@ OSErr    CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
+               //      checkout the extent record first
+               err = ChkExtRec( GPtr, extents, &lastExtentIndex );
+               if (err != noErr) {
+-                      dprintf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
++                      dbg_printf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
+                       /* Stop verification if bad extent is found for system file or EA */
+                       if ((fileNumber < kHFSFirstUserCatalogNodeID) ||
+diff --git a/fsck_hfs.tproj/fsck_debug.c b/fsck_hfs.tproj/fsck_debug.c
+index 1be3fc5..77e8e51 100644
+--- a/fsck_hfs.tproj/fsck_debug.c
++++ b/fsck_hfs.tproj/fsck_debug.c
+@@ -25,18 +25,18 @@
+ #include <stdio.h>
+ #include <stdarg.h>
+-/* Current debug level of fsck_hfs for printing messages via dprintf */
++/* Current debug level of fsck_hfs for printing messages via dbg_printf */
+ unsigned long cur_debug_level;
+-/* Function: dprintf
++/* Function: dbg_printf
+  *
+  * Description: Debug function similar to printf except the first parameter
+- * which indicates the type of message to be printed by dprintf. Based on 
++ * which indicates the type of message to be printed by dbg_printf. Based on
+  * current debug level and the type of message, the function decides 
+  * whether to print the message or not.
+  *
+  * Each unique message type has a bit assigned to it.  The message type 
+- * passed to dprintf can be one or combination (OR-ed value) of pre-defined 
++ * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
+  * debug message types.  Only the messages whose type have one or more similar
+  * bits set in comparison with current global debug level are printed. 
+  *
+@@ -56,7 +56,7 @@ unsigned long cur_debug_level;
+  * Output:
+  *    Nothing
+  */
+-void dprintf (unsigned long type, char *fmt, ...) 
++void dbg_printf (unsigned long type, char *fmt, ...)
+ {
+       if (cur_debug_level & type) {
+               va_list ap;
+diff --git a/fsck_hfs.tproj/fsck_debug.h b/fsck_hfs.tproj/fsck_debug.h
+index 81e3932..cb1b9be 100644
+--- a/fsck_hfs.tproj/fsck_debug.h
++++ b/fsck_hfs.tproj/fsck_debug.h
+@@ -36,18 +36,18 @@ enum debug_message_type {
+       d_overlap       =       0x0020  /* Overlap extents related messages */
+ };
+-/* Current debug level of fsck_hfs for printing messages via dprintf */
++/* Current debug level of fsck_hfs for printing messages via dbg_printf */
+ extern unsigned long cur_debug_level;
+-/* Function: dprintf
++/* Function: dbg_printf
+  *
+  * Description: Debug function similar to printf except the first parameter
+- * which indicates the type of message to be printed by dprintf. Based on 
++ * which indicates the type of message to be printed by dbg_printf. Based on
+  * current debug level and the type of message, the function decides 
+  * whether to print the message or not.
+  *
+  * Each unique message type has a bit assigned to it.  The message type 
+- * passed to dprintf can be one or combination (OR-ed value) of pre-defined 
++ * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
+  * debug message types.  Only the messages whose type have one or more similar
+  * bits set in comparison with current global debug level are printed. 
+  *
+@@ -67,6 +67,6 @@ extern unsigned long cur_debug_level;
+  * Output:
+  *    Nothing
+  */
+-extern void dprintf (unsigned long message_type, char *format, ...);
++extern void dbg_printf (unsigned long message_type, char *format, ...);
+ #endif /* __FSCK_DEBUG__ */
diff --git a/utils/hfsprogs/patches/0010-Rename-custom-macro-nil-with-NULL.patch b/utils/hfsprogs/patches/0010-Rename-custom-macro-nil-with-NULL.patch
new file mode 100644 (file)
index 0000000..354b4ff
--- /dev/null
@@ -0,0 +1,1319 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:21 -0200
+Subject: Rename custom macro nil with NULL
+
+---
+ fsck_hfs.tproj/dfalib/BTree.c         | 142 +++++++++++++++++-----------------
+ fsck_hfs.tproj/dfalib/BTreeAllocate.c |  14 ++--
+ fsck_hfs.tproj/dfalib/BTreeMiscOps.c  |  26 +++----
+ fsck_hfs.tproj/dfalib/BTreeNodeOps.c  |  30 +++----
+ fsck_hfs.tproj/dfalib/BTreeTreeOps.c  |  38 ++++-----
+ fsck_hfs.tproj/dfalib/SControl.c      |  56 +++++++-------
+ fsck_hfs.tproj/dfalib/SRepair.c       |   6 +-
+ fsck_hfs.tproj/dfalib/SUtils.c        |   6 +-
+ fsck_hfs.tproj/dfalib/SVerify1.c      |  32 ++++----
+ fsck_hfs.tproj/dfalib/SVerify2.c      |   4 +-
+ 10 files changed, 177 insertions(+), 177 deletions(-)
+
+diff --git a/fsck_hfs.tproj/dfalib/BTree.c b/fsck_hfs.tproj/dfalib/BTree.c
+index 7ad9fe0..c0c8744 100644
+--- a/fsck_hfs.tproj/dfalib/BTree.c
++++ b/fsck_hfs.tproj/dfalib/BTree.c
+@@ -163,21 +163,21 @@ OSStatus BTInitialize            (FCB                                    *filePtr,
+       ////////////////////// Preliminary Error Checking ///////////////////////////
+-      headerNode.buffer       = nil;
++      headerNode.buffer       = NULL;
+-      if (pathPtr                                                                             == nil) return  paramErr;
++      if (pathPtr == NULL)    return  paramErr;
+       setEndOfForkProc        = pathPtr->agentPtr->agent.setEndOfForkProc;
+       setBlockSizeProc        = pathPtr->agentPtr->agent.setBlockSizeProc;
+-      if (pathPtr->agentPtr->agent.getBlockProc               == nil) return  E_NoGetBlockProc;
+-      if (pathPtr->agentPtr->agent.releaseBlockProc   == nil) return  E_NoReleaseBlockProc;
+-      if (setEndOfForkProc                                                    == nil) return  E_NoSetEndOfForkProc;
+-      if (setBlockSizeProc                                                    == nil) return  E_NoSetBlockSizeProc;
++      if (pathPtr->agentPtr->agent.getBlockProc == NULL)      return  E_NoGetBlockProc;
++      if (pathPtr->agentPtr->agent.releaseBlockProc == NULL)  return  E_NoReleaseBlockProc;
++      if (setEndOfForkProc == NULL)   return  E_NoSetEndOfForkProc;
++      if (setBlockSizeProc == NULL)   return  E_NoSetBlockSizeProc;
+       forkPtr = pathPtr->path.forkPtr;
+-      if (forkPtr->fork.btreePtr != nil)                                              return  fsBTrFileAlreadyOpenErr;
++      if (forkPtr->fork.btreePtr != NULL) return      fsBTrFileAlreadyOpenErr;
+       if ((maxKeyLength == 0) ||
+               (maxKeyLength >  kMaxKeyLength))                                        return  fsBTInvalidKeyLengthErr;
+@@ -209,7 +209,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
+       //////////////////////// Allocate Control Block /////////////////////////////
+       M_RESIDENT_ALLOCATE_FIXED_CLEAR( &btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
+-      if (btreePtr == nil)
++      if (btreePtr == NULL)
+       {
+               err = memFullErr;
+               goto ErrorExit;
+@@ -220,7 +220,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
+       btreePtr->flags                         = 0;
+       btreePtr->attributes            = 0;
+       btreePtr->forkPtr                       = forkPtr;
+-      btreePtr->keyCompareProc        = nil;
++      btreePtr->keyCompareProc        = NULL;
+       btreePtr->keyDescPtr            = keyDescPtr;
+       btreePtr->btreeType                     = btreeType;
+       btreePtr->treeDepth                     = 0;
+@@ -282,7 +282,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
+       ///////////////////// Copy Key Descriptor To Header /////////////////////////
+ #if SupportsKeyDescriptors
+-      if (keyDescPtr != nil)
++      if (keyDescPtr != NULL)
+       {
+               err = CheckKeyDescriptor (keyDescPtr, maxKeyLength);
+               M_ExitOnError (err);
+@@ -309,7 +309,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
+       err = UpdateHeader (btreePtr);
+       M_ExitOnError (err);
+-      pathPtr->path.forkPtr->fork.btreePtr = nil;
++      pathPtr->path.forkPtr->fork.btreePtr = NULL;
+       M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
+       return  noErr;
+@@ -320,7 +320,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
+ ErrorExit:
+       (void) ReleaseNode (btreePtr, &headerNode);
+-      if (btreePtr != nil)
++      if (btreePtr != NULL)
+               M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
+       return  err;
+@@ -342,7 +342,7 @@ Input:             filePtr                         - pointer to file to open as a B-tree
+                       setEndOfForkProc        - pointer to client's SetEOF function
+ Result:               noErr                           - success
+-                      paramErr                        - required ptr was nil
++                      paramErr                        - required ptr was NULL
+                       fsBTInvalidFileErr                              -
+                       memFullErr                      -
+                       != noErr                        - failure
+@@ -364,16 +364,16 @@ OSStatus BTOpenPath                      (SFCB                                   *filePtr,
+       ////////////////////// Preliminary Error Checking ///////////////////////////
+-      if ( filePtr == nil                             ||
+-               getBlockProc == nil            ||
+-               releaseBlockProc == nil        ||
+-               setEndOfForkProc == nil        ||
+-               setBlockSizeProc == nil )
++      if (filePtr == NULL ||
++               getBlockProc == NULL ||
++               releaseBlockProc == NULL ||
++               setEndOfForkProc == NULL ||
++               setBlockSizeProc == NULL)
+       {
+               return  paramErr;
+       }
+-      if ( filePtr->fcbBtree != nil )                 // already has a BTreeCB
++      if (filePtr->fcbBtree != NULL)                  // already has a BTreeCB
+               return noErr;
+                                                                                               // is file large enough to contain header node?
+@@ -384,7 +384,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
+       //////////////////////// Allocate Control Block /////////////////////////////
+       btreePtr = (BTreeControlBlock*) AllocateClearMemory( sizeof( BTreeControlBlock ) );
+-      if (btreePtr == nil)
++      if (btreePtr == NULL)
+       {
+               Panic ("\pBTOpen: no memory for btreePtr.");
+               return  memFullErr;
+@@ -397,7 +397,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
+       /////////////////////////// Read Header Node ////////////////////////////////
+-      nodeRec.buffer                          = nil;                          // so we can call ReleaseNode
++      nodeRec.buffer                          = NULL;                         // so we can call ReleaseNode
+       
+       btreePtr->fcbPtr                        = filePtr;
+       filePtr->fcbBtree                       = (void *) btreePtr;    // attach btree cb to file
+@@ -487,7 +487,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
+       ////////////////////////// Get Key Descriptor ///////////////////////////////
+ #if SupportsKeyDescriptors
+-      if ( keyCompareProc == nil )            //      if no key compare proc then get key descriptor
++      if (keyCompareProc == NULL)             //      if no key compare proc then get key descriptor
+       {
+               err = GetKeyDescriptor (btreePtr, nodeRec.buffer);      //¥¥ it should check amount of memory allocated...
+               M_ExitOnError (err);
+@@ -499,7 +499,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
+       else
+ #endif
+       {
+-              btreePtr->keyDescPtr = nil;                     // clear it so we don't dispose garbage later
++              btreePtr->keyDescPtr = NULL;                    // clear it so we don't dispose garbage later
+       }
+       err = ReleaseNode (btreePtr, &nodeRec);
+@@ -528,7 +528,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
+ ErrorExit:
+-      filePtr->fcbBtree = nil;
++      filePtr->fcbBtree = NULL;
+       (void) ReleaseNode (btreePtr, &nodeRec);
+       DisposeMemory( btreePtr );
+@@ -567,7 +567,7 @@ OSStatus   BTClosePath                     (SFCB                                   *filePtr)
+       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
+-      if (btreePtr == nil)
++      if (btreePtr == NULL)
+               return fsBTInvalidFileErr;
+       ////////////////////// Check for other BTree Paths //////////////////////////
+@@ -603,14 +603,14 @@ OSStatus BTClosePath                     (SFCB                                   *filePtr)
+       M_ExitOnError (err);
+ #if SupportsKeyDescriptors
+-      if (btreePtr->keyDescPtr != nil)                        // deallocate keyDescriptor, if any
++      if (btreePtr->keyDescPtr != NULL)                       // deallocate keyDescriptor, if any
+       {
+               DisposeMemory( btreePtr->keyDescPtr );
+       }
+ #endif
+       DisposeMemory( btreePtr );
+-      filePtr->fcbBtree = nil;
++      filePtr->fcbBtree = NULL;
+ //    LogEndTime(kTraceCloseBTree, noErr);
+@@ -643,7 +643,7 @@ Function:  Search for position in B*Tree indicated by searchKey. If a valid node
+ Input:                pathPtr                 - pointer to path for BTree file.
+                       searchKey               - pointer to search key to match.
+-                      hintPtr                 - pointer to hint (may be nil)
++                      hintPtr                 - pointer to hint (may be NULL)
+ Output:               record                  - pointer to BufferDescriptor containing record
+                       recordLen               - length of data at recordPtr
+@@ -678,14 +678,14 @@ OSStatus BTSearchRecord          (SFCB                                           *filePtr,
+ //    LogStartTime(kTraceSearchBTree);
+-      if (filePtr == nil)                                                                     return  paramErr;
+-      if (searchIterator == nil)                                                      return  paramErr;
++      if (filePtr == NULL)            return  paramErr;
++      if (searchIterator == NULL)     return  paramErr;
+       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
+-      if (btreePtr == nil)                                                            return  fsBTInvalidFileErr;
++      if (btreePtr == NULL)           return  fsBTInvalidFileErr;
+ #if SupportsKeyDescriptors
+-      if (btreePtr->keyCompareProc == nil)            // CheckKey if we using Key Descriptor
++      if (btreePtr->keyCompareProc == NULL)           // CheckKey if we using Key Descriptor
+       {
+               err = CheckKey (&searchIterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength);
+               M_ExitOnError (err);
+@@ -775,9 +775,9 @@ OSStatus   BTSearchRecord          (SFCB                                           *filePtr,
+               //¥¥ Should check for errors! Or BlockMove could choke on recordPtr!!!
+               GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len);
+-              if (recordLen != nil)                   *recordLen = len;
++              if (recordLen != NULL)  *recordLen = len;
+-              if (record != nil)
++              if (record != NULL)
+               {
+                       ByteCount recordSize;
+@@ -794,7 +794,7 @@ OSStatus   BTSearchRecord          (SFCB                                           *filePtr,
+       /////////////////////// Success - Update Iterator ///////////////////////////
+-      if (resultIterator != nil)
++      if (resultIterator != NULL)
+       {
+               resultIterator->hint.writeCount = btreePtr->writeCount;
+               resultIterator->hint.nodeNum    = nodeNum;
+@@ -825,10 +825,10 @@ OSStatus BTSearchRecord          (SFCB                                           *filePtr,
+ ErrorExit:
+-      if (recordLen != nil)
++      if (recordLen != NULL)
+               *recordLen = 0;
+-      if (resultIterator != nil)
++      if (resultIterator != NULL)
+       {
+               resultIterator->hint.writeCount = 0;
+               resultIterator->hint.nodeNum    = 0;
+@@ -892,18 +892,18 @@ OSStatus BTIterateRecord         (SFCB                                           *filePtr,
+       ////////////////////////// Priliminary Checks ///////////////////////////////
+-      left.buffer             = nil;
+-      right.buffer    = nil;
+-      node.buffer             = nil;
++      left.buffer             = NULL;
++      right.buffer    = NULL;
++      node.buffer             = NULL;
+-      if (filePtr == nil)
++      if (filePtr == NULL)
+       {
+               return  paramErr;
+       }
+       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
+-      if (btreePtr == nil)
++      if (btreePtr == NULL)
+       {
+               return  fsBTInvalidFileErr;                     //¥¥ handle properly
+       }
+@@ -968,7 +968,7 @@ OSStatus   BTIterateRecord         (SFCB                                           *filePtr,
+               }
+               else
+               {
+-                      if (left.buffer == nil)
++                      if (left.buffer == NULL)
+                       {
+                               nodeNum = ((NodeDescPtr) node.buffer)->bLink;
+                               if ( nodeNum > 0)
+@@ -981,13 +981,13 @@ OSStatus BTIterateRecord         (SFCB                                           *filePtr,
+                               }
+                       }
+                       //      Before we stomp on "right", we'd better release it if needed
+-                      if (right.buffer != nil) {
++                      if (right.buffer != NULL) {
+                               err = ReleaseNode(btreePtr, &right);
+                               M_ExitOnError(err);
+                       }
+                       right           = node;
+                       node            = left;
+-                      left.buffer     = nil;
++                      left.buffer     = NULL;
+                       index           = ((NodeDescPtr) node.buffer)->numRecords -1;
+               }
+       }
+@@ -1012,7 +1012,7 @@ OSStatus BTIterateRecord         (SFCB                                           *filePtr,
+               }
+               else
+               {
+-                      if (right.buffer == nil)
++                      if (right.buffer == NULL)
+                       {
+                               nodeNum = ((NodeDescPtr) node.buffer)->fLink;
+                               if ( nodeNum > 0)
+@@ -1025,13 +1025,13 @@ OSStatus       BTIterateRecord         (SFCB                                           *filePtr,
+                               }
+                       }
+                       //      Before we stomp on "left", we'd better release it if needed
+-                      if (left.buffer != nil) {
++                      if (left.buffer != NULL) {
+                               err = ReleaseNode(btreePtr, &left);
+                               M_ExitOnError(err);
+                       }
+                       left             = node;
+                       node             = right;
+-                      right.buffer = nil;
++                      right.buffer = NULL;
+                       index            = 0;
+               }
+       }
+@@ -1054,9 +1054,9 @@ CopyData:
+       err = GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len);
+       M_ExitOnError (err);
+-      if (recordLen != nil)                   *recordLen = len;
++      if (recordLen != NULL)                  *recordLen = len;
+-      if (record != nil)
++      if (record != NULL)
+       {
+               ByteCount recordSize;
+@@ -1069,7 +1069,7 @@ CopyData:
+               CopyMemory (recordPtr, record->bufferAddress, len);
+       }
+-      if (iterator != nil)                                            // first & last do not require iterator
++      if (iterator != NULL)                                           // first & last do not require iterator
+       {
+               iterator->hint.writeCount       = btreePtr->writeCount;
+               iterator->hint.nodeNum          = nodeNum;
+@@ -1089,13 +1089,13 @@ CopyData:
+       err = ReleaseNode (btreePtr, &node);
+       M_ExitOnError (err);
+-      if (left.buffer != nil)
++      if (left.buffer != NULL)
+       {
+               err = ReleaseNode (btreePtr, &left);
+               M_ExitOnError (err);
+       }
+-      if (right.buffer != nil)
++      if (right.buffer != NULL)
+       {
+               err = ReleaseNode (btreePtr, &right);
+               M_ExitOnError (err);
+@@ -1113,10 +1113,10 @@ ErrorExit:
+       (void)  ReleaseNode (btreePtr, &node);
+       (void)  ReleaseNode (btreePtr, &right);
+-      if (recordLen != nil)
++      if (recordLen != NULL)
+               *recordLen = 0;
+-      if (iterator != nil)
++      if (iterator != NULL)
+       {
+               iterator->hint.writeCount       = 0;
+               iterator->hint.nodeNum          = 0;
+@@ -1157,7 +1157,7 @@ OSStatus BTInsertRecord          (SFCB                                           *filePtr,
+       ////////////////////////// Priliminary Checks ///////////////////////////////
+-      nodeRec.buffer = nil;                                   // so we can call ReleaseNode
++      nodeRec.buffer = NULL;                                  // so we can call ReleaseNode
+       err = CheckInsertParams (filePtr, iterator, record, recordLen);
+       if (err != noErr)
+@@ -1317,7 +1317,7 @@ OSStatus BTSetRecord                     (SFCB                                           *filePtr,
+       ////////////////////////// Priliminary Checks ///////////////////////////////
+-      nodeRec.buffer = nil;                                   // so we can call ReleaseNode
++      nodeRec.buffer = NULL;                                  // so we can call ReleaseNode
+       err = CheckInsertParams (filePtr, iterator, record, recordLen);
+       if (err != noErr)
+@@ -1506,7 +1506,7 @@ OSStatus BTReplaceRecord         (SFCB                                           *filePtr,
+       ////////////////////////// Priliminary Checks ///////////////////////////////
+-      nodeRec.buffer = nil;                                   // so we can call ReleaseNode
++      nodeRec.buffer = NULL;                                  // so we can call ReleaseNode
+       err = CheckInsertParams (filePtr, iterator, record, recordLen);
+       if (err != noErr)
+@@ -1645,20 +1645,20 @@ OSStatus       BTDeleteRecord          (SFCB                                           *filePtr,
+       ////////////////////////// Priliminary Checks ///////////////////////////////
+-      nodeRec.buffer = nil;                                   // so we can call ReleaseNode
++      nodeRec.buffer = NULL;                                  // so we can call ReleaseNode
+-      M_ReturnErrorIf (filePtr == nil,        paramErr);
+-      M_ReturnErrorIf (iterator == nil,       paramErr);
++      M_ReturnErrorIf (filePtr == NULL,       paramErr);
++      M_ReturnErrorIf (iterator == NULL,      paramErr);
+       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
+-      if (btreePtr == nil)
++      if (btreePtr == NULL)
+       {
+               err = fsBTInvalidFileErr;
+               goto ErrorExit;
+       }
+ #if SupportsKeyDescriptors
+-      if (btreePtr->keyDescPtr != nil)
++      if (btreePtr->keyDescPtr != NULL)
+       {
+               err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength);
+               M_ExitOnError (err);
+@@ -1712,12 +1712,12 @@ OSStatus       BTGetInformation        (SFCB                                   *filePtr,
+       BTreeControlBlockPtr    btreePtr;
+-      M_ReturnErrorIf (filePtr == nil,        paramErr);
++      M_ReturnErrorIf (filePtr == NULL,       paramErr);
+       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
+-      M_ReturnErrorIf (btreePtr == nil,       fsBTInvalidFileErr);
+-      M_ReturnErrorIf (info == nil,           paramErr);
++      M_ReturnErrorIf (btreePtr == NULL,      fsBTInvalidFileErr);
++      M_ReturnErrorIf (info == NULL,          paramErr);
+       //¥¥ check version?
+@@ -1730,7 +1730,7 @@ OSStatus BTGetInformation        (SFCB                                   *filePtr,
+       info->keyDescriptor     = btreePtr->keyDescPtr; //¥¥ this won't do at all...
+       info->reserved          = 0;
+-      if (btreePtr->keyDescPtr == nil)
++      if (btreePtr->keyDescPtr == NULL)
+               info->keyDescLength     = 0;
+       else
+               info->keyDescLength     = (UInt32) btreePtr->keyDescPtr->length;
+@@ -1762,11 +1762,11 @@ OSStatus       BTFlushPath                             (SFCB                                   *filePtr)
+ //    LogStartTime(kTraceFlushBTree);
+-      M_ReturnErrorIf (filePtr == nil,        paramErr);
++      M_ReturnErrorIf (filePtr == NULL,       paramErr);
+       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
+-      M_ReturnErrorIf (btreePtr == nil,       fsBTInvalidFileErr);
++      M_ReturnErrorIf (btreePtr == NULL,      fsBTInvalidFileErr);
+       err = UpdateHeader (btreePtr);
+@@ -1788,13 +1788,13 @@ Input:         iterator        - pointer to BTreeIterator
+ Output:               iterator        - iterator with the hint.nodeNum cleared
+ Result:               noErr                   - success
+-                      paramErr        - iterator == nil
++                      paramErr        - iterator == NULL
+ -------------------------------------------------------------------------------*/
+ OSStatus      BTInvalidateHint        (BTreeIterator                          *iterator )
+ {
+-      if (iterator == nil)
++      if (iterator == NULL)
+               return  paramErr;
+       iterator->hint.nodeNum = 0;
+diff --git a/fsck_hfs.tproj/dfalib/BTreeAllocate.c b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
+index 485d867..02bdd8d 100644
+--- a/fsck_hfs.tproj/dfalib/BTreeAllocate.c
++++ b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
+@@ -83,7 +83,7 @@ OSStatus     AllocateNode (BTreeControlBlockPtr              btreePtr, UInt32        *nodeNum)
+       
+       
+       nodeNumber              = 0;                            // first node number of header map record
+-      node.buffer             = nil;                          // clear node.buffer to get header node
++      node.buffer             = NULL;                         // clear node.buffer to get header node
+                                                                               //      - and for ErrorExit
+       
+       while (true)
+@@ -192,7 +192,7 @@ OSStatus   FreeNode (BTreeControlBlockPtr          btreePtr, UInt32        nodeNum)
+       //////////////////////////// Find Map Record ////////////////////////////////
+       nodeIndex                       = 0;                            // first node number of header map record
+-      node.buffer                     = nil;                          // invalidate node.buffer to get header node
++      node.buffer                     = NULL;                         // invalidate node.buffer to get header node
+       
+       while (nodeNum >= nodeIndex)
+       {
+@@ -278,8 +278,8 @@ OSStatus   ExtendBTree     (BTreeControlBlockPtr   btreePtr,
+       nodeSize                        = btreePtr->nodeSize;
+       filePtr                         = btreePtr->fcbPtr;
+       
+-      mapNode.buffer          = nil;
+-      newNode.buffer          = nil;
++      mapNode.buffer          = NULL;
++      newNode.buffer          = NULL;
+       mapNodeRecSize  = nodeSize - sizeof(BTNodeDescriptor) - 6;      // 2 bytes of free space (see note)
+@@ -448,7 +448,7 @@ ErrorExit:
+ Routine:      GetMapNode      -       Get the next map node and pointer to the map record.
+ Function:     Given a BlockDescriptor to a map node in nodePtr, GetMapNode releases
+-                      it and gets the next node. If nodePtr->buffer is nil, then the header
++                      it and gets the next node. If nodePtr->buffer is NULL, then the header
+                       node is retrieved.
+@@ -474,7 +474,7 @@ OSStatus   GetMapNode (BTreeControlBlockPtr          btreePtr,
+       UInt16          mapIndex;
+       UInt32          nextNodeNum;
+       
+-      if (nodePtr->buffer != nil)             // if iterator is valid...
++      if (nodePtr->buffer != NULL)            // if iterator is valid...
+       {
+               nextNodeNum = ((NodeDescPtr)nodePtr->buffer)->fLink;
+               if (nextNodeNum == 0)
+@@ -521,7 +521,7 @@ ErrorExit:
+       
+       (void) ReleaseNode (btreePtr, nodePtr);
+       
+-      *mapPtr         = nil;
++      *mapPtr         = NULL;
+       *mapSize        = 0;
+       
+       return  err;
+diff --git a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
+index 7c9edca..997f34b 100644
+--- a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
++++ b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
+@@ -236,13 +236,13 @@ OSStatus FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
+       // assume index points to UInt16
+       // assume foundRecord points to Boolean
+       
+-      left->buffer            = nil;
+-      middle->buffer          = nil;
+-      right->buffer           = nil;
++      left->buffer            = NULL;
++      middle->buffer          = NULL;
++      right->buffer           = NULL;
+       
+       foundIt                         = false;
+       
+-      if (iterator == nil)                                            // do we have an iterator?
++      if (iterator == NULL)                                           // do we have an iterator?
+       {
+               err = fsBTInvalidIteratorErr;
+               goto ErrorExit;
+@@ -250,7 +250,7 @@ OSStatus   FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
+ #if SupportsKeyDescriptors
+       //¥¥ verify iterator key (change CheckKey to take btreePtr instead of keyDescPtr?)
+-      if (btreePtr->keyDescPtr != nil)
++      if (btreePtr->keyDescPtr != NULL)
+       {
+               err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength );
+               M_ExitOnError (err);
+@@ -309,7 +309,7 @@ OSStatus   FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
+               {
+                       *right                  = *middle;
+                       *middle                 = *left;
+-                      left->buffer    = nil;
++                      left->buffer    = NULL;
+                       index                   = leftIndex;
+                       
+                       goto SuccessfulExit;
+@@ -330,7 +330,7 @@ OSStatus   FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
+               {
+                       *right                  = *middle;
+                       *middle                 = *left;
+-                      left->buffer    = nil;
++                      left->buffer    = NULL;
+                       index                   = leftIndex;
+                       
+                       goto SuccessfulExit;
+@@ -363,7 +363,7 @@ OSStatus   FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
+               {
+                       *left                   = *middle;
+                       *middle                 = *right;
+-                      right->buffer   = nil;
++                      right->buffer   = NULL;
+                       index                   = rightIndex;
+                       
+                       goto SuccessfulExit;
+@@ -427,15 +427,15 @@ OSStatus CheckInsertParams               (SFCB                                           *filePtr,
+ {
+       BTreeControlBlockPtr    btreePtr;
+       
+-      if (filePtr == nil)                                                                     return  paramErr;
++      if (filePtr == NULL)                                                                    return  paramErr;
+       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
+-      if (btreePtr == nil)                                                            return  fsBTInvalidFileErr;
+-      if (iterator == nil)                                                            return  paramErr;
+-      if (record       == nil)                                                                return  paramErr;
++      if (btreePtr == NULL)                                                           return  fsBTInvalidFileErr;
++      if (iterator == NULL)                                                           return  paramErr;
++      if (record       == NULL)                                                               return  paramErr;
+       
+ #if SupportsKeyDescriptors
+-      if (btreePtr->keyDescPtr != nil)
++      if (btreePtr->keyDescPtr != NULL)
+       {
+               OSStatus        err;
+diff --git a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
+index da07cc7..ef2bd7b 100644
+--- a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
++++ b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
+@@ -105,7 +105,7 @@ Function:  Gets an existing BTree node from FS Agent and verifies it.
+ Input:                btreePtr        - pointer to BTree control block
+                       nodeNum         - number of node to request
+                       
+-Output:               nodePtr         - pointer to beginning of node (nil if error)
++Output:               nodePtr         - pointer to beginning of node (NULL if error)
+                       
+ Result:
+                       noErr           - success
+@@ -139,7 +139,7 @@ OSStatus   GetNode         (BTreeControlBlockPtr    btreePtr,
+       if (err != noErr)
+       {
+               Panic ("\pGetNode: getNodeProc returned error.");
+-              nodePtr->buffer = nil;
++              nodePtr->buffer = NULL;
+               goto ErrorExit;
+       }
+       ++btreePtr->numGetNodes;
+@@ -156,8 +156,8 @@ OSStatus   GetNode         (BTreeControlBlockPtr    btreePtr,
+       return noErr;
+ ErrorExit:
+-      nodePtr->buffer                 = nil;
+-      nodePtr->blockHeader    = nil;
++      nodePtr->buffer         = NULL;
++      nodePtr->blockHeader    = NULL;
+       
+ //    LogEndTime(kTraceGetNode, err);
+@@ -176,7 +176,7 @@ Function:  Gets a new BTree node from FS Agent and initializes it to an empty
+ Input:                btreePtr                - pointer to BTree control block
+                       nodeNum                 - number of node to request
+                       
+-Output:               returnNodePtr   - pointer to beginning of node (nil if error)
++Output:               returnNodePtr   - pointer to beginning of node (NULL if error)
+                       
+ Result:               noErr           - success
+                       != noErr        - failure
+@@ -203,7 +203,7 @@ OSStatus   GetNewNode      (BTreeControlBlockPtr    btreePtr,
+       if (err != noErr)
+       {
+               Panic ("\pGetNewNode: getNodeProc returned error.");
+-              returnNodePtr->buffer = nil;
++              returnNodePtr->buffer = NULL;
+               return err;
+       }
+       ++btreePtr->numGetNewNodes;
+@@ -248,7 +248,7 @@ OSStatus   ReleaseNode     (BTreeControlBlockPtr    btreePtr,
+       err = noErr;
+       
+-      if (nodePtr->buffer != nil)
++      if (nodePtr->buffer != NULL)
+       {
+               /*
+                * The nodes must remain in the cache as big endian!
+@@ -267,8 +267,8 @@ OSStatus   ReleaseNode     (BTreeControlBlockPtr    btreePtr,
+               ++btreePtr->numReleaseNodes;
+       }
+       
+-      nodePtr->buffer = nil;
+-      nodePtr->blockHeader = nil;
++      nodePtr->buffer = NULL;
++      nodePtr->blockHeader = NULL;
+       
+ //    LogEndTime(kTraceReleaseNode, err);
+@@ -299,7 +299,7 @@ OSStatus   TrashNode       (BTreeControlBlockPtr    btreePtr,
+       err = noErr;
+       
+-      if (nodePtr->buffer != nil)
++      if (nodePtr->buffer != NULL)
+       {
+               releaseNodeProc = btreePtr->releaseBlockProc;
+               err = releaseNodeProc (btreePtr->fcbPtr,
+@@ -309,8 +309,8 @@ OSStatus   TrashNode       (BTreeControlBlockPtr    btreePtr,
+               ++btreePtr->numReleaseNodes;
+       }
+-      nodePtr->buffer                 = nil;
+-      nodePtr->blockHeader    = nil;
++      nodePtr->buffer         = NULL;
++      nodePtr->blockHeader    = NULL;
+       
+       return err;
+ }
+@@ -338,7 +338,7 @@ OSStatus   UpdateNode      (BTreeControlBlockPtr    btreePtr,
+       
+       err = noErr;
+               
+-      if (nodePtr->buffer != nil)                     //¥¥ why call UpdateNode if nil ?!?
++      if (nodePtr->buffer != NULL)                    //¥¥ why call UpdateNode if NULL ?!?
+       {
+       //      LogStartTime(kTraceReleaseNode);
+               err = hfs_swap_BTNode(nodePtr, btreePtr->fcbPtr, kSwapBTNodeHostToBig);
+@@ -358,8 +358,8 @@ OSStatus   UpdateNode      (BTreeControlBlockPtr    btreePtr,
+               ++btreePtr->numUpdateNodes;
+       }
+       
+-      nodePtr->buffer                 = nil;
+-      nodePtr->blockHeader    = nil;
++      nodePtr->buffer         = NULL;
++      nodePtr->blockHeader    = NULL;
+       return  noErr;
+diff --git a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
+index 37fb170..73e1fda 100644
+--- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
++++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
+@@ -177,7 +177,7 @@ Output:            nodeNum                 - number of the node containing the key position
+                       
+ Result:               noErr                   - key found, index is record index
+                       fsBTRecordNotFoundErr   - key not found, index is insert index
+-                      fsBTEmptyErr            - key not found, return params are nil
++                      fsBTEmptyErr            - key not found, return params are NULL
+                       otherwise                       - catastrophic failure (GetNode/ReleaseNode failed)
+ -------------------------------------------------------------------------------*/
+@@ -321,8 +321,8 @@ ReleaseAndExit:
+ ErrorExit:
+       
+       *nodeNum                                        = 0;
+-      nodePtr->buffer                         = nil;
+-      nodePtr->blockHeader            = nil;
++      nodePtr->buffer                         = NULL;
++      nodePtr->blockHeader            = NULL;
+       *returnIndex                            = 0;
+       return  err;
+@@ -354,7 +354,7 @@ OSStatus   InsertTree ( BTreeControlBlockPtr                btreePtr,
+       primaryKey.replacingKey = replacingKey;
+       primaryKey.skipRotate   = false;
+-      err     = InsertLevel (btreePtr, treePathTable, &primaryKey, nil,
++      err     = InsertLevel (btreePtr, treePathTable, &primaryKey, NULL,
+                                          targetNode, index, level, insertNode );
+                                               
+       return err;
+@@ -385,7 +385,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
+ #if defined(applec) && !defined(__SC__)
+       PanicIf ((level == 1) && (((NodeDescPtr)targetNode->buffer)->kind != kBTLeafNode), "\P InsertLevel: non-leaf at level 1! ");
+ #endif
+-      siblingNode.buffer = nil;
++      siblingNode.buffer = NULL;
+       targetNodeNum = treePathTable [level].node;
+       insertParent = false;
+@@ -420,7 +420,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
+       
+       ////// process second insert (if any) //////
+-      if  ( secondaryKey != nil )
++      if (secondaryKey != NULL)
+       {
+               Boolean                         temp;
+@@ -446,7 +446,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
+               UInt8 *                         recPtr;
+               UInt16                          recSize;
+               
+-              secondaryKey = nil;
++              secondaryKey = NULL;
+               
+               PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?");
+@@ -606,9 +606,9 @@ static OSErr       InsertNode      (BTreeControlBlockPtr    btreePtr,
+       
+       if ( leftNodeNum > 0 )
+       {
+-              PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!");
++              PanicIf(siblingNode->buffer != NULL, "InsertNode: siblingNode already aquired!");
+-              if ( siblingNode->buffer == nil )
++              if (siblingNode->buffer == NULL)
+               {
+                       err = GetNode (btreePtr, leftNodeNum, siblingNode);     // will be released by caller or a split below
+                       M_ExitOnError (err);
+@@ -703,7 +703,7 @@ OSStatus   DeleteTree                      (BTreeControlBlockPtr            btreePtr,
+       targetNodeNum = treePathTable[level].node;
+       targetNodePtr = targetNode->buffer;
+-      PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!");
++      PanicIf (targetNodePtr == NULL, "DeleteTree: targetNode has NULL buffer!");
+       DeleteRecord (btreePtr, targetNodePtr, index);
+               
+@@ -766,7 +766,7 @@ OSStatus   DeleteTree                      (BTreeControlBlockPtr            btreePtr,
+               deleteRequired = false;
+               updateRequired = false;
+               
+-              if ( targetNode->buffer == nil )        // then root was freed and the btree is empty
++              if (targetNode->buffer == NULL) // then root was freed and the btree is empty
+               {
+                       btreePtr->rootNode  = 0;
+                       btreePtr->treeDepth = 0;
+@@ -1124,7 +1124,7 @@ static OSStatus  SplitLeft               (BTreeControlBlockPtr            btreePtr,
+       if ( (right->height == 1) && (right->kind != kBTLeafNode) )
+               return  fsBTInvalidNodeErr;
+       
+-      if ( left != nil )
++      if (left != NULL)
+       {
+               if ( left->fLink != rightNodeNum )
+                       return fsBTInvalidNodeErr;                                                                              //¥¥ E_BadSibling ?
+@@ -1145,7 +1145,7 @@ static OSStatus  SplitLeft               (BTreeControlBlockPtr            btreePtr,
+       /////////////// Update Forward Link In Original Left Node ///////////////////
+-      if ( left != nil )
++      if (left != NULL)
+       {
+               left->fLink     = newNodeNum;
+               err = UpdateNode (btreePtr, leftNode);
+@@ -1240,8 +1240,8 @@ static OSStatus  AddNewRootNode  (BTreeControlBlockPtr    btreePtr,
+       Boolean                         didItFit;
+       UInt16                          keyLength;      
+       
+-      PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil");
+-      PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil");
++      PanicIf (leftNode == NULL, "AddNewRootNode: leftNode == NULL");
++      PanicIf (rightNode == NULL, "AddNewRootNode: rightNode == NULL");
+       
+       
+       /////////////////////// Initialize New Root Node ////////////////////////////
+@@ -1362,7 +1362,7 @@ static OSStatus  SplitRight              (BTreeControlBlockPtr            btreePtr,
+       if ( (leftPtr->height == 1) && (leftPtr->kind != kBTLeafNode) )
+               return  fsBTInvalidNodeErr;
+       
+-      if ( rightPtr != nil )
++      if (rightPtr != NULL)
+       {
+               if ( rightPtr->bLink != nodeNum )
+                       return fsBTInvalidNodeErr;                                                                              //¥¥ E_BadSibling ?
+@@ -1382,7 +1382,7 @@ static OSStatus  SplitRight              (BTreeControlBlockPtr            btreePtr,
+       /////////////// Update backward Link In Original Right Node ///////////////////
+-      if ( rightPtr != nil )
++      if (rightPtr != NULL)
+       {
+               rightPtr->bLink = newNodeNum;
+               err = UpdateNode (btreePtr, rightNodePtr);
+@@ -1739,7 +1739,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
+       UInt16                          keyLength;
+       KeyPtr                          keyPtr;
+       UInt8                           *dataPtr;
+-      KeyPtr                          prevkeyP        = nil;
++      KeyPtr                          prevkeyP        = NULL;
+       if ( nodeP->numRecords == 0 )
+@@ -1766,7 +1766,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
+                               return( -1 );
+                       }
+       
+-                      if ( prevkeyP != nil )
++                      if (prevkeyP != NULL)
+                       {
+                               if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )
+                               {
+diff --git a/fsck_hfs.tproj/dfalib/SControl.c b/fsck_hfs.tproj/dfalib/SControl.c
+index 8b03ece..d3145e0 100644
+--- a/fsck_hfs.tproj/dfalib/SControl.c
++++ b/fsck_hfs.tproj/dfalib/SControl.c
+@@ -82,7 +82,7 @@ CheckHFS(    int fsReadRef, int fsWriteRef, int checkLevel, int repairLevel,
+ {
+       SGlob                           dataArea;       // Allocate the scav globals
+       short                           temp;   
+-      FileIdentifierTable     *fileIdentifierTable    = nil;
++      FileIdentifierTable     *fileIdentifierTable    = NULL;
+       OSErr                           err = noErr;
+       OSErr                           scavError = 0;
+       int                                     scanCount = 0;
+@@ -228,7 +228,7 @@ DoAgain:
+       }
+       //      Set up structures for post processing
+-      if ( (autoRepair == true) && (dataArea.fileIdentifierTable != nil) )
++      if ((autoRepair == true) && (dataArea.fileIdentifierTable != NULL))
+       {
+       //      *repairInfo = *repairInfo | kVolumeHadOverlappingExtents;       //      Report back that volume has overlapping extents
+               fileIdentifierTable     = (FileIdentifierTable *) AllocateMemory( GetHandleSize( (Handle) dataArea.fileIdentifierTable ) );
+@@ -239,7 +239,7 @@ DoAgain:
+       //
+       //      Post processing
+       //
+-      if ( fileIdentifierTable != nil )
++      if (fileIdentifierTable != NULL)
+       {
+               DisposeMemory( fileIdentifierTable );
+       }
+@@ -682,7 +682,7 @@ short CheckForStop( SGlob *GPtr )
+       //if ( ((ticks - 10) > GPtr->lastTickCount) || (dfaStage == kAboutToRepairStage) )                      //      To reduce cursor flicker on fast machines, call through on a timed interval
+       //{
+-              if ( GPtr->userCancelProc != nil )
++              if (GPtr->userCancelProc != NULL)
+               {
+                       UInt64  progress = 0;
+                       Boolean progressChanged;
+@@ -761,7 +761,7 @@ static int ScavSetUp( SGlob *GPtr)
+       short   ioRefNum;
+ #endif
+-      GPtr->MinorRepairsP = nil;
++      GPtr->MinorRepairsP = NULL;
+       
+       GPtr->itemsProcessed = 0;
+       GPtr->lastProgress = 0;
+@@ -774,7 +774,7 @@ static int ScavSetUp( SGlob *GPtr)
+               ScavStaticStructures    *pointer;
+               
+               pointer = (ScavStaticStructures *) AllocateClearMemory( sizeof(ScavStaticStructures) );
+-              if ( pointer == nil ) {
++              if (pointer == NULL) {
+                       if ( GPtr->logLevel >= kDebugLog ) {
+                               printf( "\t error %d - could not allocate %i bytes of memory \n",
+                                       R_NoMem, sizeof(ScavStaticStructures) );
+@@ -831,7 +831,7 @@ static int ScavSetUp( SGlob *GPtr)
+       //      Save current value of vcbWrCnt, to detect modifications to volume by other apps etc
+       if ( GPtr->volumeFeatures & volumeIsMountedMask )
+       {
+-              FlushVol( nil, GPtr->realVCB->vcbVRefNum );     //      Ask HFS to update all changes to disk
++              FlushVol(NULL, GPtr->realVCB->vcbVRefNum);      //      Ask HFS to update all changes to disk
+               GPtr->wrCnt = GPtr->realVCB->vcbWrCnt;          //      Remember write count after writing changes
+       }
+ #endif
+@@ -949,7 +949,7 @@ static int ScavSetUp( SGlob *GPtr)
+       
+       // Keep a valid file id list for HFS volumes
+       GPtr->validFilesList = (UInt32**)NewHandle( 0 );
+-      if ( GPtr->validFilesList == nil ) {
++      if (GPtr->validFilesList == NULL) {
+               if ( GPtr->logLevel >= kDebugLog ) {
+                       printf( "\t error %d - could not allocate file ID list \n", R_NoMem );
+               }
+@@ -995,17 +995,17 @@ static int ScavTerm( SGlobPtr GPtr )
+       (void) BitMapCheckEnd();
+-      while( (rP = GPtr->MinorRepairsP) != nil )              //      loop freeing leftover (undone) repair orders
++      while((rP = GPtr->MinorRepairsP) != NULL)               //      loop freeing leftover (undone) repair orders
+       {
+               GPtr->MinorRepairsP = rP->link;                         //      (in case repairs were not made)
+               DisposeMemory(rP);
+               err = MemError();
+       }
+       
+-      if( GPtr->validFilesList != nil )
++      if (GPtr->validFilesList != NULL)
+               DisposeHandle( (Handle) GPtr->validFilesList );
+       
+-      if( GPtr->overlappedExtents != nil ) {
++      if (GPtr->overlappedExtents != NULL) {
+               extentsTableH = GPtr->overlappedExtents;
+       
+               /* Overlapped extents list also allocated memory for attribute name */
+@@ -1021,44 +1021,44 @@ static int ScavTerm( SGlobPtr GPtr )
+               DisposeHandle( (Handle) GPtr->overlappedExtents );
+       }
+       
+-      if( GPtr->fileIdentifierTable != nil )
++      if (GPtr->fileIdentifierTable != NULL)
+               DisposeHandle( (Handle) GPtr->fileIdentifierTable );
+       
+-      if( GPtr->calculatedVCB == nil )                                                                //      already freed?
++      if (GPtr->calculatedVCB == NULL)                                                                //      already freed?
+               return( noErr );
+       //      If the FCB's and BTCB's have been set up, dispose of them
+       fcbP = GPtr->calculatedExtentsFCB;      // release extent file BTree bit map
+-      if ( fcbP != nil )
++      if (fcbP != NULL)
+       {
+               btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
+-              if ( btcbP != nil)
++              if (btcbP != NULL)
+               {
+-                      if( btcbP->refCon != nil )
++                      if (btcbP->refCon != NULL)
+                       {
+-                              if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
++                              if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL)
+                               {
+                                       DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr);
+                                       err = MemError();
+                               }
+                               DisposeMemory( (Ptr)btcbP->refCon );
+                               err = MemError();
+-                              btcbP->refCon = nil;
++                              btcbP->refCon = NULL;
+                       }
+                               
+                       fcbP = GPtr->calculatedCatalogFCB;      //      release catalog BTree bit map
+                       btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
+                               
+-                      if( btcbP->refCon != nil )
++                      if (btcbP->refCon != NULL)
+                       {
+-                              if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
++                              if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL)
+                               {
+                                       DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr);
+                                       err = MemError();
+                               }
+                               DisposeMemory( (Ptr)btcbP->refCon );
+                               err = MemError();
+-                              btcbP->refCon = nil;
++                              btcbP->refCon = NULL;
+                       }
+               }
+       }
+@@ -1066,7 +1066,7 @@ static int ScavTerm( SGlobPtr GPtr )
+       DisposeMemory( GPtr->calculatedVCB );                                           //      Release our block of data structures    
+       err = MemError();
+-      GPtr->calculatedVCB = nil;
++      GPtr->calculatedVCB = NULL;
+       return( noErr );
+ }
+@@ -1113,7 +1113,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
+       // Now look at the name of the Driver name. If it is .BlueBoxShared keep it out of the list of available disks.
+       driverDCtlHandle = GetDCtlEntry(dqPtr->dQRefNum);
+       driverDCtlPtr = *driverDCtlHandle;
+-      if((((driverDCtlPtr->dCtlFlags) & Is_Native_Mask) == 0) && (driverDCtlPtr->dCtlDriver != nil))
++      if((((driverDCtlPtr->dCtlFlags) & Is_Native_Mask) == 0) && (driverDCtlPtr->dCtlDriver != NULL))
+       {
+               if (((driverDCtlPtr->dCtlFlags) & Is_Ram_Based_Mask) == 0)
+               {
+@@ -1127,19 +1127,19 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
+                       
+               }
+               driverName = (StringPtr)&(drvrHeaderPtr->drvrName);
+-              if (!(IdenticalString(driverName,blueBoxSharedDriverName,nil)))
++              if (!(IdenticalString(driverName,blueBoxSharedDriverName,NULL)))
+               {
+                       return( true );
+               }
+               // Special case for the ".Sony" floppy driver which might be accessed in Shared mode inside the Blue Box
+               // Test its "where" string instead of the driver name.
+-              if (!(IdenticalString(driverName,sonyDriverName,nil)))
++              if (!(IdenticalString(driverName,sonyDriverName,NULL)))
+               {
+                       CntrlParam                      paramBlock;
+               
+-                      paramBlock.ioCompletion = nil;
+-                      paramBlock.ioNamePtr    = nil;
++                      paramBlock.ioCompletion = NULL;
++                      paramBlock.ioNamePtr    = NULL;
+                       paramBlock.ioVRefNum    = dqPtr->dQDrive;
+                       paramBlock.ioCRefNum    = dqPtr->dQRefNum;
+                       paramBlock.csCode               = kDriveIcon;                                           // return physical icon
+@@ -1152,7 +1152,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
+                               
+                               iconAndStringRecPtr = * (IconAndStringRecPtr*) & paramBlock.csParam;
+                               whereStringPtr = (StringPtr) & iconAndStringRecPtr->string;
+-                              if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,nil)))
++                              if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,NULL)))
+                               {
+                                       return( true );
+                               }
+diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
+index 89c12d6..b261c37 100644
+--- a/fsck_hfs.tproj/dfalib/SRepair.c
++++ b/fsck_hfs.tproj/dfalib/SRepair.c
+@@ -844,7 +844,7 @@ static     int     DelFThd( SGlobPtr GPtr, UInt32 fid )                            //      the file ID
+       isHFSPlus = VolumeObjectIsHFSPlus( );
+       
+-      BuildCatalogKey( fid, (const CatalogName*) nil, isHFSPlus, &key );
++      BuildCatalogKey(fid, NULL, isHFSPlus, &key);
+       result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint );
+       
+       if ( result )   return ( IntError( GPtr, result ) );
+@@ -910,7 +910,7 @@ static     OSErr   FixDirThread( SGlobPtr GPtr, UInt32 did )       //      the dir ID
+       isHFSPlus = VolumeObjectIsHFSPlus( );
+-      BuildCatalogKey( did, (const CatalogName*) nil, isHFSPlus, &key );
++      BuildCatalogKey(did, NULL, isHFSPlus, &key);
+       result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint );
+       
+       if ( result )
+@@ -2171,7 +2171,7 @@ static   OSErr   FixOrphanedFiles ( SGlobPtr GPtr )
+                               }
+                               //-- Build the key for the file thread
+-                              BuildCatalogKey( cNodeID, nil, isHFSPlus, &key );
++                              BuildCatalogKey(cNodeID, NULL, isHFSPlus, &key);
+                               err = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, 
+                                                                                &tempKey, &threadRecord, &recordSize, &hint2 );
+diff --git a/fsck_hfs.tproj/dfalib/SUtils.c b/fsck_hfs.tproj/dfalib/SUtils.c
+index 6e9253e..491afbf 100644
+--- a/fsck_hfs.tproj/dfalib/SUtils.c
++++ b/fsck_hfs.tproj/dfalib/SUtils.c
+@@ -395,11 +395,11 @@ OSErr GetVolumeFeatures( SGlobPtr GPtr )
+       err = GetVCBDriveNum( &GPtr->realVCB, GPtr->DrvNum );
+       ReturnIfError( err );
+-      if ( GPtr->realVCB != nil )
++      if (GPtr->realVCB != NULL)
+       {
+               GPtr->volumeFeatures    |= volumeIsMountedMask;
+-              pb.ioParam.ioNamePtr    = nil;
++              pb.ioParam.ioNamePtr    = NULL;
+               pb.ioParam.ioVRefNum    = GPtr->realVCB->vcbVRefNum;
+               pb.ioParam.ioBuffer             = (Ptr) &buffer;
+               pb.ioParam.ioReqCount   = sizeof( buffer );
+@@ -2282,7 +2282,7 @@ void print_prime_buckets(PrimeBuckets *cur);
+  *                    4. btreetye - can be kHFSPlusCatalogRecord or kHFSPlusAttributeRecord
+  *                            indicates which btree prime number bucket should be incremented
+  *
+- * Output:    nil
++ * Output:    NULL
+  */
+ void RecordXAttrBits(SGlobPtr GPtr, UInt16 flags, HFSCatalogNodeID fileid, UInt16 btreetype) 
+ {
+diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
+index 39bda5c..c33155f 100644
+--- a/fsck_hfs.tproj/dfalib/SVerify1.c
++++ b/fsck_hfs.tproj/dfalib/SVerify1.c
+@@ -790,13 +790,13 @@ OSErr    CreateExtentsBTreeControlBlock( SGlobPtr GPtr )
+       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
+       //
+       btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
+-      if ( btcb->refCon == nil ) {
++      if (btcb->refCon == NULL) {
+               err = R_NoMem;
+               goto exit;
+       }
+       size = (btcb->totalNodes + 7) / 8;                                                                                      //      size of BTree bit map
+       ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size);                      //      get precleared bitmap
+-      if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
++      if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
+       {
+               err = R_NoMem;
+               goto exit;
+@@ -1145,13 +1145,13 @@ OSErr  CreateCatalogBTreeControlBlock( SGlobPtr GPtr )
+       //
+       btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
+-      if ( btcb->refCon == nil ) {
++      if (btcb->refCon == NULL) {
+               err = R_NoMem;
+               goto exit;
+       }
+       size = (btcb->totalNodes + 7) / 8;                                                                                      //      size of BTree bit map
+       ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size);                      //      get precleared bitmap
+-      if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
++      if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
+       {
+               err = R_NoMem;
+               goto exit;
+@@ -1339,7 +1339,7 @@ OSErr CatHChk( SGlobPtr GPtr )
+       
+       //¥¥ Can we ignore this part by just taking advantage of setting the selCode = 0x8001;
+       { 
+-              BuildCatalogKey( 1, (const CatalogName *)nil, isHFSPlus, &key );
++              BuildCatalogKey(1, NULL, isHFSPlus, &key);
+               result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint );
+       
+               GPtr->TarBlock = hint;                                                                  /* set target block */
+@@ -1443,7 +1443,7 @@ OSErr CatHChk( SGlobPtr GPtr )
+                               /* 
+                                * Find thread record
+                                */
+-                              BuildCatalogKey( dprP->directoryID, (const CatalogName *) nil, isHFSPlus, &key );
++                              BuildCatalogKey(dprP->directoryID, NULL, isHFSPlus, &key);
+                               result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint );
+                               if ( result != noErr ) {
+                                       char idStr[16];
+@@ -1780,26 +1780,26 @@ OSErr  CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
+       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
+       //
+       btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
+-      if ( btcb->refCon == nil ) {
++      if (btcb->refCon == NULL) {
+               err = R_NoMem;
+               goto exit;
+       }
+       if (btcb->totalNodes == 0)
+       {
+-              ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr                   = nil;
++              ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr                   = NULL;
+               ((BTreeExtensionsRec*)btcb->refCon)->BTCBMSize                  = 0;
+               ((BTreeExtensionsRec*)btcb->refCon)->realFreeNodeCount  = 0;
+       }
+       else
+       {
+-              if ( btcb->refCon == nil ) {
++              if (btcb->refCon == NULL) {
+                       err = R_NoMem;
+                       goto exit;
+               }
+               size = (btcb->totalNodes + 7) / 8;                                                                                      //      size of BTree bit map
+               ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size);                      //      get precleared bitmap
+-              if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
++              if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
+               {
+                       err = R_NoMem;
+                       goto exit;
+@@ -2358,7 +2358,7 @@ static   OSErr   RcdMDBEmbededVolDescriptionErr( SGlobPtr GPtr, OSErr type, HFSMaste
+       RcdError( GPtr, type );                                                                                         //      first, record the error
+       
+       p = AllocMinorRepairOrder( GPtr, sizeof(EmbededVolDescription) );       //      get the node
+-      if ( p == nil ) return( R_NoMem );
++      if (p == NULL)  return( R_NoMem );
+       
+       p->type                                                 =  type;                                                        //      save error info
+       desc                                                    =  (EmbededVolDescription *) &(p->name);
+@@ -2397,7 +2397,7 @@ static   OSErr   RcdInvalidWrapperExtents( SGlobPtr GPtr, OSErr type )
+       RcdError( GPtr, type );                                                                                         //      first, record the error
+       
+       p = AllocMinorRepairOrder( GPtr, 0 );   //      get the node
+-      if ( p == nil ) return( R_NoMem );
++      if (p == NULL)  return( R_NoMem );
+       
+       p->type                                                 =  type;                                                        //      save error info
+       
+@@ -3029,7 +3029,7 @@ OSErr    CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
+       foundBadExtent = false;
+       lastExtentIndex = GPtr->numExtents;
+       
+-      while ( (extents != nil) && (err == noErr) )
++      while ((extents != NULL) && (err == noErr))
+       {       
+               //      checkout the extent record first
+               err = ChkExtRec( GPtr, extents, &lastExtentIndex );
+@@ -3105,7 +3105,7 @@ OSErr    CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
+                       if ( err == btNotFound )
+                       {
+                               err = noErr;                                                            //       no more extent records
+-                              extents = nil;
++                              extents = NULL;
+                               break;
+                       }
+                       else if ( err != noErr )
+@@ -3121,7 +3121,7 @@ OSErr    CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
+                       if ( err == btNotFound )
+                       {
+                               err = noErr;                                                            //       no more extent records
+-                              extents = nil;
++                              extents = NULL;
+                               break;
+                       }
+                       else if ( err != noErr )
+@@ -3205,7 +3205,7 @@ static OSErr     AddExtentToOverlapList( SGlobPtr GPtr, HFSCatalogNodeID fileNumber,
+       }
+       
+       //      If it's uninitialized
+-      if ( GPtr->overlappedExtents == nil )
++      if (GPtr->overlappedExtents == NULL)
+       {
+               GPtr->overlappedExtents = (ExtentsTable **) NewHandleClear( sizeof(ExtentsTable) );
+               extentsTableH   = GPtr->overlappedExtents;
+diff --git a/fsck_hfs.tproj/dfalib/SVerify2.c b/fsck_hfs.tproj/dfalib/SVerify2.c
+index c68f3d8..da1a982 100644
+--- a/fsck_hfs.tproj/dfalib/SVerify2.c
++++ b/fsck_hfs.tproj/dfalib/SVerify2.c
+@@ -1013,7 +1013,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb )
+       UInt16                          keyLength;
+       KeyPtr                          keyPtr;
+       UInt8                           *dataPtr;
+-      KeyPtr                          prevkeyP        = nil;
++      KeyPtr                          prevkeyP        = NULL;
+       if ( nodeP->numRecords == 0 )
+@@ -1044,7 +1044,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb )
+                               return( E_KeyLen );
+                       }
+       
+-                      if ( prevkeyP != nil )
++                      if (prevkeyP != NULL)
+                       {
+                               if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )
+                               {
diff --git a/utils/hfsprogs/patches/0011-Fix-types.patch b/utils/hfsprogs/patches/0011-Fix-types.patch
new file mode 100644 (file)
index 0000000..88c049f
--- /dev/null
@@ -0,0 +1,71 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 24 Oct 2013 01:11:22 -0200
+Subject: Fix types
+
+---
+ fsck_hfs.tproj/cache.c | 30 ++++++++++++++++--------------
+ 1 file changed, 16 insertions(+), 14 deletions(-)
+
+diff --git a/fsck_hfs.tproj/cache.c b/fsck_hfs.tproj/cache.c
+index 527088a..540fa0b 100644
+--- a/fsck_hfs.tproj/cache.c
++++ b/fsck_hfs.tproj/cache.c
+@@ -961,20 +961,21 @@ int CacheLookup (Cache_t *cache, uint64_t off, Tag_t **tag)
+  */
+ int CacheRawRead (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
+ {
+-      uint64_t        result;
++      off_t   result1;
++      ssize_t result2;
+               
+       /* Both offset and length must be multiples of the device block size */
+       if (off % cache->DevBlockSize) return (EINVAL);
+       if (len % cache->DevBlockSize) return (EINVAL);
+       
+       /* Seek to the position */
+-      result = lseek (cache->FD_R, off, SEEK_SET);
+-      if (result < 0) return (errno);
+-      if (result != off) return (ENXIO);
++      result1 = lseek(cache->FD_R, off, SEEK_SET);
++      if (result1 < 0) return (errno);
++      if (result1 != off) return (ENXIO);
+       /* Read into the buffer */
+-      result = read (cache->FD_R, buf, len);
+-      if (result < 0) return (errno);
+-      if (result == 0) return (ENXIO);
++      result2 = read(cache->FD_R, buf, len);
++      if (result2 < 0) return (errno);
++      if (result2 == 0) return (ENXIO);
+       /* Update counters */
+       cache->DiskRead++;
+@@ -989,21 +990,22 @@ int CacheRawRead (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
+  */
+ int CacheRawWrite (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
+ {
+-      uint64_t        result;
++      off_t   result1;
++      ssize_t result2;
+       
+       /* Both offset and length must be multiples of the device block size */
+       if (off % cache->DevBlockSize) return (EINVAL);
+       if (len % cache->DevBlockSize) return (EINVAL);
+       
+       /* Seek to the position */
+-      result = lseek (cache->FD_W, off, SEEK_SET);
+-      if (result < 0) return (errno);
+-      if (result != off) return (ENXIO);
++      result1 = lseek (cache->FD_W, off, SEEK_SET);
++      if (result1 < 0) return (errno);
++      if (result1 != off) return (ENXIO);
+       
+       /* Write into the buffer */
+-      result = write (cache->FD_W, buf, len);
+-      if (result < 0) return (errno);
+-      if (result == 0) return (ENXIO);
++      result2 = write (cache->FD_W, buf, len);
++      if (result2 < 0) return (errno);
++      if (result2 == 0) return (ENXIO);
+       
+       /* Update counters */
+       cache->DiskWrite++;
diff --git a/utils/hfsprogs/patches/0012-Fix-mkfs-not-creating-UUIDs-for-new-filesystems.patch b/utils/hfsprogs/patches/0012-Fix-mkfs-not-creating-UUIDs-for-new-filesystems.patch
new file mode 100644 (file)
index 0000000..883a7b7
--- /dev/null
@@ -0,0 +1,50 @@
+From: Matthew Garrett <mjg59@codon.org.uk>
+Date: Thu, 24 Oct 2013 01:11:22 -0200
+Subject: Fix mkfs not creating UUIDs for new filesystems.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fix mkfs not creating UUIDs for new filesystems.
+
+Thanks to Lars Noodén for reporting the bug at
+ <https://bugs.launchpad.net/bugs/737002>.
+
+This closes LP: #737002.
+---
+ include/missing.h | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/include/missing.h b/include/missing.h
+index 0a859c4..f50e8fb 100644
+--- a/include/missing.h
++++ b/include/missing.h
+@@ -72,7 +72,7 @@
+ #define NAME_MAX      255
+ /* Byteswap stuff */
+-#define NXSwapHostLongToBig(x)                cpu_to_be64(x)
++#define NXSwapHostLongToBig(x)                cpu_to_be32(x)
+ #define NXSwapBigShortToHost(x)       be16_to_cpu(x)
+ #define OSSwapBigToHostInt16(x)               be16_to_cpu(x)
+ #define NXSwapBigLongToHost(x)                be32_to_cpu(x)
+@@ -88,6 +88,9 @@
+ #ifndef be32_to_cpu
+ #define be32_to_cpu(x) bswap_32(x)
+ #endif
++#ifndef cpu_to_be32
++#define cpu_to_be32(x) bswap_32(x)
++#endif
+ #ifndef be64_to_cpu
+ #define be64_to_cpu(x) bswap_64(x)
+ #endif
+@@ -102,6 +105,9 @@
+ #ifndef be32_to_cpu
+ #define be32_to_cpu(x)        (x)
+ #endif
++#ifndef cpu_to_be32
++#define cpu_to_be32(x)        (x)
++#endif
+ #ifndef be64_to_cpu
+ #define be64_to_cpu(x)        (x)
+ #endif
diff --git a/utils/hfsprogs/patches/0013-Fix-manpages.patch b/utils/hfsprogs/patches/0013-Fix-manpages.patch
new file mode 100644 (file)
index 0000000..d78083b
--- /dev/null
@@ -0,0 +1,157 @@
+From: =?UTF-8?q?Rog=C3=A9rio=20Theodoro=20de=20Brito?= <rbrito@ime.usp.br>
+Date: Thu, 25 Nov 2010 00:00:00 -0200
+Subject: Fix manpages
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Remove typos, references in the "See also" sections of the manpages to
+commands that are not available in Debian systems (and, quite probably,
+other systems too) and non-Linux specific comments.
+
+Authored also by Christoph Hellwig <hch@lst.de> and  "A. Costa" <agcosta@gis.net>
+
+Bug-Debian: http://bugs.debian.org/598714
+Bug-Debian: http://bugs.debian.org/575201
+Forwarded: no
+Reviewed-by: Rogério Theodoro de Brito <rbrito@ime.usp.br>
+---
+ fsck_hfs.tproj/fsck_hfs.8   | 18 +++++++-----------
+ newfs_hfs.tproj/newfs_hfs.8 | 23 ++++++++---------------
+ 2 files changed, 15 insertions(+), 26 deletions(-)
+
+diff --git a/fsck_hfs.tproj/fsck_hfs.8 b/fsck_hfs.tproj/fsck_hfs.8
+index aec9949..0bc804d 100644
+--- a/fsck_hfs.tproj/fsck_hfs.8
++++ b/fsck_hfs.tproj/fsck_hfs.8
+@@ -19,18 +19,18 @@
+ .Dt FSCK_HFS 8
+ .Os "Mac OS X"
+ .Sh NAME
+-.Nm fsck_hfs
++.Nm fsck.hfs
+ .Nd HFS file system consistency check
+ .Sh SYNOPSIS
+-.Nm fsck_hfs
++.Nm fsck.hfs
+ .Fl q
+ .Op Fl df
+ .Ar special ...
+-.Nm fsck_hfs
++.Nm fsck.hfs
+ .Fl p
+ .Op Fl df
+ .Ar special ...
+-.Nm fsck_hfs
++.Nm fsck.hfs
+ .Op Fl n | y | r
+ .Op Fl dfgl
+ .Op Fl m Ar mode
+@@ -52,9 +52,7 @@ The second form of
+ preens the specified file systems.
+ It is normally started by
+ .Xr fsck 8
+-run from
+-.Pa /etc/rc.boot
+-during automatic reboot, when a HFS file system is detected.
++during systen boot, when a HFS file system is detected.
+ When preening file systems,
+ .Nm
+ will fix common inconsistencies for file systems that were not
+@@ -105,9 +103,9 @@ to check and repair journaled HFS+ file systems.
+ .It Fl g
+ Causes
+ .Nm
+-to generate it's output strings in GUI format.
++to generate its output strings in GUI format.
+ This option is used when another application with a graphical user interface
+-(like Mac OS X Disk Utility) is envoking the
++(like Mac OS X Disk Utility) is invoking the
+ .Nm
+ tool.
+ .It Fl l
+@@ -144,8 +142,6 @@ specified file system for a new catalog file and if there is no damage
+ to the leaf nodes in the existing catalog file.
+ .El
+ .Pp
+-Because of inconsistencies between the block device and the buffer cache,
+-the raw device should always be used.
+ .Sh SEE ALSO
+ .Xr fsck 8
+ .Sh BUGS
+diff --git a/newfs_hfs.tproj/newfs_hfs.8 b/newfs_hfs.tproj/newfs_hfs.8
+index d002cc9..fe91962 100644
+--- a/newfs_hfs.tproj/newfs_hfs.8
++++ b/newfs_hfs.tproj/newfs_hfs.8
+@@ -19,10 +19,10 @@
+ .Dt NEWFS_HFS 8
+ .Os "Mac OS X"
+ .Sh NAME
+-.Nm newfs_hfs
++.Nm mkfs.hfs
+ .Nd construct a new HFS Plus file system
+ .Sh SYNOPSIS
+-.Nm newfs_hfs
++.Nm mkfs.hfs
+ .Op Fl N Ar [partition-size]
+ .Op Fl U Ar uid
+ .Op Fl G Ar gid
+@@ -37,19 +37,13 @@
+ .Op Fl v Ar volume-name
+ .Ar special
+ .Sh DESCRIPTION
+-.Nm Newfs_hfs
++.Nm mkfs.hfs
+ builds an HFS Plus file system on the specified special device.
+-Before running 
+-.Nm newfs_hfs
+-the disk should be partitioned using the
+-.Em Disk Utility
+-application or
+-.Xr pdisk 8 .
+ .Pp
+ The file system default parameters are calculated based on
+ the size of the disk partition. Typically the defaults are
+ reasonable, however
+-.Nm newfs_hfs
++.Nm mkfs.hfs
+ has several options to allow the defaults to be selectively overridden.
+ The options are as follows:
+ .Bl -tag -width Fl
+@@ -66,7 +60,7 @@ Set the group of the file system's root directory to
+ Specify the access permissions mask for the file system's root directory.
+ .It Fl h
+ Creates a legacy HFS format filesystem. This option
+-is not recomended for file systems that will be
++is not recommended for file systems that will be
+ primarily used with Mac OS X or Darwin.
+ .It Fl s
+ Creates a case-sensitive HFS Plus filesystem. By
+@@ -93,7 +87,7 @@ sizes are specified with the
+ option followed by a comma
+ separated list of the form arg=blocks.
+ .Pp
+-Example:  -c c=5000,e=500
++Example:  \-c c=5000,e=500
+ .Bl -tag -width Fl
+ .It Em a=blocks
+ Set the attribute file clump size.
+@@ -126,7 +120,7 @@ the form arg=bytes. The
+ size must be a power of two and no larger than
+ 32768 bytes.
+ .Pp
+-Example:  -n c=8192,e=4096
++Example:  \-n c=8192,e=4096
+ .Bl -tag -width Fl
+ .It Em a=bytes
+ Set the attribute b-tree node size.
+@@ -139,8 +133,7 @@ Set the extent overflow b-tree node size.
+ Volume name (file system name) in ascii or UTF-8 format.
+ .El
+ .Sh SEE ALSO
+-.Xr mount 8 ,
+-.Xr pdisk 8
++.Xr mount 8
+ .Sh HISTORY
+ The
+ .Nm
diff --git a/utils/hfsprogs/patches/0014-uClibc_no_loadavg.patch b/utils/hfsprogs/patches/0014-uClibc_no_loadavg.patch
new file mode 100644 (file)
index 0000000..48649ba
--- /dev/null
@@ -0,0 +1,15 @@
+--- diskdev_cmds-332.25/newfs_hfs.tproj/makehfs.c      2015-03-27 21:58:04.163171675 -0700
++++ hfsprogs-332.25/newfs_hfs.tproj/makehfs.c  2015-03-27 21:56:03.687175020 -0700
+@@ -2119,10 +2119,12 @@
+               sysctl(mib, 2, sysctlstring, &datalen, NULL, 0);
+               SHA1_Update(&context, sysctlstring, datalen);
+ #endif
++#ifndef __UCLIBC__
+               /* The system's load average: */
+               datalen = sizeof(sysloadavg);
+               getloadavg(sysloadavg, 3);
+               SHA1_Update(&context, &sysloadavg, datalen);
++#endif
+               /* The system's VM statistics: */
+ #if !LINUX
index 7bd096f1affe018cb7c4985d175407744fb91866..3e4361b55e610944f22b093c199dcd9074a814fe 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=LVM2
-PKG_VERSION:=2.02.117
+PKG_VERSION:=2.02.118
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0 LGPL-2.1
 
 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2
-PKG_MD5SUM:=ab5889dae7924b44ed2444161058a419
+PKG_MD5SUM:=27f028974e8f067a9791d685b4e0fa90
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
 
index dc159c5529377485237368c679c8d77be5f849ad..09d2db96256c7f3700057cb7fba8117341c29750 100644 (file)
@@ -8,4 +8,4 @@
 +#include <blkid/blkid.h>
  #endif
  
- #include "device-types.h"
+ #ifdef UDEV_SYNC_SUPPORT
diff --git a/utils/lvm2/patches/002-const-stdio.patch b/utils/lvm2/patches/002-const-stdio.patch
new file mode 100644 (file)
index 0000000..15c2e86
--- /dev/null
@@ -0,0 +1,58 @@
+Index: LVM2.2.02.118/lib/commands/toolcontext.c
+===================================================================
+--- LVM2.2.02.118.orig/lib/commands/toolcontext.c
++++ LVM2.2.02.118/lib/commands/toolcontext.c
+@@ -1625,8 +1625,10 @@ struct cmd_context *create_toolcontext(u
+                                      unsigned threaded)
+ {
+       struct cmd_context *cmd;
++#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
+       FILE *new_stream;
+       int flags;
++#endif
+ #ifdef M_MMAP_MAX
+       mallopt(M_MMAP_MAX, 0);
+@@ -1662,7 +1664,7 @@ struct cmd_context *create_toolcontext(u
+       /* FIXME Make this configurable? */
+       reset_lvm_errno(1);
+-#ifndef VALGRIND_POOL
++#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
+       /* Set in/out stream buffering before glibc */
+       if (set_buffering) {
+               /* Allocate 2 buffers */
+@@ -2035,7 +2037,7 @@ void destroy_toolcontext(struct cmd_cont
+       if (cmd->libmem)
+               dm_pool_destroy(cmd->libmem);
+-#ifndef VALGRIND_POOL
++#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
+       if (cmd->linebuffer) {
+               /* Reset stream buffering to defaults */
+               if (is_valid_fd(STDIN_FILENO) &&
+Index: LVM2.2.02.118/tools/lvmcmdline.c
+===================================================================
+--- LVM2.2.02.118.orig/tools/lvmcmdline.c
++++ LVM2.2.02.118/tools/lvmcmdline.c
+@@ -1602,6 +1602,7 @@ int lvm_split(char *str, int *argc, char
+ /* Make sure we have always valid filedescriptors 0,1,2 */
+ static int _check_standard_fds(void)
+ {
++#ifdef __GLIBC__
+       int err = is_valid_fd(STDERR_FILENO);
+       if (!is_valid_fd(STDIN_FILENO) &&
+@@ -1628,6 +1629,12 @@ static int _check_standard_fds(void)
+                      strerror(errno));
+               return 0;
+       }
++#else
++      if (!is_valid_fd(STDERR_FILENO) ||
++          !is_valid_fd(STDOUT_FILENO) ||
++          !is_valid_fd(STDIN_FILENO))
++              return 0;
++#endif
+       return 1;
+ }
diff --git a/utils/lvm2/patches/003-no-mallinfo.patch b/utils/lvm2/patches/003-no-mallinfo.patch
new file mode 100644 (file)
index 0000000..1337236
--- /dev/null
@@ -0,0 +1,13 @@
+Index: LVM2.2.02.118/lib/mm/memlock.c
+===================================================================
+--- LVM2.2.02.118.orig/lib/mm/memlock.c
++++ LVM2.2.02.118/lib/mm/memlock.c
+@@ -137,7 +137,7 @@ static void _touch_memory(void *mem, siz
+ static void _allocate_memory(void)
+ {
+-#ifndef VALGRIND_POOL
++#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
+       void *stack_mem;
+       struct rlimit limit;
+       int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
index eaf77efdb43c8e862261352bd128c06dd65a81d3..3b2d1e435528a0fcef2aa7333a8fc4839855600b 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lxc
-PKG_VERSION:=1.1.0
+PKG_VERSION:=1.1.1
 PKG_RELEASE:=1
 
 PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
@@ -16,7 +16,7 @@ PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/lxc/
-PKG_MD5SUM:=ab1cbabf859abc15165050c854979c5c
+PKG_MD5SUM:=d80cb08f0edf36f0887e32c96aec8c13
 
 PKG_BUILD_DEPENDS:=lua
 PKG_BUILD_PARALLEL:=1
diff --git a/utils/lxc/patches/030-lxc-download.patch b/utils/lxc/patches/030-lxc-download.patch
new file mode 100644 (file)
index 0000000..295bae0
--- /dev/null
@@ -0,0 +1,43 @@
+--- a/templates/lxc-download.in
++++ b/templates/lxc-download.in
+@@ -39,7 +39,7 @@ DOWNLOAD_LIST_IMAGES="false"
+ DOWNLOAD_MODE="system"
+ DOWNLOAD_READY_GPG="false"
+ DOWNLOAD_RELEASE=
+-DOWNLOAD_SERVER="images.linuxcontainers.org"
++DOWNLOAD_SERVER="virtualwrt.org/containers/"
+ DOWNLOAD_SHOW_GPG_WARNING="true"
+ DOWNLOAD_SHOW_HTTP_WARNING="true"
+ DOWNLOAD_TARGET="system"
+@@ -257,14 +257,6 @@ for bin in tar xz wget; do
+     fi
+ done
+-# Check for GPG
+-if [ "$DOWNLOAD_VALIDATE" = "true" ]; then
+-    if ! type gpg >/dev/null 2>&1; then
+-        echo "ERROR: Missing recommended tool: gpg" 1>&2
+-        echo "You can workaround this by using --no-validate." 1>&2
+-        exit 1
+-    fi
+-fi
+ # Check that we have all variables we need
+ if [ -z "$LXC_NAME" ] || [ -z "$LXC_PATH" ] || [ -z "$LXC_ROOTFS" ]; then
+@@ -456,16 +448,9 @@ if [ "$DOWNLOAD_USE_CACHE" = "false" ];
+         echo "Downloading the rootfs"
+         download_file $DOWNLOAD_URL/rootfs.tar.xz \
+             ${DOWNLOAD_TEMP}/rootfs.tar.xz normal
+-        download_sig  $DOWNLOAD_URL/rootfs.tar.xz.asc \
+-             ${DOWNLOAD_TEMP}/rootfs.tar.xz.asc normal
+-        gpg_validate ${DOWNLOAD_TEMP}/rootfs.tar.xz.asc
+-
+         echo "Downloading the metadata"
+         download_file $DOWNLOAD_URL/meta.tar.xz \
+             ${DOWNLOAD_TEMP}/meta.tar.xz normal
+-        download_sig  $DOWNLOAD_URL/meta.tar.xz.asc \
+-            ${DOWNLOAD_TEMP}/meta.tar.xz.asc normal
+-        gpg_validate ${DOWNLOAD_TEMP}/meta.tar.xz.asc
+         if [ -d $LXC_CACHE_PATH ]; then
+             rm -Rf $LXC_CACHE_PATH
diff --git a/utils/lxc/patches/300-fix-lxc-destroy.patch b/utils/lxc/patches/300-fix-lxc-destroy.patch
deleted file mode 100644 (file)
index 241f387..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From bdeafb7bc4857e80dbca5192a751eedcf7b69abd Mon Sep 17 00:00:00 2001
-From: Luka Perkov <luka@openwrt.org>
-Date: Mon, 27 Oct 2014 21:49:46 +0100
-Subject: [PATCH] utils: remove unnecessary check of mystat.st_dev
-
-The check is not needed and it breaks lxc-destroy when container is installed
-on top of overlayfs. More information why this is a problem on overlayfs can be
-found here:
-
-https://kernel.googlesource.com/pub/scm/linux/kernel/git/mszeredi/vfs/+/overlayfs.current/Documentation/filesystems/overlayfs.txt
-
-Signed-off-by: Luka Perkov <luka@openwrt.org>
----
- src/lxc/utils.c | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
-
---- a/src/lxc/utils.c
-+++ b/src/lxc/utils.c
-@@ -47,7 +47,7 @@
- lxc_log_define(lxc_utils, lxc);
--static int _recursive_rmdir_onedev(char *dirname, dev_t pdev,
-+static int _recursive_rmdir_onedev(char *dirname,
-                                  const char *exclude, int level)
- {
-       struct dirent dirent, *direntp;
-@@ -108,10 +108,8 @@ static int _recursive_rmdir_onedev(char
-                       failed=1;
-                       continue;
-               }
--              if (mystat.st_dev != pdev)
--                      continue;
-               if (S_ISDIR(mystat.st_mode)) {
--                      if (_recursive_rmdir_onedev(pathname, pdev, exclude, level+1) < 0)
-+                      if (_recursive_rmdir_onedev(pathname, exclude, level+1) < 0)
-                               failed=1;
-               } else {
-                       if (unlink(pathname) < 0) {
-@@ -147,7 +145,7 @@ extern int lxc_rmdir_onedev(char *path,
-               return -1;
-       }
--      return _recursive_rmdir_onedev(path, mystat.st_dev, exclude, 0);
-+      return _recursive_rmdir_onedev(path, exclude, 0);
- }
- static int mount_fs(const char *source, const char *target, const char *type)
diff --git a/utils/lxc/patches/300-lxc-destroy.patch b/utils/lxc/patches/300-lxc-destroy.patch
new file mode 100644 (file)
index 0000000..a76e27a
--- /dev/null
@@ -0,0 +1,113 @@
+One of the 'features' of overlayfs is that depending on whether a file
+is on the upper or lower dir you get back a different device from stat.
+That breaks our lxc_rmdir_onedev.
+
+So at lxc_rmdir_ondev check the device of the directory being deleted.
+If it is overlayfs, then skip the device check.
+
+Note this is unrelated to overlayfs snapshots - in those cases when you
+delete a container, /var/lib/lxc/$container/ does not actually have an
+overlayfs under it.  Rather, to reproduce this you would
+
+sudo mkdir /opt/{lower,upper,workdir}
+sudo mount -t overlayfs -o lower=/opt/lower,upper=/opt/upper,workdir=/opt/workdir \
+       lxc /var/lib/lxc
+sudo lxc-create -t download -n c1 -- -d ubuntu -r trusty -a amd64
+sudo lxc-destroy -n c1
+
+Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
+---
+ src/lxc/utils.c | 39 ++++++++++++++++++++++++++++++++-------
+ 1 file changed, 32 insertions(+), 7 deletions(-)
+
+--- a/src/lxc/utils.c
++++ b/src/lxc/utils.c
+@@ -29,6 +29,7 @@
+ #include <stddef.h>
+ #include <string.h>
+ #include <sys/types.h>
++#include <sys/vfs.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
+ #include <sys/param.h>
+@@ -68,8 +69,8 @@
+ lxc_log_define(lxc_utils, lxc);
+-static int _recursive_rmdir_onedev(char *dirname, dev_t pdev,
+-                                 const char *exclude, int level)
++static int _recursive_rmdir(char *dirname, dev_t pdev,
++                          const char *exclude, int level, bool onedev)
+ {
+       struct dirent dirent, *direntp;
+       DIR *dir;
+@@ -106,7 +107,7 @@ static int _recursive_rmdir_onedev(char
+                       if (ret < 0) {
+                               switch(errno) {
+                               case ENOTEMPTY:
+-                                      INFO("Not deleting snapshots");
++                                      INFO("Not deleting snapshot %s", pathname);
+                                       hadexclude = true;
+                                       break;
+                               case ENOTDIR:
+@@ -129,14 +130,14 @@ static int _recursive_rmdir_onedev(char
+                       failed=1;
+                       continue;
+               }
+-              if (mystat.st_dev != pdev)
++              if (onedev && mystat.st_dev != pdev)
+                       continue;
+               if (S_ISDIR(mystat.st_mode)) {
+-                      if (_recursive_rmdir_onedev(pathname, pdev, exclude, level+1) < 0)
++                      if (_recursive_rmdir(pathname, pdev, exclude, level+1, onedev) < 0)
+                               failed=1;
+               } else {
+                       if (unlink(pathname) < 0) {
+-                              ERROR("%s: failed to delete %s", __func__, pathname);
++                              SYSERROR("%s: failed to delete %s", __func__, pathname);
+                               failed=1;
+                       }
+               }
+@@ -158,17 +159,41 @@ static int _recursive_rmdir_onedev(char
+       return failed ? -1 : 0;
+ }
++/* we have two different magic values for overlayfs, yay */
++#define OVERLAYFS_SUPER_MAGIC 0x794c764f
++#define OVERLAY_SUPER_MAGIC 0x794c7630
++/*
++ * In overlayfs, st_dev is unreliable.  so on overlayfs we don't do
++ * the lxc_rmdir_onedev()
++ */
++static bool is_native_overlayfs(const char *path)
++{
++      struct statfs sb;
++
++      if (statfs(path, &sb) < 0)
++              return false;
++      if (sb.f_type == OVERLAYFS_SUPER_MAGIC ||
++                      sb.f_type == OVERLAY_SUPER_MAGIC)
++              return true;
++      return false;
++}
++
+ /* returns 0 on success, -1 if there were any failures */
+ extern int lxc_rmdir_onedev(char *path, const char *exclude)
+ {
+       struct stat mystat;
++      bool onedev = true;
++
++      if (is_native_overlayfs(path)) {
++              onedev = false;
++      }
+       if (lstat(path, &mystat) < 0) {
+               ERROR("%s: failed to stat %s", __func__, path);
+               return -1;
+       }
+-      return _recursive_rmdir_onedev(path, mystat.st_dev, exclude, 0);
++      return _recursive_rmdir(path, mystat.st_dev, exclude, 0, onedev);
+ }
+ static int mount_fs(const char *source, const char *target, const char *type)
index 1fb7becccea456cb152c4c5bf2a5e82ea095a0cc..ab8cd1b0300713049207ccea3a1bc71281557c58 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mc
-PKG_VERSION:=4.8.13
-PKG_RELEASE:=1.2
+PKG_VERSION:=4.8.14
+PKG_RELEASE:=1.3
 PKG_MAINTAINER:=Dirk Brenken <dibdot@gmail.com>
 PKG_LICENSE:=GPL-3.0+
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://ftp.midnight-commander.org/
-PKG_MD5SUM:=d967caa12765eb86e52a6a63ca202500
+PKG_MD5SUM:=fbdaddb9edcf8925dcf3231331a8720b
 
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
@@ -36,7 +36,7 @@ include $(INCLUDE_DIR)/nls.mk
 define Package/mc
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+glib2 +libncurses +MC_VFS:libssh2 $(LIBRPC_DEPENDS) $(ICONV_DEPENDS)
+  DEPENDS:=+glib2 +libncurses +libmount +MC_VFS:libssh2 $(LIBRPC_DEPENDS) $(ICONV_DEPENDS)
   TITLE:=Midnight Commander - a powerful visual file manager
   URL:=http://www.midnight-commander.org/
   MENU:=1
index a5c425b6a20839dde83569be0433abcc3ca0c7db..ca85493639e70f7175cd5b4b66b6095dc5196b48 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mmc-utils
-PKG_VERSION=2015-03-06-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=2
+PKG_VERSION=2015-03-25-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git
-PKG_SOURCE_VERSION:=f4eb241519f8d500ce6068a70d2389be39ac5189
+PKG_SOURCE_VERSION:=50b68547ad895803128519af71c31b9f14bfc791
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
 
diff --git a/utils/mmc-utils/patches/001-dont-set-fortify-source-in-makefile.patch b/utils/mmc-utils/patches/001-dont-set-fortify-source-in-makefile.patch
deleted file mode 100644 (file)
index 9b2b8ba..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Index: mmc-utils-f4eb241519f8d500ce6068a70d2389be39ac5189/Makefile
-===================================================================
---- mmc-utils-f4eb241519f8d500ce6068a70d2389be39ac5189.orig/Makefile
-+++ mmc-utils-f4eb241519f8d500ce6068a70d2389be39ac5189/Makefile
-@@ -1,5 +1,5 @@
- CC ?= gcc
--AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
-+AM_CFLAGS = -D_FILE_OFFSET_BITS=64
- CFLAGS ?= -g -O2
- objects = \
-       mmc.o \
diff --git a/utils/mmc-utils/patches/001-properly-set-fortify-source-in-makefile.patch b/utils/mmc-utils/patches/001-properly-set-fortify-source-in-makefile.patch
new file mode 100644 (file)
index 0000000..4a35b95
--- /dev/null
@@ -0,0 +1,11 @@
+Index: mmc-utils-f4eb241519f8d500ce6068a70d2389be39ac5189/Makefile
+===================================================================
+--- mmc-utils-f4eb241519f8d500ce6068a70d2389be39ac5189.orig/Makefile
++++ mmc-utils-f4eb241519f8d500ce6068a70d2389be39ac5189/Makefile
+@@ -1,5 +1,5 @@
+ CC ?= gcc
+-AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
++AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
+ CFLAGS ?= -g -O2
+ objects = \
+       mmc.o \
index 16312b3f1d46120908aec343105a6ac043ab4fc8..f0553a9d73eea94ed1d26dfb752bd35b54ebb22c 100644 (file)
@@ -58,7 +58,9 @@ define Package/libmysqlclient-r
   DEPENDS+= +libpthread
 endef
 
-TARGET_CXX=g++-uc
+ifneq ($(CONFIG_USE_UCLIBCXX),)
+  TARGET_CXX=g++-uc
+endif
 
 TARGET_CFLAGS += $(FPIC)
 
index 49f0b9bb978d60a4ae61d76feefe8bab3e4b04ed..e1600c03be645229f282b78c9ce51afc0f94dcb2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2014 OpenWrt.org
+# Copyright (C) 2007-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nano
-PKG_VERSION:=2.3.6
+PKG_VERSION:=2.4.1
 PKG_RELEASE:=1
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.nano-editor.org/dist/v2.3
-PKG_MD5SUM:=df3d201aecb3155a80633990cc467831
+PKG_SOURCE_URL:=http://www.nano-editor.org/dist/v2.4
+PKG_MD5SUM:=1c612b478f976abf8ef926480c7a3684
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
diff --git a/utils/ntfs-3g/patches/001-fuseint-fix-path-mounted-on-musl.patch b/utils/ntfs-3g/patches/001-fuseint-fix-path-mounted-on-musl.patch
new file mode 100644 (file)
index 0000000..577c89b
--- /dev/null
@@ -0,0 +1,30 @@
+Index: ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/fusermount.c
+===================================================================
+--- ntfs-3g-2014.2.15-1-fuseint.orig/libfuse-lite/fusermount.c
++++ ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/fusermount.c
+@@ -36,6 +36,10 @@
+ #define FUSE_DEV_NEW "/dev/fuse"
++#ifndef _PATH_MOUNTED
++#define _PATH_MOUNTED "/proc/mounts"
++#endif
++
+ #ifndef MS_DIRSYNC
+ #define MS_DIRSYNC 128
+ #endif
+Index: ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/mount_util.c
+===================================================================
+--- ntfs-3g-2014.2.15-1-fuseint.orig/libfuse-lite/mount_util.c
++++ ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/mount_util.c
+@@ -255,6 +255,10 @@ int fuse_mnt_check_fuseblk(void)
+ #else /* __SOLARIS__ */
++#ifndef _PATH_MOUNTED
++#define _PATH_MOUNTED "/proc/mounts"
++#endif /* _PATH_MOUNTED */
++
+ static int mtab_needs_update(const char *mnt)
+ {
+       int res;
index c7e19f18b773172fa8fc872cdcac13d41e8bef37..1c8ef9d51db115420730f8cb86b89d2b1491a78d 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=open-plc-utils
-PKG_VERSION:=2013-01-29
+PKG_VERSION:=2015-02-23
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://github.com/qca/open-plc-utils.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=6beeb6fe6ce2b16b14284c26e1b9220b68044591
+PKG_SOURCE_VERSION:=1f6e7e372b313cf570aa63314037588ed01ec0de
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
index aadd3e2f3bf0a8e603f3d6d688c5f1d8744c5c8c..9f86330d4aed493940edefe3a6657d963e6f9498 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openocd
-PKG_VERSION:=v0.8.0-258-gd537cfa
-PKG_RELEASE:=2
+PKG_VERSION:=v0.9.0-rc1
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://git.code.sf.net/p/openocd/code
index 0d7ec33f9a395a672d54a510eb61d3fa72aaf9b0..e9879f601b9066cd86bf778fac67b85b1668785f 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pciutils
-PKG_VERSION:=3.3.0
-PKG_RELEASE:=3
-PKG_USE_MIPS16:=0
+PKG_VERSION:=3.3.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
-PKG_MD5SUM:=bf6ce5c50b273ffc2d27f659e929a37e
+PKG_MD5SUM:=86d5462e5cfc2a4341a2b91ce3ed0f09
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
+PKG_USE_MIPS16:=0
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
index 02b8fa01e5c9207e634d13d414dba8b62d776d32..83aa40d4270e902a15ee15b0e66d5785205b592b 100644 (file)
@@ -8,23 +8,25 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sumo
-PKG_VERSION:=0.22.0
+PKG_VERSION:=0.23.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-src-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/sumo
-PKG_MD5SUM:=d239a3f94fdb905fdaf1648f2b71fd42
+PKG_MD5SUM:=0df95a449d44808b8d3677af086e1af1
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
 CONFIGURE_ARGS += \
-       --with-xerces-includes=$(STAGING_DIR)/usr/include/xercesc \
+       --with-xerces=$(STAGING_DIR)/usr \
        --disable-debug \
        --disable-dependency-tracking \
        --disable-silent-rules
index 2ae8df8c245629f042c1cd6c1652f43013372a58..0f0af4db49682da493ba7aeb980783d782b7fd72 100644 (file)
@@ -3,4 +3,4 @@
 
 SUMO_HOME=/usr/share/sumo sumo-bin $@
 
-exit 0
+exit $?
diff --git a/utils/sumo/patches/100-configure_fix.patch b/utils/sumo/patches/100-configure_fix.patch
new file mode 100644 (file)
index 0000000..6fff18c
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -13,11 +13,6 @@ AC_LANG([C++])
+ dnl the debug check has to be made before the program checks
+ dnl because it modifies CXXFLAGS
+-if test x$CXX = xclang++; then
+-    CXXFLAGS="-msse2 $CXXFLAGS"
+-else
+-    CXXFLAGS="-msse2 -mfpmath=sse $CXXFLAGS"
+-fi
+ AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],[enable sumo debugging code [default=no].])])
+ if test x$enable_debug = xyes; then
+     AC_DEFINE(_DEBUG, 1, [Define to 1 in order to enable sumo debugging code.])
diff --git a/utils/tmux/patches/200-usr-local.patch b/utils/tmux/patches/200-usr-local.patch
new file mode 100644 (file)
index 0000000..07336de
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -101,9 +101,9 @@ bin_PROGRAMS = tmux$(EXEEXT)
+ @IS_DEBUG_TRUE@@IS_GCC_TRUE@  -Wdeclaration-after-statement
+ @IS_DEBUG_TRUE@@IS_GCC_TRUE@am__append_4 = -DDEBUG
+ @IS_DEBUG_FALSE@@IS_GCC_TRUE@am__append_5 = -O2
+-@IS_GCC4_TRUE@@IS_GCC_TRUE@am__append_6 = -iquote. -I/usr/local/include
++@IS_GCC4_TRUE@@IS_GCC_TRUE@am__append_6 = -iquote.
+ @IS_DEBUG_TRUE@@IS_GCC4_TRUE@@IS_GCC_TRUE@am__append_7 = -Wno-pointer-sign
+-@IS_GCC4_FALSE@@IS_GCC_TRUE@am__append_8 = -I. -I- -I/usr/local/include
++@IS_GCC4_FALSE@@IS_GCC_TRUE@am__append_8 = -I. -I-
+ # Set flags for Solaris.
+ @IS_GCC_TRUE@@IS_SUNOS_TRUE@am__append_9 = -D_XPG6 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS
index dc13abcfec7af465ea63a459ea5fc911fe2f427e..bcabfc56716986ff1f0f6387dbd33ecdd77bba5f 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unrar
-PKG_VERSION:=5.2.6
+PKG_VERSION:=5.2.7
 PKG_RELEASE:=1
 
 PKG_SOURCE:=unrarsrc-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.rarlab.com/rar
-PKG_MD5SUM:=86736fdc652dcbedddac6ac1dff3115a
+PKG_MD5SUM:=0c145e1ac47d428553123462c0740279
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=UnRAR
index 65ab016672157b115c6d9e2ca609aad45a93d03f..239c84b72ed1305bac28bb8a31a581142d62952b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=usbmuxd
 PKG_VERSION:=1.1.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_SOURCE_PROTO:=git
 
 PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
@@ -31,7 +31,7 @@ define Package/usbmuxd
   CATEGORY:=Utilities
   TITLE:=USB multiplexing daemon
   URL:=http://www.libimobiledevice.org/
-  DEPENDS:=+librt +libusb-1.0 +libusbmuxd +libcrypto +libopenssl +libimobiledevice
+  DEPENDS:=+librt +libusb-1.0 +libusbmuxd +libopenssl +libimobiledevice
 endef
 
 define Package/usbmuxd/description
diff --git a/utils/xz/Makefile b/utils/xz/Makefile
new file mode 100644 (file)
index 0000000..e08ef95
--- /dev/null
@@ -0,0 +1,112 @@
+#
+# Copyright (C) 2013-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=xz
+PKG_VERSION:=5.2.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://tukaani.org/xz
+PKG_MD5SUM:=d484910b26fec5aff99ee66350589e29
+
+PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/xz/Default
+  SUBMENU:=Compression
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=http://tukaani.org/xz
+endef
+
+define Package/xz-utils
+$(call Package/xz/Default)
+  TITLE:=XZ Utils (meta)
+  MENU:=1
+endef
+
+define Package/liblzma
+$(call Package/xz/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libpthread
+  TITLE:=liblzma library from XZ Utils
+endef
+
+# $(1): package name & command in /usr/bin/
+# $(2): package dependencies
+# $(3): symbolic links to $(1) in /usr/bin/
+define BuildSubPackage
+
+  define Package/$(1)
+  $(call Package/xz/Default)
+    DEPENDS:=xz-utils $(2)
+    TITLE:=$(1) utility from XZ Utils
+  endef
+
+  define Package/$(1)/description
+   Contains: $(1) $(3)
+  endef
+
+  define Package/$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/bin
+       $(CP) $(foreach f,$(1) $(3),$(PKG_INSTALL_DIR)/usr/bin/$(f)) $$(1)/usr/bin/
+  endef
+
+  $$(eval $$(call BuildPackage,$(1)))
+endef
+
+
+CONFIGURE_ARGS += \
+       --enable-small \
+       --enable-assume-ram=4 \
+       --disable-assembler \
+       --disable-werror \
+
+# API uses "restrict" keyword introduced in C99 standard
+TARGET_CFLAGS += \
+       -std=c99 \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/liblzma/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
+endef
+
+
+$(eval $(call BuildPackage,xz-utils))
+$(eval $(call BuildPackage,liblzma))
+$(eval $(call BuildSubPackage,lzmadec, +liblzma,))
+$(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
+$(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
+$(eval $(call BuildSubPackage,xzdec, +liblzma,))
+$(eval $(call BuildSubPackage,xzdiff, +bash +xz, lzcmp lzdiff xzcmp))
+$(eval $(call BuildSubPackage,xzgrep, +bash +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
+$(eval $(call BuildSubPackage,xzless, +bash +xz, lzless))
+$(eval $(call BuildSubPackage,xzmore, +bash +xz, lzmore))
index 6f1b6ef8f5c63aec8ac77f2f7638195abf78b236..fdbdf28142f655395a660558f914aa2084b6bea1 100644 (file)
@@ -9,8 +9,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zoneinfo
-PKG_VERSION:=2015a
-PKG_VERSION_CODE:=2015a
+PKG_VERSION:=2015d
+PKG_VERSION_CODE:=2015d
 PKG_RELEASE:=1
 
 #As i couldn't find real license used "Public Domain"
@@ -20,14 +20,14 @@ PKG_LICENSE:=Public Domain
 PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz
 PKG_SOURCE_CODE:=tzcode$(PKG_VERSION_CODE).tar.gz
 PKG_SOURCE_URL:=http://www.iana.org/time-zones/repository/releases
-PKG_MD5SUM:=4ed11c894a74a5ea64201b1c6dbb8831
+PKG_MD5SUM:=b595bdc4474b8fc1a15cffc67c66025b
 
 include $(INCLUDE_DIR)/package.mk
 
 define Download/tzcode
    FILE=$(PKG_SOURCE_CODE)
    URL=$(PKG_SOURCE_URL)
-   MD5SUM:=8f375ede46ae137fbac047ac431bda37
+   MD5SUM:=4008a3abc025a398697b2587c48258b9
 endef
 
 $(eval $(call Download,tzcode))