mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
move ifupdown2/* .
ifupdown2 code was one level deeper because ifupdown2 initially had ifupdown2 and ifupdown2-addons as two separate packages. Since they were combined into one package, it makes sense to move all combined code under the top level directory Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
30
debian/copyright
vendored
Normal file
30
debian/copyright
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: ifupdown2
|
||||
Source: http://www.cumulusnetworks.com
|
||||
|
||||
Files: *
|
||||
Copyright: 2013 Cumulus Networks
|
||||
License: GPL-2
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2013 Cumulus Networks
|
||||
License: GPL-2
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License
|
||||
.
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||
|
||||
# Please also look if there are files or directories which have a
|
||||
# different copyright/license attached and list them here.
|
||||
# Please avoid to pick license terms that are more restrictive than the
|
||||
# packaged work, as it may make Debian's contributions unacceptable upstream.
|
114
debian/python-ifupdown2.postinst
vendored
Normal file
114
debian/python-ifupdown2.postinst
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
#!/bin/sh
|
||||
# postinst script for ifupdown2
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postinst> `configure' <most-recently-configured-version>
|
||||
# * <old-postinst> `abort-upgrade' <new version>
|
||||
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
||||
# <new-version>
|
||||
# * <postinst> `abort-remove'
|
||||
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
||||
# <failed-install-package> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
process_udev()
|
||||
{
|
||||
# override default udev bridge and hotplug rules because they interfere with
|
||||
# networking init script
|
||||
udev_user_rulesdir=/etc/udev/rules.d/
|
||||
udev_sys_rulesdir=/lib/udev/rules.d/
|
||||
if [ -e $udev_user_rulesdir ]; then
|
||||
udev_ifupdown2_overrides="80-networking.rules
|
||||
60-bridge-network-interface.rules"
|
||||
for u in ${udev_ifupdown2_overrides}
|
||||
do
|
||||
if [ -e ${udev_sys_rulesdir}/$u -a ! -e ${udev_user_rulesdir}/$u ]; then
|
||||
(cd ${udev_user_rulesdir} && ln -sf /dev/null $u)
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
MYNAME="${0##*/}"
|
||||
|
||||
report() { echo "${MYNAME}: $*" ; }
|
||||
report_warn() { report "Warning: $*" >&2 ; }
|
||||
report_err() { report "Error: $*" >&2 ; }
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
# Create /etc/network/run
|
||||
[ -d /run/network ] || mkdir -p /run/network
|
||||
|
||||
# for backward compatibility
|
||||
if [ ! -f /etc/network/run ]; then
|
||||
ln -sf /run/network /etc/network/run
|
||||
fi
|
||||
|
||||
ln -sf /usr/share/python-ifupdown2/generate_interfaces.py \
|
||||
/usr/share/doc/python-ifupdown2/examples/generate_interfaces.py
|
||||
|
||||
[ -d /etc/network/if-pre-up.d ] || mkdir -p /etc/network/if-pre-up.d
|
||||
[ -d /etc/network/if-up.d ] || mkdir -p /etc/network/if-up.d
|
||||
[ -d /etc/network/if-post-up.d ] || mkdir -p /etc/network/if-post-up.d
|
||||
|
||||
[ -d /etc/network/if-pre-down.d ] || mkdir -p /etc/network/if-pre-down.d
|
||||
[ -d /etc/network/if-down.d ] || mkdir -p /etc/network/if-down.d
|
||||
[ -d /etc/network/if-post-down.d ] || mkdir -p /etc/network/if-post-down.d
|
||||
|
||||
|
||||
# Generic stuff done on all configurations
|
||||
if [ -f /etc/network/interfaces ] ; then
|
||||
# TODO: This should be handled with debconf and the script
|
||||
# could introduce the line there directly
|
||||
if ! grep -q "^[[:space:]]*iface[[:space:]]\+lo0\?[[:space:]]\+inet[[:space:]]\+loopback\>" /etc/network/interfaces ; then
|
||||
report_warn "No 'iface lo' definition found in /etc/network/interfaces"
|
||||
fi
|
||||
|
||||
if ! grep -q "^[[:space:]]*\(allow-\|\)auto[[:space:]]\+\(.*[[:space:]]\+\|\)lo0\?\([[:space:]]\+\|$\)" /etc/network/interfaces ; then
|
||||
report_warn "No 'auto lo' statement found in /etc/network/interfaces"
|
||||
fi
|
||||
else # ! -f /etc/network/interfaces
|
||||
if [ -z "$2" ]; then
|
||||
echo "Creating /etc/network/interfaces."
|
||||
echo "# interfaces(5) file used by ifup(8) and ifdown(8)" > /etc/network/interfaces
|
||||
echo "auto lo" >> /etc/network/interfaces
|
||||
echo "iface lo inet loopback" >> /etc/network/interfaces
|
||||
else
|
||||
report_warn "/etc/network/interfaces does not exist"
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -e /sbin/ifup ] || ln -sf /sbin/ifupdown /sbin/ifup
|
||||
[ -e /sbin/ifdown ] || ln -sf /sbin/ifupdown /sbin/ifdown
|
||||
[ -e /sbin/ifquery ] || ln -sf /sbin/ifupdown /sbin/ifquery
|
||||
[ -e /sbin/ifreload ] || ln -sf /sbin/ifupdown /sbin/ifreload
|
||||
|
||||
(cd /usr/share/man/man8/ && ln -sf /usr/share/man/man8/ifup.8.gz ifdown.8.gz)
|
||||
|
||||
mkdir -p /etc/network/interfaces.d/
|
||||
process_udev
|
||||
update-rc.d networking start 40 S . start 35 0 6 . >/dev/null
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
71
debian/python-ifupdown2.postrm
vendored
Normal file
71
debian/python-ifupdown2.postrm
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/bin/sh
|
||||
# postrm script for ifupdown2
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postrm> `remove'
|
||||
# * <postrm> `purge'
|
||||
# * <old-postrm> `upgrade' <new-version>
|
||||
# * <new-postrm> `failed-upgrade' <old-version>
|
||||
# * <new-postrm> `abort-install'
|
||||
# * <new-postrm> `abort-install' <old-version>
|
||||
# * <new-postrm> `abort-upgrade' <old-version>
|
||||
# * <disappearer's-postrm> `disappear' <overwriter>
|
||||
# <overwriter-version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
process_udev()
|
||||
{
|
||||
udevlink=$(readlink /etc/udev/rules.d/80-networking.rules 2>/dev/null || true)
|
||||
[ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/80-networking.rules
|
||||
udevlink=$(readlink /etc/udev/rules.d/60-bridge-network-interface.rules 2>/dev/null || true)
|
||||
[ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/60-bridge-network-interface.rules
|
||||
}
|
||||
|
||||
postrm_remove()
|
||||
{
|
||||
rm -f /sbin/ifup /sbin/ifdown /sbin/ifquery
|
||||
process_udev
|
||||
update-rc.d networking remove >/dev/null
|
||||
}
|
||||
|
||||
# Note: We don't remove /etc/network/interfaces
|
||||
postrm_purge()
|
||||
{
|
||||
rm -f /var/tmp/network/ifstatenew
|
||||
if [ -L /etc/network/run ] ; then
|
||||
rm -f /etc/network/run
|
||||
elif [ -d /etc/network/run ] ; then
|
||||
rmdir --ignore-fail-on-non-empty /etc/network/run
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
purge)
|
||||
postrm_purge
|
||||
;;
|
||||
|
||||
remove)
|
||||
postrm_remove
|
||||
;;
|
||||
|
||||
|
||||
upgrade|disappear|failed-upgrade|abort-install|abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
56
debian/python-ifupdown2.preinst
vendored
Executable file
56
debian/python-ifupdown2.preinst
vendored
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/bin/sh
|
||||
# preinst script for newpkg
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <new-preinst> `install'
|
||||
# * <new-preinst> `install' <old-version>
|
||||
# * <new-preinst> `upgrade' <old-version>
|
||||
# * <old-preinst> `abort-upgrade' <new-version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
preinst_upgrade()
|
||||
{
|
||||
local oldver="$1"
|
||||
local udev_user_rulesdir="/etc/udev/rules.d"
|
||||
|
||||
# we have to fixup the filesystem here as previous packages of
|
||||
# ifupdown2 introduced a bug in the postrm script that require
|
||||
# these files to exist, otherwise the postrm script will always
|
||||
# fail.
|
||||
local badver="0.1-cl2.5+2"
|
||||
if dpkg --compare-versions "${oldver}" "lt" "${badver}"; then
|
||||
local files="${udev_user_rulesdir}/80-networking.rules
|
||||
${udev_user_rulesdir}/60-bridge-network-interface.rules"
|
||||
for f in ${files}; do
|
||||
echo "touching udev rule: ${f}"
|
||||
test ! -e "${f}" && ln -s /dev/null "${f}" || \
|
||||
/bin/echo -e "\tudev rule exists leaving"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
install|upgrade)
|
||||
preinst_upgrade "$2"
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "preinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user