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