/[smeserver]/rpms/e-smith-base/sme9/e-smith-base-5.6.0-dummy_nic.patch
ViewVC logotype

Annotation of /rpms/e-smith-base/sme9/e-smith-base-5.6.0-dummy_nic.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Thu Jun 11 20:13:30 2015 UTC (9 years, 4 months ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-base-5_6_0-23_el6_sme, e-smith-base-5_6_0-34_el6_sme, e-smith-base-5_6_0-26_el6_sme, e-smith-base-5_6_0-36_el6_sme, e-smith-base-5_6_0-27_el6_sme, e-smith-base-5_6_0-30_el6_sme, e-smith-base-5_6_0-35_el6_sme, e-smith-base-5_6_0-20_el6_sme, e-smith-base-5_6_0-22_el6_sme, e-smith-base-5_6_0-29_el6_sme, e-smith-base-5_6_0-33_el6_sme, e-smith-base-5_6_0-25_el6_sme, e-smith-base-5_6_0-28_el6_sme, e-smith-base-5_6_0-32_el6_sme, e-smith-base-5_6_0-21_el6_sme, e-smith-base-5_6_0-31_el6_sme, e-smith-base-5_6_0-24_el6_sme, HEAD
* Thu Jun 11 2015 Daniel Berteaud <daniel@firewall-services.com> 5.6.0-20.sme
- Add dummy NIC support as InternalInterface [SME: 7200]

1 vip-ire 1.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     (

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed