From df028e420c174cf2a41508beaff7a2c96c6afe63 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 17 Sep 2013 08:10:36 -0700 Subject: [PATCH 1/2] Use 'ip neigh ls' when 'arp' isn't installed. - From Martin Gignac Signed-off-by: Tom Eastep --- Shorewall-core/lib.cli | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index aaff30ad5..c52b328ab 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -1503,7 +1503,12 @@ do_dump_command() { if [ $g_family -eq 4 ]; then heading "ARP" - arp -na + if qt mywhich arp; then + arp -na + else + ip -4 neigh ls + ip -4 neigh ls proxy + fi else heading "Neighbors" ip -6 neigh ls From 45242811630cac816dff70a65e79116cd4b28b37 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 17 Sep 2013 08:22:52 -0700 Subject: [PATCH 2/2] Apply Thomas D's Gentoo support patch Signed-off-by: Tom Eastep --- Shorewall-core/install.sh | 7 ++++++- Shorewall-init/install.sh | 17 ++++++++++++++++- Shorewall-lite/install.sh | 11 +++++++++++ Shorewall/install.sh | 11 +++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index 81e97f866..665cf1d6c 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -204,6 +204,9 @@ if [ -z "$BUILD" ]; then debian) BUILD=debian ;; + gentoo) + BUILD=gentoo + ;; opensuse) BUILD=suse ;; @@ -213,6 +216,8 @@ if [ -z "$BUILD" ]; then esac elif [ -f /etc/debian_version ]; then BUILD=debian + elif [ -f /etc/gentoo-release ]; then + BUILD=gentoo elif [ -f /etc/redhat-release ]; then BUILD=redhat elif [ -f /etc/slackware-version ] ; then @@ -271,7 +276,7 @@ case "$HOST" in apple) echo "Installing Mac-specific configuration..."; ;; - debian|redhat|slackware|archlinux|linux|suse) + debian|gentoo|redhat|slackware|archlinux|linux|suse) ;; *) echo "ERROR: Unknown HOST \"$HOST\"" >&2 diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 259fb9ea9..4b659df9b 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -194,6 +194,9 @@ if [ -z "$BUILD" ]; then debian) BUILD=debian ;; + gentoo) + BUILD=gentoo + ;; opensuse) BUILD=suse ;; @@ -203,6 +206,8 @@ if [ -z "$BUILD" ]; then esac elif [ -f /etc/debian_version ]; then BUILD=debian + elif [ -f /etc/gentoo-release ]; then + BUILD=gentoo elif [ -f /etc/redhat-release ]; then BUILD=redhat elif [ -f /etc/SuSE-release ]; then @@ -225,7 +230,7 @@ case $BUILD in apple) T= ;; - debian|redhat|suse|slackware|archlinux) + debian|gentoo|redhat|suse|slackware|archlinux) ;; *) [ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 || echo "ERROR: Unknown BUILD environment" @@ -241,6 +246,9 @@ case "$HOST" in debian) echo "Installing Debian-specific configuration..." ;; + gentoo) + echo "Installing Gentoo-specific configuration..." + ;; redhat) echo "Installing Redhat/Fedora-specific configuration..." ;; @@ -375,6 +383,9 @@ else if [ $HOST = suse ]; then mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d + elif [ $HOST = gentoo ]; then + # Gentoo does not support if-{up,down}.d + return else mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d fi @@ -446,6 +457,10 @@ if [ -z "$DESTDIR" ]; then update-rc.d shorewall-init enable echo "Shorewall Init will start automatically at boot" + elif [ $HOST = gentoo ]; then + # On Gentoo, a service must be enabled manually by the user, + # not by the installer + return else if [ -n "$SYSTEMD" ]; then if systemctl enable shorewall-init.service; then diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index 1e81d8175..cab2bdf86 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -212,6 +212,9 @@ if [ -z "$BUILD" ]; then debian) BUILD=debian ;; + gentoo) + BUILD=gentoo + ;; opensuse) BUILD=suse ;; @@ -221,6 +224,8 @@ if [ -z "$BUILD" ]; then esac elif [ -f ${CONFDIR}/debian_version ]; then BUILD=debian + elif [ -f /etc/gentoo-release ]; then + BUILD=gentoo elif [ -f ${CONFDIR}/redhat-release ]; then BUILD=redhat elif [ -f ${CONFDIR}/SuSE-release ]; then @@ -269,6 +274,9 @@ case "$HOST" in debian) echo "Installing Debian-specific configuration..." ;; + gentoo) + echo "Installing Gentoo-specific configuration..." + ;; redhat) echo "Installing Redhat/Fedora-specific configuration..." ;; @@ -389,6 +397,9 @@ fi if [ $HOST = archlinux ] ; then sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf +elif [ $HOST = gentoo ]; then + # Adjust SUBSYSLOCK path (see https://bugs.gentoo.org/show_bug.cgi?id=459316) + perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/$PRODUCT|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf fi # diff --git a/Shorewall/install.sh b/Shorewall/install.sh index cd5347aff..c32211695 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -222,6 +222,9 @@ if [ -z "$BUILD" ]; then debian) BUILD=debian ;; + gentoo) + BUILD=gentoo + ;; opensuse) BUILD=suse ;; @@ -231,6 +234,8 @@ if [ -z "$BUILD" ]; then esac elif [ -f /etc/debian_version ]; then BUILD=debian + elif [ -f /etc/gentoo-release ]; then + BUILD=gentoo elif [ -f /etc/redhat-release ]; then BUILD=redhat elif [ -f /etc/slackware-version ] ; then @@ -275,6 +280,9 @@ case "$HOST" in debian) echo "Installing Debian-specific configuration..." ;; + gentoo) + echo "Installing Gentoo-specific configuration..." + ;; redhat) echo "Installing Redhat/Fedora-specific configuration..." ;; @@ -499,6 +507,9 @@ if [ ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf ]; then sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf elif [ $HOST = debian ]; then perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix} + elif [ $HOST = gentoo ]; then + # Adjust SUBSYSLOCK path (see https://bugs.gentoo.org/show_bug.cgi?id=459316) + perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/$PRODUCT|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix} fi echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf"