commit network-autoconfig for openSUSE:Factory
Hello community, here is the log from the commit of package network-autoconfig for openSUSE:Factory checked in at Tue Jan 25 10:13:31 CET 2011. -------- New Changes file: --- /dev/null 2010-08-26 16:28:41.000000000 +0200 +++ /mounts/work_src_done/STABLE/network-autoconfig/network-autoconfig.changes 2010-12-22 11:36:53.000000000 +0100 @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Tue Dec 21 12:40:32 UTC 2010 - mvidner@suse.cz + +- Initial packaging + calling whatdependson for head-i586 New: ---- README boot.network-autoconfig network-autoconfig network-autoconfig.changes network-autoconfig.spec ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ network-autoconfig.spec ++++++ # # spec file for package network-autoconfig # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: network-autoconfig Version: 0.8 Release: 1 License: MIT BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch Requires: dhcpcd Requires(pre): %insserv_prereq Group: System/Boot Summary: Find a connected eth interface and create an ifcfg for it Url: http://gitorious.org/opensuse/network-autoconfig Source0: README Source1: network-autoconfig Source2: boot.network-autoconfig %description All available Ethernet network interfaces will be cycled until one is successfully configured. This script should run at the first boot of a machine that has several interfaces. %prep %setup -c -T cp %{SOURCE0} . %build %install # install it to a directory where autoyast will run it once SBINDIR=$RPM_BUILD_ROOT/usr/sbin INITDIR=$RPM_BUILD_ROOT/etc/init.d mkdir -p $SBINDIR $INITDIR install %{SOURCE1} $SBINDIR install %{SOURCE2} $INITDIR %clean rm -rf "$RPM_BUILD_ROOT" %post %{fillup_and_insserv boot.network-autoconfig} %files %defattr(-,root,root) %doc README /etc/init.d/boot.network-autoconfig /usr/sbin/network-autoconfig %changelog ++++++ README ++++++ network-autoconfig: Find a connected eth interface and create an ifcfg for it All available Ethernet network interfaces will be cycled until one is successfully configured. This script will be run at the first boot of a machine. The log of the run is saved to /var/log/network-autoconfig . Requirements: SUSE Linux, dhcpcd. ++++++ boot.network-autoconfig ++++++ #!/bin/sh # ### BEGIN INIT INFO # Provides: boot.network-autoconfig # Required-Start: # Required-Stop: $null # Should-Start: $local_fs boot.ipconfig # Should-Stop: $null # Default-Start: B # Default-Stop: # X-UnitedLinux-Default-Enabled: yes # Short-Description: Find a connected eth interface and create an ifcfg for it # Description: Find a connected eth interface and create an ifcfg for it ### END INIT INFO . /etc/rc.status case "$1" in start) echo -n "Network autoconfig: " /usr/sbin/network-autoconfig >> /var/log/network-autoconfig 2>&1 rc_status $status -r -v chkconfig boot.network-autoconfig off ;; stop) rc_status -v ;; restart) rc_status -v ;; status) rc_status -v ;; reload) rc_status -v ;; force-reload) rc_status -v ;; *) echo "Usage: $0 {start|stop|restart|status|reload|force-reload}" exit 1 ;; esac rc_exit ++++++ network-autoconfig ++++++ #! /bin/sh # network-autoconfig: Find a connected eth interface and create an ifcfg for it. # This script should run at the first boot of a machine # that has several interfaces # Author: Martin Vidner <mvidner@suse.cz> # Reference: https://fate.novell.com/309518 # Copyright (C) 2010 Novell, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. # FIXME we assume no config exists. what if it does? display+log a warning and overwrite, or skip # Be safe when testing, prolly support -h, -v # Should we check if more cables are connected? main() { # check_dependencies for INTERFACE in `interfaces`; do if connected $INTERFACE; then create_dhcp_ifcfg $INTERFACE break fi done } # prints non-loopback interface names, one per line interfaces() { ls /sys/class/net | grep -v '^lo$' } # $1 is interface name, like eth7 # returns true/false cable_connected() { # ifplugstatus requires ifplugd.rpm ifplugstatus $1 test $? = 2 # or grep ethtool } # $1 is interface name, like eth7 # returns true/false # requires dhcpcd.rpm connected() { echo >&2 "$0: Trying $1" PATH=/usr/sbin:/sbin:$PATH dhcpcd-test $1 | grep ^IPADDR } # $1 is interface name, like eth7 create_dhcp_ifcfg() { IFCFG=/etc/sysconfig/network/ifcfg-$1 if [ -f $IFCFG ]; then echo >&2 "$0: ifcfg already exists, will not overwrite $IFCFG" return 1 fi echo >&2 "$0: creating $IFCFG" cat >$IFCFG <<EOF # created by $0 BOOTPROTO='dhcp' STARTMODE='auto' EOF } main ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de