Changeset 338f300 in rtems-libbsd


Ignore:
Timestamp:
Apr 25, 2018, 2:28:00 PM (13 months ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
b5f8d4831d66364b7391e3660560cb9bbecada2e, 31b5c87357cee83d6a3419c5d801a9bf16912714
Children:
a779a3b
Parents:
4eb2502
git-author:
Christian Mauderer <christian.mauderer@…> (04/25/18 14:28:00)
git-committer:
Christian Mauderer <christian.mauderer@…> (05/03/18 05:09:46)
Message:

buildset: Add minimal and everything config.

This adds two new buildset configurations: One that leaves out as much
features as possible and one that enables all features. For the default
configuration WiFi? support is now disabled.

To disable IPv6 for the minimal configuration, all -DINET6 are
eliminated in libbsd.py. They are now replaced by a #ifdef that checks
for RTEMS_BSD_MODULE_NETINET6 instead.

Close #3351.

Files:
2 added
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • builder.py

    r4eb2502 r338f300  
    187187    data = re.sub('#include <bsd.h>',      '#include <rtems/bsd/bsd.h>', data)
    188188    data = re.sub('#include <zerocopy.h>', '#include <rtems/bsd/zerocopy.h>', data)
     189    data = re.sub('#include <modules.h>',  '#include <rtems/bsd/modules.h>', data)
    189190    return data
    190191
  • buildset/default.ini

    r4eb2502 r338f300  
    11#
    2 # Default configuration.
     2# Default configuration. Contains most features except for some big or slow ones
     3# like WiFi or IPSec.
     4#
     5# At all developers: Please allways add all modules to this file and mark them
     6# as explicitly "off" if they are not used.
    37#
    48
     
    3135dev_usb_serial = on
    3236dev_usb_storage = on
    33 dev_usb_wlan = on
    34 dev_wlan_rtwn = on
     37dev_usb_wlan = off
     38dev_wlan_rtwn = off
    3539dhcpcd = on
    3640dpaa = on
     
    4448mmc_ti = on
    4549net = on
    46 net80211 = on
     50net80211 = off
    4751netinet = on
    4852netinet6 = on
     
    5458tty = on
    5559user_space = on
    56 user_space_wlanstats = on
     60user_space_wlanstats = off
    5761usr_sbin_tcpdump = on
    58 usr_sbin_wpa_supplicant = on
     62usr_sbin_wpa_supplicant = off
  • dhcpcd/config.h

    r4eb2502 r338f300  
    1515#include <stdint.h>
    1616#include "compat/pollts.h"
     17#include <rtems/bsd/local/opt_inet6.h>
    1718uint32_t arc4random(void);
    1819static inline int dhcpcd_flock(int a, int b) { return -1; }
  • dhcpcd/dhcp6.c

    r4eb2502 r338f300  
    2828/* TODO: We should decline dupliate addresses detected */
    2929
     30#ifdef __rtems__
     31#include <rtems/bsd/local/opt_inet6.h>
     32#endif /* __rtems__ */
     33#if defined(__rtems__) && defined(INET6)
    3034#include <sys/stat.h>
    3135#include <sys/utsname.h>
     
    28102814        return n;
    28112815}
     2816#endif /* defined(__rtems__) && defined(INET6) */
  • dhcpcd/ipv6.c

    r4eb2502 r338f300  
    2626 */
    2727
     28#ifdef __rtems__
     29#include <rtems/bsd/local/opt_inet6.h>
     30#endif /* __rtems__ */
     31#if defined(__rtems__) && defined(INET6)
    2832#include <sys/param.h>
    2933#include <sys/types.h>
     
    10461050        routes = nrs;
    10471051}
     1052#endif /* defined(__rtems__) && defined(INET6) */
  • dhcpcd/ipv6.h

    r4eb2502 r338f300  
    3232
    3333#include <netinet/in.h>
     34#ifdef __rtems__
     35#include <rtems/bsd/local/opt_inet6.h>
     36#endif /* __rtems__ */
    3437
    3538#define ALLROUTERS "ff02::2"
  • dhcpcd/ipv6nd.c

    r4eb2502 r338f300  
    2626 */
    2727
     28#ifdef __rtems__
     29#include <rtems/bsd/local/opt_inet6.h>
     30#endif /* __rtems__ */
     31#if defined(__rtems__) && defined(INET6)
    2832#include <sys/ioctl.h>
    2933#include <sys/param.h>
     
    18341838        return 0;
    18351839}
     1840#endif /* defined(__rtems__) && defined(INET6) */
  • dhcpcd/platform.h

    r4eb2502 r338f300  
    2828#ifndef PLATFORM_H
    2929#define PLATFORM_H
     30#ifdef __rtems__
     31#include <rtems/bsd/local/opt_inet6.h>
     32#endif /* __rtems__ */
    3033
    3134char *hardware_platform(void);
  • freebsd/lib/libc/rpc/rpcb_clnt.c

    r4eb2502 r338f300  
    3232
    3333/* #ident       "@(#)rpcb_clnt.c        1.27    94/04/24 SMI" */
    34 
    3534
    3635#if defined(LIBC_SCCS) && !defined(lint)
  • freebsd/sbin/ifconfig/ifconfig.c

    r4eb2502 r338f300  
    5555#include <machine/rtems-bsd-program.h>
    5656#include <machine/rtems-bsd-commands.h>
     57#include <rtems/bsd/modules.h>
    5758#endif /* __rtems__ */
    5859#include <sys/param.h>
     
    383384        group_ctor();
    384385        ifmedia_ctor();
     386#ifdef RTEMS_BSD_MODULE_IEEE80211
    385387        ieee80211_ctor();
     388#endif
     389#ifdef RTEMS_BSD_MODULE_NETINET6
    386390        inet6_ctor();
     391#endif
    387392        inet_ctor();
    388393        lagg_ctor();
  • freebsd/sbin/ping6/ping6.c

    r4eb2502 r338f300  
    7070 */
    7171
     72#if defined(__rtems__) && defined(INET6)
    7273#ifndef lint
    7374static const char copyright[] =
     
    28362837        exit(1);
    28372838}
     2839#endif /* defined(__rtems__) && defined(INET6) */
  • libbsd.py

    r4eb2502 r338f300  
    25622562                'lib/libc/db/recno/rec_utils.c',
    25632563            ],
    2564             mm.generator['source']('-D__DBINTERFACE_PRIVATE -DINET6')
     2564            mm.generator['source']('-D__DBINTERFACE_PRIVATE')
    25652565        )
    25662566        self.addRTEMSHeaderFiles(
     
    28052805                'usr.sbin/arp/arp.c',
    28062806            ],
    2807             mm.generator['source'](['-DINET6', '-DINET'])
     2807            mm.generator['source'](['-DINET'])
    28082808        )
    28092809
     
    28302830                'lib/libbsdstat/bsdstat.c',
    28312831            ],
    2832             mm.generator['source'](['-DINET6', '-DINET'])
     2832            mm.generator['source']([])
    28332833        )
    28342834
     
    38413841        cflags = ['-D__FreeBSD__=1',
    38423842                  '-DBSD=1',
    3843                   '-DINET6',
    38443843                  '-D_U_=__attribute__((unused))',
    38453844                  '-DHAVE_LIMITS_H=1',
     
    41524151            ],
    41534152            mm.generator['source'](['-D__FreeBSD__=1',
    4154                                     '-DINET6',
    41554153                                    '-D_U_=__attribute__((unused))',
    41564154                                    '-DHAVE_CONFIG_H=1',
     
    45594557                'dhcpcd/crypt/hmac_md5.c',
    45604558            ],
    4561             mm.generator['source']('-D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6')
     4559            mm.generator['source']('-D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET')
    45624560        )
    45634561        self.addRTEMSSourceFiles(
  • libbsd.txt

    r4eb2502 r338f300  
    120120The build system based on the Waf build system. To build with Waf please refer
    121121to the README.waf file.
     122
     123Note that the libbsd supports different buildsets. These can be selected with
     124the `--buildset=xxx.ini` option during the configure phase. Take a look at the
     125comments in `buildset/*.ini` to see which build sets are officially supported.
     126
     127You can also create and provide your own buildset configuration. But remember
     128that it's quite easy to break something by disabling the wrong modules. Only the
     129configurations in the `buildset` directory are officially maintained.
    122130
    123131===== Example Configuration for Network Tests =====
     
    11741182
    11751183The libbsd provides a basic support for WLAN. Note that currently this support
    1176 is still in an early state. The following gives a rough overview over the
    1177 necessary steps to connect to an encrypted network with an RTL8188EU based WiFi
    1178 dongle:
     1184is still in an early state. The WLAN support is _not_ enabled in the default
     1185buildset. You have to configure libbsd with the
     1186`--buildset=buildset/everything.ini` to enable that feature.
     1187
     1188The following gives a rough overview over the necessary steps to connect to an
     1189encrypted network with an RTL8188EU based WiFi dongle:
    11791190
    11801191- Reference all necessary module for your BSP. For some BSPs this is already
  • rtemsbsd/include/machine/rtems-bsd-user-space.h

    r4eb2502 r338f300  
    4343#define __FreeBSD__ 1
    4444
     45#include <rtems/bsd/local/opt_inet6.h>
    4546#include <machine/rtems-bsd-version.h>
    4647#include <sys/cdefs.h>
  • rtemsbsd/include/rtems/bsd/local/opt_inet6.h

    r4eb2502 r338f300  
    1 #define INET6 1
     1#include <rtems/bsd/modules.h>
     2#ifdef RTEMS_BSD_MODULE_NETINET6
     3  #define INET6 1
     4#endif
  • testsuite/commands01/test_main.c

    r4eb2502 r338f300  
    4141
    4242#include <rtems/libcsupport.h>
     43#include <rtems/bsd/modules.h>
    4344
    4445#define TEST_NAME "LIBBSD COMMANDS 1"
     
    109110                NULL
    110111        };
     112#ifdef RTEMS_BSD_MODULE_NETINET6
    111113        char *lo0_inet6[] = {
    112114                "ifconfig",
     
    118120                NULL
    119121        };
     122#endif /* RTEMS_BSD_MODULE_NETINET6 */
    120123        char *status[] = {
    121124                "ifconfig",
     
    124127                NULL
    125128        };
     129#ifdef RTEMS_BSD_MODULE_NETINET6
    126130        char *status_inet6[] = {
    127131                "ifconfig",
     
    130134                NULL
    131135        };
     136#endif /* RTEMS_BSD_MODULE_NETINET6 */
    132137
    133138        exit_code = rtems_bsd_command_ifconfig(ARGC(lo0), lo0);
    134139        assert(exit_code == EX_OK);
    135140
     141#ifdef RTEMS_BSD_MODULE_NETINET6
    136142        exit_code = rtems_bsd_command_ifconfig(ARGC(lo0_inet6), lo0_inet6);
    137143        assert(exit_code == EX_OK);
     144#endif /* RTEMS_BSD_MODULE_NETINET6 */
    138145
    139146        rtems_resource_snapshot_take(&snapshot);
     
    142149        assert(exit_code == EX_OK);
    143150
     151#ifdef RTEMS_BSD_MODULE_NETINET6
    144152        exit_code = rtems_bsd_command_ifconfig(ARGC(status_inet6), status_inet6);
    145153        assert(exit_code == EX_OK);
    146 
    147         rtems_resource_snapshot_take(&snapshot);
    148 
     154#endif /* RTEMS_BSD_MODULE_NETINET6 */
     155
     156        rtems_resource_snapshot_take(&snapshot);
     157
     158#ifdef RTEMS_BSD_MODULE_NETINET6
    149159        exit_code = rtems_bsd_command_ifconfig(ARGC(status_inet6), status_inet6);
    150160        assert(exit_code == EX_OK);
     161#endif /* RTEMS_BSD_MODULE_NETINET6 */
    151162
    152163        assert(rtems_resource_snapshot_check(&snapshot));
     
    196207test_ping6(void)
    197208{
     209#ifdef RTEMS_BSD_MODULE_NETINET6
    198210        rtems_resource_snapshot snapshot;
    199211        int exit_code;
     
    215227
    216228        assert(rtems_resource_snapshot_check(&snapshot));
     229#endif
    217230}
    218231
     
    261274test_wlanstats(void)
    262275{
     276#ifdef RTEMS_BSD_MODULE_USER_SPACE_WLANSTATS
    263277        rtems_resource_snapshot snapshot;
    264278        char *wlanstats[] = {
     
    272286        rtems_bsd_command_wlanstats(ARGC(wlanstats), wlanstats);
    273287        assert(rtems_resource_snapshot_check(&snapshot));
     288#endif /* RTEMS_BSD_MODULE_USER_SPACE_WLANSTATS */
    274289}
    275290
  • testsuite/include/rtems/bsd/test/default-network-init.h

    r4eb2502 r338f300  
    4848#include <rtems/stackchk.h>
    4949#include <rtems/bsd/bsd.h>
     50#include <rtems/bsd/modules.h>
    5051
    5152#if defined(DEFAULT_NETWORK_DHCPCD_ENABLE) && \
     
    328329#include <rtems/netcmds-config.h>
    329330
     331#ifdef RTEMS_BSD_MODULE_USER_SPACE_WLANSTATS
     332  #define SHELL_WLANSTATS_COMMAND &rtems_shell_WLANSTATS_Command,
     333#else
     334  #define SHELL_WLANSTATS_COMMAND
     335#endif
     336
     337#ifdef RTEMS_BSD_MODULE_USR_SBIN_WPA_SUPPLICANT
     338  #define SHELL_WPA_SUPPLICANT_COMMAND &rtems_shell_WPA_SUPPLICANT_Command,
     339#else
     340  #define SHELL_WPA_SUPPLICANT_COMMAND
     341#endif
     342
    330343#define CONFIGURE_SHELL_USER_COMMANDS \
     344  SHELL_WLANSTATS_COMMAND \
     345  SHELL_WPA_SUPPLICANT_COMMAND \
    331346  &bsp_interrupt_shell_command, \
    332347  &rtems_shell_ARP_Command, \
     
    338353  &rtems_shell_TCPDUMP_Command, \
    339354  &rtems_shell_SYSCTL_Command, \
    340   &rtems_shell_VMSTAT_Command, \
    341   &rtems_shell_WLANSTATS_Command, \
    342   &rtems_shell_WPA_SUPPLICANT_Command
     355  &rtems_shell_VMSTAT_Command
    343356
    344357#define CONFIGURE_SHELL_COMMAND_CPUINFO
  • testsuite/media01/test_main.c

    r4eb2502 r338f300  
    201201#include <rtems/netcmds-config.h>
    202202
     203#ifdef RTEMS_BSD_MODULE_USR_SBIN_WPA_SUPPLICANT
     204  #define SHELL_WPA_SUPPLICANT_COMMANDS \
     205    &rtems_shell_WPA_SUPPLICANT_Command, \
     206    &rtems_shell_WPA_SUPPLICANT_FORK_Command,
     207#else
     208  #define SHELL_WPA_SUPPLICANT_COMMANDS
     209#endif
     210
    203211#define CONFIGURE_SHELL_USER_COMMANDS \
     212  SHELL_WPA_SUPPLICANT_COMMANDS \
    204213  &bsp_interrupt_shell_command, \
    205214  &rtems_shell_ARP_Command, \
     
    210219  &rtems_shell_SYSCTL_Command, \
    211220  &rtems_shell_IFCONFIG_Command, \
    212   &rtems_shell_VMSTAT_Command, \
    213   &rtems_shell_WPA_SUPPLICANT_Command, \
    214   &rtems_shell_WPA_SUPPLICANT_FORK_Command
     221  &rtems_shell_VMSTAT_Command
    215222
    216223#define CONFIGURE_SHELL_COMMAND_CPUINFO
Note: See TracChangeset for help on using the changeset viewer.