summaryrefslogtreecommitdiffstats
path: root/unmaintained
diff options
context:
space:
mode:
Diffstat (limited to 'unmaintained')
-rw-r--r--unmaintained/wanpipe-grsec/APKBUILD69
-rw-r--r--unmaintained/wanpipe-grsec/constify.patch134
2 files changed, 203 insertions, 0 deletions
diff --git a/unmaintained/wanpipe-grsec/APKBUILD b/unmaintained/wanpipe-grsec/APKBUILD
new file mode 100644
index 000000000..64ba35b77
--- /dev/null
+++ b/unmaintained/wanpipe-grsec/APKBUILD
@@ -0,0 +1,69 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_flavor=${FLAVOR:-grsec}
+_realname=wanpipe
+_name=$_realname-$_flavor
+
+_kpkg=linux-$_flavor
+_kver=3.9.5
+_kpkgrel=1
+
+# source the kernel version
+if [ -f ../../main/linux-$_flavor/APKBUILD ]; then
+ . ../../main/linux-$_flavor/APKBUILD
+ pkgname=$_name
+ [ "$_kver" != "$pkgver" ] && die "$_name: Please update _kver to $pkgver"
+ [ "$_kpkgrel" != "$pkgrel" ] && die "$_name: Please update _kpkgrel to $pkgrel"
+fi
+
+_kernelver=$_kver-r$_kpkgrel
+_abi_release=${_kver}-${_kpkgrel}-${_flavor}
+
+pkgname=$_name
+pkgver=$_kver
+_realver=7.0.0
+_mypkgrel=0
+pkgrel=$(($_kpkgrel + $_mypkgrel))
+pkgdesc="Sangoma Wanpipe drivers for $_flavor kernel"
+url="http://wiki.sangoma.com/wanpipe-linux-drivers"
+arch=""
+license="GPL"
+depends="linux-${_flavor}=${_kernelver}"
+makedepends="linux-${_flavor}-dev=${_kernelver} bison libtool flex bash
+ dahdi-linux-dev autoconf"
+install=
+install_if="linux-$_flavor=$_kernelver $_realname"
+subpackages=
+source="ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-$_realver.tgz"
+
+# override kernel's prepare()
+prepare() {
+ cd "$srcdir/$_realname-$_realver"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$srcdir/$_realname-$_realver"
+ export GCC_SPECS=/usr/share/gcc/hardenednopie.specs
+
+ make CC="${CC:-gcc}" \
+ KVER=$_abi_release \
+ DAHDI_DIR=/usr/src/dahdi-headers-$_abi_release \
+ all_kmod_dahdi || return 1
+}
+
+package() {
+ cd "$srcdir/$_realname-$_realver"
+ make CC="${CC:-gcc}" \
+ KVER=$_abi_release \
+ DAHDI_DIR=/usr/src/dahdi-headers-$_abi_release \
+ DESTDIR="$pkgdir" \
+ install_kmod || return 1
+}
+
+md5sums="0602bf8a632312019e092f7de23caa9a wanpipe-7.0.0.tgz"
+sha256sums="39e6b820168af511b3714d80aeede9bb62002ad6e03653ecf47904e4cc247118 wanpipe-7.0.0.tgz"
+sha512sums="70996740de89f7369d16f5a55e825e36e29b227bef8f1a21962f7b8fdd7f5922ff125e3d0e9f4b6472acdf68567a8b469c85693b3a68f3b788ce15a68fb2a875 wanpipe-7.0.0.tgz"
diff --git a/unmaintained/wanpipe-grsec/constify.patch b/unmaintained/wanpipe-grsec/constify.patch
new file mode 100644
index 000000000..dfd78eca7
--- /dev/null
+++ b/unmaintained/wanpipe-grsec/constify.patch
@@ -0,0 +1,134 @@
+diff --git a/patches/kdrivers/include/if_wanpipe_common.h b/patches/kdrivers/include/if_wanpipe_common.h
+index e7f4fca..1bf0c1b 100644
+--- a/patches/kdrivers/include/if_wanpipe_common.h
++++ b/patches/kdrivers/include/if_wanpipe_common.h
+@@ -49,7 +49,7 @@ typedef struct {
+ #if defined (__LINUX__)
+ int (*change_mtu)(netdevice_t *dev, int new_mtu);
+ #endif
+-} wanpipe_common_iface_t;
++} __no_const wanpipe_common_iface_t;
+
+ typedef struct wanpipe_common {
+ #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+diff --git a/patches/kdrivers/include/sdla_front_end.h b/patches/kdrivers/include/sdla_front_end.h
+index 11d7f3c..61bb8a2 100644
+--- a/patches/kdrivers/include/sdla_front_end.h
++++ b/patches/kdrivers/include/sdla_front_end.h
+@@ -630,7 +630,7 @@ typedef struct {
+ /* Enable/Disable Clock recovery from the line */
+ int (*clock_ctrl)(sdla_fe_t*, u_int8_t /* WANOPT_NO/WANOPT_YES */);
+ u_int32_t (*read_tx_alarm)(sdla_fe_t *fe, int);
+-} sdla_fe_iface_t;
++} __no_const sdla_fe_iface_t;
+
+ /*
+ ** Sangoma Front-End interface structure (new version)
+diff --git a/patches/kdrivers/include/sdladrv.h b/patches/kdrivers/include/sdladrv.h
+index 4398f4c..5e34811 100644
+--- a/patches/kdrivers/include/sdladrv.h
++++ b/patches/kdrivers/include/sdladrv.h
+@@ -743,7 +743,7 @@ typedef struct sdlahw_iface
+ int (*usb_flush_err_stats)(void *phw);
+ void (*reset_fe)(void*);
+
+-} sdlahw_iface_t;
++} __no_const sdlahw_iface_t;
+
+ typedef struct sdla_hw_type_cnt
+ {
+@@ -772,7 +772,7 @@ typedef struct sdla_hw_type_cnt
+ typedef struct sdladrv_callback_ {
+ int (*add_device)(void);
+ int (*delete_device)(char*);
+-} sdladrv_callback_t;
++} __no_const sdladrv_callback_t;
+
+ #if defined(SDLADRV_HW_IFACE)
+ typedef struct sdladrv_hw_probe_iface {
+diff --git a/patches/kdrivers/include/wanpipe_cdev_iface.h b/patches/kdrivers/include/wanpipe_cdev_iface.h
+index bccf2e2..486572e 100644
+--- a/patches/kdrivers/include/wanpipe_cdev_iface.h
++++ b/patches/kdrivers/include/wanpipe_cdev_iface.h
+@@ -32,7 +32,7 @@ typedef struct wanpipe_cdev_ops
+ /* handle transmission time out */
+ int (*tx_timeout)(void* dev_ptr);
+
+-}wanpipe_cdev_ops_t;
++} __no_const wanpipe_cdev_ops_t;
+
+
+
+diff --git a/patches/kdrivers/include/wanpipe_defines.h b/patches/kdrivers/include/wanpipe_defines.h
+index 9c62b8d..5269262 100644
+--- a/patches/kdrivers/include/wanpipe_defines.h
++++ b/patches/kdrivers/include/wanpipe_defines.h
+@@ -895,7 +895,7 @@ typedef struct wan_rtp_pkt {
+
+ #if defined(HAVE_NET_DEVICE_OPS) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
+
+-#define WAN_DECLARE_NETDEV_OPS(_ops_name) static struct net_device_ops _ops_name = {0};
++#define WAN_DECLARE_NETDEV_OPS(_ops_name) static net_device_ops_no_const _ops_name = {0};
+
+ #define WAN_NETDEV_OPS_BIND(dev,_ops_name) dev->netdev_ops = &_ops_name
+
+diff --git a/patches/kdrivers/include/wanpipe_wanrouter.h b/patches/kdrivers/include/wanpipe_wanrouter.h
+index 7b2a919..4a05fa5 100644
+--- a/patches/kdrivers/include/wanpipe_wanrouter.h
++++ b/patches/kdrivers/include/wanpipe_wanrouter.h
+@@ -362,7 +362,7 @@ typedef struct wan_device
+ void (*ringdetect) (void* card_id, wan_event_t*);
+ void (*linkstatus) (void* card_id, wan_event_t*);
+ void (*polarityreverse) (void* card_id, wan_event_t*);
+- } event_callback;
++ } __no_const event_callback;
+
+ unsigned char ignore_front_end_status;
+ unsigned char line_idle;
+diff --git a/patches/kdrivers/src/net/sdladrv.c b/patches/kdrivers/src/net/sdladrv.c
+index 22d4b4f..d5b9fbb 100644
+--- a/patches/kdrivers/src/net/sdladrv.c
++++ b/patches/kdrivers/src/net/sdladrv.c
+@@ -343,12 +343,12 @@ static unsigned sdla_test_memregion (sdlahw_t* hw, unsigned len);
+ static unsigned short sdla_checksum (unsigned char* buf, unsigned len);
+ static int sdla_init_pci_slot(sdlahw_t *);
+
+-static sdlahw_card_t* sdla_card_register(u8 hw_type, int bus_no, int slot_no, int ioport, char*);
++static sdlahw_card_t* sdla_card_register(u8 hw_type, int bus_no, int slot_no, int ioport, const char*);
+ static int sdla_card_unregister (sdlahw_card_t*);
+-static sdlahw_card_t* sdla_card_search(u8 hw_type, int bus_no, int slot_no, int ioport, char*);
++static sdlahw_card_t* sdla_card_search(u8 hw_type, int bus_no, int slot_no, int ioport, const char*);
+ static int sdla_card_info(sdlahw_card_t*);
+
+-sdlahw_cpu_t* sdla_hwcpu_search(u8, int, int, int, int, char*);
++sdlahw_cpu_t* sdla_hwcpu_search(u8, int, int, int, int, const char*);
+ static sdlahw_cpu_t* sdla_hwcpu_register(sdlahw_card_t*, int, int, void*);
+ static int sdla_hwcpu_unregister(sdlahw_cpu_t*);
+ static int sdla_hwcpu_info(sdlahw_cpu_t*);
+@@ -4339,7 +4339,7 @@ static int sdla_card_info(sdlahw_card_t *hwcard)
+ }
+
+ static sdlahw_card_t*
+-sdla_card_register(u8 hw_type, int bus_no, int slot_no, int ioport, char *bus_id)
++sdla_card_register(u8 hw_type, int bus_no, int slot_no, int ioport, const char *bus_id)
+ {
+ sdlahw_card_t *new_hwcard, *last_hwcard;
+
+@@ -4408,7 +4408,7 @@ sdla_card_unregister(sdlahw_card_t* hwcard)
+ }
+
+ static sdlahw_card_t*
+-sdla_card_search(u8 hw_type, int bus_no, int slot_no, int ioport, char *bus_id)
++sdla_card_search(u8 hw_type, int bus_no, int slot_no, int ioport, const char *bus_id)
+ {
+ sdlahw_card_t* tmp;
+
+@@ -4547,7 +4547,7 @@ static int sdla_hwcpu_unregister(sdlahw_cpu_t *hwcpu)
+ }
+
+ sdlahw_cpu_t*
+-sdla_hwcpu_search(u8 hw_type, int bus_no, int slot_no, int ioport, int cpu_no, char *bus_id)
++sdla_hwcpu_search(u8 hw_type, int bus_no, int slot_no, int ioport, int cpu_no, const char *bus_id)
+ {
+ sdlahw_cpu_t* tmp;
+