Commit Graph
60 Commits
Author SHA1 Message Date
Joachim Wiberg 51f24b7765 board/common: initial /etc/mdev.conf from mdev-like-a-boss
- Support modprobe for hotplugged devices
 - Allow writable /dev/{null,zero,...} by all users
 - Correct TTY and console permissions
 - Adapt groups to Buildroot standard (Debian)

https://github.com/slashbeast/mdev-like-a-boss

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-24 08:06:07 +01:00
Joachim Wiberg fef42eb45b configs: switch from ifupdown2 to ifupdown-ng
- Replace ISC dhclient with dhcpcd => IPv4 link-local address
 - Enable openresolv to handle /etc/resolv.conf for us
 - iproute2 was a dependency of ifupdown2, but now we need to
   enable it explicitly
 - Ensure we have the same default system interface in infix
 - Reenable BusyBox applets disabled when enabling ifupdown2, for
   infix derivatives that may prefer a smaller base image.

Note: ifupdown-ng prefers dhcpcd over udhcpc, so no risk for conflict by
      reenabling udhcpc.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-19 18:09:26 +01:00
Joachim Wiberg 9018024ca9 Add support for generating GNS3 appliance file for amd64 builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-16 19:15:40 +01:00
Joachim Wiberg 2a89445570 board/common: default to show group 'iface' in show iface command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-16 19:15:40 +01:00
Joachim Wiberg 59a2abb203 board/common: include a default (empty) rc.local as example
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-16 19:15:40 +01:00
Joachim Wiberg 9cda32b4f5 board/common: bridge template for ifupdown2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-16 19:15:40 +01:00
Joachim Wiberg e514cf419d board/common: use swup to ensure port and iface groups exist
Used by the 'show' script for grouping and filtering Linux interfaces.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-16 19:15:40 +01:00
Joachim Wiberg bc21f93ec2 Add support for returning a device to factory defaults
This change adds a `factory` tool, and login shell, that schedules a
reset of all writable (overlay) filesystems.  The tool is set up with
the suid gid flag to allow all members of the wheel group to perform
the reset.

The login method only allows reset from /dev/console, to prevent any
malicious reset over SSH.  This should be further constrained later
when PAM is introduced.

To initiate factory reset from the login prompt, use login/pass:

    factory/reset

To initiate factory reset from the shell, call

    factory

Both methods are interactive by default, but two command line options
can be used to modify the behavior:

  -r  Skip reboot, and "reboot now?" question
  -y  Assume yes to all questions, for non-interactive use

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-04 15:24:36 +01:00
Joachim Wiberg ccba72b083 Add factory default, all switch ports in group VLAN 1 on br0
This change checks¹ if the system does not have a br0 interface, creates
a default one consisting of all switch ports in VLAN 1 of br0.

On top of br0 a vlan1 management interface is created with DHCP address.

For emulation and test purposes, a way to supply tap interfaces from
Qemu, and pass off as if they were regular switch ports, is added.
____
¹ obviously a better way to detect a factory-reset device is needed,
  not all systems running infix will need or want a br0 interface.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-03 18:25:18 +01:00
Joachim Wiberg ec3c6e245a show: drop auto-port classification
This should now be handled by the swup script at bootstrap instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-03 18:14:43 +01:00
Joachim Wiberg 7e56dec874 board/common: new ifduown2 dhcp policy
Do not wait for dhclient to acquire first release, this will cause
unnecessary delays when booting, and not provide any real value in our
system.  Because we will never have any service that depends on a
network address being set when starting up, this is a feature that
Finit can provide for us as a condition when starting such services.

