@@ -1207,6 +1207,16 @@ END
preseed_hook_command($ho, 'late_command', $sfx, $cmds);
}
+ my $wantphysif= get_host_property($ho,'interface force','auto');
+ if ($wantphysif ne 'auto' && $ho->{Flags}{'force-mac-address'}) {
+ preseed_hook_command($ho, 'late_command', $sfx, <<END);
+#!/bin/sh
+set -ex
+
+sed -i 's/\\(iface\\s*$wantphysif\\s*inet.*\\)/\\1\\n hwaddress $ho->{Ether}/' /target/etc/network/interfaces
+END
+ }
+
if ( $ho->{Flags}{'need-uboot-bootscr'} ) {
my @bootargs = uboot_common_kernel_bootargs($ho);
ff9e0d8cbd generated a udev rule for setting the mac address. But that udev rule is not copied into the target so reboot after installation will fail. We can copy the udev rule to target system so the reboot after installation works, but then the generated udev rules will end up in initramfs, which means the guest (which uses host's initrd) will use the same rune to set conflicting mac address. Put the mac address in interfaces(5). We still need to keep the udev rule for the initrd overlay otherwise host installation will fail. Signed-off-by: Wei Liu <wei.liu2@citrix.com> --- Osstest/Debian.pm | 10 ++++++++++ 1 file changed, 10 insertions(+)