From f9f1d61069140d531492730cf405fd78ff9d1404 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 1 May 2013 20:20:36 +0000 Subject: [PATCH] Have debian support support BOOTIF autodetection git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16153 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/debian.pm | 13 +++++++++++-- .../lib/debian-installer-startup.d/S91detectnic | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 xCAT-server/share/xcat/install/debian/initoverlay/lib/debian-installer-startup.d/S91detectnic diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index c6e5583d1..6aeab7d54 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -161,7 +161,16 @@ sub using_dracut return 0; } - +sub copyAndAddCustomizations { + my $source = shift; + my $dest = shift; + #first, it's simple, we copy... + copy($source,$dest); + #next, we apply xCAT customizations to enhance debian installer.. + chdir("$::XCATROOT/share/xcat/install/debian/initoverlay"); + system("find . |cpio -o -H newc | gzip -c - -9 >> $dest"); +} + sub copycd { xCAT::MsgUtils->message("S","Doing debian copycds"); @@ -720,7 +729,7 @@ sub mkinstall if ($docopy) { mkpath("$tftppath"); copy($kernpath,"$tftppath/vmlinuz"); - copy($initrdpath,"$tftppath/initrd.img"); + copyAndAddCustomizations($initrdpath,"$tftppath/initrd.img"); } #We have a shot... diff --git a/xCAT-server/share/xcat/install/debian/initoverlay/lib/debian-installer-startup.d/S91detectnic b/xCAT-server/share/xcat/install/debian/initoverlay/lib/debian-installer-startup.d/S91detectnic new file mode 100644 index 000000000..547fec517 --- /dev/null +++ b/xCAT-server/share/xcat/install/debian/initoverlay/lib/debian-installer-startup.d/S91detectnic @@ -0,0 +1,9 @@ +BOOTMAC=`sed -e s/.*BOOTIF=/BOOTIF=/ /proc/cmdline|cut -f 1` +if echo $BOOTMAC|grep BOOTIF= > /dev/null; then + BOOTMAC=`echo $BOOTMAC|sed -e s/BOOTIF=01-// -e s/-/:/g` + for dir in /sys/class/net/*; do + if grep -i $BOOTMAC $dir/address > /dev/null; then + debconf-set netcfg/choose_interface `basename $dir` + fi + done +fi