summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2015-07-06 20:12:21 -0400
committerChris Severance2015-07-06 20:12:21 -0400
commit46aff6896e80489c9e6e414f9a572d4509ff8a12 (patch)
tree9986d221e9f5754aafce4be6ef23b08aac33e8a2
downloadaur-46aff6896e80489c9e6e414f9a572d4509ff8a12.tar.gz
Initial import
-rw-r--r--.SRCINFO33
-rw-r--r--PKGBUILD402
-rwxr-xr-xautorebuild-dgrp.sh72
-rw-r--r--dgrp-install.sh49
-rwxr-xr-xdrpadmin333
-rw-r--r--drpadmin.1143
6 files changed, 1032 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9e40b42693f1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,33 @@
+pkgbase = dgrp
+ pkgdesc = tty driver for Digi RealPort Connect EtherLite Flex One CM PortServer IBM RAN
+ pkgver = 1.9.35
+ pkgrel = 1
+ url = http://www.digi.com/
+ install = dgrp-install.sh
+ arch = i686
+ arch = x86_64
+ license = GPL
+ license = APACHE
+ license = custom:DigiInternational
+ makedepends = linux-headers
+ makedepends = openssl
+ makedepends = sudo
+ depends = linux=4.0.7
+ depends = openssl
+ optdepends = tcl: digi config manager in X
+ optdepends = tk: digi config manager in X
+ conflicts = linux>4.0.7
+ conflicts = linux<4.0.7
+ options = !docs
+ options = !emptydirs
+ source = dgrp-1.9.35-81000137_W.tgz::http://ftp1.digi.com/support/driver/81000137_W.tgz
+ source = drpadmin
+ source = drpadmin.1
+ source = autorebuild-dgrp.sh
+ sha256sums = 218c3a873f8623d2e663735efdee384f7dac784327cea9e7211eddce700fe1c8
+ sha256sums = 1ab0ccdc361760ae078f9b69f603e99b40849cdf97ad69bb028ad6af27012634
+ sha256sums = 66f8b106a052b4807513ace92978e5e6347cef08eee39e4b4ae31c60284cc0a3
+ sha256sums = dde3d60179c465696370aa493a5b9f0ba2e5189e56cfc51439cfcca38f66bad5
+
+pkgname = dgrp
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..603931d1889f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,402 @@
+#!/bin/false
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Category: system
+
+# Todo: add systemd getty support to drpadmin
+# Todo: Fix autorebuild for multiple users with sudo chown
+# Todo: Fix ttyaa-ttyaa text in drpadmin
+# Digi bug: terminal freezes when viewing /proc/dgrp/mon
+
+# Digi Realport driver for Arch Linux. See Digi release notes for supported products.
+
+# Build instructions: (Skip these first two sections)
+
+# This only applies if you installed a long time ago when this driver would still
+# compile and haven't upgraded in a while. Now this can't be built on Arch without a
+# patch so new users skip to the next section.
+
+# This PKGBUILD does not clean up the slop from the Digi supplied make.
+# If you have already installed according to the the instructions
+# log on as root and go through the process in reverse from the original
+# unmodified Digi tgz. You won't lose your configuration.
+# make preuninstall; make uninstall
+# To clean up you may want to remove the folders /share/ and /etc/init.d/
+# Arch Linux does not use these folders though they may have spurious files from
+# other misdirected installs.
+
+# The next section: ... Now onto the real install ...
+
+# Set the mode for all created devices.
+_opt_defaultmode="0666" # default: 0600
+# If you need more granular control.
+# See http://www.digi.com/support/kbase/kbaseresultdetl?id=3048
+# Once set copy /etc/udev/rules.d/10-dgrp.rules to the PKGBUILD folder
+# and it will be made into the package.
+
+# sudo must be configured and available to the user account
+# In (non root) user account: download PKGBUILD into a new folder
+# using any method: cower or any AUR helper, wget, web browser, copy through network, or paste into PuTTY
+# makepkg -sCcfi
+
+# Since the kernel module isn't loaded until you have an active
+# device, these services are automatically enabled and started
+# for immediate hardware support. They will be reenabled each time the
+# package is installed or upgraded.
+# systemctl enable dgrp_daemon.service
+# systemctl start dgrp_daemon.service
+# systemctl enable dgrp_ditty.service
+# systemctl start dgrp_ditty.service
+
+# To stop these services from loading:
+# systemctl disable dgrp_daemon.service
+# systemctl stop dgrp_daemon.service
+# systemctl disable dgrp_ditty.service
+# systemctl stop dgrp_ditty.service
+
+# To get started using your Digi products:
+# man -Ik "Digi "
+# man dgrp_gui
+# man dgrp_cfg_node
+# man ditty
+# man drpadmin
+
+# The man page for dgrp_cfg_node lacks some detail. See this page for more info
+# ftp://digiftp.digi.com/support_archive/support/manuals/psts/rp-linux-conf-managing-portservers-with-dgrp-config-node.html
+
+# To get your equipment up faster on servers that don't have Xwindows installed
+# I've supplied a console shell script "drpadmin".
+# It is adapted from Digi's RealPort "drpadmin" for Sun, HP UX, and SCO and has the same
+# look and feel.
+
+# For information about using dgrp_ditty.service to maintain your ditty settings
+# across reboots see http://www.digi.com/support/kbase/kbaseresultdetl?id=904
+
+# make install and other commands described in the release notes
+# only build properly in the Arch environment when you first run
+# "makepkg -sC" to unpack the source allowing this PKGBUILD to patch the build files.
+
+# makepkg switches:
+# -s = build package
+# -C = erase source and rebuild from scratch. This is important because once
+# built it is locked to your booted kernel version. When the kernel
+# changes the package is worthless and you must boot the new kernel and
+# rebuild from scratch. Rebuild automation is provided.
+# -f = force overwrite of already built package. When the kernel changes the
+# the package is worthless.
+# -c = erase work folders when done
+# -i = install or upgrade package after build.
+
+# Leave "-c -i" off if you'd like to perform the make and install yourself
+# using "make install" as described in the release notes.
+
+# If you opt out of the Arch Linux package you must
+# sudo make install
+# sudo make postinstall
+# You will need to construct your own startup environment.
+# The BSD init scripts run just fine. They just don't launch automatically
+# in systemd. For startup I use @reboot in cron (cronie) to launch a shell
+# script in ~root with these commands:
+# #!/bin/sh
+# sleep 5 # wait for network and other services to start
+# /etc/init.d/dgrp_daemon start # This submits configured interfaces to the kernel module
+# /etc/init.d/dgrp_ditty start # this sets configured baud rates and other ditty-rp settings for the ports
+# You won't get a graceful shutdown on reboot.
+
+# In general for any manual upgrade you will need to:
+# sudo make preuninstall # this shuts down all of your interfaces which unloads the kernel module.
+ # Then the UDEV module is removed. The config file is not erased.
+# sudo make uninstall # This removes the old executables, man pages, and other Digi files
+# sudo mandb # this removes the Digi man page summaries from "man -k".
+# (don't do this) "./configure" # this rebuilds the makefiles with the new kernel version
+# (don't do this) "sudo make all" # this builds all the new executables
+# (do this instead) "makepkg -sC" # This modifies some files for the Arch Linux package, runs the above two commands, makes a package, then modifies the makefiles for "make install"
+# sudo make install # this installs all the executables
+# sudo mandb # this adds the Digi man page summaries and any other missing summaries to "man -k"
+# sudo make postinstall # this installs the UDEV module and starts any configured interfaces and the kernel module.
+# Adjust your daemon startup as necessary. The @reboot option in cron (cronie) is one choice, see above.
+
+# Note that the kernel module is not loaded until you configure at least one interface.
+# When your last interface is uninit the kernel module will be unloaded.
+
+# The manual install will not give you a systemd init script and installs unnecessary
+# files and is a bunch of work to rebuild every time the kernel changes.
+
+# How about we don't do that and use the Arch Linux package instead.
+
+# The Arch Linux package gives you
+# * systemd init scripts
+# * Only installs the right files
+# * Automatic removal on kernel upgrade
+# * Automatic rebuild and start on next login
+
+# Uninstall cleanup:
+# rm /etc/dgrp.backing.store /usr/bin/dgrp/config/ditty.commands
+# rmdir /usr/bin/dgrp/config
+# rmdir /usr/bin/dgrp
+
+# If Digi releases a new version then all you need to change is
+# pkgver, source, and possibly _pkgnamever
+# Then run "updpkgsums" to get new md5sums
+
+############################### Arch PKGBUILD #################################
+set -u
+pkgname='dgrp'
+_pkgnamever="${pkgname}-1.9" # this is the folder name inside the supplied tgz. It should be ${pkgname}-$pkgver but Digi didn't do that.
+pkgver='1.9.35'
+pkgrel=1
+_RealPort='RealPort' # Digi's product name is inconsistent. Here you can choose. RealPort seems right so I didn't complete the change to Realport.
+pkgdesc=("tty driver for Digi ${_RealPort} Connect EtherLite Flex One CM PortServer IBM RAN")
+_pkgdescshort="Digi ${_RealPort} driver for Ethernet serial servers"
+arch=('i686' 'x86_64')
+url='http://www.digi.com/'
+license=('GPL' 'APACHE' 'custom:DigiInternational')
+makedepends=('linux-headers' 'openssl' 'sudo') # openssl in in Arch Linux "base"
+
+_lock_to_kernel=1
+
+# Locking to a kernel is only necessary if we must manually uninstall before
+# upgrading the kernel. Kernel locking makes upgrades impossible. Without a
+# lock the service will stop before the reboot, and not start on the next boot.
+# We'll sense the missing kernel module and the upgrade will remove the
+# old kernel module and install the new one. The upgrade will start the kernel
+# module.
+_kernelversionsmall="`uname -r | cut -d - -f 1`"
+if [ "${_lock_to_kernel}" -ne 0 ]; then
+ depends=("linux=${_kernelversionsmall}" 'openssl')
+else
+ depends=('linux' 'openssl')
+ backup=('etc/dgrp.backing.store') # don't do this if you kernel lock or your config will be lost on upgrade
+fi
+conflicts=("linux>${_kernelversionsmall}" "linux<${_kernelversionsmall}")
+optdepends=('tcl: digi config manager in X' 'tk: digi config manager in X')
+source=("${pkgname}-${pkgver}-81000137_W.tgz::http://ftp1.digi.com/support/driver/81000137_W.tgz" 'drpadmin' 'drpadmin.1' 'autorebuild-dgrp.sh')
+sha256sums=('218c3a873f8623d2e663735efdee384f7dac784327cea9e7211eddce700fe1c8'
+ '1ab0ccdc361760ae078f9b69f603e99b40849cdf97ad69bb028ad6af27012634'
+ '66f8b106a052b4807513ace92978e5e6347cef08eee39e4b4ae31c60284cc0a3'
+ 'dde3d60179c465696370aa493a5b9f0ba2e5189e56cfc51439cfcca38f66bad5')
+options=('!docs' '!emptydirs')
+install="${pkgname}-install.sh"
+_autorebuild="autorebuild-${pkgname}.sh"
+_autorebuildsenseexe="/usr/lib/modules/\`uname -r\`/misc/dgrp.ko"
+
+prepare() {
+ set -
+ cd "${_pkgnamever}"
+ ./configure # --prefix=/usr # this didn't work
+
+ # Produce an Arch compatible Makefile
+ if [ ! -f 'Makefile.inc.Arch' ]; then
+ echo "# patched by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR" > 'Makefile.inc.Arch'
+ echo '# http://aur.archlinux.org/' >> 'Makefile.inc.Arch'
+ echo 'prefix=/usr' >> 'Makefile.inc.Arch'
+ echo '' >> 'Makefile.inc.Arch'
+ cat 'Makefile.inc' >> 'Makefile.inc.Arch'
+ sed -i -e 's:/usr/sbin:/usr/bin:g' 'Makefile.inc.Arch'
+ fi
+ cp -p 'Makefile.inc.Arch' 'Makefile.inc'
+
+ # Produce a "file_locations" that we can pull in here.
+ if [ ! -f 'config/file_locations.Arch' ]; then
+ echo "# patched by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR" > 'config/file_locations.Arch'
+ sed -e 's/^DGRP/_DGRP/g' 'config/file_locations' >> 'config/file_locations.Arch'
+ fi
+ . 'config/file_locations.Arch'
+
+ #export mandir=/usr/share/man
+ #export CFLAGS="$CFLAGS -DTTY_CLOSING=7"
+ #export MYMANDIR=/usr/share/man # didn't work
+ #sed -i -e 's/CPPFLAGS =/CPPFLAGS = -DTTY_CLOSING=7/g' Makefile # didn't work
+ #sed -i -e 's/MANDIR=.*$/MANDIR = \/usr\/share\/man/g' Makefile.inc # didn't work
+ #sed -i -e 's/-DDGRP_TRACER/-DDGRP_TRACER -DTTY_CLOSING=7/g' driver/build/Makefile.in # didn't work
+ #sed -i -e 's:\$(RPM_BUILD_ROOT)\$(MYMANDIR):/usr/share:g' driver/build/Makefile # I'm gonna get you, one way or another!
+ #sed -i -e 's:\$(MANDIR):/usr/share/man:g' */Makefile # these changes are all ignored. I'm not gonna...
+
+ # /usr/sbin /sbin and /lib are deprecated as soft links and aren't permitted in packages
+ sed -i -e 's:/usr/sbin:/usr/bin:g' 'Makefile' */Makefile driver/*/Makefile
+ # sed will perform a replace on already replaced text, but only once.
+ # That doesn't make sense to me but I can get around it by ensuring
+ # the from string isn't in the to string and doing it twice.
+ sed -i -e 's:/lib/:/usr/lIb/:g' Makefile */Makefile driver/*/Makefile
+ sed -i -e 's:/lIb/:/lib/:g' Makefile */Makefile driver/*/Makefile
+
+ # I'd like to use /usr/local/bin but I suspect that this change would be
+ # even more work than what I've already done and much to different from
+ # Digi's install.
+
+ # Patch a source for a constant that has been removed from the kernel.
+ # Digi should fix this since it will eventually not work right.
+ # See https://lkml.org/lkml/2014/10/16/632 [PATCH -next 09/27] tty: Remove TTY_CLOSING - LKML.ORG
+ # See http://lkml.iu.edu/hypermail/linux/kernel/1411.0/03202.html [PATCH -next v2 09/26] tty: Remove TTY_CLOSING
+ echo '' >> 'driver/build/include/dgrp_net_ops.h'
+ echo "/* patched by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR */" >> 'driver/build/include/dgrp_net_ops.h'
+ echo '/* http://aur.archlinux.org/ */' >> 'driver/build/include/dgrp_net_ops.h'
+ echo '#ifndef TTY_CLOSING' >> 'driver/build/include/dgrp_net_ops.h'
+ echo '#define TTY_CLOSING (7)' >> 'driver/build/include/dgrp_net_ops.h'
+ echo '#endif' >> 'driver/build/include/dgrp_net_ops.h'
+ set +u
+}
+
+build() {
+ set -
+ cd "${_pkgnamever}"
+ . 'config/file_locations.Arch'
+
+ # The instructions say we can only use pkgdir in package() but fortunately it exists here
+ # This bit of magic might work on other RPM based commercial drivers
+ echo "RPM_BUILD_ROOT=${pkgdir}" > 'Makefile.inc'
+ cat 'Makefile.inc.Arch' >> 'Makefile.inc'
+ make all -s -j $(nproc)
+ # This package doesn't seem to support threaded make
+ set +u
+}
+
+_daemons='daemon ditty'
+
+package() {
+ set -
+ cd "${_pkgnamever}"
+ . 'config/file_locations.Arch'
+ make install
+ # Leave the user with a properly modified Makefile.inc so the make commands in
+ # the release notes mostly work in the Arch environment.
+ cp -p 'Makefile.inc.Arch' 'Makefile.inc'
+
+ if [ "${_opt_defaultmode}" != '' ]; then
+ mv "${pkgdir}/tmp/dgrp/10-dgrp.rules" "${pkgdir}/tmp/dgrp/10-dgrp.rules.Arch"
+ cat > "${pkgdir}/tmp/dgrp/10-dgrp.rules" << EOF
+# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
+# http://aur.archlinux.org/
+
+# Generated: `date +"%F %T"`
+# From PKGBUILD in folder: `pwd`
+
+# Warning: If you modify this file you should copy it into the folder with the
+# PKGBUILD or you might lose the customizations on the next install.
+
+# This file was customized by the PKGBUILD by setting the mode on all ports
+# to MODE=(see below). If all you need is a different mode on all ports
+# then set the option in the PKGBUILD. If you need more granular control
+# see these customization instructions:
+
+# http://www.digi.com/support/kbase/kbaseresultdetl?id=3048
+
+# Then copy this file into the folder with PKGBUILD.
+
+EOF
+ cat "${pkgdir}/tmp/dgrp/10-dgrp.rules.Arch" >> "${pkgdir}/tmp/dgrp/10-dgrp.rules"
+ rm -f "${pkgdir}/tmp/dgrp/10-dgrp.rules.Arch"
+ sed -i -e 's:^\(KERNEL=="tty_dgrp\)\(.*\)$:\1\2, MODE="'"${_opt_defaultmode}"'":g' "${pkgdir}/tmp/dgrp/10-dgrp.rules"
+ cp -p "${srcdir}/10-dgrp.rules" "${pkgdir}/tmp/dgrp/10-dgrp.rules" || :
+ fi
+
+ # we need this to be safe just in case this points to the real /etc instead of pkg/etc as we expect
+ # as non root we'll be unable to erase any of these things from the real /etc. On Arch Linux none will exist anyways
+ mv -n "${pkgdir}/etc/init.d/dgrp_daemon" "${pkgdir}/etc/init.d/dgrp_ditty" "${pkgdir}/usr/bin/dgrp/daemon/"
+ rm -f "${pkgdir}/etc/init.d/dgrp_daemon" "${pkgdir}/etc/init.d/dgrp_ditty"
+ rmdir "${pkgdir}/etc/init.d" "${pkgdir}/etc"
+ chmod 1777 "${pkgdir}/tmp" # /tmp is not allowed in packages. We're not making a binary distro so having /tmp here shouldn't be a problem.
+ chmod 700 "${pkgdir}/usr/bin/dgelreset" "${pkgdir}/usr/bin/dgipserv" "${pkgdir}/usr/bin/dgrp/config/postinstall" "${pkgdir}/usr/bin/dgrp/config/preuninstall"
+ # It's not really clear to me why these are in the man pages but not in the path so you can use them.
+ cd "${pkgdir}/usr/bin"
+ for _exes in 'dgrp_cfg_node' 'dgrp_gui'; do
+ ln -s "dgrp/config/${_exes}" "${_exes}"
+ done
+ # ditty: You might need this if you have scripts that depend on ditty. It is commented out in case you have another ditty on your system.
+ # ln -s ditty-rp ditty
+ #rmdir "${pkgdir}/usr/share/doc" # The Arch PKGBUILD does for us
+
+ # systemd integration. Umask is 000 on my system. I don't know how makepkg gets the right permissions on this mkdir.
+ mkdir -p "${pkgdir}/usr/lib/systemd/system/"
+ local _daemon
+ for _daemon in ${_daemons}; do
+ cat > "dgrp_${_daemon}.service" << EOF
+# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
+# http://aur.archlinux.org/
+[Unit]
+Description="Digi ${_RealPort} ${_daemon}"
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/dgrp/daemon/dgrp_${_daemon} start
+ExecStop=/usr/bin/dgrp/daemon/dgrp_${_daemon} stop
+ExecReload=/usr/bin/dgrp/daemon/dgrp_${_daemon} reload
+
+[Install]
+WantedBy=multi-user.target
+EOF
+ install -m 644 "dgrp_${_daemon}.service" "${pkgdir}/usr/lib/systemd/system/"
+ rm -f "dgrp_${_daemon}.service"
+done
+
+ # Install my custom drpadmin with man page. This automatically detects if the files aren't provided.
+ sed -i -e "s/RealPort/${_RealPort}/gI" "${pkgdir}/usr/share/man/man8/"*.8 "${pkgdir}/usr/share/man/man1/"*.1
+ if [ -s "${srcdir}/drpadmin" ]; then
+ install -Dm755 "${srcdir}/drpadmin" "${pkgdir}/usr/bin/"
+ sed -i -e 's/^#distro=:::$/distro="Arch Linux"/g' \
+ -e "s/RealPort/${_RealPort}/gI" "${pkgdir}/usr/bin/drpadmin"
+ if [ -s "${srcdir}/drpadmin.1" ]; then
+ install -Dm444 "${srcdir}/drpadmin.1" "${pkgdir}/usr/share/man/man1/"
+ sed -i -e "s/RealPort/${_RealPort}/gI" "${pkgdir}/usr/share/man/man1/drpadmin.1"
+ fi
+ fi
+}
+
+_geninstall() {
+# produce the install script so it doesnt need to be downloaded separately
+# I'm wondering why there isn't a function for this.
+cat > "${install}" << EOF
+# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
+# http://aur.archlinux.org/
+
+post_upgrade() {
+ set -u
+ mandb -q
+ /usr/bin/dgrp/config/postinstall # this runs depmod -a
+ rmdir '/tmp/dgrp' # postinstall forgets to remove this. Useful on /tmp folders that are not mounted tmpfs
+ systemctl daemon-reload
+ # Digi's postinstall automatically loads the daemons so we might as well too
+ for _daemon in ${_daemons}; do
+ systemctl enable "dgrp_\${_daemon}.service"
+ systemctl start "dgrp_\${_daemon}.service"
+ done
+ echo "${_RealPort} (dgrp) startup scripts updated or installed"
+ set +u
+}
+
+post_install() {
+ post_upgrade
+}
+
+pre_upgrade() {
+ set -u
+ for _daemon in ${_daemons}; do
+ systemctl stop "dgrp_\${_daemon}.service"
+ systemctl disable "dgrp_\${_daemon}.service"
+ done
+ /usr/bin/dgrp/config/preuninstall
+ set +u
+}
+
+pre_remove() {
+ pre_upgrade
+ set -u
+ . '/usr/bin/dgrp/config/file_locations'
+ if [ -f "\${DGRP_STORE}" ]; then
+ echo "To clean fully you may want to remove your config: \${DGRP_STORE}"
+ fi
+ set +u
+}
+
+post_remove() {
+ set -u
+ mandb -q
+ systemctl daemon-reload
+ echo "${_RealPort} (dgrp) startup scripts removed"
+ set +u
+}
+EOF
+chmod 644 "${install}"
+}
+_geninstall
+set +u
diff --git a/autorebuild-dgrp.sh b/autorebuild-dgrp.sh
new file mode 100755
index 000000000000..374d0d8e2a95
--- /dev/null
+++ b/autorebuild-dgrp.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+# Part of the dgrp-1.9.35 PKGBUILD from Arch Linux AUR
+# http://aur.archlinux.org/
+
+# If you remove this script your package will not auto rebuild
+# and your hardware will stop working after the next kernel upgrade.
+
+# Purpose: Automatically build and install this package on the next login
+# after pacman removes it on kernel upgrade.
+# Every package that needs to be autorebuilt should have a shell script
+# like this one. All you need is a PKGBUILD and a sense file to tell
+# when the package is missing.
+
+# This shell script can be easily adapted to any PKGBUILD. As an alternative
+# you can look into "DKMS" Dynamic Kernel Module Support.
+
+# To launch, add this to any user's profile or the system profile.
+# The preferred user is the one most likely to log on after an upgrade.
+# sudo must be installed and configured. Each user expected to rebuild packages
+# must be added to the wheel group (usermod -G).
+
+# for install_group in `groups`; do
+# if [ "$install_group" = "wheel" ]; then
+# find ~/pkg -type f -perm /400 -name "autorebuild-*.sh" -exec sh {} \;
+# break
+# fi
+# done
+
+# This presumes you have neatly placed all your packages into ~pkg.
+
+# (Note: the multi user aspect has yet to be tested)
+
+# For multiple users you can use a standard folder set to be world writable.
+
+sensefile="/usr/lib/modules/`uname -r`/misc/dgrp.ko"
+rebuildtitle="Digi RealPort driver for Ethernet serial servers"
+
+if [ ! -s "$sensefile" ]; then
+ if [ "$EUID" -ne "0" ]; then
+ cd "`dirname "$0"`" # compatible with cron and find
+ #prevumask=`umask`; umask 000
+ makepkg -sCcfi
+ #umask $prevumask
+ ## Allow other users to build without permissions interference
+ ## This would be a security problem in most environments
+ ## chmod 777 files with any x bit set
+ #find . -type f ! "(" -perm 666 -o -perm 777 ")" -a -perm /111 -exec chmod 777 {} \;
+ ## chmod 666 files without any x bit set
+ #find . -type f ! "(" -perm 666 -o -perm 777 ")" -a "!" -perm /111 -exec chmod 666 {} \;
+ ## chmod 777 files with any x bit set
+ #find . -type d ! -perm 777 -exec chmod 777 {} \;
+ else
+ # su user -c "$*" # this might work if you need the root user to rebuild.
+ echo "`tput clear`"
+ echo "Important. A recent kernel upgrade has diabled your"
+ echo ""
+ echo "$rebuildtitle"
+ echo "Status: Disabled!"
+ echo ""
+ echo "It is easy to rebuild and enable but not by a root user."
+ echo "You must log in as a non root user with sudo access (wheel group) and"
+ echo ""
+ echo "run: $0"
+ echo ""
+ echo "if it doesn't start automatically."
+ echo "Press Enter"
+ read autorebuild
+ fi
+else
+ echo "$rebuildtitle already installed"
+fi
diff --git a/dgrp-install.sh b/dgrp-install.sh
new file mode 100644
index 000000000000..7b2fa441f5c2
--- /dev/null
+++ b/dgrp-install.sh
@@ -0,0 +1,49 @@
+# Automatically generated by dgrp-1.9.35 PKGBUILD from Arch Linux AUR
+# http://aur.archlinux.org/
+
+post_upgrade() {
+ set -u
+ mandb -q
+ /usr/bin/dgrp/config/postinstall # this runs depmod -a
+ rmdir '/tmp/dgrp' # postinstall forgets to remove this. Useful on /tmp folders that are not mounted tmpfs
+ systemctl daemon-reload
+ # Digi's postinstall automatically loads the daemons so we might as well too
+ for _daemon in daemon ditty; do
+ systemctl enable "dgrp_${_daemon}.service"
+ systemctl start "dgrp_${_daemon}.service"
+ done
+ echo "RealPort (dgrp) startup scripts updated or installed"
+ set +u
+}
+
+post_install() {
+ post_upgrade
+}
+
+pre_upgrade() {
+ set -u
+ for _daemon in daemon ditty; do
+ systemctl stop "dgrp_${_daemon}.service"
+ systemctl disable "dgrp_${_daemon}.service"
+ done
+ /usr/bin/dgrp/config/preuninstall
+ set +u
+}
+
+pre_remove() {
+ pre_upgrade
+ set -u
+ . '/usr/bin/dgrp/config/file_locations'
+ if [ -f "${DGRP_STORE}" ]; then
+ echo "To clean fully you may want to remove your config: ${DGRP_STORE}"
+ fi
+ set +u
+}
+
+post_remove() {
+ set -u
+ mandb -q
+ systemctl daemon-reload
+ echo "RealPort (dgrp) startup scripts removed"
+ set +u
+}
diff --git a/drpadmin b/drpadmin
new file mode 100755
index 000000000000..07c1b09e4297
--- /dev/null
+++ b/drpadmin
@@ -0,0 +1,333 @@
+#!/bin/bash
+
+# drpadmin - adminstrative tool for adding and removing portservers,
+# tty devices, and configuration files on servers not running xWindows.
+# From drpadmin written by Digi for SCO, HP UX, and Solaris
+
+. /usr/bin/dgrp/config/file_locations
+if [ "$DGRP_STORE" = "" ]; then
+ echo "$0: Can't find backing store from file locations."
+ exit 2
+fi
+
+ttyname=tty # driver prefix
+procdir=`dirname "$DGRP_PROCCONFIG"`
+distro="Linux" # Originally made for Arch Linux
+# Installers can use sed -i to change this next line to the appropriate distro name
+#distro=:::
+
+check_devid() {
+ case $1 in
+ [a-o,q-z]|[a-z][a-z]);;
+ p)printf "**** p cannot be used. p is reserved for psuedo devices!"
+ return 1
+ ;;
+ *)printf "**** Please enter 1 or 2 alpha characters"
+ return 1
+ ;;
+ esac
+ return 0
+}
+
+check_kernel() {
+ if [ ! -d "$procdir" ]; then
+ modprobe dgrp
+ fi
+ if [ -d "$procdir" ]; then
+ lines=`wc -l "$DGRP_PROCCONFIG" | cut -d " " -f 1`
+ if [ "$lines" -eq 0 ]; then
+ echo "The kernel module is loaded but no devices are active"
+ # this is not possible because the config file is removed and the kernel module is unloaded when the last device is uninit
+ fi
+ else
+ echo "The kernel module is not loaded"
+ if [ -s "$DGRP_STORE" ]; then
+ echo "A configuration exists but will not be active until the kernel module is loaded"
+ else
+ echo "Add any device to load the kernel module"
+ fi
+ return 1
+ fi
+ return 0
+}
+
+#
+# add a PortServer entry
+#
+add_ps() {
+ check_kernel
+ while true; do
+ printf "\nEnter the host name or IP address: "
+ read node
+ if [ "$node" = "" -o "$node" = "0" ]; then
+ return
+ fi
+
+ ping -c 4 "$node"
+
+ while true; do
+ printf "Enter the number of ports: "
+ read ndev
+ if [ "$ndev" = "" -o "$ndev" = "0" ]; then
+ return
+ fi
+ if [ "$ndev" -ge 1 -a "$ndev" -le 64 ]; then
+ break
+ fi
+ printf "\n**** Please enter a number from 1 to 64\n\n"
+ done
+
+ while true; do
+ printf "Enter the tty device ID (1 or 2 lower case alpha characters) : "
+ read devid
+ if [ "$devid" = "" -o "$devid" = "0" ]; then
+ return
+ fi
+ check_devid $devid
+ if [ $? -ne 0 ]; then
+ continue
+ fi
+
+ while true; do
+ printf "\n\nWould you like this RealPort session to be encrypted?\n\n"
+ printf "NOTE: Not all RealPort products support encrypted RealPort sessions.\n"
+ printf "Please check your RealPort product's firmware release notes\n"
+ printf "or product literature before selecting \"always\".\n"
+ printf "If in doubt, select \"never\".\n\n"
+ printf "(always/never) : (never): "
+
+ read secure
+ if [ -z "$secure" ]; then
+ secure="never"
+ fi
+
+ case $secure in
+ [aA])
+ secure="always"
+ secureopt="always"
+ ;;
+ always)
+ secureopt="always"
+ ;;
+ [nN])
+ secure="never"
+ secureopt="never"
+ ;;
+ never)
+ secureopt="never"
+ ;;
+ *)
+ printf "\nPlease answer (a)lways or (n)ever.\n" >&2
+ ;;
+ esac
+
+ if [ ! -z "$secureopt" ]; then
+ break
+ fi
+ done
+
+ while true; do
+ printf "\nIf the network connection between your Server system\n"
+ printf "and the remote device includes a WAN link slower than 1 MBit,\n"
+ printf "see the drpd manual page and enter the WAN speed here : "
+ read wan
+ if [ -z "$wan" ]; then
+ break
+ fi
+ printf "\n**** "
+ #expr "$s" : '.*:\(.*\)'
+ done
+
+ printf "\nThe following device will be configured,\n"
+ printf "$node\t$ndev\t$ttyname$devid$start-$ttyname$devid$p\t\tsecure ($secureopt)\t$wan\n"
+ printf "\nIs this correct (y to add or x to abort) ? "
+ read ans
+ if [ -z "$ans" ]; then
+ printf "\nEmpty response, not configuring this device.\n"
+ return
+ fi
+ if [ $ans = 'x' ]; then
+ printf "\nx pressed, not configuring this device.\n"
+ return
+ fi
+ if [ $ans = 'y' ]; then
+ if [ "$wan" != "" ]; then
+ $wan = "-s $wan"
+ fi
+ echo "$DGRP_CFG" -v -e $secureopt $wan init $devid $node $ndev
+ "$DGRP_CFG" -v -e $secureopt $wan init $devid $node $ndev
+ return
+ fi
+ done
+ done
+}
+
+#
+# delete a PortServer device
+#
+delete_ps() {
+ check_kernel
+ if [ $? -ne 0 ]; then
+ return
+ fi
+ show_ps
+ printf "\nEnter the 2 letter id of the device to delete: "
+ read devid
+ check_devid $devid
+ if [ $? -ne 0 ]; then
+ return
+ fi
+ echo "$DGRP_CFG" -v uninit "$devid"
+ "$DGRP_CFG" -v uninit "$devid"
+}
+
+#
+# reset by stop/start a PortServer device
+#
+# $1 = 0 for reset, 1 for move
+# $2 = word to display like "Resetting" or "Moving"
+# $3 = word to display like "reset" or "move"
+# $4 = word to display like "" or "new"
+resetmove_ps() {
+ check_kernel
+ if [ $? -ne 0 ]; then
+ return
+ fi
+ show_ps
+ printf "\nWarning: $2 a device will disconnect all active connections!\n"
+ printf "Enter the 1 or 2 letter device to $3: "
+ read devid
+ check_devid $devid
+ if [ $? -ne 0 ]; then
+ return
+ fi
+ node=`grep "^$devid[^0-9]" "$DGRP_STORE" | cut -d " " -f 2`
+ if [ "$node" = "" ]; then
+ printf "Device $devid not found"
+ fi
+ if [ "$1" -eq 1 ]; then
+ printf "\nEnter the $4 host name or IP address: "
+ read node
+ if [ "$node" = "" -o "$node" = "0" ]; then
+ return
+ fi
+ echo ping -w 4 -c 4 "$node"
+ ping -w 4 -c 4 "$node"
+ fi
+ echo "$DGRP_CFG" -v stop "$devid"
+ "$DGRP_CFG" -v stop "$devid"
+ echo "$DGRP_CFG" -v start "$devid" "$node"
+ "$DGRP_CFG" -v start "$devid" "$node"
+}
+
+show_ps() {
+ check_kernel
+ if [ -s "$DGRP_STORE" ]; then
+ lines=`wc -l "$DGRP_STORE" | cut -d " " -f 1`
+ else
+ lines=0
+ fi
+ if [ "$lines" -eq 0 ]; then
+ echo ""
+ echo "No devices are configured."
+ elif [ "$lines" -lt 20 ]; then
+ echo `grep PortCount "$DGRP_STORE" | cut -d " " -f3-`
+ grep "^[a-z]" "$DGRP_STORE"
+ else
+ less "$DGRP_STORE"
+ fi
+}
+
+show_info() {
+ check_kernel
+ if [ $? -eq 0 ]; then
+ if [ "$lines" -lt 20 ]; then
+ cat "$DGRP_PROCCONFIG"
+ else
+ less "$DGRP_PROCCONFIG"
+ fi
+ fi
+}
+
+show_node() {
+ check_kernel
+ if [ $? -eq 0 ]; then
+ if [ "`wc -l "$procdir/nodeinfo" | cut -d " " -f 1`" -lt 20 ]; then
+ cat "$procdir/nodeinfo"
+ else
+ less "$procdir/nodeinfo"
+ fi
+ fi
+}
+
+show_version() {
+ check_kernel
+ if [ $? -eq 0 ]; then
+ if [ "`wc -l "$procdir/info" | cut -d " " -f 1`" -lt 20 ]; then
+ cat "$procdir/info"
+ elif [ "$lines < 20" ]; then
+ less "$procdir/info"
+ fi
+ fi
+}
+
+# main body
+
+echo ""
+
+if [ "$EUID" -ne 0 ]; then
+ printf "\nDigi Realport Current Configuration:\n"
+ show_ps
+else
+ echo "Digi Realport Configuration Menu for $distro"
+ echo ""
+ echo "Add - add a new device configuration (init)"
+ echo "Delete - delete a device configuration (uninit)"
+ echo "Reset - reset a single device by stopping and starting it"
+ echo "Move - change IP address for a device without losing configuration"
+ echo "Show - display set configuration $DGRP_STORE"
+ echo "Kernel - display active configuration $DGRP_PROCCONFIG"
+ echo "Node - display active nodes $procdir/nodeinfo"
+ echo "Version - display kernel version and debugging info $procdir/info"
+fi
+
+check_kernel
+
+if [ -d "$procdir" ]; then
+ echo ""
+ echo "Kernel Status: Running"
+ lines=`grep "^[^#].*" "$procdir/config" | wc -l | cut -d " " -f 1`
+ if [ "$lines" -eq 0 ]; then
+ echo "Device Count : $lines"
+ echo "systemctl start dgrp_daemon.service"
+ systemctl start dgrp_daemon.service
+ echo "systemctl start dgrp_ditty.service"
+ systemctl start dgrp_ditty.service
+ lines=`grep "^[^#].*" "$procdir/config" | wc -l | cut -d " " -f 1`
+ fi
+ echo "Device Count : $lines"
+else
+ echo ""
+ echo "Kernel status: NOT RUNNING"
+fi
+
+if [ "$EUID" -ne 0 ]; then
+ printf "\nMust be root to use $0\n"
+ exit 2
+fi
+
+while true; do
+ printf "\nOp: (a)dd (d)elete (r)eset (s)how (k)ernel (n)ode (v)ersion (q)uit:"
+ read opt
+ case $opt in
+ 'a') add_ps ;;
+ 'd') delete_ps;;
+ 'r') resetmove_ps 0 "Resetting" "reset" "";;
+ #'m') resetmove_ps 1 "Moving" "move" "new";; # Doesn't work according to the instructions
+ 's') show_ps;;
+ 'k') show_info;;
+ 'n') show_node;;
+ 'v') show_version;;
+ 'q') echo "man `basename $DGRP_CFG` for advanced configuration options"; exit 0;;
+ esac
+done
diff --git a/drpadmin.1 b/drpadmin.1
new file mode 100644
index 000000000000..3dfd0bc3c831
--- /dev/null
+++ b/drpadmin.1
@@ -0,0 +1,143 @@
+. Copyright (c) 1998 Digi International, All Rights Reserved.
+.
+. $Id: drpadmin.1m,v 1.4 2001/08/08 20:42:08 jamesp Exp $
+.
+.TH DRPADMIN 1M "November 1, 1998"
+.SH NAME
+drpadmin - Digi Realport Configuration Utility
+.SH SYNOPSIS
+.TP 14
+drpadmin
+.SH DESCRIPTION
+The drpadmin utility is invoked by the system administrator to
+view, add, remove, or change the configuration of RealPort-enabled
+Products used with the
+.B dgrp
+driver. When invoked by a non root user the current configuration
+is displayed along with any kernel warning messages. Configuration
+is not available to a non root user.
+.PP
+When invoked, drpadmin begins a question-and-answer
+terminal conversation with the user. The user may
+.B add
+a RealPort-enabled product,
+.B show
+the current configuration and other details provided by the kernel driver,
+.B remove
+a previously configured unit, or
+.B reset
+a previously configured unit
+.PP
+In the
+.B show
+operation, the program simply displays the contents of the
+.I /etc/dgrp.backing.store
+file with the
+.B less
+program.
+.PP
+The show operations are safe to run any time.
+The remaining operations may cause
+temporary or permanent service interruptions to your Realport devices.
+.PP
+In the
+.B add
+operation, the user is asked for:
+.TP 8
+Remote node name or IP address
+The TCP/IP node name, or the numeric dot-address of the Digi ethernet-based
+serial device.
+.TP
+Number of ports
+The number of tty devices to be created for this unit.
+If this number is less than the number of physical ports,
+only the entered number will be available to the Realport Driver.
+The unassigned ports will be available for other connection types.
+Some Digi products and drivers accept other connection types to assigned ports
+so long as there are no active Realport connections.
+If this number is greater, the additional devices will not be usable
+unless/until the hardware is expanded.
+.TP
+Realport tty device id
+This one or two character alphanumeric string is used to generate
+the
+.BI /dev/tty XN,
+.BI /dev/pr XN
+and
+.BI /dev/cu XN
+device names for this unit.
+Here
+.I X
+is the entered string, and
+.I N
+is the automatically generated 2 digit port number in the range 01 to 64.
+.TP
+Encryption
+The encryption setting for this unit. If your device does not support
+encryption then encryption should not be enabled or the device will
+not function. Check your device specifications to see if encryption
+is supported.
+.TP
+Network link speed
+This parameter should be specified only when the network connection from
+the system to the remote device includes a WAN link slower
+than 1 MBit/second.
+The user may enter either simply the WAN speed
+(eg 56000 for a 56K Frame Relay link)
+or may enter a complete WAN speed string as documented
+in the
+.BR drpd (1m)
+manual page.
+.PP
+When all data is entered, the
+.B add
+command calls
+.B dgrp_cfg_node init
+to load the kernel module if not already loaded and
+activate the device. The new device is then immediately available.
+.PP
+drpadmin only configures the most
+common options. Please see the
+.BR dgrp_cfg_node (1m)
+manual page for all available options.
+.PP
+In the
+.B remove
+operation, the user is first asked for the unit ID
+to delete as displayed by the
+.B show
+option. The command then calls
+.B dgrp_cfg_node uninit
+to deactivate the device with the kernel module.
+When the last device is deactivated the kernel module is unloaded
+.PP
+The configuration changes take effect immediately.
+.PP
+In the
+.B reset
+operation, the user is first asked for the unit ID
+to reset as displayed by the
+.B show
+option. The command then calls
+.B dgrp_cfg_node stop
+then
+.B dgrp_cfg_node start
+to reset the device with the kernel module.
+.PP
+When the
+.B reset
+operation is complete all connections using the device will be reset.
+.PP
+To change the configuration of a remote device,
+the unit must first be removed and then added back
+into the configuration.
+.PP
+.B dgrp_cfg_node stop
+and
+.B dgrp_cfg_node start
+can be used to change the IP address of a configured unit.
+.PP
+.SH "SEE ALSO"
+.BR ditty (1),
+.BR drpd (1m),
+.BR dgrp_cfg_node (1m)