Explorar el Código

kernel: only strip proc for small flash devices

Currently, you are not able to get statistics about IPv4 and IPv6
usage. This information can be collected via the snmp and snmp6.
However, in the current state this interface is disabled as you can
read in the "902-debloat_proc.patch":
 "Strip non-essential /proc functionality to reduce code size"

Tools like netstat use the snmp/6 interface to collect interface
statistics. Some prometheus exporters also mention this:
- prometheus-collectors/netstat.lua
- prometheus-collectors/snmp6 (still a PR)
- collectd/snmp6 (still a PR)

PRs:
- https://github.com/collectd/collectd/pull/3789
- https://github.com/openwrt/packages/pull/14158

Instead of enabling it as default for all devices we condition it
 default y if SMALL_FLASH

A test shows it needs around 16 kiB.

Signed-off-by: Nick Hainke <[email protected]>
[fixed whitespace issue]
Signed-off-by: Petr Štetiar <[email protected]>
Nick Hainke hace 4 años
padre
commit
4943bc5cff
Se han modificado 2 ficheros con 5 adiciones y 2 borrados
  1. 5 1
      config/Config-kernel.in
  2. 0 1
      target/linux/generic/config-5.4

+ 5 - 1
config/Config-kernel.in

@@ -35,6 +35,10 @@ config KERNEL_SWAP
 	bool "Support for paging of anonymous memory (swap)"
 	default y if !SMALL_FLASH
 
+config KERNEL_PROC_STRIPPED
+	bool "Strip non-essential /proc functionality to reduce code size"
+	default y if SMALL_FLASH
+
 config KERNEL_DEBUG_FS
 	bool "Compile the kernel with debug filesystem enabled"
 	default y
@@ -376,7 +380,7 @@ config KERNEL_AIO
 config KERNEL_IO_URING
 	bool "Compile the kernel with io_uring support"
 	default y if !SMALL_FLASH
-	depends on LINUX_5_4 
+	depends on LINUX_5_4
 
 config KERNEL_FHANDLE
 	bool "Compile the kernel with support for fhandle syscalls"

+ 0 - 1
target/linux/generic/config-5.4

@@ -4123,7 +4123,6 @@ CONFIG_PRINT_STACK_DEPTH=64
 CONFIG_PROC_FS=y
 # CONFIG_PROC_KCORE is not set
 # CONFIG_PROC_PAGE_MONITOR is not set
-CONFIG_PROC_STRIPPED=y
 CONFIG_PROC_SYSCTL=y
 # CONFIG_PROC_VMCORE_DEVICE_DUMP is not set
 # CONFIG_PROFILE_ALL_BRANCHES is not set