diff options
author | Richard Narron <richard@aaazen.com> | 2019-12-29 11:20:28 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2019-12-29 11:20:28 +0700 |
commit | c5864ccde0498a33582aa7fe20619b9176bb9cad (patch) | |
tree | e5256fdb72c7b6f1c46e4cc2e9d935e42d0f9126 | |
parent | bd1a7fd096cf42895510ebcd2b0c9411bd5e98cf (diff) | |
download | slackbuilds-c5864ccde0498a33582aa7fe20619b9176bb9cad.tar.gz |
network/linksys-tftp: Added (tftp client).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | network/linksys-tftp/README | 19 | ||||
-rw-r--r-- | network/linksys-tftp/linksys-tftp-1.2.1-r1-Makefile.patch | 28 | ||||
-rw-r--r-- | network/linksys-tftp/linksys-tftp-1.2.1-r1-header.patch | 52 | ||||
-rw-r--r-- | network/linksys-tftp/linksys-tftp.SlackBuild | 78 | ||||
-rw-r--r-- | network/linksys-tftp/linksys-tftp.info | 10 | ||||
-rw-r--r-- | network/linksys-tftp/slack-desc | 19 |
6 files changed, 206 insertions, 0 deletions
diff --git a/network/linksys-tftp/README b/network/linksys-tftp/README new file mode 100644 index 0000000000..d2132b7f01 --- /dev/null +++ b/network/linksys-tftp/README @@ -0,0 +1,19 @@ +Linksys-tftp is a BSD tftp client for the non-standard tftp +authentication process used by some Linksys routers. + +These routers include the BEFW11, WRT54G and WRT54GL + +They all need a password for the tftp firmware file transfer to work. + +For example to upgrade a Linksys WRT54G router at 192.168.1.1 with +tomato firmware, WRT54G_WRT54GL.bin, where the password is admin + +$linksys-wrt 192.168.1.1 +linksys-tftp>verbose +linksys-tftp>binary +linksys-tftp>blocksize 512 +linksys-tftp>rexmt 1 +linksys-tftp>timeout 30 +linksys-tftp>trace +linksys-tftp>put WRT54G_WRT54GL.bin admin +linksys-tftp>quit diff --git a/network/linksys-tftp/linksys-tftp-1.2.1-r1-Makefile.patch b/network/linksys-tftp/linksys-tftp-1.2.1-r1-Makefile.patch new file mode 100644 index 0000000000..b374e808ec --- /dev/null +++ b/network/linksys-tftp/linksys-tftp-1.2.1-r1-Makefile.patch @@ -0,0 +1,28 @@ +Fix LDFLAGS (bug http://bugs.gentoo.org/336956 ) and +CFLAGS (bug http://bugs.gentoo.org/240894 ) by +Michael Weber <xmw@gentoo.org> + +--- linksys-tftp-1.2.1/Makefile ++++ linksys-tftp-1.2.1/Makefile +@@ -19,18 +19,18 @@ + # We override /usr/include/arpa/tftp.h with our own because + # we want tu_block to be unsigned short, not short as on most platforms + # +-CFLAGS= -I. -O2 -Dsin=sin_x ++CFLAGS += -I. -Dsin=sin_x + #DEBUG + # CFLAGS= -I. -Wall -ggdb -Dsin=sin_x + SRCS= main.c tftp.c tftpsubs.c + OBJS= main.o tftp.o tftpsubs.o + DOBJS= tftpsubs.o +-CC= gcc ++CC?= gcc + + all: linksys-tftp + + linksys-tftp: ${OBJS} +- ${CC} -o $@ ${CFLAGS} ${OBJS} ++ ${CC} -o $@ ${CFLAGS} ${OBJS} ${LDFLAGS} + + clean: + rm -f ${OBJS} ${DOBJS} *core linksys-tftp diff --git a/network/linksys-tftp/linksys-tftp-1.2.1-r1-header.patch b/network/linksys-tftp/linksys-tftp-1.2.1-r1-header.patch new file mode 100644 index 0000000000..9944f3c059 --- /dev/null +++ b/network/linksys-tftp/linksys-tftp-1.2.1-r1-header.patch @@ -0,0 +1,52 @@ +--- linksys-tftp-1.2.1/main.c ++++ linksys-tftp-1.2.1/main.c +@@ -40,6 +40,10 @@ + #include <setjmp.h> + #include <ctype.h> + #include <netdb.h> ++#include <stdlib.h> ++#include <string.h> ++#include <unistd.h> ++#include <sys/sendfile.h> + + #define TIMEOUT 5 /* secs between rexmt's */ + +@@ -110,7 +112,7 @@ + char *index(); + char *rindex(); + +-main(argc, argv) ++int main(argc, argv) + char *argv[]; + { + struct sockaddr_in sin; +--- a/tftp.c ++++ b/tftp.c +@@ -36,8 +36,8 @@ + #include <stdio.h> + #include <errno.h> + #include <setjmp.h> +- +-extern int errno; ++#include <string.h> ++#include <unistd.h> + + extern struct sockaddr_in sin; /* filled in by main */ + extern int f; /* the opened socket */ +@@ -69,16 +69,6 @@ void timer(int sig) + longjmp(timeoutbuf, 1); + } + +-strnlen(s, n) +- char *s; +- int n; +-{ +- int i = 0; +- +- while (n-- > 0 && *s++) i++; +- return(i); +-} +- + /* + * Parse an OACK package and set blocksize accordingly + */ diff --git a/network/linksys-tftp/linksys-tftp.SlackBuild b/network/linksys-tftp/linksys-tftp.SlackBuild new file mode 100644 index 0000000000..2803fcdc1a --- /dev/null +++ b/network/linksys-tftp/linksys-tftp.SlackBuild @@ -0,0 +1,78 @@ +#!/bin/sh + +# Slackware build script for linksys-tftp + +# Copyright 2019 Richard Narron, California +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 AUTHOR 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. + +PRGNAM=linksys-tftp +VERSION=${VERSION:-1.2.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# patches thanks to Gentoo +(echo " " && cat $CWD/linksys-tftp-1.2.1-r1-Makefile.patch) | patch -b -p1 +(echo " " && cat $CWD/linksys-tftp-1.2.1-r1-header.patch) | patch -b -p1 + +make + +install -D -m755 -t $PKG/usr/bin/ linksys-tftp + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $CWD/README $PKG/usr/doc/$PRGNAM-$VERSION/README.slackware +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/linksys-tftp/linksys-tftp.info b/network/linksys-tftp/linksys-tftp.info new file mode 100644 index 0000000000..1e2c9be8ff --- /dev/null +++ b/network/linksys-tftp/linksys-tftp.info @@ -0,0 +1,10 @@ +PRGNAM="linksys-tftp" +VERSION="1.2.1" +HOMEPAGE="https://www.redsand.net/solutions/linksys_tftp.html" +DOWNLOAD="https://www.redsand.net/solutions/linksys-tftp-1.2.1.tar.gz" +MD5SUM="f536f778dcbcb4a65838042ca0a2a454" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Richard Narron" +EMAIL="richard@aaazen.com" diff --git a/network/linksys-tftp/slack-desc b/network/linksys-tftp/slack-desc new file mode 100644 index 0000000000..52b24ab204 --- /dev/null +++ b/network/linksys-tftp/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +linksys-tftp: linksys-tftp (tftp client for Linksys routers requiring a password) +linksys-tftp: +linksys-tftp: This is a BSD tftp client for Linksys routers that need a password +linksys-tftp: for tftp firmware installation such as the BEFW11, WRT54G and WRT54GL +linksys-tftp: +linksys-tftp: +linksys-tftp: +linksys-tftp: +linksys-tftp: +linksys-tftp: +linksys-tftp: |