]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 29 Oct 2018 10:51:44 +0000 (10:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 29 Oct 2018 10:51:44 +0000 (10:51 +0000)
config/rootfiles/core/125/filelists/files
html/cgi-bin/hardwaregraphs.cgi
html/cgi-bin/media.cgi
html/cgi-bin/wlanap.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/hostapd
src/patches/hostapd/hostapd-2.6-noscan.patch [new file with mode: 0644]
src/scripts/makegraphs

index 26ac36080a49b4989bb75cf4d8edb0f9f00a8794..f2afb62fbf6597f1d613849002b2d97b56f6a260 100644 (file)
@@ -3,5 +3,8 @@ etc/issue
 etc/ssh/sshd_config
 etc/sysctl.conf
 srv/web/ipfire/cgi-bin/credits.cgi
+srv/web/ipfire/cgi-bin/hardwaregraphs.cgi
+srv/web/ipfire/cgi-bin/media.cgi
 srv/web/ipfire/cgi-bin/pakfire.cgi
+usr/local/bin/makegraphs
 var/ipfire/langs
index f5999c87ebee88e97faf0692de3134d2e033a4e0..e582acfb9181bcbc6ab5c7fabb03725062c1a086 100644 (file)
@@ -71,6 +71,10 @@ if ( $querry[0] =~ "hwtemp"){
        print "Content-type: image/png\n\n";
        binmode(STDOUT);
        &Graphs::updatehddgraph($querry[0],$querry[1]);
+}elsif ( $querry[0] =~ "nvme?" ){
+       print "Content-type: image/png\n\n";
+       binmode(STDOUT);
+       &Graphs::updatehddgraph($querry[0],$querry[1]);
 }else{
        &Header::showhttpheaders();
        &Header::openpage($Lang::tr{'hardware graphs'}, 1, '');
@@ -93,7 +97,7 @@ if ( $querry[0] =~ "hwtemp"){
                &General::writehash("${General::swroot}/sensors/settings", \%sensorsettings);
        }
 
-       my @disks = `ls -1 /sys/block | grep -E '^sd' | sort | uniq`;
+       my @disks = `ls -1 /sys/block | grep -E '^sd|^nvme' | sort | uniq`;
 
        foreach (@disks){
                my $disk = $_;
index 4c94d1c8dd8b3d6b4cf8bf111da885c109329e24..5753bc301dfdcb7a74e7c543e077a9c0b30e27ce 100644 (file)
@@ -45,9 +45,9 @@ my @querry = split(/\?/,$ENV{'QUERY_STRING'});
 $querry[0] = '' unless defined $querry[0];
 $querry[1] = 'hour' unless defined $querry[1];
 
-my @devices = `ls -1 /sys/block | grep -E '^sd|^mmcblk|^xvd|^vd|^md' | sort | uniq`;
+my @devices = `ls -1 /sys/block | grep -E '^sd|^mmcblk|^nvme|^xvd|^vd|^md' | sort | uniq`;
 
-if ( $querry[0] =~ "sd?" || $querry[0] =~ "mmcblk?" || $querry[0] =~ "xvd??" || $querry[0] =~ "vd?" || $querry[0] =~ "md*" ){
+if ( $querry[0] =~ "sd?" || $querry[0] =~ "mmcblk?" || $querry[0] =~ "nvme?n?" || $querry[0] =~ "xvd??" || $querry[0] =~ "vd?" || $querry[0] =~ "md*" ){
        print "Content-type: image/png\n\n";
        binmode(STDOUT);
        
index 0abbf6d6e71cc817635ef01a598fe05d11bbe6c0..72c9a129828fb845ddc654313854b57d85b3489c 100644 (file)
@@ -74,6 +74,7 @@ $wlanapsettings{'DEBUG'} = '4';
 $wlanapsettings{'DRIVER'} = 'NL80211';
 $wlanapsettings{'HTCAPS'} = '';
 $wlanapsettings{'VHTCAPS'} = '';
+$wlanapsettings{'NOSCAN'} = 'off';
 
 &General::readhash("/var/ipfire/wlanap/settings", \%wlanapsettings);
 &Header::getcgihash(\%wlanapsettings);
@@ -247,6 +248,10 @@ $checked{'HIDESSID'}{'off'} = '';
 $checked{'HIDESSID'}{'on'} = '';
 $checked{'HIDESSID'}{$wlanapsettings{'HIDESSID'}} = "checked='checked'";
 
+$checked{'NOSCAN'}{'off'} = '';
+$checked{'NOSCAN'}{'on'} = '';
+$checked{'NOSCAN'}{$wlanapsettings{'NOSCAN'}} = "checked='checked'";
+
 $selected{'ENC'}{$wlanapsettings{'ENC'}} = "selected='selected'";
 $selected{'CHANNEL'}{$wlanapsettings{'CHANNEL'}} = "selected='selected'";
 $selected{'COUNTRY'}{$wlanapsettings{'COUNTRY'}} = "selected='selected'";
@@ -415,6 +420,7 @@ END
 ;
 }
 print<<END
+<tr><td width='25%' class='base'>$Lang::tr{'wlanap neighbor scan'}:&nbsp;</td><td class='base' >on <input type='radio' name='NOSCAN' value='off' $checked{'NOSCAN'}{'off'} /> | <input type='radio' name='NOSCAN' value='on' $checked{'NOSCAN'}{'on'} /> off</td><td class='base' colspan='2'>$Lang::tr{'wlanap neighbor scan warning'}</td></tr>
 <tr><td colspan='4'><br></td></tr>
 <tr><td width='25%' class='base'>$Lang::tr{'wlanap encryption'}:&nbsp;</td><td class='base' colspan='3'>
        <select name='ENC'>
@@ -626,6 +632,20 @@ END
 
  }
 
+ if ( $wlanapsettings{'NOSCAN'} eq 'on' ){
+       print CONFIGFILE <<END
+noscan=1
+END
+;
+
+ }else{
+       print CONFIGFILE <<END
+noscan=0
+END
+;
+
+ }
+
  if ( $wlanapsettings{'ENC'} eq 'wpa1'){
        print CONFIGFILE <<END
 ######################### wpa hostapd configuration ############################
index c8d4c65e7ff0d23ea1d5751b63cbe0cda3a2d51b..42eb141037cc0acae68f33a6e1b3545709ebb800 100644 (file)
 'wlanap invalid wpa' => 'Ungültige Länge in WPA-Passphrase. Muss zwischen 8 und 63 Zeichen lang sein.',
 'wlanap link dhcp' => 'Wireless Lan DHCP-Einstellungen',
 'wlanap link wireless' => 'Wireless Lan Clients freischalten',
+'wlanap neighbor scan' => 'Nachbarschaftsscan',
+'wlanap neighbor scan warning' => 'Warnung! Deaktivierung kann gegen Funkregeln verstoßen.',
 'wlanap no interface' => 'Ausgewähltes Interface ist keine WLAN-Karte!',
 'wlanap none' => 'keine',
 'wlanap notifications' => 'Hinweise',
index b563e568520e61e2cf3bc2506c369ec3ef129744..e9356407ac58abfe48e5d82fd15e90c1de0621bc 100644 (file)
 'wlanap invalid wpa' => 'Invalid length in WPA Passphrase. Must be between 8 and 63 characters.',
 'wlanap link dhcp' => 'Wireless lan DHCP configuration',
 'wlanap link wireless' => 'Activate wireless lan clients',
+'wlanap neighbor scan' => 'Neighborhood scan',
+'wlanap neighbor scan warning' => 'Warning! Disabling may violate regulatory rules!',
 'wlanap no interface' => 'Selected interface is not a wirless lan card!',
 'wlanap none' => 'none',
 'wlanap notifications' => 'Notifications',
index 5a1180d03e7e693dfe479796b54b23cfde874b1a..a8302ccddbe6cad335de2f84bb5f8f636a1a07d8 100644 (file)
@@ -88,6 +88,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cd $(DIR_APP) && patch -p1 < $(DIR_SRC)/src/patches/wpa_supplicant/rebased-v2.6-0008-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
 
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/hostapd-2.3_increase_EAPOL-timeouts.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/hostapd/hostapd-2.6-noscan.patch
+
        cd $(DIR_APP)/hostapd && cp $(DIR_SRC)/config/hostapd/config ./.config
        cd $(DIR_APP)/hostapd && sed -e "s@/usr/local@/usr@g" -i Makefile
        cd $(DIR_APP)/hostapd && make $(MAKETUNING) $(EXTRA_MAKE)
diff --git a/src/patches/hostapd/hostapd-2.6-noscan.patch b/src/patches/hostapd/hostapd-2.6-noscan.patch
new file mode 100644 (file)
index 0000000..8009fa0
--- /dev/null
@@ -0,0 +1,62 @@
+diff -Naur hostapd-2.6.org/hostapd/config_file.c hostapd-2.6/hostapd/config_file.c
+--- hostapd-2.6.org/hostapd/config_file.c      2016-10-02 20:51:11.000000000 +0200
++++ hostapd-2.6/hostapd/config_file.c  2018-10-26 09:16:34.393456086 +0200
+@@ -2863,6 +2863,10 @@
+               }
+ #endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211N
++      } else if (os_strcmp(buf, "noscan") == 0) {
++              conf->noscan = atoi(pos);
++      } else if (os_strcmp(buf, "ht_coex") == 0) {
++              conf->no_ht_coex = !atoi(pos);
+       } else if (os_strcmp(buf, "ieee80211n") == 0) {
+               conf->ieee80211n = atoi(pos);
+       } else if (os_strcmp(buf, "ht_capab") == 0) {
+diff -Naur hostapd-2.6.org/src/ap/ap_config.h hostapd-2.6/src/ap/ap_config.h
+--- hostapd-2.6.org/src/ap/ap_config.h 2016-10-02 20:51:11.000000000 +0200
++++ hostapd-2.6/src/ap/ap_config.h     2018-10-26 09:16:34.393456086 +0200
+@@ -664,6 +664,8 @@
+       int ht_op_mode_fixed;
+       u16 ht_capab;
++      int noscan;
++      int no_ht_coex;
+       int ieee80211n;
+       int secondary_channel;
+       int no_pri_sec_switch;
+diff -Naur hostapd-2.6.org/src/ap/hw_features.c hostapd-2.6/src/ap/hw_features.c
+--- hostapd-2.6.org/src/ap/hw_features.c       2016-10-02 20:51:11.000000000 +0200
++++ hostapd-2.6/src/ap/hw_features.c   2018-10-26 09:16:34.393456086 +0200
+@@ -474,7 +474,8 @@
+       int ret;
+       /* Check that HT40 is used and PRI / SEC switch is allowed */
+-      if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch)
++      if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch ||
++              iface->conf->noscan)
+               return 0;
+       hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
+diff -Naur hostapd-2.6.org/src/ap/ieee802_11_ht.c hostapd-2.6/src/ap/ieee802_11_ht.c
+--- hostapd-2.6.org/src/ap/ieee802_11_ht.c     2016-10-02 20:51:11.000000000 +0200
++++ hostapd-2.6/src/ap/ieee802_11_ht.c 2018-10-26 09:17:42.976793198 +0200
+@@ -244,6 +244,9 @@
+       if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET))
+               return;
++      if (iface->conf->noscan || iface->conf->no_ht_coex)
++              return;
++
+       if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie))
+               return;
+@@ -368,6 +371,9 @@
+       if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
+               return;
++      if (iface->conf->noscan || iface->conf->no_ht_coex)
++              return;
++
+       wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
+                  " in Association Request", MAC2STR(sta->addr));
index 0b56b9325018e17123edb3382dcca5d42ab264ee..b91a70e3adf5a39e9589e788eeb011e592c3b34b 100644 (file)
@@ -85,10 +85,17 @@ sub updatehdddata{
                my $smart_output = '';
                system("$path_smartctl -iHA /dev/$disk > /var/run/smartctl_out_hddtemp-$disk");
                if ( -e "/var/run/smartctl_out_hddtemp-".$array[$#array] ){
-                       my $hdd_output = `cat /var/run/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
-                       my @t = split(/\s+/,$hdd_output);
-                       $temp = $t[9];
-               }else{$temp = 0;}
+                       my $hdd_nvme = `grep "NVMe Log" /var/run/smartctl_out_hddtemp-$array[$#array]`;
+                       if ( $hdd_nvme !~/NVMe Log/ ) {
+                               my $hdd_output = `cat /var/run/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
+                               my @t = split(/\s+/,$hdd_output);
+                               $temp = $t[9];
+                       } else {
+                               my $hdd_output = `cat /var/run/smartctl_out_hddtemp-$array[$#array] | grep Temperature:`;
+                               my @t = split(/\s+/,$hdd_output);
+                               $temp = $t[1];
+                       }
+               } else { $temp = 0; }
                print "Temperature for ".$array[$#array]."->".$temp."<-\n";
                # Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
                if ($temp){
@@ -102,7 +109,7 @@ sub updatehdddata{
 ## Update vnstat
 system ('/usr/bin/vnstat -u');
 
-my @disks = `ls -1 /sys/block | grep -E '^sd|^mmcblk|^xvd|^vd|^md' | sort | uniq`;
+my @disks = `ls -1 /sys/block | grep -E '^sd|^nvme|^mmcblk|^xvd|^vd|^md' | sort | uniq`;
 system("unlink /var/run/hddstatus 2>/dev/null && touch /var/run/hddstatus");
 foreach (@disks){
        my $disk = $_;