1 |
diff -Nur e-smith-base-5.6.0/root/etc/e-smith/events/actions/update-ifcfg e-smith-base-5.6.0_bz7200/root/etc/e-smith/events/actions/update-ifcfg |
2 |
--- e-smith-base-5.6.0/root/etc/e-smith/events/actions/update-ifcfg 2014-03-24 03:47:24.000000000 +0100 |
3 |
+++ e-smith-base-5.6.0_bz7200/root/etc/e-smith/events/actions/update-ifcfg 2015-06-11 22:12:27.443605697 +0200 |
4 |
@@ -5,9 +5,16 @@ |
5 |
use esmith::ethernet; |
6 |
use strict; |
7 |
|
8 |
+my $c = esmith::ConfigDB->open_ro() || |
9 |
+ die "Couldn't open ConfigDB"; |
10 |
+ |
11 |
my @adapters = split(/\n/, esmith::ethernet::probeAdapters()); |
12 |
my @nics = (); |
13 |
|
14 |
+if (($c->get('EthernetDriver1')->value || 'unknown') eq 'dummy'){ |
15 |
+ push @adapters, "dummy\tdummy\t10:00:01:02:03:04\tFake Network Interface\tdummy0"; |
16 |
+} |
17 |
+ |
18 |
# Expand templates for every adapters found |
19 |
foreach my $adapter (@adapters){ |
20 |
my (undef, undef, undef, undef, $nic) = split(/\t/, $adapter, 5); |
21 |
@@ -30,8 +37,6 @@ |
22 |
} |
23 |
|
24 |
# Build a list of interfaces for which we want to keep the config |
25 |
-my $c = esmith::ConfigDB->open_ro() || |
26 |
- die "Couldn't open ConfigDB"; |
27 |
foreach ($c->get_all_by_prop( type => 'interface')){ |
28 |
push @nics, $_->prop('Name'); |
29 |
} |
30 |
diff -Nur e-smith-base-5.6.0/root/etc/sysconfig/modules/dummy.modules e-smith-base-5.6.0_bz7200/root/etc/sysconfig/modules/dummy.modules |
31 |
--- e-smith-base-5.6.0/root/etc/sysconfig/modules/dummy.modules 1970-01-01 01:00:00.000000000 +0100 |
32 |
+++ e-smith-base-5.6.0_bz7200/root/etc/sysconfig/modules/dummy.modules 2015-06-11 21:46:25.972266957 +0200 |
33 |
@@ -0,0 +1,3 @@ |
34 |
+#!/bin/sh |
35 |
+/sbin/modprobe dummy |
36 |
+exec ip link set dummy0 address 10:00:01:02:03:04 |
37 |
diff -Nur e-smith-base-5.6.0/root/usr/share/perl5/vendor_perl/esmith/console/configure.pm e-smith-base-5.6.0_bz7200/root/usr/share/perl5/vendor_perl/esmith/console/configure.pm |
38 |
--- e-smith-base-5.6.0/root/usr/share/perl5/vendor_perl/esmith/console/configure.pm 2015-06-11 21:37:53.259394821 +0200 |
39 |
+++ e-smith-base-5.6.0_bz7200/root/usr/share/perl5/vendor_perl/esmith/console/configure.pm 2015-06-11 21:53:36.797092816 +0200 |
40 |
@@ -49,17 +49,17 @@ |
41 |
|
42 |
if (scalar @adapters == 1) |
43 |
{ |
44 |
- if ($ifName eq "external") |
45 |
+ if ($ifName eq "external" && $db->get_prop('InternalInterface', 'Name') ne 'dummy0') |
46 |
{ |
47 |
# We'll use a VLAN on eth0 for the "dedicated" WAN link |
48 |
$db->set_value("EthernetDriver2", "unknown"); |
49 |
return 'CHANGE'; |
50 |
} |
51 |
- # Internal, and there's only one |
52 |
- my (undef, $driver, $hwaddr, undef, $device) = split (/\t/, $adapters[0], 5); |
53 |
- $db->set_value("EthernetDriver1", $driver); |
54 |
- $db->set_prop("InternalInterface", "Name", $device); |
55 |
- return 'CHANGE'; |
56 |
+ else |
57 |
+ { |
58 |
+ # Add a dummy network interface, only valid for internal nic |
59 |
+ push @adapters, "dummy\tdummy\t10:00:01:02:03:04\tFake Network Interface\tdummy0"; |
60 |
+ } |
61 |
} |
62 |
|
63 |
my %tag2driver; |
64 |
@@ -105,6 +105,8 @@ |
65 |
$default ||= $tag; |
66 |
} |
67 |
} |
68 |
+ # Remove the dummy adapter from the list, it can't be used as external device |
69 |
+ pop @adapters if $adapters[1] =~ m/^dummy\tdummy/; |
70 |
|
71 |
#-------------------------------------------------------- |
72 |
# These are just to ensure that xgettext knows about the |
73 |
@@ -533,7 +535,7 @@ |
74 |
ETHERNET_EXTERNAL: |
75 |
#------------------------------------------------------------ |
76 |
{ |
77 |
- if (scalar @adapters == 1) |
78 |
+ if (scalar @adapters == 1 && $db->get_prop('InternalInterface', 'Name') ne 'dummy0') |
79 |
{ |
80 |
($rc, $choice) = $console->message_page |
81 |
( |