diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-04-10 11:29:25 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-04-10 11:29:25 +0000 |
commit | 609d7acd796c05a8458d898f11f3991d32d099ec (patch) | |
tree | 4478f1fde8386d87e442f67c0cfa6d3e2879ff67 /main | |
parent | 6d6d11d6dadd52c8f4337fa3adaefff4f91b7183 (diff) | |
download | aports-609d7acd796c05a8458d898f11f3991d32d099ec.tar.bz2 aports-609d7acd796c05a8458d898f11f3991d32d099ec.tar.xz |
main/devicemaster-linux*: move from testing
Diffstat (limited to 'main')
-rw-r--r-- | main/devicemaster-linux-grsec/APKBUILD | 71 | ||||
-rw-r--r-- | main/devicemaster-linux-grsec/nslink.patch | 81 | ||||
-rw-r--r-- | main/devicemaster-linux/APKBUILD | 60 | ||||
-rw-r--r-- | main/devicemaster-linux/makefile.patch | 19 | ||||
-rw-r--r-- | main/devicemaster-linux/nslink.initd | 16 |
5 files changed, 247 insertions, 0 deletions
diff --git a/main/devicemaster-linux-grsec/APKBUILD b/main/devicemaster-linux-grsec/APKBUILD new file mode 100644 index 0000000000..c8aeb43e43 --- /dev/null +++ b/main/devicemaster-linux-grsec/APKBUILD @@ -0,0 +1,71 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> + +_flavor=grsec +_kpkg=linux-$_flavor +_kver=3.14.37 +_kpkgrel=3 +_mypkgrel=0 + +_kpkgver="$_kver-r$_kpkgrel" +_abi_release=${_kver}-${_kpkgrel}-${_flavor} +_realname=devicemaster-linux + +pkgname=${_realname}-${_flavor} +pkgver=$_kver +# when changing _realver we *must* bump _mypkgrel +_realver=7.06 +pkgrel=$(( $_kpkgrel + $_mypkgrel )) +pkgdesc="NS-Link Device Drivers $_realver for linux-$_flavor" +url="http://www.comtrol.com/resources/product-resources-white-papers/ns-link-device-drivers" +arch="all" +license="GPL" +depends="linux-${_flavor}=${_kpkgver}" +makedepends="linux-${_flavor}-dev=${_kpkgver} linux-headers" +install= +install_if="$_kpkg=$_kpkgver $_realname" +subpackages="" +source="ftp://ftp.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-$_realver.tar.gz + nslink.patch + " + +prepare() { + # verify the kernel version + (if [ -f ../../main/linux-${_flavor}/APKBUILD ]; then + _name=$pkgname + . ../../main/linux-${_flavor}/APKBUILD + pkgname=$_name + [ "$_kver" != "$pkgver" ] \ + && die "please update _kver to $pkgver" + [ "$_kpkgrel" != "$pkgrel" ] \ + && die "please update _kpkgrel to $pkgrel" + fi) || return 1 + + cd "$srcdir/$_realname-$_realver" + for i in $source; do + case $i in + *.patch|*.diff) + msg "Applying $i" + patch -p1 -i "$srcdir"/$i || return 1 + ;; + esac + done +} + +build() { + cd "$srcdir/$_realname-$_realver" + make -C /lib/modules/$_abi_release/build SUBDIRS="$PWD" modules \ + V=1 || return 1 +} + +package() { + cd "$srcdir/$_realname-$_realver" + mkdir -p "$pkgdir/lib/modules/${_abi_release}/misc/" + cp *.ko "$pkgdir/lib/modules/${_abi_release}/misc/" || return 1 +} + +md5sums="deded30023c8135c9beb06696e8c578f devicemaster-linux-7.06.tar.gz +4a7ab12e64cfb0dc2f5270a95534ca18 nslink.patch" +sha256sums="6b11295952d1d74a6102a295a6ed5651ec040a0d8c30838cd23a1f3f7c95a4e7 devicemaster-linux-7.06.tar.gz +6d635a133f795a90ff776b1f5026d4cae734570a46042b3e23c3f6bd07d2c11c nslink.patch" +sha512sums="496144ee40464c96442ce655424db886cb5b4df1701e30cc8d059fc918e8916cb6c3b0b57cead2d0e9d50e4618ee13efa5f3630765545ea45e29f8080101800b devicemaster-linux-7.06.tar.gz +acb1e19bb56f47ba95bebf386c66a5639e11ed5c3d7e8591060fcc739d5383cec0cab08a1accaeef930adae495f3a63526ed1491977567caa257e4a9bd219045 nslink.patch" diff --git a/main/devicemaster-linux-grsec/nslink.patch b/main/devicemaster-linux-grsec/nslink.patch new file mode 100644 index 0000000000..0304bf6c8b --- /dev/null +++ b/main/devicemaster-linux-grsec/nslink.patch @@ -0,0 +1,81 @@ +diff --git a/nslink.c b/nslink.c +index 16a4212..e64907d 100755 +--- a/nslink.c ++++ b/nslink.c +@@ -113,6 +113,7 @@ + #include <linux/slab.h> + #include <linux/time.h> + #include <linux/delay.h> ++#include <linux/utsname.h> + #if LINUX_VERSION_CODE >= VERSION_CODE(2,6,36) && LINUX_VERSION_CODE < VERSION_CODE(2,6,39) + #include <linux/smp_lock.h> + #endif +@@ -2864,7 +2865,7 @@ static int nrp_open(struct tty_struct *tty, struct file *filp) + + info = nrp_table[line]; + +- DebugOpen("ttySI%d (count=%d) enter\n", line, info->port.count); ++ DebugOpen("ttySI%d (count=%d) enter\n", line, info->port.count.counter); + + if (!info->si) { + DebugOpenErr("ttySI%d info->si==NULL: return -ENODEV\n", line); +@@ -2880,9 +2881,9 @@ static int nrp_open(struct tty_struct *tty, struct file *filp) + ret = tty_port_open(&info->port, tty, filp); + + if (ret && ret != -ERESTARTSYS) +- DebugOpenErr("ttySI%d (count=%d) return %d\n", line, info->port.count,ret); ++ DebugOpenErr("ttySI%d (count=%d) return %d\n", line, info->port.count.counter,ret); + else +- DebugOpen("ttySI%d (count=%d) return %d\n", line, info->port.count,ret); ++ DebugOpen("ttySI%d (count=%d) return %d\n", line, info->port.count.counter,ret); + return ret; + } + +@@ -2925,9 +2926,9 @@ static void nrp_port_shutdown(struct tty_port *port) + static void nrp_close(struct tty_struct *tty, struct file *filp) + { + struct nr_port *info = (struct nr_port *) tty->driver_data; +- DebugOpen("ttySI%d (count=%d) enter\n", info->line, info->port.count); ++ DebugOpen("ttySI%d (count=%d) enter\n", info->line, info->port.count.counter); + tty_port_close(&info->port, tty, filp); +- DebugOpen("ttySI%d (count=%d) return\n", info->line, info->port.count); ++ DebugOpen("ttySI%d (count=%d) return\n", info->line, info->port.count.counter); + } + + static void nrp_set_termios(struct tty_struct *tty, struct ktermios *old_termios) +@@ -4786,7 +4787,7 @@ static int free_si_box(int boxid) + info = nrp_table[i + si->base_port]; + if (!info) + continue; +- if (info->port.count) { ++ if (info->port.count.counter) { + DebugOpenErr("Attempt to free_si_box() with port open\n"); + return -EBUSY; + } +@@ -5008,7 +5009,7 @@ static int port_proc_show(struct seq_file *m, void *v) + for (i=0; i<NumElements(nrp_table); ++i) { + struct nr_port *info = nrp_table[i]; + if (info) { +- seq_printf(m,"%3d %4d %02x %6d ", i, info->port.count, info->rsmode, info->baud_rate); ++ seq_printf(m,"%3d %4d %02x %6d ", i, info->port.count.counter, info->rsmode, info->baud_rate); + + // Ctrl ... + seq_printf(m, (info->control_settings & SC_DATABITS_7) ? "7" : "8"); +@@ -5192,7 +5193,7 @@ static int status_proc_show(struct seq_file *m, void *v) + struct si_state *si; + + seq_printf(m, "Comtrol NS-Link -- version %s (%s)\n",SI_VERSION,SI_DATE); +- seq_printf(m, "Built %s %s\n\n",__DATE__,__TIME__); ++ seq_printf(m, "Build %s\n\n",utsname()->version); + seq_printf(m, "Hub State Address Ports\n"); + seq_printf(m, "--- ------------ ------------------ -----\n"); + +@@ -5381,7 +5382,7 @@ int nrp_init(void) + static struct proc_dir_entry *procdir; + + printk(KERN_INFO "nslink: NS-Link driver, version %s %s\n",SI_VERSION, SI_DATE); +- printk(KERN_INFO "nslink: Built %s %s\n", __DATE__, __TIME__); ++ printk(KERN_INFO "nslink: Build %s\n", utsname()->version); + + // Initialize the array of pointers to our own internal state structures. + memset(nrp_table, 0, sizeof(nrp_table)); diff --git a/main/devicemaster-linux/APKBUILD b/main/devicemaster-linux/APKBUILD new file mode 100644 index 0000000000..d4a1ffc892 --- /dev/null +++ b/main/devicemaster-linux/APKBUILD @@ -0,0 +1,60 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=devicemaster-linux +pkgver=7.06 +pkgrel=2 +pkgdesc="Userspace tools for NS-Link Device Drivers" +url="http://www.comtrol.com/resources/product-resources-white-papers/ns-link-device-drivers" +arch="all" +license="GPL" +depends="" +makedepends="linux-headers" +install= +subpackages="$pkgname-doc" +source="ftp://ftp.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-$pkgver.tar.gz + makefile.patch + nslink.initd + " +_builddir="$srcdir"/devicemaster-linux-$pkgver +prepare() { + cd "$_builddir" + for i in $source; do + case $i in + *.patch|*.diff) + msg "Applying $i" + patch -p1 -i "$srcdir"/$i || return 1 + ;; + esac + done +} + +build() { + cd "$_builddir" + make nslinkd nslinkadmin nslinkrelease nslinktool || return 1 +} + +package() { + cd "$_builddir" + install -d \ + "$pkgdir"/etc/init.d \ + "$pkgdir"/sbin \ + "$pkgdir"/usr/share/man/man5 \ + "$pkgdir"/usr/share/man/man8 \ + || reutrn 1 + install -m700 nslinkadmin nslinktool nslinkrelease nslinkd \ + "$pkgdir"/sbin/ || return 1 + install nslink.conf "$pkgdir"/etc/ || return 1 + install -m755 "$srcdir"/nslink.initd "$pkgdir"/etc/init.d/nslink + + install -m644 *.8 "$pkgdir"/usr/share/man/man8 || return 1 + install -m644 *.5 "$pkgdir"/usr/share/man/man5 || return 1 +} + +md5sums="deded30023c8135c9beb06696e8c578f devicemaster-linux-7.06.tar.gz +5be3c1860d3377f792a05cd15ae2c88e makefile.patch +64634a815c270604033c5ec072aed8be nslink.initd" +sha256sums="6b11295952d1d74a6102a295a6ed5651ec040a0d8c30838cd23a1f3f7c95a4e7 devicemaster-linux-7.06.tar.gz +36b5a4eab09929805e146445cb704e6be6ba8d15704846330c4dd39229a1b80b makefile.patch +8da3614cff29acb9691ef6f49f79c40f6356c75f03c21d98a60eba2a11a5fb21 nslink.initd" +sha512sums="496144ee40464c96442ce655424db886cb5b4df1701e30cc8d059fc918e8916cb6c3b0b57cead2d0e9d50e4618ee13efa5f3630765545ea45e29f8080101800b devicemaster-linux-7.06.tar.gz +aeafcaa2b15f1ebb4b5dc1eed87bd528cb5fa0be0d82177e9e70a85b7f74c5000af05d82f4927b25a8cbf2254e4fae7f89cb7d3b18bef2be45feb80c409c9ea4 makefile.patch +1634eeae3269a38003deb46564e222b86fec7635b8fb3a282bc48c2d34766d27a778a651577ce1c34bb33376c2b2624a5b5ca0b3d974293e0a84c2e7c5ad3c06 nslink.initd" diff --git a/main/devicemaster-linux/makefile.patch b/main/devicemaster-linux/makefile.patch new file mode 100644 index 0000000000..da50b9e85a --- /dev/null +++ b/main/devicemaster-linux/makefile.patch @@ -0,0 +1,19 @@ +--- ./Makefile.orig ++++ ./Makefile +@@ -52,13 +52,13 @@ + nslink.o: nslink.o nslink.c nslink_int.h nslink.h version.h + + nslinkd: nslinkd.c parse.c nslink.h nslinkd.h version.h +- gcc -Wall -o nslinkd nslinkd.c parse.c ++ $(CC) $(CFLAGS) -Wall $(LDFLAGS) -o nslinkd nslinkd.c parse.c + + nslinkadmin: nslinkadmin.c +- gcc -Wall -o nslinkadmin nslinkadmin.c ++ $(CC) $(CFLAGS) -Wall $(LDFLAGS) -o nslinkadmin nslinkadmin.c + + nslinkrelease: nslinkrelease.c +- $(CC) -Wall -o nslinkrelease nslinkrelease.c ++ $(CC) $(CFLAGS) -Wall $(LDFLAGS) -o nslinkrelease nslinkrelease.c + + modules: nslink.o mod_nslink.o + diff --git a/main/devicemaster-linux/nslink.initd b/main/devicemaster-linux/nslink.initd new file mode 100644 index 0000000000..5e4b869050 --- /dev/null +++ b/main/devicemaster-linux/nslink.initd @@ -0,0 +1,16 @@ +#!/sbin/runscript + +program=/sbin/nslink +pidfile=/var/run/nslink.pid + +start_pre() { + if ! [ -f /etc/nslink.conf ]; then + eerror "Configuration file /etc/nslink.conf not found" + return 1 + fi + + if ! grep -q -w nslink /proc/modules; then + modprobe nslink + fi +} + |