Also, never set global "README" in multiple policy files, this will
cause ifupdown2 to crash in horrific ways.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-03 17:11:02 +01:00
Joachim Wiberg 50493740e4 board/common: new script swup
Probe for switch ports, classify, rename interfaces according to mactab

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-20 16:32:21 +01:00
Joachim Wiberg c3cf4a4d60 board/common: set local mgmt interface prefix policy for ifupdown2
The default policy for management interface prefix in ifupdown2 is
"eth", which currently clashes with Infix default switch port names.
Changing our naming policy of switch ports to "swpN", mimicing the
naming using in Cumulus Linux, would also help.  To be discussed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-16 11:29:32 +01:00
Joachim Wiberg d9841fbf3e board/common: override ifupdown2 addons.conf
We will not use features like batman, vxrd, or openvswitch.  Also, the
clagd and vxrd addons are not in ifupdown2, so likely proprietary ext.
by Cumulus.  Dropping them makes "unknown addon" warnings go away.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-16 11:27:22 +01:00
Joachim Wiberg ab6c156c89 board/common: add compat symlinks to ip command
Various scripts and tools search for the ip command in different
places.  Most distros install it to /bin/ip and symlink to /sbin
and /usr dito, but Buildroot only installs to /sbin/ip

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg 6829e0b72d Follow-up to e7d3a42: add noauto to cfgfs, optional feature atm
Unlike debugfs, cfgfs is currently an optional feature in Infix, so
let's set it to noauto for now.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg 3c02e4b675 board/common: silence runtime warnings from ifupdown2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg 989a81fdc9 Enable ifupdown2 for all platforms, replacing BusyBox ifup/ifdown
This change replaces the BusyBox ifup/ifdown applets with the full-blown
ifupdown2 package.  To get it fully working we also need to enable a few
missing kernel features: ipv4 + ipv6, multiple routing tables, and some
netfilter features.  We take the opportunity to sync kernel features in
between the two archs as well.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-13 17:34:19 +01:00
Tobias Waldekranz e7d3a42eec common: Mount configfs, if available 2022-12-12 16:07:25 +01:00
Joachim Wiberg c2c45026d0 show: add support for port classification and "show port NAME"
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-08 11:29:58 +01:00
Joachim Wiberg 8d9bd8ec09 Roll out final product branding
Change all inf/IX or Inf/IX to plain Infix after steering group meeting.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-05 21:09:05 +01:00
Joachim Wiberg 333f972d12 board/marvell: drop linux-extras, merged in aarch6/linux_defconfig
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-05 20:39:03 +01:00
Joachim Wiberg 5adb612dda board/aarch64: initial support for EspressoBIN
- Drop Cortex A72 in favor of more general A53 images
 - Enable device trees for all supported EspressoBIN models
 - Bump kernel to latest 6.0
 - Currently only starts from SD card, so add genimage to post-build
 - Create Ext2/4 disk image for SD card
 - Add infix-rw partition to sd-card image
 - The genimage tool needs genext2fs to create rw.ext4

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-26 17:05:26 +01:00
Tobias Waldekranz 9358a0f277 aarch64: Enable SMP support for SparX-5i
Upstream device trees specify regular PSCI support for SparX-5i, but
the U-Boot that Microchip ships does not actually support it.
Therefore, wrap the upstream version to disable PSCI and revert to
spin tables for SMP bringup.
2022-11-24 22:55:11 +01:00
Tobias Waldekranz a3ed770e1e aarch64: Add make target to flash U-Boot to the SparX-5i eval board 2022-11-24 22:55:11 +01:00
Joachim Wiberg 2a06a50687 amd64,aarch64: enable kernel watchdog driver support
- At least softdog should always be there
 - Add i6300esb driver for Qemu

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-23 14:41:23 +01:00
Tobias Waldekranz feb73e84ef doc: Unbricking instruction for SparX-5i eval board
For...you know...other people.
2022-11-22 15:33:25 +01:00
Joachim Wiberg 25205f0957 common: follow-up to 3cb7606, prevent host key regen on boot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-20 11:33:44 +01:00
Joachim Wiberg 0bdacbf59b common: add default /etc/issue
Preparing for the upcoming Finit v4.4 which takes system information
from /etc/os-release -- reduces branding efforts.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-20 11:33:44 +01:00
Joachim Wiberg a399bc1f88 motd logo too big, move to README for now
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-20 11:33:44 +01:00
Joachim Wiberg ceacc5a3dc common: add support for 'factory' to reset /rw/infix to defaults
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-19 12:36:43 +01:00
Joachim Wiberg 1d89526fac common: resize serial terminal on login
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-19 12:18:38 +01:00
Joachim Wiberg 8d0653b5e9 common: default Inf/IX message of the day
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-19 12:18:08 +01:00
Joachim Wiberg f5f4af380e common: colorize fdb/mdb and route show commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:54:37 +01:00
Joachim Wiberg 9ef2078758 common: standardize on 8 char (tab) indent for shell scripts
Like Buildroot

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:49:15 +01:00
Joachim Wiberg 138a4261a3 common: add 'show fdb' and 'show mdb' commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:48:20 +01:00
Joachim Wiberg 5355876821 common: source /etc/bash.bashrc to disable built-in help command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:44:22 +01:00
Joachim Wiberg 82bd7ea032 mkfit.sh: silent by default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:44:22 +01:00
Joachim Wiberg 8388c647bf common: add 'help' and 'show' commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:44:22 +01:00
Joachim Wiberg 71948c6c9b aarch64,amd64: enable IEC 62439-2 MRP bridge and userspace support
Set up bridge first:

    root@infix:~# ip link set dev eth0 up
    root@infix:~# ip link set dev eth1 up
    root@infix:~# ip link set dev eth2 up
    root@infix:~# ip link set dev eth3 up
    root@infix:~# ip link add name br0 type bridge
    root@infix:~# ip link set dev eth0 master br0
    root@infix:~# ip link set dev eth1 master br0
    root@infix:~# ip link set dev eth2 master br0
    root@infix:~# ip link set dev eth3 master br0

