From 680a09572eaae0bfb9f2ab1ea6f805f96c052864 Mon Sep 17 00:00:00 2001 From: mxi1 Date: Thu, 16 Dec 2010 09:36:17 +0000 Subject: [PATCH] the code to generate ifcfg-ethx files has been moved from rc.statelite to the enablekdump script git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8437 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../netboot/add-on/statelite/rc.statelite | 29 ------------------ xCAT/postscripts/enablekdump | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite index 5423ab814..470ac8227 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite @@ -518,35 +518,6 @@ ResolveLinks # make sure mtab points to the right place: /bin/ln -sf /proc/mounts ${TMPFS}/etc/mtab -# create /etc/sysconfig/network-scripts/ -for i in `/bin/cat /proc/cmdline`; do - KEY=`/bin/echo $i | /bin/awk -F= '{print $1}'` - if [ "$KEY" = "ifname" ]; then - ifname=`/bin/echo $i | /bin/awk -F= '{print $2}'` - MACX=${ifname#*:} - ETHX=${ifname%:$MACX*} - break - elif [ "$KEY" = "netdev" ]; then - ETHX=$netdev - MACX=`/sbin/ip link show $netdev | /bin/grep ether | /bin/awk '{print $2}'` - break - elif [ "$KEY" = "BOOTIF" ]; then - MACX=$BOOTIF - ETHX=`/sbin/ifconfig | /bin/grep -i $BOOTIF | /bin/awk '{print $1}'` - break - fi -done - -if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then - if [ ! -e $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX ]; then - /bin/touch $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX - fi - echo "DEVICE=$ETHX" > $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX - echo "BOOTPROTO=dhcp" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX - echo "HWADDR=$MACX" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX - echo "ONBOOT=yes" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX -fi - /bin/cat /etc/resolv.conf > $MNTDIR/etc/resolv.conf # catch all hack for debugging: diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 1445a2c47..d2e3f93ee 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -3,6 +3,36 @@ #(C)IBM Corp # +# create /etc/sysconfig/network-scripts/ +for i in `/bin/cat /proc/cmdline`; do + KEY=`/bin/echo $i | /bin/awk -F= '{print $1}'` + if [ "$KEY" = "ifname" ]; then + ifname=`/bin/echo $i | /bin/awk -F= '{print $2}'` + MACX=${ifname#*:} + ETHX=${ifname%:$MACX*} + break + elif [ "$KEY" = "netdev" ]; then + ETHX=$netdev + MACX=`/sbin/ip link show $netdev | /bin/grep ether | /bin/awk '{print $2}'` + break + elif [ "$KEY" = "BOOTIF" ]; then + MACX=$BOOTIF + ETHX=`/sbin/ifconfig | /bin/grep -i $BOOTIF | /bin/awk '{print $1}'` + break + fi +done + +if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then + if [ ! -e $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX ]; then + /bin/touch $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX + fi + echo "DEVICE=$ETHX" > $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX + echo "BOOTPROTO=dhcp" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX + echo "HWADDR=$MACX" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX + echo "ONBOOT=yes" >> $MNTDIR/etc/sysconfig/network-scripts/ifcfg-$ETHX +fi + + for i in `cat /proc/cmdline`; do KEY=`echo $i | awk -F= '{print $1}'` if [ "$KEY" = "dump" ]; then