[PATCH 3/3] buildset: Add minimal and everything config.

Christian Mauderer christian.mauderer at embedded-brains.de
Thu Apr 26 09:50:22 UTC 2018


Update #3351.
---
 buildset/default.ini                               | 16 ++++++++++------
 buildset/everything.ini                            | 15 +++++++++++++++
 buildset/minimal.ini                               | 22 ++++++++++++++++++++++
 buildset/sample.ini                                | 10 ----------
 freebsd/sbin/ifconfig/ifconfig.c                   |  5 +++++
 rtemsbsd/include/rtems/bsd/local/opt_inet6.h       |  5 ++++-
 testsuite/commands01/test_main.c                   |  3 +++
 .../include/rtems/bsd/test/default-network-init.h  | 19 ++++++++++++++++---
 testsuite/media01/test_main.c                      | 13 ++++++++++---
 9 files changed, 85 insertions(+), 23 deletions(-)
 create mode 100644 buildset/everything.ini
 create mode 100644 buildset/minimal.ini
 delete mode 100644 buildset/sample.ini

diff --git a/buildset/default.ini b/buildset/default.ini
index e58ea99f..a5cbdf9c 100644
--- a/buildset/default.ini
+++ b/buildset/default.ini
@@ -1,5 +1,9 @@
 #
-# Default configuration.
+# Default configuration. Contains most features except for some big or slow ones
+# like WiFi or IPSec.
+#
+# At all developers: Please allways add all modules to this file and mark them
+# as explicitly "off" if they are not used.
 #
 
 [general]
@@ -30,8 +34,8 @@ dev_usb_net = on
 dev_usb_quirk = on
 dev_usb_serial = on
 dev_usb_storage = on
-dev_usb_wlan = on
-dev_wlan_rtwn = on
+dev_usb_wlan = off
+dev_wlan_rtwn = off
 dhcpcd = on
 dpaa = on
 evdev = on
@@ -43,7 +47,7 @@ mghttpd = on
 mmc = on
 mmc_ti = on
 net = on
-net80211 = on
+net80211 = off
 netinet = on
 netinet6 = on
 opencrypto = on
@@ -53,6 +57,6 @@ rtems = on
 tests = on
 tty = on
 user_space = on
-user_space_wlanstats = on
+user_space_wlanstats = off
 usr_sbin_tcpdump = on
-usr_sbin_wpa_supplicant = on
+usr_sbin_wpa_supplicant = off
diff --git a/buildset/everything.ini b/buildset/everything.ini
new file mode 100644
index 00000000..0d9cc5fb
--- /dev/null
+++ b/buildset/everything.ini
@@ -0,0 +1,15 @@
+#
+# This configuration has the target to provide all features of libbsd even the
+# big and slow ones.
+#
+
+[general]
+name = everything
+extends = default.ini
+
+[modules]
+dev_usb_wlan = on
+dev_wlan_rtwn = on
+net80211 = on
+user_space_wlanstats = on
+usr_sbin_wpa_supplicant = on
diff --git a/buildset/minimal.ini b/buildset/minimal.ini
new file mode 100644
index 00000000..c5ad8214
--- /dev/null
+++ b/buildset/minimal.ini
@@ -0,0 +1,22 @@
+#
+# This configuration has the target to provide the smallest possible libbsd
+# during link time. It should disable everything that can be disabled without
+# loosing basic functionality. As a target, it should once only provide the
+# following functions:
+#
+# - basic IPv4 only networking
+# - basic USB support
+# - all device drivers that don't increase the application size without being
+#   explicitly linked in
+#
+# ATTENTION: This configuration will loose functionality in the future as soon
+# as it is possible to disable the functionality.
+#
+
+[general]
+name = minimal
+extends = default.ini
+
+[modules]
+crypto_openssl = off
+netinet6 = off
diff --git a/buildset/sample.ini b/buildset/sample.ini
deleted file mode 100644
index 5d73e2a5..00000000
--- a/buildset/sample.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Currently this is mostly a sample configuration.
-#
-
-[general]
-name = sample
-extends = default.ini
-
-[modules]
-dev_nic_broadcomm = off
diff --git a/freebsd/sbin/ifconfig/ifconfig.c b/freebsd/sbin/ifconfig/ifconfig.c
index 956a9dfe..b9ba236a 100644
--- a/freebsd/sbin/ifconfig/ifconfig.c
+++ b/freebsd/sbin/ifconfig/ifconfig.c
@@ -54,6 +54,7 @@ static const char rcsid[] =
 #undef option
 #include <machine/rtems-bsd-program.h>
 #include <machine/rtems-bsd-commands.h>
+#include <rtems/bsd/modules.h>
 #endif /* __rtems__ */
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -382,8 +383,12 @@ mainwrapper(int argc, char *argv[])
 	gre_ctor();
 	group_ctor();
 	ifmedia_ctor();
+#ifdef RTEMS_BSD_MODULE_IEEE80211
 	ieee80211_ctor();
+#endif
+#ifdef RTEMS_BSD_MODULE_NETINET6
 	inet6_ctor();
+#endif
 	inet_ctor();
 	lagg_ctor();
 	link_ctor();
