diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-02 13:52:54 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-02 13:55:35 +0000 |
commit | 04efd3f9aa7e80a15988f0ae9553200afad82e60 (patch) | |
tree | e33e1ed9a09cad60392c938cbe594afd3ef862f0 /testing | |
parent | 5ce8cb10047286c5736213cb2737c3436ad42422 (diff) | |
download | aports-04efd3f9aa7e80a15988f0ae9553200afad82e60.tar.bz2 aports-04efd3f9aa7e80a15988f0ae9553200afad82e60.tar.xz |
testing/wanpipe-grsec: new aport
Sangoma Wanpipe drivers for grsec kernel
http://wiki.sangoma.com/wanpipe-linux-drivers
ref #166
Diffstat (limited to 'testing')
-rw-r--r-- | testing/wanpipe-grsec/APKBUILD | 67 | ||||
-rw-r--r-- | testing/wanpipe-grsec/constify.patch | 134 |
2 files changed, 201 insertions, 0 deletions
diff --git a/testing/wanpipe-grsec/APKBUILD b/testing/wanpipe-grsec/APKBUILD new file mode 100644 index 0000000000..cb5ed10e2f --- /dev/null +++ b/testing/wanpipe-grsec/APKBUILD @@ -0,0 +1,67 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +_flavor=${FLAVOR:-grsec} +_realname=wanpipe +_name=$_realname-$_flavor + +_kver=3.2.7 +_kpkgrel=1 + +# source the kernel version +if [ -f ../../main/linux-$_flavor/APKBUILD ]; then + . ../../main/linux-$_flavor/APKBUILD + [ "$_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-${_flavor} + +pkgname=$_name +pkgver=$_kver +_realver=3.5.25 +_mypkgrel=0 +pkgrel=$(($_kpkgrel + $_mypkgrel)) +pkgdesc="Sangoma Wanpipe drivers for $_flavor kernel" +url="http://wiki.sangoma.com/wanpipe-linux-drivers" +arch="all" +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 + constify.patch" + +# 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="96700bece0d358bb12af9491d2730304 wanpipe-3.5.25.tgz +c05de38644472046f63985e03228205d constify.patch" diff --git a/testing/wanpipe-grsec/constify.patch b/testing/wanpipe-grsec/constify.patch new file mode 100644 index 0000000000..dfd78eca7d --- /dev/null +++ b/testing/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; + |