Start MRP server and add a configuration:

    root@infix:~# mrp_server &
    root@infix:~# mrp addmrp bridge br0 ring_nr 1 pport eth0 sport eth1 ring_role mrm
    root@infix:~# mrp addmrp bridge br0 ring_nr 2 pport eth2 sport eth3 ring_role mrm
    root@infix:~# mrp getmrp
    bridge: br0 ring_nr: 1 pport: eth0 sport: eth1 ring_role: MRM ring_state: CHK_RO
    bridge: br0 ring_nr: 2 pport: eth2 sport: eth3 ring_role: MRM ring_state: CHK_RC

Once all rings are set up:

    root@infix:~# ip link set dev br0 up

For more information, see:

 - https://github.com/microchip-ung/mrp
 - https://lwn.net/Articles/809089/

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:08:59 +01:00
Tobias Waldekranz dc9de06317 README: Add some basic documentation 2022-11-18 16:24:32 +01:00
Tobias Waldekranz 4948cfebff aarch64/sparx5: Add support for PCB135 (eMMC) board 2022-11-18 16:24:32 +01:00
Tobias Waldekranz cef9cd9e44 aarch64/kernel: Support SparX-5i 2022-11-18 16:24:32 +01:00
Joachim WibergandTobias Waldekranz 0d31903736 amd64: enable common rootfs overlay import Buildroot linux_defconfig
The Buildroot linux_defconfig doesn't have CONFIG_OVERLAY_FS, which we
need for our shared rootfs overlay.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Tobias Waldekranz b2befc4566 build: Optionally build an FIT image with all enabled DTBs 2022-11-17 20:26:53 +01:00
Tobias Waldekranz 7477f81d71 post-image: Remove old QEMU remnants
TODO: Restore x86_64 support
2022-11-17 20:16:38 +01:00
Tobias Waldekranz 5ec3817bf3 aarch64/sparx5: Add defconfig to build U-Boot for devboard 2022-11-17 16:05:20 +01:00
Tobias Waldekranz e2fbd55970 aarch64: Add kernel defconfig
Default to build CN9130 for now.
2022-11-16 20:29:48 +01:00
Tobias Waldekranz e8943b77cf rootfs: Disable mg backups by default 2022-11-16 20:28:41 +01:00
Tobias Waldekranz 1e326a1ce2 rootfs: Add ipaddr/iplink aliases to the default profile 2022-11-16 20:27:42 +01:00