diff --git a/rtemsbsd/include/rtems/bsd/local/opt_inet6.h b/rtemsbsd/include/rtems/bsd/local/opt_inet6.h
index 1aaf3a65..8a124cfd 100644
--- a/rtemsbsd/include/rtems/bsd/local/opt_inet6.h
+++ b/rtemsbsd/include/rtems/bsd/local/opt_inet6.h
@@ -1 +1,4 @@
-#define INET6 1
+#include <rtems/bsd/modules.h>
+#ifdef RTEMS_BSD_MODULE_NETINET6
+  #define INET6 1
+#endif
diff --git a/testsuite/commands01/test_main.c b/testsuite/commands01/test_main.c
index f0ddab50..4a543c2a 100644
--- a/testsuite/commands01/test_main.c
+++ b/testsuite/commands01/test_main.c
@@ -40,6 +40,7 @@
 #include <machine/rtems-bsd-commands.h>
 
 #include <rtems/libcsupport.h>
+#include <rtems/bsd/modules.h>
 
 #define TEST_NAME "LIBBSD COMMANDS 1"
 
@@ -260,6 +261,7 @@ test_netstat(void)
 static void
 test_wlanstats(void)
 {
+#ifdef RTEMS_BSD_MODULE_USER_SPACE_WLANSTATS
 	rtems_resource_snapshot snapshot;
 	char *wlanstats[] = {
 		"wlanstats",
@@ -271,6 +273,7 @@ test_wlanstats(void)
 	rtems_resource_snapshot_take(&snapshot);
 	rtems_bsd_command_wlanstats(ARGC(wlanstats), wlanstats);
 	assert(rtems_resource_snapshot_check(&snapshot));
+#endif /* RTEMS_BSD_MODULE_USER_SPACE_WLANSTATS */
 }
 
 static void
diff --git a/testsuite/include/rtems/bsd/test/default-network-init.h b/testsuite/include/rtems/bsd/test/default-network-init.h
index d6949b8b..322f7a69 100644
--- a/testsuite/include/rtems/bsd/test/default-network-init.h
+++ b/testsuite/include/rtems/bsd/test/default-network-init.h
@@ -47,6 +47,7 @@
 #include <rtems/printer.h>
 #include <rtems/stackchk.h>
 #include <rtems/bsd/bsd.h>
+#include <rtems/bsd/modules.h>
 
 #if defined(DEFAULT_NETWORK_DHCPCD_ENABLE) && \
     !defined(DEFAULT_NETWORK_NO_STATIC_IFCONFIG)
@@ -323,7 +324,21 @@ Init(rtems_task_argument arg)
 
 #include <rtems/netcmds-config.h>
 
+#ifdef RTEMS_BSD_MODULE_USER_SPACE_WLANSTATS
+  #define SHELL_WLANSTATS_COMMAND &rtems_shell_WLANSTATS_Command,
+#else
+  #define SHELL_WLANSTATS_COMMAND
+#endif
+
+#ifdef RTEMS_BSD_MODULE_USR_SBIN_WPA_SUPPLICANT
+  #define SHELL_WPA_SUPPLICANT_COMMAND &rtems_shell_WPA_SUPPLICANT_Command,
+#else
+  #define SHELL_WPA_SUPPLICANT_COMMAND
+#endif
+
 #define CONFIGURE_SHELL_USER_COMMANDS \
+  SHELL_WLANSTATS_COMMAND \
+  SHELL_WPA_SUPPLICANT_COMMAND \
   &bsp_interrupt_shell_command, \
   &rtems_shell_ARP_Command, \
   &rtems_shell_HOSTNAME_Command, \
@@ -333,9 +348,7 @@ Init(rtems_task_argument arg)
   &rtems_shell_IFCONFIG_Command, \
   &rtems_shell_TCPDUMP_Command, \
   &rtems_shell_SYSCTL_Command, \
-  &rtems_shell_VMSTAT_Command, \
-  &rtems_shell_WLANSTATS_Command, \
-  &rtems_shell_WPA_SUPPLICANT_Command
+  &rtems_shell_VMSTAT_Command
 
 #define CONFIGURE_SHELL_COMMAND_CPUINFO
 #define CONFIGURE_SHELL_COMMAND_CPUUSE
diff --git a/testsuite/media01/test_main.c b/testsuite/media01/test_main.c
index f929cba1..c9d902dc 100644
--- a/testsuite/media01/test_main.c
+++ b/testsuite/media01/test_main.c
@@ -200,7 +200,16 @@ early_initialization(void)
 
 #include <rtems/netcmds-config.h>
 
+#ifdef RTEMS_BSD_MODULE_USR_SBIN_WPA_SUPPLICANT
+  #define SHELL_WPA_SUPPLICANT_COMMANDS \
+    &rtems_shell_WPA_SUPPLICANT_Command, \
+    &rtems_shell_WPA_SUPPLICANT_FORK_Command,
+#else
+  #define SHELL_WPA_SUPPLICANT_COMMANDS
+#endif
+
 #define CONFIGURE_SHELL_USER_COMMANDS \
+  SHELL_WPA_SUPPLICANT_COMMANDS \
   &bsp_interrupt_shell_command, \
   &rtems_shell_ARP_Command, \
   &rtems_shell_HOSTNAME_Command, \
@@ -209,9 +218,7 @@ early_initialization(void)
   &rtems_shell_NETSTAT_Command, \
   &rtems_shell_SYSCTL_Command, \
   &rtems_shell_IFCONFIG_Command, \
-  &rtems_shell_VMSTAT_Command, \
-  &rtems_shell_WPA_SUPPLICANT_Command, \
-  &rtems_shell_WPA_SUPPLICANT_FORK_Command
+  &rtems_shell_VMSTAT_Command
 
 #define CONFIGURE_SHELL_COMMAND_CPUINFO
 #define CONFIGURE_SHELL_COMMAND_CPUUSE
-- 
2.13.6




More information about the devel mailing list