Hello community, here is the log from the commit of package mkinitrd for openSUSE:Factory checked in at Thu Jun 23 13:08:41 CEST 2011.
-------- --- mkinitrd/mkinitrd.changes 2011-06-21 11:14:31.000000000 +0200 +++ /mounts/work_src_done/STABLE/mkinitrd/mkinitrd.changes 2011-06-22 17:32:36.000000000 +0200 @@ -1,0 +2,11 @@ +Wed Jun 22 15:02:26 UTC 2011 - mma...@novell.com + +- dcbd was replaced with lldpad. + +------------------------------------------------------------------- +Wed Jun 22 14:12:55 UTC 2011 - mma...@novell.com + +- Add support for configuring multiple network interfaces + (fate#311345). + +------------------------------------------------------------------- @@ -250,0 +262,6 @@ +Fri Feb 19 10:30:01 CET 2010 - mma...@suse.cz + +- scripts/boot-network.sh: really fix net_delay handling + (bnc#575816). + +------------------------------------------------------------------- @@ -362,0 +380,5 @@ +Wed Nov 11 13:14:08 CET 2009 - mci...@suse.cz + +- add a bridge to support fcoe and dcbd (fate#307444) + +------------------------------------------------------------------- @@ -403,0 +426,6 @@ + +------------------------------------------------------------------- +Tue Oct 13 14:12:54 CEST 2009 - mvanc...@suse.cz + +- scripts/boot-network.sh: add "net_delay" kernel cmdline option + for kdump purposes (bnc#471943) calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mkinitrd.spec ++++++ --- /var/tmp/diff_new_pack.yLN7eU/_old 2011-06-23 12:01:49.000000000 +0200 +++ /var/tmp/diff_new_pack.yLN7eU/_new 2011-06-23 12:01:49.000000000 +0200 @@ -31,7 +31,7 @@ %endif AutoReqProv: on Version: 2.7.0 -Release: 13 +Release: 15 Conflicts: udev < 118 Requires: dhcpcd PreReq: %fillup_prereq ++++++ mkinitrd.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/mkinitrd.changes new/mkinitrd-2.7.0/mkinitrd.changes --- old/mkinitrd-2.7.0/mkinitrd.changes 2011-06-21 11:13:33.000000000 +0200 +++ new/mkinitrd-2.7.0/mkinitrd.changes 2011-06-22 17:28:22.000000000 +0200 @@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Wed Jun 22 15:02:26 UTC 2011 - mma...@novell.com + +- dcbd was replaced with lldpad. + +------------------------------------------------------------------- +Wed Jun 22 14:12:55 UTC 2011 - mma...@novell.com + +- Add support for configuring multiple network interfaces + (fate#311345). + +------------------------------------------------------------------- Tue Jun 21 09:11:06 UTC 2011 - mma...@novell.com - purge-kernels: Change the variable to multiversion.kernels to @@ -248,6 +259,12 @@ - do not require sysvinit but the tools and sbin_init ------------------------------------------------------------------- +Fri Feb 19 10:30:01 CET 2010 - mma...@suse.cz + +- scripts/boot-network.sh: really fix net_delay handling + (bnc#575816). + +------------------------------------------------------------------- Wed Feb 17 13:33:55 CET 2010 - mma...@suse.cz - scripts/boot-mount.sh: Fix fsck progressbar (bnc#564325). @@ -360,6 +377,11 @@ list on input (sysconfig file or cmdline options) (bnc#551339) ------------------------------------------------------------------- +Wed Nov 11 13:14:08 CET 2009 - mci...@suse.cz + +- add a bridge to support fcoe and dcbd (fate#307444) + +------------------------------------------------------------------- Fri Oct 30 14:39:03 CET 2009 - mma...@suse.cz - restart mdmon before switching to the new root (fate#306823). @@ -403,6 +425,12 @@ (bnc#531252) ------------------------------------------------------------------- +Tue Oct 13 14:12:54 CEST 2009 - mvanc...@suse.cz + +- scripts/boot-network.sh: add "net_delay" kernel cmdline option + for kdump purposes (bnc#471943) + +------------------------------------------------------------------- Tue Oct 13 09:12:54 CEST 2009 - mvanc...@suse.cz - In case running kernel and kernel initrd is being build for are diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/sbin/mkinitrd new/mkinitrd-2.7.0/sbin/mkinitrd --- old/mkinitrd-2.7.0/sbin/mkinitrd 2011-06-21 11:13:33.000000000 +0200 +++ new/mkinitrd-2.7.0/sbin/mkinitrd 2011-06-22 17:28:22.000000000 +0200 @@ -29,7 +29,7 @@ LOGDIR=/var/log/YaST2 LOGFILE=$LOGDIR/mkinitrd.log declare -a cmd_option -declare cmd_option_name cmd_option_desc cmd_option_param cmd_param_desc cmd_param_name +declare cmd_option_name cmd_option_desc cmd_option_param cmd_param_desc cmd_param_name cmd_param_is_array shopt -s nullglob read_options_eval() { @@ -67,7 +67,13 @@ shift cmd_option_param="$*" IFS="$OLDIFS" - [ "$cmd_param_name" ] + if test "${cmd_param_name:0:1}" = "@"; then + cmd_param_name=${cmd_param_name:1} + cmd_param_is_array=true + else + cmd_param_is_array=false + fi + test -n "$cmd_param_name" } cmd_docmd() { @@ -294,7 +300,13 @@ exit 0 ;; *) if cmd_docmd $a; then - next_param && eval "$cmd_param_name='$OPTARG'" + if next_param; then + if $cmd_param_is_array; then + eval "$cmd_param_name=\"\$$cmd_param_name $OPTARG\"" + else + eval "$cmd_param_name='$OPTARG'" + fi + fi eval param_$a=1 else exit 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/boot-network.sh new/mkinitrd-2.7.0/scripts/boot-network.sh --- old/mkinitrd-2.7.0/scripts/boot-network.sh 2011-06-21 11:13:33.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/boot-network.sh 2011-06-22 17:28:22.000000000 +0200 @@ -17,13 +17,111 @@ ## dhcp=<device> if set runs dhcp on the given device (no dhcp if device is "off") ## ip=$ipaddr:$peeraddr:$gwaddr:$netmask:$hostname:$iface:$autoconf defines the ip configuration to use ## nfsaddrs an alias for "ip" +## net_delay=<seconds> additional delay after the network is set up ## # load the modules before detecting which device we are going to use load_modules -# mac address based config -if [ -n "$macaddress" ] ; then +configure_static() +{ + local ip=$1 + + /bin/ipconfig $ip + # dhcp information emulation + IPADDR="${ip%%:*}" + ip="${ip#*:}" # first entry => peeraddr + PEERADDR="${ip%%:*}" + ip="${ip#*:}" # first entry => gwaddr + GATEWAY="${ip%%:*}" + ip="${ip#*:}" # first entry => netmask + NETMASK="${ip%%:*}" + ip="${ip#*:}" # first entry => hostname + HOSTNAME="${ip%%:*}" + ip="${ip#*:}" # first entry => iface + INTERFACE="${ip%%:*}" + echo 'hosts: files dns' > /etc/nsswitch.conf +} + +configure_dynamic() +{ + local interface=$1 + + echo "running dhcpcd on interface $interface" + dhcpcd -R -Y -N -t 120 $interface + if [ -s /var/lib/dhcpcd/dhcpcd-$interface.info ] ; then + . /var/lib/dhcpcd/dhcpcd-$interface.info + else + echo "no response from dhcp server -- exiting to /bin/sh" + cd / + PATH=$PATH PS1='$ ' /bin/sh -i + fi + [ -e "/var/run/dhcpcd-$interface.pid" ] && kill -9 $(cat /var/run/dhcpcd-$interface.pid) + if [ -n "$DNS" ]; then + oifs="$IFS" + IFS="," + for ns in $DNS ; do + echo "nameserver $ns" >> /etc/resolv.conf + done + IFS="$oifs" + if [ -n "$DOMAIN" ]; then + echo "search $DOMAIN" >> /etc/resolv.conf + fi + echo 'hosts: files dns' > /etc/nsswitch.conf + elif [ -n "$DNSSERVERS" ]; then + oifs="$IFS" + IFS=" " + for ns in $DNSSERVERS ; do + echo "nameserver $ns" >> /etc/resolv.conf + done + IFS="$oifs" + if [ -n "$DNSDOMAIN" ]; then + echo "search $DNSDOMAIN" >> /etc/resolv.conf + fi + echo 'hosts: files dns' > /etc/nsswitch.conf + fi +} + +# configure_bonding iface "slaves:eth0 eth1~miimon:..." +configure_bonding() +{ + local iface=$1 config=$2 param value + local slaves slave mode miimon arp_interval arp_ip_target + + if test ! -d /sys/class/net/$iface; then + echo "+$iface" >/sys/class/net/bonding_masters + fi + ip link set $iface down + + local saveifs="$IFS" + local IFS='~' + set -- $config + for param; do + : "$param" + value=${param#*:} + case "$param" in + slaves:*) + slaves=(${value// /\~}) + ;; + *) + if test -n "$value"; then + echo "$value" >/sys/class/net/$iface/bonding/${param%%:*} + fi + esac + done + IFS="$saveifs" + + ip link set $iface up + for slave in "${slaves[@]}"; do + echo "+$slave" > /sys/class/net/$iface/bonding/slaves + done +} + + +macaddr2if() +{ + local macaddress=$1 tmpmac dev + for dev in /sys/class/net/* ; do # skip files that are no directories if ! [ -d $dev ] ; then @@ -32,126 +130,48 @@ read tmpmac < $dev/address if [ "$tmpmac" == "$macaddress" ] ; then - interface=${dev##*/} - echo "[NETWORK] using interface $interface" + echo ${dev##*/} + return fi done +} - if [ -n "$ip" ] ; then - nettype=${ip##*:} - ip=${ip%:*} - tmpip=${ip%:*} - ip="${tmpip}:${interface}:${nettype}" +i=0 +static_ips=($static_ips) +static=true +for macaddr in $static_macaddresses -- $dhcp_macaddresses; do + if test "x$macaddr" = "x--"; then + static=false + continue fi -fi - -if [ -n "$nfsaddrs" -a -z "$(get_param ip)" ]; then - ip=$nfsaddrs -fi - -if [ -n "$ip" -a ! "$(echo $ip | sed '/:/P;d')" ]; then - echo "[NETWORK] using dhcp on $interface based on ip=$ip" - nettype=dhcp -elif [ "${ip##*:}" = dhcp ]; then - nettype=dhcp - newinterface="${ip%*:dhcp}" - newinterface="${newinterface##*:}" - [ "$newinterface" != dhcp -a "$newinterface" ] && interface="$newinterface" - echo "[NETWORK] using dhcp on $interface based on ip=$ip" -fi + case "$macaddr" in + BONDING:*) + iface=${macaddr#*:} + var=bonding_$iface + configure_bonding "$iface" "${!var}" + ;; + *) + iface=$(macaddr2if "$macaddr") + esac -if [ -n "$(get_param dhcp)" -a "$(get_param dhcp)" != "off" ]; then - echo "[NETWORK] using dhcp based on dhcp=$dhcp" - interface=$(get_param dhcp) - nettype=dhcp -fi - -[ "$(get_param dhcp)" = "off" ] && nettype=static - -if [ -n "$ip" -a "$nettype" != "dhcp" ]; then - echo "[NETWORK] using static config based on ip=$ip" - nettype=static -fi + if $static; then + ip="${static_ips[i++]}" -if [[ "$drvlink" = *bonding* ]]; then - ip link set $interface down - echo "$miimon" > /sys/class/net/$interface/bonding/miimon - echo "$mode" > /sys/class/net/$interface/bonding/mode - ip link set $interface up - for address in $slave_macaddresses ; do - for dev in /sys/class/net/* ; do - if ! [ -d $dev ] ; then - continue - fi - read tmpmac < $dev/address - if [ "$tmpmac" == "$address" ] ; then - slave=${dev##*/} - echo "+$slave" > /sys/class/net/$interface/bonding/slaves - fi - done - done -fi + # the interface name in the ip config string can differ from the actual + # one, replace it + nettype=${ip##*:} + ip=${ip%:*} + tmpip=${ip%:*} + ip="${tmpip}:${iface}:${nettype}" -# dhcp based ip config -if [ "$nettype" = "dhcp" ]; then - # run dhcp - if [ "$interface" != "off" ]; then - echo "running dhcpcd on interface $interface" - dhcpcd -R -Y -N -t 120 $interface - if [ -s /var/lib/dhcpcd/dhcpcd-$interface.info ] ; then - . /var/lib/dhcpcd/dhcpcd-$interface.info - else - echo "no response from dhcp server -- exiting to /bin/sh" - cd / - PATH=$PATH PS1='$ ' /bin/sh -i - fi - [ -e "/var/run/dhcpcd-$interface.pid" ] && kill -9 $(cat /var/run/dhcpcd-$interface.pid) - if [ -n "$DNS" ]; then - oifs="$IFS" - IFS="," - for ns in $DNS ; do - echo "nameserver $ns" >> /etc/resolv.conf - done - IFS="$oifs" - if [ -n "$DOMAIN" ]; then - echo "search $DOMAIN" >> /etc/resolv.conf - fi - echo 'hosts: files dns' > /etc/nsswitch.conf - elif [ -n "$DNSSERVERS" ]; then - oifs="$IFS" - IFS=" " - for ns in $DNSSERVERS ; do - echo "nameserver $ns" >> /etc/resolv.conf - done - IFS="$oifs" - if [ -n "$DNSDOMAIN" ]; then - echo "search $DNSDOMAIN" >> /etc/resolv.conf - fi - echo 'hosts: files dns' > /etc/nsswitch.conf - fi + configure_static "$ip" + else + configure_dynamic "$iface" fi +done # static ip config -elif [ "$nettype" = "static" ]; then - # configure interface - if [ -n "$ip" ]; then - /bin/ipconfig $ip - # dhcp information emulation - IPADDR="${ip%%:*}" - ip="${ip#*:}" # first entry => peeraddr - PEERADDR="${ip%%:*}" - ip="${ip#*:}" # first entry => gwaddr - GATEWAY="${ip%%:*}" - ip="${ip#*:}" # first entry => netmask - NETMASK="${ip%%:*}" - ip="${ip#*:}" # first entry => hostname - HOSTNAME="${ip%%:*}" - ip="${ip#*:}" # first entry => iface - INTERFACE="${ip%%:*}" - fi - - echo 'hosts: files dns' > /etc/nsswitch.conf -elif [ "$nettype" = "ifup" ] ; then +if [ "$nettype" = "ifup" ] ; then for i in /etc/sysconfig/network/ifcfg-* ; do interface=${i##*/ifcfg-} [ -d /sys/class/net/$interface/device ] || continue @@ -160,3 +180,9 @@ done fi +if [ "0$(get_param net_delay)" -gt 0 ]; then + echo "[NETWORK] sleeping for $net_delay seconds." + sleep "$(get_param net_delay)" +fi + +# vim: et:sw=4:sts=4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/setup-network.sh new/mkinitrd-2.7.0/scripts/setup-network.sh --- old/mkinitrd-2.7.0/scripts/setup-network.sh 2011-06-21 11:13:33.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/setup-network.sh 2011-06-22 17:28:22.000000000 +0200 @@ -1,9 +1,9 @@ #!/bin/bash # #%stage: device -#%depends: iscsi nfs -#%param_D: "Run dhcp on the specified interface." interface interface -#%param_I: "Configure the specified interface statically." interface interface +#%depends: iscsi nfs lldpad fcoe +#%param_D: "Run dhcp on the specified interface." interface @dhcp_interfaces +#%param_I: "Configure the specified interface statically." interface @static_interfaces # # Calculate the netmask for a given prefix calc_netmask() { @@ -161,33 +161,33 @@ for addfeature in $ADDITIONAL_FEATURES; do if [ "$addfeature" = "network" ]; then - if [ -z "$interface" ] ; then + if test -z "$interface$static_interfaces$dhcp_interfaces"; then interface=default fi fi if [ "$addfeature" = "ifup" ] ; then nettype=ifup interface= + dhcp_interfaces= + static_interfaces= fi done ip= -interface=${interface#/dev/} -[ "$param_D" ] && nettype=dhcp -[ "$param_I" ] && nettype=static - # get the default interface if requested if [ "$interface" = "default" ]; then - ifspec=$(get_default_interface) - interface=${ifspec%%/*} - case "${ifspec##*/}" in - dhcp*) - nettype=dhcp - ;; - *) - nettype=static - ;; - esac + interface= + if -z "$static_interfaces$dhcp_interfaces"; then + ifspec=$(get_default_interface) + case "${ifspec##*/}" in + dhcp*) + dhcp_interfaces=${ifspec%%/*} + ;; + *) + static_interfaces=${ifspec%%/*} + ;; + esac + fi fi if [ "$create_monster_initrd" ]; then @@ -199,26 +199,47 @@ done fi -if [ -n "$interface" ] ; then - # Pull in network module - if [ -d /sys/class/net/$interface/device ] ; then - drvlink=$(get_network_module $interface) - read macaddress < /sys/class/net/$interface/address - elif [ -d /sys/class/net/$interface/bonding ] ; then - verbose "[NETWORK]\tConfigure bonding for $interface" - bonding_module=bonding - drvlink=bonding - mode=$(< /sys/class/net/$interface/bonding/mode) - miimon=$(< /sys/class/net/$interface/bonding/miimon) - slave_macaddresses=$(sed -ne 's/Permanent HW addr: \(.*\)/\1/p' /proc/net/bonding/$interface) +if test -n "$interface"; then + echo "XXX: \$interface still set (to $interface), should not happen." >&2 +fi - # include hardware modules for the slaves - for interf in $(< /sys/class/net/$interface/bonding/slaves) ; do +static=true +for iface in $static_interfaces -- $dhcp_interfaces; do + if test "x$iface" = "x--"; then + static=false + continue + fi + if [ -d /sys/class/net/$iface/device ] ; then + drvlink="$drvlink $(get_network_module $iface)" + read macaddress < /sys/class/net/$iface/address + if $static; then + static_macaddresses="$static_macaddresses $macaddress" + else + dhcp_macaddresses="$dhcp_macaddresses $macaddress" + fi + elif [ -d /sys/class/net/$iface/bonding ] ; then + verbose "[NETWORK]\tConfigure bonding for $iface" + bonding_module=bonding + drvlink="$drvlink bonding" + config= + for param in mode miimon arp_interval arp_ip_target; do + config="${config:+$config~}$param:$(< /sys/class/net/$iface/bonding/$param)" + done + slaves=$(< /sys/class/net/$iface/bonding/slaves) + for interf in $slaves; do + # include hardware modules for the slaves mod=$(get_network_module $interf) drvlink="$drvlink $mod" done + read bonding_$iface <<<"slaves:$slaves~$config" + save_var bonding_$iface + if $static; then + static_macaddresses="$static_macaddresses BONDING:$iface" + else + dhcp_macaddresses="$dhcp_macaddresses BONDING:$iface" + fi fi -fi +done # Copy ifcfg settings if [ "$nettype" = "ifup" ] ; then @@ -229,14 +250,14 @@ if [ -d /sys/class/net/$interface/device ] ; then mod=$(get_network_module $interface) drvlink="$drvlink $mod" - verbose "[NETWORK]\t$interface ($nettype)" + verbose "[NETWORK]\tifup: $interface" fi done interface= fi # Copy the /etc/resolv.conf when the IP is static -if [ "$interface" -a "$nettype" = "static" -a -f /etc/resolv.conf ] ; then +if test -n "$static_interfaces"; then verbose "[NETWORK]\tUsing /etc/resolv.conf from the system in the initrd" cp /etc/resolv.conf $tmp_mnt/etc fi @@ -246,9 +267,9 @@ cp /etc/hosts $tmp_mnt/etc # Get static IP configuration if requested -if [ "$interface" -a "$nettype" = "static" ] ; then - ip=$(get_ip_config $interface) -fi +for iface in $static_interfaces; do + static_ips="$static_ips $(get_ip_config $iface)" +done mkdir -p $tmp_mnt/var/lib/dhcpcd mkdir -p $tmp_mnt/var/run @@ -266,14 +287,14 @@ cp_bin /bin/touch $tmp_mnt/bin/touch fi -[ "$interface" ] && verbose "[NETWORK]\t$interface ($nettype)" +test -n "$static_interfaces" && verbose "[NETWORK]\tstatic: $static_interfaces" +test -n "$dhcp_interfaces" && verbose "[NETWORK]\tdynamic: $dhcp_interfaces" save_var nettype -save_var ip -save_var interface -save_var macaddress +save_var static_macaddresses +save_var static_ips +save_var dhcp_macaddresses save_var drvlink -save_var mode -save_var miimon -save_var slave_macaddresses save_var bonding_module + +# vim:sw=4:et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mkinitrd-2.7.0/scripts/setup-prepare.sh new/mkinitrd-2.7.0/scripts/setup-prepare.sh --- old/mkinitrd-2.7.0/scripts/setup-prepare.sh 2011-06-21 11:13:33.000000000 +0200 +++ new/mkinitrd-2.7.0/scripts/setup-prepare.sh 2011-06-22 17:28:22.000000000 +0200 @@ -1,7 +1,7 @@ #!/bin/bash # #%stage: setup -#%param_f: "Features to be enabled when generating initrd.\nAvailable features are:\niscsi, md, multipath, lvm, lvm2, ifup" "\"feature list\"" ADDITIONAL_FEATURES +#%param_f: "Features to be enabled when generating initrd.\nAvailable features are:\niscsi, md, multipath, lvm, lvm2, ifup, fcoe, lldpad" "\"feature list\"" ADDITIONAL_FEATURES #%param_k: "List of kernel images for which initrd files are created. Defaults to all kernels found in /boot." "\"kernel list\"" kernel_images #%param_i: "List of file names for the initrd; position have match to \"kernel list\". Defaults to all kernels found in /boot." "\"initrd list\"" initrd_images #%param_l: "mkinitrd directory. Defaults to /lib/mkinitrd." "\"lib_dir\"" INITRD_PATH ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org