Compare commits

...
387 Commits
Author SHA1 Message Date
Tobias Waldekranz 747b211348 klinfix: Initial add
Infix integration of klish and klish-plugin-sysrepo.
2023-03-29 16:14:43 +02:00
Tobias Waldekranz d66dc16600 package/klish-plugin-sysrepo: Bump to latest master
This adds completion support for nodes nested under choice and case
nodes.
2023-03-29 11:32:09 +02:00
Joachim Wiberg 24a1eb542d src/confd: add support for enabling yang features
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 08:03:37 +02:00
Joachim Wiberg 708b756eba src/confd: minor, coding style
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 07:43:48 +02:00
Joachim Wiberg 3bbc5c49cd src/confd: derive YANG module search path from configure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 07:12:13 +02:00
Joachim Wiberg 41db19ffaa src/confd: import updated yang models from mech
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 06:22:27 +02:00
Joachim Wiberg 1907bd6a75 src/confd: adjust Denis' copyright year, last changed 2020
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 06:22:27 +02:00
Joachim Wiberg d1444b900a package/confd: allow klishd to run in NETCONF mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:53:55 +02:00
Joachim Wiberg 737f99e35e package/klish: make sure to enable libxml2 in configure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:53:41 +02:00
Tobias WaldekranzandJoachim Wiberg b549ddd88a package/klish-plugin-sysrepo: Add version 1.0.0
Adds a klish interface to local datastores managed by sysrepo.
2023-03-28 20:29:31 +02:00
Tobias WaldekranzandJoachim Wiberg 5d8e0ec123 package/klish: Add version 3.0.0
Extensible CLI application
2023-03-28 20:29:31 +02:00
Tobias WaldekranzandJoachim Wiberg fdfcac70eb package/faux: Add version 2.1.0
Used by the upcoming klish package
2023-03-28 20:29:31 +02:00
Joachim Wiberg 7a69c21e9d configs: change default NETCONF to use sysrepo instead of clixon
Extended evaluation of sysrepo due to problems parsing yang v1.1 models
with the built-in yang parser in Clixon.  Problems not seen with libyang

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00
Joachim Wiberg b1be357a41 package/confd: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00
Joachim Wiberg 767296e830 src/confd: port to sysrepo 2.x
Changes compared to original project:

 - installs into the sysrepo-plugind plugin directory, so no need
   for calling sysrepoctl to load the plugin
 - the plugin loads its yang module, so no need for calling sysrepoctl
   to load the module before starting sysrepo-plugind
 - bug fix ERROR() macro

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00
Joachim Wiberg 91d67e6b00 src/confd: import sysrepo ietf-system plugin by Denis Kalashnikov
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00
Joachim Wiberg 8e03114518 patches: add support for running sysrepo-plugind in the foreground
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00
Joachim Wiberg 546a2f3afb package/mech: relocate clixon system setup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00
Joachim Wiberg aa3d8945b9 buildroot: switch to (updated) sysrepo branch from kkit
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 13:37:45 +02:00
Joachim Wiberg d7b032cee7 .github: dispatch workflows manually from now on
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 15:53:35 +02:00
Joachim Wiberg f5a863df04 package/finit: bump for initctl -n additions (enable/disable)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 15:48:38 +02:00
Joachim Wiberg 0cfd0fcd89 package/skeleton-init-finit: add Frr pathd and vrrpd start scripts
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:38:17 +02:00
Joachim Wiberg 81c9398a19 doc: project goals and founding ideas
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:13:25 +02:00
Joachim Wiberg eed61988d1 doc: RESTCONF adventures, lab notes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:11:10 +02:00
Joachim Wiberg fe20f4a470 mech: new autocli commands, cut-and-paste from various examples
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:10:26 +02:00
Joachim Wiberg ac7b9073a5 mech: disable debug dumps of transactions by default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:08:27 +02:00
Joachim Wiberg aec2514eae mech: add support for ietf-syste:system/dns-resolver
This commit adds multi-nameserver support using openresolv (resolvconf)
and dnsmasq.  This means that a DHCP client (dhcpcd) or VPN client can
be providers of nameservers to the system.  Dnsmasq takes over as the
system resolver, except when the user has set up static configuration.

Static nameserver(s), as well as search and options, are always added
first by openresolv to /etc/resolv.conf.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:05:03 +02:00
Joachim Wiberg a5258d7102 mech: wrap system() as run(), returning WEXITSTATUS() or -1 on error
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:03:03 +02:00
Joachim Wiberg 4acaa170e4 mech: add support for ietf-system:set-current-datetime rpc
Also adds:
 - namespace validation
 - proper rpc operation lookup

Fixes:
 - ietf-system:system-shutdown (broken due do invalid op)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-24 01:50:36 +01:00
Joachim Wiberg 688c0ce2f7 mech: add support for ietf-system state data
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-24 01:50:36 +01:00
Joachim Wiberg 2ff4f869fa board/common: add ID_LIKE, BUILD_ID and ARCHITECTURE to /etc/os-release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-24 01:50:36 +01:00
Joachim Wiberg cdb68cb611 package/skeleton-init-finit: add remaining Frr daemons
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-24 01:50:36 +01:00
Joachim Wiberg 8cff15e215 package/skeleton-init-finit: drop stdout log redirection
lldpd already use syslog

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-24 01:50:31 +01:00
Joachim Wiberg b25a374409 mech: drop unused code
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-23 18:40:18 +01:00
Joachim Wiberg 35b0880e7b package/clixon: add clish alias and append to /etc/shells
Allow clixon_cli to be a login shell.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-23 15:00:15 +01:00
Joachim Wiberg 80f57d0809 Add Building section and ToC
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-23 14:51:49 +01:00
Joachim Wiberg 89d08338ce mech: initial support for ietf-interfaces state data
First example of how to implement supoort for ro/state-data.
Only oper-status and phys-address per interface currently.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-23 13:25:23 +01:00
Joachim Wiberg 2abb0a5eb9 mech: add support for setting interface description as ifalias
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-23 13:24:26 +01:00
Joachim Wiberg 4730f3fe09 mech: clean up developer logs in ietf-interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-23 13:23:54 +01:00
Joachim Wiberg ec7d72c4c5 package/finit: bump to latest snapshot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-22 09:43:41 +01:00
Joachim Wiberg cbc0374251 mech: add support for ietf-system:system-restart and system-shutdown
Shutdown depends on how the kernel is configured, on most embedded
systems this just means reboot.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 19:32:24 +01:00
Joachim Wiberg 2124f27d2c mech: initial support for ietf-interfaces and ietf-ip
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 17:40:39 +01:00
Joachim Wiberg 6df91143ba board/common: no need to clean up rc.local or /etc/network/*
In managed NETCONF mode /etc is always based on the image's read-only
/etc with a read-writable overlay as a RAM disk.  We control the image
and know the default rc.local is empty and the interfaces file only
list the loopback interface.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 17:38:38 +01:00
Tobias Waldekranz c74203720a mech: Compress empty yang containers in CLI
E.g. instead of: `set interfaces interface eth0`

We can now say: `set interface eth0`
2023-03-16 16:13:09 +01:00
Joachim Wiberg 74cf105512 mech: fix disabling chronyd when system ntp client is disabled
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 15:55:13 +01:00
Joachim Wiberg 0da4578362 board/common: allow lldpd to run by default in NETCONF mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 15:55:13 +01:00
Joachim Wiberg 24d2f28fb6 board/common: allow default auth:none restconf via nginx to clixon
- Only disable default services we don't need, prevents touching
   services mid-air in runlevel S.  Allow nginx now as well
 - Enable fcgi based RESTCONF interface via nginx by default
 - Enable auth:none for customer demo

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 15:55:13 +01:00
Tobias Waldekranz 3c6c2ec66d mech: Import ietf-{interface,ip} models 2023-03-16 15:48:38 +01:00
Tobias Waldekranz f7f6333b6f mech: Generate a tree representation of the YANG model
If pyang is available, generate texual and HTML representations of the
system's YANG model.
2023-03-16 15:48:38 +01:00
Joachim Wiberg 4e46b60b6f mech: deviation /sys:system/clock/timezone-utc-offset not-supported
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 08:26:21 +01:00
Joachim Wiberg 0185efeb3f mech: add support for setting timezone, e.g. Europe/Stockholm
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 08:00:40 +01:00
Joachim Wiberg f0e659c185 chrony: does not support SIGHUP, requires /var/lib/chrony
Chrony drops privs after startup to user chrony, when restarting it
writes its state in /var/lib/chrony, so the directory needs to have
the correct permissions for that user.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 07:26:40 +01:00
Joachim Wiberg 4ca2e2d8c4 mech: initial support for ietf-system ntp using chrony
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 07:26:40 +01:00
Joachim Wiberg 79f4baf519 board/common: enable syslog LOG_DEBUG messages to /var/log/debug
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 06:37:56 +01:00
Joachim Wiberg fa45015140 mech: debug transactions
For observability. All transactions that reach ietf-system are logged
with LOG_DEBUG log level.  See /var/log/debug for details.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 06:37:56 +01:00
Joachim Wiberg 17424a140f mech: ensure clixon_backend always use syslog backend
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 06:37:56 +01:00
Joachim Wiberg d130011f96 mech: common convenience library, currently only XML debug fns
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 06:37:56 +01:00
Joachim Wiberg d01617a79e board/amd64: enable RTC subsystem
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 06:37:56 +01:00
Joachim Wiberg 00daab72fc package/mech: start clixon_backend as 'clixon', redirect stdout/err
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 20:32:38 +01:00
Joachim Wiberg 90b4a739b5 mech: always run initctl in batch mode when in non-interactive mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 20:31:50 +01:00
Joachim Wiberg 28b6cecb73 package/clixon: bump to 6.1.0+kkit
Tracking kkit branch (clixon 6.1+) w/a for issue #334.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 17:05:21 +01:00
Joachim Wiberg 48f819b315 package/cligen: bump to v6.1.0
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 17:05:00 +01:00
Joachim Wiberg e9b252b514 buildroot: bump to 2023.02 LTS
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 16:07:15 +01:00
Joachim Wiberg 060af92a29 package/clixon: /var/clixon is a directory
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:38:08 +01:00
Joachim Wiberg 7a4fe98a3e mech: remember hard-coded strings
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg f43b31b1f5 mech: system headers before clixon, skip sys/ prefix
The canonical location for syslog.h is in the root.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 1aac798041 mech: must specify model revision
Found when debugging output from "show state", which displayed NULL for
the infix model.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 77f6d5e82e mech: use same pager as Clixon by default
Add configurable pager support to Clixon later.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg cc5453bfbd mech: use new 'show -n' to skip shell user's help notice
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 3c4ff8cabb board/common: add 'show -n' for no footer output
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 6fec738628 board/common: make sure to enable clixon_backend in NETCONF mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 6a591ddd5a mech: use NOTICE file and spdx format for Apache 2.0 license
Recommendations on how to apply the Apache 2.0 license to a project from
https://www.linkedin.com/pulse/how-apply-apache-20-license-your-open-source-software-vladimír-gorej/

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg d8d761bfa4 mech: change license to Apache v2.0, same as Clixon package
To facilitate linking and circumvent any possible legal problems.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 2f7dbe110a src/mech: add some basic 'show' commands
- Example of optional args (show log [FILE])
 - Example of dynamic expansion
 - Example of how to re-enable signals for external commands
 - Example of hidden commands
 - Add basic 'help' command for the current level

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 9041c54dbd README: mention Clixon and add Qeneth as alternative to GNS3
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 9f74bac06c README: fix footnote link
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Joachim Wiberg 70a393ec99 package/mech: minor, for Buildroot conformance
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-14 09:06:22 +01:00
Tobias Waldekranz 77d94e0ffd doc: Expand boot procedure documentation
Provide more details on the boot procedure, different image types
used, how to configure the bootloader, and how to perform system
upgrades.
2023-03-13 23:20:01 +01:00
Tobias Waldekranz 19672fcc58 rauc: Initial support
Add support for firmware updates via RAUC on aarch64. The created RAUC
bundle (images/infix-$BR2_ARCH.pkg) is signed with the same key used
to sign the raw FIT image.
2023-03-13 14:46:37 +01:00
Tobias Waldekranz e7112ca0c9 qemu: Support mounting host filesystem inside guest
This is mounted at /mnt/host in the guest. By default the images
directory is mounted.
2023-03-13 13:53:12 +01:00
Tobias Waldekranz 162f019574 aarch64: Remove U-Boot envimage generation from defconfig
This created a circular dependency that caused the build to fail. This
is now handled by the mkdisk.sh script instead.
2023-03-13 10:21:08 +01:00
Tobias Waldekranz bf240e0d89 amd64: Update GNS3 appliance generation to use the disk image
The appliance now uses the same QEMU setup as when using `make run`
with OVMF loader.
2023-03-13 09:57:04 +01:00
Tobias Waldekranz 6cc26307b7 common: Mark output from Infix shell scripts similarly to Make
Similarly to how $(call IXMSG,"hello world") outputs a blue
information line from a makefile, provide `ixmsg` to accomplish the
same thing in shell scripts.

Use a different prefix (`#!:` vs `>>>`) to differentiate it from
makefile output.
2023-03-13 09:57:04 +01:00
Tobias Waldekranz d777d59ee2 common: Prettify output from Infix extensions to the build system
This makes it easier to spot where we've added things (that might not
work :))
2023-03-13 09:57:04 +01:00
Tobias Waldekranz 3c720892dc aarch64: Cleanup unused stuff from defconfig
Config options are now loaded internally by the post-image script.

We never use the EXT image for anything.
2023-03-13 09:57:04 +01:00
Tobias Waldekranz f3304a6539 common: Unify disk image generation across aarch64 and amd64
On amd64, we use grub instead of U-Boot, because yours truly can't
figure out how to handle ACPI handover to the kernel.

The resulting image is now called disk.img instead of the old mmc.img,
since we can use it over any interface (e.g. virtio or SCSI).
2023-03-13 09:57:03 +01:00
Tobias Waldekranz 515d9f6e84 config: Replace $() with ${}
This lets us source .config from shell scripts
2023-03-13 09:56:37 +01:00
Tobias Waldekranz 96af542d40 qemu: Consolidate DTB extension handling in qemu.sh 2023-03-13 09:55:16 +01:00
Tobias Waldekranz e9adde4100 qemu: Add option to start with UEFI instead of BIOS 2023-03-13 09:55:16 +01:00
Tobias Waldekranz 81f0276a31 qemu: Remove redundant enabling of KVM 2023-03-13 09:55:16 +01:00
Tobias Waldekranz 7ba2e0a0b1 qemu: Always use disk images when using U-Boot
The U-Boot scripts won't accept a raw squash.
2023-03-13 09:55:16 +01:00
Tobias Waldekranz d1607cc2f3 doc: Document boot process and image formats 2023-03-13 09:55:16 +01:00
Tobias Waldekranz 9869c1a290 common: uboot: Update environment to new disk layout
- Adapt boot scripts to exepect the split FIT header/SquashFS image
  layout.

- Make sure that we can boot from any kind of block device (most
  importantly virtio for GNS3).

- Rename net -> dhcp as we might have more kinds of netboots in the
  future (http).
2023-03-13 09:55:16 +01:00
Tobias Waldekranz 8296a98e61 common: Use plain SquashFS images on disk
Store FIT headers separately on aux, and place the raw SquashFS images
on primary/secondary. This removes the need to muck about with the
device mapper to setup the rootfs, and it allows us to boot using
syslinux files.
2023-03-13 09:55:16 +01:00
Joachim Wiberg c328c41eff package/profeth: document QEMU_NET_TAP_N=10 requirement
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-09 07:21:50 +01:00
Joachim Wiberg 6c1a53ffdb package/skeleton-init-finit: add missing /etc/sysctl.d directory
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-09 07:17:21 +01:00
Joachim Wiberg 597207b7dd profeth: drop copy of p-net headers, use library headers instead
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-09 06:58:46 +01:00
Joachim Wiberg 67727e3050 configs: enable PROFINET support in default builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-09 05:58:09 +01:00
Joachim Wiberg 8eb879c8b2 board/amd64: enable E1000 ethernet nic support for Qemu
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-09 05:58:09 +01:00
Joachim Wiberg f8738de608 package/skeletin-init/finit: per-package tmpfiles.d directory
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-09 05:58:09 +01:00
Joachim Wiberg 2f0b2e113e package/skeleton-init-finit: update lldpd configuration
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-09 05:58:09 +01:00
Joachim Wiberg 0f38ac54f8 src/profeth: add submodules for all ports, matching the GSD file
These changes allow profeth to pass the Automatic RT Tester's first
behavior tests: Scenario 1-9.

 - Explorative changes to the GSD file to appease the conformance tool
 - Fix mismatch in installed submodules vs advertised ports in GSD file

Note: changes in GSD file only match the amd64 virtual build.  Must be
      updated for the final product.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-09 05:58:09 +01:00
Joachim Wiberg 25db613398 Refactor boot mode handling
With the recent `if:<cond>` addition to Finit we can simplify a lot of
the logic for disabling and enabling features in Infix.  Standardizing
on conditions that Finit provides.

We create boot/netconf, boot/etc, and boot/profinet conditions early,
after all filesystems have been mounted (and cleaned), so they are all
set before Finit loads its configuration files in runlevel S.

The default is still to boot into a managed NETCONF mode, since the end
goal remains to integrate PROFINET as yet another service.  The other
mode, native /etc, should then be the only exception.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-08 20:02:03 +01:00
Joachim Wiberg 81212e12f1 package/profeth: persistent data in /var/lib, syslog.conf
Split tmpfiles config in two, one for snmpd and one for profeth.
Add logging and redirect profeth logs to /log/profinet.log with
default log rotation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-08 20:02:03 +01:00
Joachim Wiberg f8670f7150 package/p-net: increase log level slightly Fatal -> Info
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-08 20:01:55 +01:00
Joachim Wiberg 917633f439 mech: create the /run/clixon directory at boot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-08 18:40:25 +01:00
Joachim Wiberg e94b4de865 rootfs: add handy /log shortcut to /var/log
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-08 18:39:23 +01:00
Joachim Wiberg 5045c6e6ba utils: use same IP subnet as PROFINET Automated RT Tester
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-08 17:05:37 +01:00
Joachim Wiberg f41846fab4 src/profeth: use RT-Labs VendorID and DeviceID for now
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 15:08:20 +01:00
Joachim Wiberg 4942a53483 package/profeth: add set_network_parameters script
Allow profeth to set IP address, netmask and gateway on PROFINET set.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 15:08:09 +01:00
Joachim Wiberg 06599d2097 package/finit: bump for next snapshot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:54:00 +01:00
Joachim Wiberg 5ddbb2cf55 utils: helper script for briding a Qemu instance with the real world
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg 7cf945af5b board/common: add PROFINET boot mode, compliments native /etc
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg 6c7d945e8b profeth: use /var/run/agentx/master socket instead of default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg bb62d58b17 profeth: branding
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg c0c087e719 src/profeth: fix system IP address/netmask and gateway query
Replace the old p-net API for querying the interface address, netmask
and gateway with the new ones that use getifaddrs() and inspect the
kernel routing table.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg e33f191d07 package/profeth: add support for starting and monitoring PROFINET
An Infix build with PROFINET gears Net-SNMP heavily towards acting as a
servant to profeth (p-net stack).  This will be hard-coded for now until
we've integrated it all better in Clixon.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg d572bc78f3 package/skeleton-init-finit: add support for monitoring net-snmp
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg 5a003c40c3 package/skeleton-init-finit: add env file to mini-snmpd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg e3adc8a6e4 src/profeth: add GPLv3 license and basic README
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg 221cc0b1f6 mech: move Finit service .conf to package and add conditions
The new if: conditions require latest Finit master, unreleased v4.4

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg 90a1fd99ec board/common: ensure cache directory for nginx is created at boot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg 80b23566b5 board/common: use same method to determine operating mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg 281183755b qemu: replace -nic with -netdev to get >8 NICs, fix MAC calculation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Tobias WaldekranzandJoachim Wiberg 5a441252f8 profeth: Initial add 2023-03-06 10:50:58 +01:00
Tobias WaldekranzandJoachim Wiberg 23a25147cc package/p-net: new package
Use ael fork with not-yet upstreamed fixes for now.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:51 +01:00
Joachim Wiberg 04e646ab40 qemu: default to 256M RAM for both targets
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-28 14:47:56 +01:00
Joachim Wiberg 7537e7e263 package/clixon: prevent host install from stripping .so files
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-28 11:34:59 +01:00
Joachim Wiberg bc7b366c85 package/cligen: prevent host install from stripping .so files
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-28 11:34:55 +01:00
Joachim Wiberg 046b15fbc0 common: separate handling of aarch64 and amd64 images, for now
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-28 11:33:35 +01:00
Joachim Wiberg 759f8aa589 aarch64: add missing $BR2_ARCH arg to post-image.sh
Needed by sign.sh when creating the image.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-28 11:33:08 +01:00
Tobias WaldekranzandJoachim Wiberg d8c529a2a7 common: Make U-Boot's auxiliary environment accessable from Infix
This is not the full environment used by U-Boot, just the bits needed
for U-Boot to know which slot to boot and for Infix to know how the
boot process went.

U-Boot will selectively import/export only these keys during boot,
which avoids a malicious user from altering the boot in a way that
might bypass signature validation.
2023-02-28 11:01:04 +01:00
Tobias WaldekranzandJoachim Wiberg dd8bcca180 common: Generate a new dev cert with a distant expiry date
100 years ought to be enough for everyone.
2023-02-28 11:00:15 +01:00
Tobias WaldekranzandJoachim Wiberg d4432b72dd common: uboot: Add missing blkmap patches
The blkmap patches were not included in the original U-Boot Secure
Boot changeset.

Fixes: d243c80 ("aarch64: Convenience target to configure a QEMU compatible U-Boot")
2023-02-28 11:00:15 +01:00
Tobias WaldekranzandJoachim Wiberg 07dd863fb9 common: Remove remnants of old separate FIT-header-PoC
Now that the uncut FIT is stored in primary/secondary, we don't create
any FIT header files.

Fixes: 499a8f7 ("common: Create (e)MMC image with redundant root filesystems")
2023-02-28 11:00:15 +01:00
Joachim Wiberg c94c360d4a configs: sync aarch64 with amd64 to get Clixon, Frr, nginx, etc.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-28 10:49:27 +01:00
Joachim Wiberg 513316f19e configs: drop qemu tap settings, default should bet user
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-27 15:56:38 +01:00
Joachim Wiberg 47c39c311f Basic User Guide for the Open Source base
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-24 20:08:34 +01:00
Joachim Wiberg 48a64a39f2 amd64,aarch64: disable udev hwdb, not needed currently
Saves 18 MiB from /etc

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-23 09:41:38 +01:00
Joachim Wiberg 0c07f10062 board/amd64: minor fixups to isolinux.cfg
- Drop unused com32 modules
 - Fix duplicate prompt output (serial not needed)
 - Reduce timeout before booting default to 0.5 sec
 - UI or DEFAULT must be set, otherwise isolinux complains
   so replace ONTIMEOUT with DEFAULT
 - Increase user-walked-away timeout to 5 minutes
 - Always show the prompt

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-23 09:37:40 +01:00
Joachim Wiberg f2dd7430a7 package/finit: bump for next snapshot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-22 20:00:04 +01:00
Joachim Wiberg fc6a793269 configs/amd64_defconfig: simplify syslinux, drop graphical menu
Not required and often just looks garbled, better to drop it for now.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-22 18:56:28 +01:00
Joachim Wiberg c098629ce9 mkgns3a.sh: increase node ram even more, we need 512 MiB (!) to run
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-22 18:53:30 +01:00
Joachim Wiberg 384ef8c189 package/skeleton-init-finit: fix regression introduced in aee7fb9
On rebuild (without distclean) the getty.conf contained two tty lines
for the same TTY, causing Finit to believe the command line args had
been changed between each reload -- and thus kicking out the logged
in console user who just typed `initctl reload`.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-22 18:51:45 +01:00
Joachim Wiberg 8e7b173de3 mkgns3a.sh: increase node ram, we now provide Frr
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-22 07:32:43 +01:00
Joachim Wiberg 0a5729cbea package/skeleton-init-finit: fix ftbfs regression from aee7fb9
Need to rsync the whole skeleton since we provide more than just the
finit.d files, e.g. /etc/fstab, which we also modify in this .mk.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-22 07:31:31 +01:00
Joachim Wiberg c3d7405b8f Add support for using /usr/bin/pdmenu (setup) as a login shell
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-21 22:28:42 +01:00
Joachim Wiberg 378633fa5c setup: make this the default /etc/pdmenurc in Infix
Set COLORTERM instead of using -c flag.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-21 22:28:42 +01:00
Joachim Wiberg 6cf4a986f5 setup: add support for performing factory reset
Now that we have dialog on target we can add a user-friendly factory
reset dialog.  The new `yorn` script handles any form of yes-or-no
question, with or without dialog, to call a command.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-21 22:28:42 +01:00
Joachim Wiberg 9af4155a83 board/common: always clear the tty after the setup command
Exiting pdmenu leaves artifacts on screen.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-21 22:28:42 +01:00
Joachim Wiberg 0bd3acd361 setup: add support for easily switching system boot mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-21 22:28:42 +01:00
Joachim Wiberg 7733f18179 configs/amd64: enable squashfs images as well as kernel support
Now that we only support mmc and squash in `make run` we should make
sure the reference platform works as well as aarch64.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-21 20:12:12 +01:00
Joachim Wiberg 12b5731655 board/common: add support for overriding managed mode
This change adds support for setting the system boot mode to native /etc
style for systems where it's difficult, or close to impossible, to set
the Finit boot condition to 'etc'.

Note: this also moves the check for factory reset before we check if we
should use_etc, rather than NETCONF.  This to allow clearing out any of
the state files (.use_etc) before proceeding to boot in the default mode

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-21 20:05:31 +01:00
Joachim Wiberg 605bd7262b src/factory: use new /mnt/cfg/infix/.reset path
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-21 20:02:34 +01:00
Joachim Wiberg 357799bf47 package/skeleton-init-finit: add support for Frr
1. Use same naming standard for quagga and frr
 2. Only one of quagga and frr can be used at the same time
 3. Subdirectories in available/ only in the skeleton, not on target

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-20 14:49:37 +01:00
Joachim Wiberg aee7fb91d0 package/skeleton-init-finit: refactor, install svc files on demand
Only install the corresponding Finit svc if the package is selected in
the Buildroot menuconfig.  Some packages cannot be enabled by default
though, since they require a daemon configuration file, e.g. in the
case of ulogd it requires a valid /etc/ulogd.conf

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-20 14:49:37 +01:00
Tobias Waldekranz 499a8f718c common: Create (e)MMC image with redundant root filesystems
This image contains:

- A partition to hold bootloader config ("aux").

- Two redundant copies of the FIT framed rootfs (which will be
  upgradable by RAUC from within Infix).

- A partition to store critical configuration data ("cfg")

- A partition to store data created dynamically by Infix ("var")
2023-02-20 10:48:24 +01:00
Tobias Waldekranz ca3966db62 common: Create signature of root filesystem
mkimage will generate an FIT image containing a signature of the
rootfs, where the data is kept out of the DTB data structure, i.e.:

.---------.
|   DTB   |
:---------:
| Padding |
:---------:
|         |
|         |
| rootfs  |
|         |
|         |
'---------'

This is the on-disk format of Infix. At boot, we extract kernel and
device trees from the rootfs, and then use Linux's device mapper to
create a virtual block device that exposes the rootfs (squash).
2023-02-20 10:45:51 +01:00
Tobias Waldekranz 40f55058c6 common: Enable required U-Boot options in fragment file
This ensures that U-Boot images that we build can always:

- Rely on the environment extensions in env.dtsi being available
- Access the configured signing keys
- Use SD/eMMC cards
- Extract files from SquashFS filesystems

All of which are foundations that we intend to design our image
loading around.
2023-02-20 09:57:31 +01:00
Tobias Waldekranz b655ac778a common: Install signing key and environment in U-Boot's build tree
Ensure that whenever U-Boot is built:
- The chosen signing key and is converted to the expected format and
  installed in the build tree.
- Infix's environment extensions are installed in the build tree
2023-02-20 09:57:31 +01:00
Tobias Waldekranz 8716bea698 common: Add a development signing key
Keep a shared in-tree key that can be used to sign Infix images during
development. The idea is that this will also be included in developer
builds of U-Boot.
2023-02-20 09:57:31 +01:00
Tobias Waldekranz 98b59ac20b qemu: Optionally start from U-Boot using MMC disk
This is very useful for testing things like image signature
verification, system upgrades, etc.
2023-02-20 09:57:31 +01:00
Tobias Waldekranz d243c802b0 aarch64: Convenience target to configure a QEMU compatible U-Boot 2023-02-20 09:57:31 +01:00
Tobias Waldekranz 205d6e0187 aarch64: Enable support for PCI SDHC controllers
This let's us easily emulate SD/MMC disks from QEMU.
2023-02-20 08:56:06 +01:00
Joachim Wiberg 1cb4c9ac63 package/finit: bump for next snapshot
This is likely the last before v4.4-rc1.  Last remaining thing is a very
basic tmpfiles.so plugin that replaces a lot of what bootmisc.so hs been
(ab)used for.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 19:30:43 +01:00
Joachim Wiberg df6a19bac4 configs; enable nginx and clixon restconf over fcgi
Also add libcurl so all Clixon utility functions and apps are build with
full support for RESTCONF.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 19:15:57 +01:00
Joachim Wiberg 14dea1c6e1 src/mech: allow backend to start restconf in fcgi mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 19:15:22 +01:00
Joachim Wiberg 2875a787d4 package/clixon: add missing libfcgi dependency
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 19:14:49 +01:00
Joachim Wiberg 0162c2382a src/mech: sock and pid files should go in /run
This introduces a dependency on /run/clixon to exist when starting up.
Requires a patch to Finit panding the upcoming tempfiles.so plugin.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 19:13:08 +01:00
Joachim Wiberg c0c2ca622b board/common: add nginx.conf with /restconf fcgi reverse proxy
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 19:11:49 +01:00
Joachim Wiberg b0dfad05fb package/skeleton-init-finit: add support for monitoring nginx
Also needs /var/cache/nginx when starting up.  Requires separate patch
for now, but will be added a tmpflies.so plugn to Finit.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 19:10:20 +01:00
Joachim Wiberg efb4efc0a0 Add support for Frr and SMCRoute
Primarily for evaluating OSPF in customer's use-case.  Preparing for
some (static) multicast routing tests as well.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 19:03:05 +01:00
Joachim Wiberg 6822c92fb2 package/skeleton-init-finit: fix copy-paste error in chrony env file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-15 11:17:41 +01:00
Tobias Waldekranz 581c0946b7 defconfig: Build mech by default
Clixon is the future :)
2023-02-10 16:11:34 +01:00
Tobias Waldekranz 00c93cd70c mech: Initial ietf-system support
Only hostname is supported for now.
2023-02-10 16:11:34 +01:00
Tobias Waldekranz 3d35194341 mech: Add infrastructure for backend plugins using Augeas 2023-02-10 16:11:34 +01:00
Tobias Waldekranz 3235f00cd1 mech: Import basic autocli support from clixon's main example
This allows use the autogenerated CLI to modify the database.
2023-02-10 16:11:34 +01:00
Tobias Waldekranz e56348a916 mech: Make startup_db persistent, prepare for factory configs
Keep the transient files in the system's /mnt/tmp, and only persist
startup_db in /cfg.

This design (with a symlink) means that /cfg/startup_db _must_ exist
in order for clixon to start properly. Therefore run
/lib/infix/prep-db to take care of this.

At the moment, this just creates an empty factory config, and copies
it to startup if it doesn't exist. In the future, prep-db could select
a factory config based on some hardware identifier, or even build one
dynamically, based on available ports etc.
2023-02-10 15:51:47 +01:00
Tobias Waldekranz 5a27b30c7c mech: Startup clixon at boot 2023-02-09 10:26:10 +01:00
Tobias Waldekranz 61213c7c3c sshd: Move hostkeys to /var/lib/ssh
This means keys are persistent even when /etc is not.
2023-02-09 10:26:10 +01:00
Tobias Waldekranz fbd68c4a65 qemu: Let user supply extra append options 2023-02-09 10:26:10 +01:00
Tobias Waldekranz 66688b4e5a board/common: mnt: Fix boot/etc detection
Previously, the absense of any finit boot conditions would be
interpreted as unmanaged mode, but managed should be the default.
2023-02-09 10:26:10 +01:00
Tobias Waldekranz d7c83cb9a7 board/common: Make it easier to access the CLI
- Create a shell alias, 'cli'
- Add an sshd subsystem, 'cli'
2023-02-09 10:26:10 +01:00
Tobias Waldekranz 3036b08945 board/common: Split out iface renaming from swup
The factory config part of swup will now only run when in unmanaged
mode.
2023-02-09 09:43:15 +01:00
Tobias Waldekranz 437961a644 board/common: Keep static /etc/iproute2/group
This way we don't have to patch it at every boot.
2023-02-09 09:43:15 +01:00
Tobias Waldekranz fa4a83e38d board/common: Keep our own dhcpcd.conf
This avoids the issue where the config file keeps growing as more
"background" lines are appended to it with each build.
2023-02-09 09:43:15 +01:00
Tobias Waldekranz 16af6f9622 board/common: Remove remnants of dropbear key generation 2023-02-09 09:43:15 +01:00
Tobias Waldekranz 7740baf796 Revert "board/common: enable NETCONF over SSH"
This reverts commit 2ddf9448fe.

Two reasons:

1. We will move to a debian-style /etc/ssh/ssh_config.d/ structure
   soon.

2. In a managed scenario, NETCONF could be disabled, so mech should be
   responsible for activating it at boot.
2023-02-09 09:43:15 +01:00
Joachim Wiberg 7bfb0a9478 Follow-up to 252feef: rename Orc to Mech everywhere
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 15:12:57 +01:00
Joachim Wiberg f75842ab8b src/mech: update socket group s/clixon/clicon/
Recommended group according to Clixon FAQ

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:55:03 +01:00
Joachim Wiberg 8f82d24724 board/common: add clicon user according to FAQ
https://github.com/clicon/clixon/blob/master/doc/FAQ.md#do-i-need-to-setup-anything

With the additional wheel group for the clicon user since our plugins
need to modify files in /etc at bootstrap and reconf.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:53:47 +01:00
Joachim Wiberg 2ddf9448fe board/common: enable NETCONF over SSH
The allows remote NETCONF access to the Clixon example (for now).  This
will be replaced later with the Clixon Infix system.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:53:03 +01:00
Joachim Wiberg 83b3a1b1cc board/common: follow-up to 91b40a1, fix bridge access ports
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:53:03 +01:00
Joachim Wiberg 6de17bb06a board/common: follow-up to 4ca58836b, let less be less
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:53:03 +01:00
Joachim Wiberg 8fe9e87550 patches/clixon: adjust paths to PID file and XML db store
- Use the more common .pid format for the PID file
 - Use an existing directory for the XML db, /var/lib/misc

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:53:03 +01:00
Joachim Wiberg 58c2ee159c package/clixon: fix misspelled BR2 variables in clixon.mk
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:53:01 +01:00
Joachim Wiberg e5545f1d27 Add licensing information, GPL like Buildroot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:52:19 +01:00
Joachim Wiberg e5032e1835 board/common: minor shellcheck fixes to mnt script
- Double quoting to prevent word splitting
 - local keyword is undefined in POSIX sh
 - `-m 0755` only applies to deepest directory (ignore)
 - Useless cat
 - Redirect to null, lilke the other mount_rw statements

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-08 14:52:19 +01:00
Tobias Waldekranz 252feef1c4 mech: Initial add
The mechanic, Infix's integration layer to Clixon
2023-02-08 14:05:47 +01:00
Tobias Waldekranz f8b32fb1be package/clixon: Fix default config file location
The comment in the makefile says it all.

With this in place, we can start clixon_{backend,cli,...} without any
arguments.
2023-02-08 14:05:47 +01:00
Joachim Wiberg 41737b2343 package/clixon: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-07 19:12:40 +01:00
Joachim Wiberg aa9a986d4b package/cligen: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-07 19:12:40 +01:00
Tobias Waldekranz ca1467736f common: Refactor persistent storage setup
In the new model, we have three sources of storage:

- /mnt/var: Mountpoint for a disk with the label "var"
- /mnt/cfg: Mountpoint for a disk with the label "cfg"
- /mnt/tmp: Mountpoint for a ramdisk

These sources are used for the following overlays:

- **/cfg, /home, /root**: /mnt/cfg if available, else /mnt/tmp

- **/etc**: /mnt/cfg if available and the boot/etc finit condition is
            set, else /mnt/tmp

- **/var**: /mnt/var if available, else /mnt/tmp

- **/var/lib**: /mnt/var if available, else /mnt/cfg if available,
                else /mnt/tmp

See board/common/rootfs/lib/infix/mnt for more information.
2023-02-07 15:42:35 +01:00
Joachim Wiberg 5ec019f97a Add link to GitHub Releases page
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-06 08:48:53 +01:00
Joachim Wiberg 17692eb250 package/sysrepo-plugin-system: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 13:50:25 +01:00
Joachim Wiberg f4c1f48d04 package/sysrepo-plugins-common: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 13:14:42 +01:00
Joachim Wiberg baa0d77598 package/umgmt: new package
Required by upcoming package sysrepo-plugin-system by Deutsche Telekom.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 12:38:50 +01:00
Joachim Wiberg ad22478866 board/common: allow full color output in setup tool
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:46:05 +01:00
Joachim Wiberg 326f2024d7 board/common: use plain view of log files in setup tool
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:46:02 +01:00
Joachim Wiberg 31d036c8c7 board/common: very basic 'setup' tool, also works as login shell
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:35:36 +01:00
Joachim Wiberg 8525f26137 board/common: fix show formatting in '-p' (plain output) mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:35:36 +01:00
Joachim Wiberg 0d9a218d95 board/common: add '-p' (plain output) to help command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:35:36 +01:00
Joachim Wiberg 8b263f2766 board/common: add template /etc/mactab, syntax reminder only
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:35:36 +01:00
Joachim Wiberg 92ce79bc7a board/common: add simple 'hostnm' script to change system hostname
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:35:36 +01:00
Joachim Wiberg b313096745 board/common: add '-p' option to help script for plain/noansi output
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:35:36 +01:00
Joachim Wiberg 81698b17a1 board/common: update and fix show script for plain/noansi output
Also, the "show port foo" didn't work.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:35:36 +01:00
Joachim Wiberg c4f40a49c7 board/common: ensure port+iface group is assigned in factory defaults
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-01 08:35:33 +01:00
Joachim Wiberg 4ca58836b4 board/common: replace edit and editor with symlink to nano
The nano editor has been shown, over and over again, to be more
user-friendly to complete UNIX/Linux beginners than even Mg.

Also, change the default pager/less to be less (again), it was
very confusing to have less be most and more just be more.  We
recommend scripts to use pager and edit/editor to call system
safe defaults.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-31 21:45:32 +01:00
Joachim Wiberg 70b725baec board/common: some helpful hints on port classification and NAT
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-31 20:03:59 +01:00
Joachim Wiberg 5ab09ccad0 Demo issues fixed
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-31 12:35:39 +01:00
Joachim Wiberg 11e96318ef board/common: make rc.local executable, not called otherwise
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-31 12:35:39 +01:00
Joachim Wiberg d100f27585 board/common: import default sysctl.conf from Debian
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-31 12:35:39 +01:00
Joachim Wiberg a1c5e8b33f board/common: drop ifupdown2 defaults, not used anymore
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-31 12:25:58 +01:00
Joachim Wiberg 2e62e0d655 package/ifupdown-ng: fix overlayfs issue (DT_REG)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-31 11:35:24 +01:00
Joachim Wiberg 69e3e4672b Minor issues observed when preparing the first demo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-27 19:24:02 +01:00
Joachim Wiberg c84af105ec board/common: 192 MiB RAM is not longer enough, increase to 256 MiB
Regrettably, the latest additions of functionality to Infix have also
incresed the size of the ramdisk.  We expect it to go down slightly
before v1.0, but considering we'll add Frr before then it's better to
be realistic of our needs when run in GNS3.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-26 17:59:59 +01:00
Joachim Wiberg 4cc1a14a87 configs: fix .gns3a file generation, missing rw.ext4
Sync amd64 build with genimage support from aarch64.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-26 15:58:04 +01:00
Joachim Wiberg 193a51af86 .github: always update latest tag on builds
The previous fix, setting 'rm: false' to prevent the parallel builds
from replacing each other, caused the latest tag to not be updated.
Very confusing, not just to end-users, but also for devs.

This patch changes the workflow to use a separate release step that
runs in sequence, waiting for the build to finish, before it moves
the latest tag.

The trick to solving this is to use upload/download artifact.  It is the
recommended way of sharing files between independent jobs in a workflow.
Notice the lack of 'name:' in both and 'path:' in the latter, it means
"don't care" just upload and then download everything to the artifact/
directory.  Making the job of the releaser action quite simple.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-26 08:22:05 +01:00
Joachim Wiberg cba6926918 TODO: wizard idea, use pdmenu for initial setup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 21:22:49 +01:00
Joachim Wiberg 2d7ca5ac88 board/common: drop bridge.template, same text now in 'help net'
Will also be part of the upcoming setup-bridge wizard built on pdmenu.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 21:20:45 +01:00
Joachim Wiberg 91b40a1385 Fix factory default, untagged access ports
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 21:16:38 +01:00
Joachim Wiberg 37ab226c9e Adjust ingress, we've moved to ifupdown-ng
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 21:00:00 +01:00
Joachim Wiberg ee926b52a2 Update 'help' with info on most, pwgen, fping, socat, etc.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:57:54 +01:00
Joachim Wiberg 2872227ec1 configs: add ttyd to all builds for sharing terminal over web
Experimental, may be reverted later after evaluation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:50:27 +01:00
Joachim Wiberg b3c08d3503 configs: add irqbalance and the full kmod tools, for evaluation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:49:19 +01:00
Joachim Wiberg 4aec9bf8cb configs: add pdmenu, neofetch, and pwgen to all builds
- pdmenu for the made-easy management tool for Infix
 - neofetch is just for demo purposes, we can add KernelKit logo
 - pwgen is for basic help, like netcalc

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:47:11 +01:00
Joachim Wiberg 05d86832f0 configs: enable fping and netcat for all builds
- fping is better for checking multiple hosts
 - OpenBSD netcat has more features and is generally better for multiple
   network testing scenarios

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:44:45 +01:00
Joachim Wiberg 45a03f17f8 configs: enable stress-ng, for stressing SoC, kernel, etc.
For board bringup, burn in testing, compliance testing, and general
troubleshooting.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:42:58 +01:00
Joachim Wiberg e7fad6fc7f We have terminfo for more terminals, let's default to TERM=linux
This gives us much better rendering of help system and other
console mode tools.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:41:40 +01:00
Joachim Wiberg 683e16cba2 configs: enable text-mode browser lynx
For debugging and external viewing of, e.g., man pages.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:40:18 +01:00
Joachim Wiberg df1cf36437 Change help viewer to 'most', more helpful to newbies
- Default to start pager (most), fall back to less/more/cat
 - Drop : from sub-headings
 - Repeat 'See Also' section
 - Relocate network section's Interesting Files to end
 - Add dhcpcd.conf to list of interesting files

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 20:36:55 +01:00
Joachim Wiberg 08cd175cfc package/tetris: new package
Small easter egg for presentations, demos, etc.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 19:57:32 +01:00
Joachim Wiberg 028298714a configs: add conntrack tools to default build
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 19:02:40 +01:00
Joachim Wiberg 579d0b5789 configs: add universal nework logging daemon (netfilter logging)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 19:01:52 +01:00
Joachim Wiberg fdd94a5943 configs: add nftables, with iptables compat, to default build
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 19:00:05 +01:00
Joachim Wiberg 36ccea2ab0 configs: enable a few more network debugging tools
- traceroute + mtr
 - nmap et al

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:52:06 +01:00
Joachim Wiberg 04ad1b90e3 Minor update, mention GNS3 support, initial password, and 'help'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:41:13 +01:00
Joachim Wiberg 3e4891bcaf board/common: update gns3a template, better description and usage
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:41:13 +01:00
Joachim Wiberg e421e938ff board/common: ensure dhcpcd backgrounds immediately for quicker boot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:41:13 +01:00
Joachim Wiberg 96c8f838e3 Update online help slightly
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:41:13 +01:00
Joachim Wiberg 2730c87772 configs: udev + dbus + avahi
This patch drops our use of mdnsd and mdev in regular Infix builds, yet
keeping them in the config and repo for smaller builds, e.g. endpoints.

Also, enable dbus to increase level of integration between compoents.
The dbus-test-tool is included for debugging connections.

Since it's about the tenth time I've been missing strace on target, it
too is added in this commit.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:41:13 +01:00
Joachim Wiberg f5a95b3a91 package/finit: bump to latest snapshot (pre -rc1)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:41:13 +01:00
Joachim Wiberg 1fd929a68e buildroot: bump to latest master for upcoming 2023 LTS
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:41:13 +01:00
Joachim Wiberg 1ee3ab604d package/skeleton-init-finit: enable Avahi if selected in Buildroot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 17:41:13 +01:00
Joachim Wiberg d6e578e060 package/ifupdown-ng: change to KernelKit integration branch
- Disable IPv6 on bridge links when adding to a bridge

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-25 12:41:14 +01:00
Joachim Wiberg 7a9af5d244 package/skeleton-init-finit: let /var/lock be a symlink to /run/lock
The whole of /var may be read-only, while /run is a newstyle ramdisk.
The /run/lock directory is created by the Finit bootmisc.so plugin at
boot.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-24 14:45:52 +01:00
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 9fd0015873 package/ifupdown-ng: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-19 16:13:15 +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 3283090401 .github: always replace artifacts in the latest release
With two parallel builds (amd64, aarch64) we have contention of who last
uploads their artifact, meaning aarch currently removes the amd64 build.
This change should fix that.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-12 15:21:56 +01:00
Joachim Wiberg 3160162f9c .github: debug workflow, try *.tar.gz instead of *.tgz
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-11 22:43:59 +01:00
Joachim Wiberg ebc776bbfc .github: add workflow to build and upload tarballs to latest tag
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-11 18:35:32 +01:00
Joachim Wiberg b05f51f673 Guidelines for how to contribute to the project
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-11 18:07:12 +01:00
Joachim Wiberg d625a4915d Import a general CoC for project
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-11 17:58:35 +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 ec177085d9 Reminders for later
@wkz look here, something for your ~/.emacs:

(use-package magit-org-todos
  :after magit
  :config
  (magit-org-todos-autoinsert)
  (setq magit-org-todos-filename "TODO.org"))

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-03 20:41:15 +01:00
Joachim Wiberg c748128137 configs: enable jq regexp support with Oniguruma
Needed by, e.g., new swup script, but also everything else we might want
to do with jq in any sane way.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-03 20:37:22 +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 ef86cd23f4 configs: enable rngd to improve entropy with /dev/hwrng
Also, enable virtio-rng-pci in Qemu for testing.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-21 10:35:37 +01:00
Joachim Wiberg 1c5730d193 configs: enable jq for all targets
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-21 10:35:00 +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 26e127d495 configs: enable mdnsd for all platforms
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 23:06:16 +01:00
Joachim Wiberg e3c772e25a package/ifupdown2: bump to latest git hash
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 23:05:07 +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 6a5ce15fc0 package/ifupdown2: use older version of python-mako for now
This is a workaround for the following code in ifupdown/template.py:37
that throw the exception with python-mako >= 1.2.0:

    try:
        self.logger.debug('setting template lookuppath to %s'
                template_lookuppath)
        lc = utils.importName('mako.lookup', 'TemplateLookup')
        self.tclassargs['lookup'] = lc(
                    directories=template_lookuppath.split(':'))
    except Exception as e:
        self.logger.warning('unable to set template lookup path'
                            ' %s (%s): are you sure \'python3-mako\''
                            'is installed?'
                            % (template_lookuppath, str(e)))

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg af6907a380 package/python-templating: port of old python-mako
The ifupdown2 package is incompatible with python-mako >= v1.2.0.  So as
a workaround we add the old one as a local override.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg 245c298f0d configs: drop old ifupdown-scripts, not needed anymore
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 bf37f8bbf8 package/mdnsd: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg dc42c70f4e configs: enable IGMP querier daemon in default builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg cfb8a8aa88 package/querierd: new package
The Westermo querierd is an IGMP querier daemon for use on top of a
standard Linux VLAN-aware bridge.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg 1653980b19 configs/aarch64_defconfig: enable mdio-tools
Latest Buildroot now has mdio-tools in mainline.  This is useful when
debugging devices attaced over MDIO interfaces, eg. switches.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-14 22:21:16 +01:00
Joachim Wiberg 08fba1ea05 buildroot: bump to latest master, preparing for 2023.02 LTS
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 WibergandGitHub 698420b90d Mention ifupdown2, another load bearing component 2022-12-13 17:36:15 +01:00
Joachim Wiberg 63b0849ca7 qemu: prefer squashfs as initrd if enabled in .config
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-13 17:34:19 +01:00
Joachim Wiberg 66f605681d configs: enable socat, for testing and scripting
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-13 17:34:19 +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
Joachim Wiberg cd5282c636 package/ifupdown2: new package
This is the next generation ifupdown from Cumulus Networks (now NVIDIA).
The idea is to use this to set up everything port/lag/vlan/interface
related in the system.

This first import uses the kkit branch from the KernelKit fork, becuase
of, amongst other things, integration problems with upstream packages.

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
Tobias Waldekranz d56937f9dc qemu: Support passing custom options to setup user mode networking
This can be used to specify things like port forwards, TFTP server,
etc.
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 e2f3e43461 Update .PHONY rule, missing argument
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-08 11:29:58 +01:00
Joachim WibergandGitHub e14eccbbc0 Revert, project front page is not as wide
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-05 21:18:28 +01:00
Joachim WibergandGitHub ed341df849 Force line break in project description for effect
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-05 21:16:42 +01:00
Joachim WibergandGitHub d9fc2c68d2 Update README.md
Drop Introduction heading, redundant.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-05 21:15:18 +01:00
Joachim Wiberg 073f2fb043 qemu: move quick-help text to right before starting qemu
The qemu.sh script can fail, due to misconfiguration or other problems,
before it actually starts qemu.  Therefore, move the help text to right
before starting the emulator.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-05 21:12:04 +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 5446978a5a Minor, spellcheck and mention new EspressoBIN support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-26 17:59:41 +01:00
Joachim Wiberg 179024b091 doc: add raw svg logos made using Inkscape
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-26 17:09:43 +01:00
Joachim Wiberg a83542df8d Change to logo variant more suitable for dark mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-26 17:09:15 +01:00
Joachim Wiberg 1b426edc2a New logo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-26 17:08:59 +01:00
Joachim Wiberg 6530bcaacb Drop ASCII logo and convert to an introduction
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-26 17:08:46 +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
Joachim Wiberg 0bbb908114 patches/mstdp: drop, already in Buildroot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-26 17:05:14 +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 0a5870aa64 package/skeleton-init-finit: sync OpenSSH support from myLinux
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-23 18:03:28 +01:00
Joachim Wiberg 766e07e9c3 amd64,aarch64: change from Dropbear SSH -> OpenSSH
OpenSSH also enable OpenSSL and ZLIB, both of which we'll need later.
This in turn means Net-SNMP no longer needs its built-in OpenSSL stub.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-23 18:02:22 +01:00
Joachim Wiberg 6e2438da6e patches/tcpdump: backport DSA fix for extracting VID
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-23 14:41:23 +01:00
Joachim Wiberg 23ce9485ea packages/skeleton-init-finit: sync Finit start scripts with myLinux
This adds Finit support for starting chronydy and mstpd, as well as
an update to inadyn supporting env file for custom args.

Also included is a patch to the start script of mstpd for BusyBox pidof,
which don't have the '-c' option.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-23 14:41:23 +01:00
Joachim Wiberg 9f9581ae83 amd64,aarch64: drop Finit watchdog in favor of watchdogd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-23 14:41:23 +01:00
Joachim Wiberg c5ffeb2d06 qemu: add default options to enable i6300 WDT and host RTC
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-23 14:41:23 +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
Joachim Wiberg 49b0e81571 aarch64,amd64: add chrony, dnsmasq, mstpd, net-snmp, ssdpd, watchdogd
- chrony will be used as NTP v3/v4 server
 - dnsmasq will serve as a DNS forwarder and DHCP server when the
   very basic BusyBox DHCP server is insufficient
 - mstpd provides RSTP support
 - ssdp-responder provides device discovery in Windows
 - watchdogd provides basic system supervision and reset cause logging

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
Tobias Waldekranz 4d41f16a7e common: Add ethtool to defconfigs 2022-11-21 20:46:23 +01:00
Joachim Wiberg 41eaae2369 Follow-up to a399bc1, re-add Finit to project identity
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-20 11:36:36 +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 03023c23af aarch64,amd64: enable tcpdump support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-19 15:50:00 +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 4e8e5bc228 aarch64,amd64: enable netcalc command line tool
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 e8c2f11821 aarch64,amd64: enable LLDP support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:08:59 +01:00
Joachim Wiberg 3cb760626e aarch64,amd64: enable SSH servver support using Dropbear daemon
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 17:08:59 +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
Joachim Wiberg 8fe0ac2901 Follow-up to 0332cfe: fix aarch64 toolchain regression
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 15572e9ec6 aarch64: enable bash, en_CA locale, tzdata, and tmux
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim WibergandTobias Waldekranz e641ca947e aarch64: replace package override with local.mk rule in external.mk
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim WibergandTobias Waldekranz 0332cfe483 configs: bump kernel to last 5.19
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +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
Joachim WibergandTobias Waldekranz 92dde2ea20 amd64: enable bash, en_CA locale, tzdata, and tmux
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim WibergandTobias Waldekranz d322a7153c configs: sync aarch64 and amd64 defconfigs, same kernel + packages
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim WibergandTobias Waldekranz 9e3a9e12d1 amd64: update defconfig and change from uclibc to glibc
Also, like the other defconfigs, ensure we have gdb-server on target.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim WibergandTobias Waldekranz d8d05b5278 qemu: silence dd and mkfs outputs, otherwise used by qemu
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim WibergandTobias Waldekranz 7badb97d06 qemu: add support for x86_64 with ext2 rootfs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim Wiberg e3c4bffb99 qemu: drop debug message from stdout
Fixes first-start error: "Qemu: cannot find 'Creating'"

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 07:59:54 +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 aba3d1c5ce aarch64: Add post-build script to defconfig 2022-11-17 20:24: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 4232b22b76 qemu: Add virtualization support
The virtualized system is configured through kconfig under "External
Options"->"QEMU Virtualization".

To launch the system, simply run "make run". This works both from
output directories, and from the infix root with O= set.
2022-11-17 00:19:23 +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
Tobias Waldekranz 45d07372d8 rootfs: Pluggable ifup scripts
Allow networking config to be supplied from multiple fragmens in
/etc/network/interfaces.d. This way, a user can customize their setup
without having to override /etc/network/interfaces.
2022-10-06 10:50:32 +02:00
Tobias Waldekranz d3e32f3286 rootfs: Add support for persistent system configuration 2022-10-06 10:46:13 +02:00
Tobias Waldekranz c4e6a24a47 rootfs: Add common overlay
Start out with some convenience macros and a proper PS1.
2022-10-06 10:46:02 +02:00
Tobias Waldekranz ef8f975b58 aarch64: Add mg and iproute2 to defconfig 2022-10-06 10:41:51 +02:00
Tobias Waldekranz 8b4c2615b2 aarch64: Initial support
Start with a basic config for the CN9130-CRB board.
2022-09-27 16:02:20 +02:00
Tobias Waldekranz 2bffa52be3 common/post-build: Use infix's version, not buildroot's, in os-release
This way we can more easily know exactly from which commit an image
was built.
2022-09-27 16:02:20 +02:00
Tobias Waldekranz 878e46c3f9 common/post-build: Make architecture independent
Until there's a real need to specify a variant, let's just not.
2022-09-27 16:02:20 +02:00
Tobias Waldekranz 9f31622e77 Add defconfig to build U-Boot for CN9130 CRB
NOTE: We globally disable stack protection, as the ATF specific
setting for disabling it does not seem to be respected by all rules in
the repo.
2022-09-27 13:26:23 +02:00
Tobias Waldekranz 3d9ad3b65b boot/arm-trusted-firmware: Workaround for non-GIT source builds
For some reason, the ATF build system does not deem an mv-ddr-marvell
archive to be valid unless it versioned using GIT. This is obviously
not the case when building from a tarball downloaded from GitHub.

Therefore, remove the check.

Despite the ominous warning above the removed line, the lack of a .git
directory does not seem to have any detrimental effect on the
generated artifact - at least not on a Marvell CN9130 build.
2022-09-27 13:20:06 +02:00
Tobias Waldekranz f6348db852 buildroot: Bump to 2022.08 2022-09-13 13:28:46 +02:00
Joachim Wiberg 2181bda965 package/finit: wrap custom fstab setting in an advanced sub-menu
Turns out its real easy to get this wrong, ending up with a "" as your
default fstab.  Since this is an advanced option let's mark it as such.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-06-13 05:43:05 +02:00
Joachim Wiberg 22de57e0dc configs: enable Buildroot host env. setup for SDK relocation
Note: update-defconfig moved sysklogd config and dropped custom headers.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-06-13 05:42:08 +02:00
Joachim Wiberg 38b5c16dc1 board/common: generate /etc/os-release in new post-build.sh
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-18 08:33:23 +02:00
Joachim Wiberg 06c1306dc5 board/common: enable kernel quiet mode by default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-17 08:49:31 +02:00
Joachim Wiberg 976c45b2b1 configs/amd64: add e2fsprogs for fsck.auto
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-17 08:49:13 +02:00
Joachim Wiberg 123937ea5f configs/amd64: enable sysklogd as system logger
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-17 08:45:50 +02:00
Joachim Wiberg 48195a1894 configs/amd64: enable finit by default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-17 08:44:44 +02:00
Joachim Wiberg 2dd603113b package/finit: new init package, with skeleton
This patch imports Finit v4.3 from myLinux to infIX along with a
rudimentary rootfs skeleton.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-17 08:43:08 +02:00
Joachim Wiberg 1b492c905a configs: add custom BusyBox defconfig for amd64_defconfig
- Disable default init
 - Disable syslogd/klogd

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-17 08:41:11 +02:00
Joachim Wiberg fb018ece43 Minor fixups, make buildroot/Makefile and order-only dep
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-16 08:23:10 +02:00
413 changed files with 32981 additions and 63 deletions
+45
View File
@@ -0,0 +1,45 @@
Contributor Code of Conduct
===========================
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all
people who contribute through reporting issues, posting feature
requests, updating documentation, submitting pull requests or patches,
and other activities.
We are committed to making participation in this project a
harassment-free experience for everyone, regardless of level of
experience, gender, gender identity and expression, sexual orientation,
disability, personal appearance, body size, race, ethnicity, age,
religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit,
or reject comments, commits, code, wiki edits, issues, and other
contributions that are not aligned to this Code of Conduct. By adopting
this Code of Conduct, project maintainers commit themselves to fairly
and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code
of Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public
spaces when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may
be reported by opening an issue or contacting one or more of the project
maintainers.
This Code of Conduct is adapted from the [Contributor Covenant][1],
[version 1.2.0][2].
[1]: http://contributor-covenant.org
[2]: http://contributor-covenant.org/version/1/2/0/
+78
View File
@@ -0,0 +1,78 @@
Contributing to Infix
=====================
We welcome any and all help in the form of bug reports, fixes, patches
to add new features -- *preferably as GitHub pull requests*. Other
methods are of course also possible: emailing the [maintainers][] a
patch or even a raw file, a feature request or an alert of a problem.
If you are unsure of what to do, or how to implement an idea or bugfix,
open an issue with `"[RFC: Unsure if this is a bug ... ?"`, or use the
GitHub discussions forum, so we can discuss it. Talking about the code
first is the best way to get started before submitting a pull request.
Either way, when sending an email, patch, or pull request, start by
stating the version the change is made against, what it does, and why.
Please take care to ensure you follow the project coding style and the
commit message format. If you follow these recommendations you help
the maintainer(s) and make it easier for them to include your code.
Coding Style
------------
> **Tip:** Always submit code that follows the style of surrounding code!
First of all, lines are allowed to be longer than 72 characters these
days. In fact, there exist no enforced maximum, but keeping it around
100 chars is OK.
The coding style itself is otherwise strictly Linux [KNF][].
Commit Messages
---------------
Commit messages exist to track *why* a change was made. Try to be as
clear and concise as possible in your commit messages, and always, be
proud of your work and set up a proper GIT identity for your commits:
git config --global user.name "Jane Doe"
git config --global user.email jane.doe@example.com
Example commit message from the [Pro Git][gitbook] online book, notice
how `git commit -s` is used to automatically add a `Signed-off-by`:
Brief, but clear and concise summary of changes
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as
the subject of an email and the rest of the text as the body. The
blank line separating the ummary from the body is critical (unless
you omit the body entirely); tools like rebase can get confused if
you run the two together.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here
Signed-off-by: Jane Doe <jane.doe@example.com>
Code of Conduct
---------------
It is expected of everyone to respect the [Code of Conduct][conduct].
The *"maintainers have the right and responsibility to remove, edit,
or reject comments, commits, code, wiki edits, issues, and other
contributions that are not aligned to this Code of Conduct."*
[1]: ../doc/MAINTAINERS
[KNF]: https://en.wikipedia.org/wiki/Kernel_Normal_Form
[gitbook]: https://git-scm.com/book/ch5-2.html
[conduct]: CODE-OF-CONDUCT.md
+79
View File
@@ -0,0 +1,79 @@
name: Bob the Builder
#on:
# push:
# branches:
# - '*'
# pull_request:
# branches:
# - '*'
on:
pull_request:
workflow_dispatch:
jobs:
build:
name: Build ${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
matrix:
platform: [aarch64, amd64]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set Build Variables
id: vars
run: |
echo "dir=infix-${{ matrix.platform }}" >> $GITHUB_OUTPUT
echo "tgz=infix-${{ matrix.platform }}.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v3
with:
path: dl/
key: dl-${{ matrix.platform }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-${{ matrix.platform }}-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v3
with:
path: .buildroot-ccache/
key: ccache-${{ matrix.board }}-os-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.board }}-os-
ccache-${{ matrix.board }}-
ccache--os-
- name: Configure & Build
run: |
make ${{ matrix.platform }}_defconfig
make
- name: Prepare Artifact
run: |
cd output
mv images ${{ steps.vars.outputs.dir }}
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
ls -l
ls -l ${{ steps.vars.outputs.dir }}
- uses: actions/upload-artifact@v3
with:
path: output/${{ steps.vars.outputs.tgz }}
release:
name: Upload Latest Build
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- uses: pyTooling/Actions/releaser@main
with:
tag: latest
rm: true
token: ${{ secrets.GITHUB_TOKEN }}
files: artifact/*
- name: Summary
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
# Latest Build Complete! :rocket:
For the public download links of these build artifacts, please see:
<https://github.com/kernelkit/infix/releases/tag/latest>
EOF
+1 -1
View File
@@ -1,3 +1,3 @@
[submodule "buildroot"]
path = buildroot
url = https://github.com/buildroot/buildroot.git
url = ../buildroot.git
+339
View File
@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+13
View File
@@ -0,0 +1,13 @@
menu "Packages"
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
endmenu
menu "QEMU Virtualization"
source "$BR2_EXTERNAL_INFIX_PATH/qemu/Config.in"
endmenu
source "$BR2_EXTERNAL_INFIX_PATH/board/common/Config.in"
+4 -6
View File
@@ -13,18 +13,16 @@ all: $(config) buildroot/Makefile
$(config):
@+$(call bmake,list-defconfigs)
@echo "ERROR: No configuration selected."
@echo "\e[7mERROR: No configuration selected.\e[0m"
@echo "Please choose a configuration from the list above by running"
@echo "'make <board>_defconfig' before building an image."
@exit 1
%: buildroot/Makefile
%: | buildroot/Makefile
@+$(call bmake,$@)
buildroot/Makefile:
@git submodule update --init
run:
@echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
@(cd $(O)/images && ./qemu.sh)
.PHONY: all
+129
View File
@@ -0,0 +1,129 @@
<img align="right" src="doc/text3134.png" alt="Infix Linux Networking Made Easy">
* [Introduction](#introduction)
* [Hardware](#hardware)
* [Qemu](#qemu)
* [GNS3](#gns3)
* [Building](#building)
* [Origin & Licensing](origin--licensing)
Introduction
------------
Infix is an embedded Linux Network Operating System (NOS) based on
[Buildroot][1], [Finit][2], [ifupdown-ng][3], and [Clixon][6].
Providing an easy-to-maintain and easy-to-port Open Source base for
networked equipment.
See the [GitHub Releases](https://github.com/kernelkit/infix/releases)
page for out pre-built images. The *Latest Build* has the bleeding edge
images, if possible we recommend using a versioned release.
> Login with user 'root', no password by default on plain builds. See
> the online `help` command for an introduction to the system.
Hardware
--------
### aarch64
By default, Infix builds with support for the following boards (you
may enable additional boards in the config, of course):
- Marvell CN9130 CRB
- Marvell EspressoBIN
- Microchip SparX-5i PCB135 (eMMC)
See the aarch64 specific [documentation](board/aarch64/README.md) for more
information.
### amd64
Primarily intended to be run under [QEMU][] for development & test as
well as evaluation, demo and [training][] purposes, e.g. using [GNS3][]
or [Qeneth][7].
QEMU
----
A virtualized instance can easily be launched from a Linux system, with
Qemu installed, by issuing `make run`.
Some settings, e.g. networking, can be configured via `make menuconfig`
under `External options -> QEMU virtualization`.
GNS3
----
Download the [latest build][0] of amd64, unpack in a dedicated directory
and use ["Import Appliance"][9] to install the `.gns3a` file into GNS3.
Infix will show up in the "Router" category, it has 10 interfaces
available by default for use as switch ports or routing.
Building
--------
Buildroot is almost stand-alone, but need a few locally installed tools
to bootstrap itself. For details, see the [excellent manual][manual].
Briefly, to build an Infix image; select the target and then make:
make amd64_defconfig
make
Online help is available:
make help
To see available defconfigs for supported targets, use:
make list-defconfigs
> **Note:** build dependencies (Debian/Ubuntu): <kbd>sudo apt install make libssl-dev</kbd>
Origin & Licensing
------------------
Infix is entirely built on Open Source components (packages). Most of
them, as well as the build system with its helper scripts and tools, is
from [Buiildroot][1], which is distributed under the terms of the GNU
General Public License (GPL). See the file COPYING for details.
Some files in Buildroot contain a different license statement. Those
files are licensed under the license contained in the file itself.
Buildroot and Infix also bundle patch files, which are applied to the
sources of the various packages. Those patches are not covered by the
license of Buildroot or Infix. Instead, they are covered by the license
of the software to which the patches are applied. When said software is
available under multiple licenses, the patches are only provided under
the publicly accessible licenses.
Infix releases include the license information covering all Open Source
packages. This is extracted automatically at build time using the tool
`make legal-info`. Any proprietary software built on top of Infix, or
Buildroot, would need separate auditing to ensure it does not link with
any GPL[^1] licensed library.
[^1]: Infix image builds use GNU libc (GLIBC) which is covered by the
[LGPL][4]. The LGPL *does allow* proprietary software, as long as
said software is linking dynamically, [not statically][5], to GLIBC.
[0]: https://github.com/kernelkit/infix/releases/tag/latest
[1]: https://buildroot.org/
[2]: https://github.com/troglobit/finit
[3]: https://github.com/ifupdown-ng/ifupdown-ng
[4]: https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
[5]: https://lwn.net/Articles/117972/
[6]: https://github.com/clicon/clixon
[7]: https://github.com/wkz/qeneth
[9]: https://docs.gns3.com/docs/using-gns3/beginners/import-gns3-appliance/
[QEMU]: https://www.qemu.org/
[GNS3]: https://gns3.com/
[training]: https://addiva-elektronik.github.io/
[manual]: https://buildroot.org/downloads/manual/manual.html
+22
View File
@@ -0,0 +1,22 @@
* TODO doc: User Guide
- Feature set and scope, e.g.
- Device discovery: SSDP, LLDP, mDNS-SD how do they work, interfacing with Windows/macOS/Linux
- Network redundancy protocols: STP/RSTP, MRP
- Configuring the system; using ifupdown2, enabling/disabling services
- Diagnosing the system; using rmon, port mirroring, debugging services, searching logs
- Limitations, e.g., PRP/HSR or IEEE 802.1CB will not be possible to support
- Tips & Trix
* TODO document how to set up passwordless SSH
* TODO add setup wizard, based on pdmenu
- setup-port script to tweak ethtool settings
- setup-iface script to configure a layer-3 interface
- setup-bridge script that creates a new bridge with config from cmdline
- setup-firewall script that can do basic firewall rules and masquerading
* TODO split out qemu Config.in to a "make run-menuconfing"
* TODO rename qemu/ to run/, perhaps?
* TODO ship qemu/* with output/images/ for stand-alone runs of older builds
+67
View File
@@ -0,0 +1,67 @@
aarch64
=======
Microchip SparX-5i PCB135 (eMMC)
--------------------------------
At present, only FIT images are supported via the SparX-5i eval
board's U-Boot, which must contain a valid load address. If you are
using this board, after selecting your base configuration, run the
following command to supplement the existing config with the required
FIT options:
make board-enable-sparx-fit
### Unbricking
1. Don't load a corrupt bootloader to begin with
2. Done
If, for some reason, you didn't manage to follow step 1, you can use
the `FLASH_PROG`(`J4`) connector on the board to access the SPI flash
directly.
Using a [Bus Blaster][BB3] in combination with [dangerspi][dangerspi],
you can load a new bootloader. The schematic below details how to
connect the Bus Blaster to the board, but the concept should be
portable to any debugger/device based around an FTDI2232 chip.
```
Bus Blaster: FLASH_PROG (J4):
.---. .---.
VTG >o o| VTG SCK >o o| GND
TRST |o o| GND MISO |o o| #RESET_FLASH
TDI |o o| GND o o| 3V3
TMS |o o| GND #CS |o o| #SYSRESET
TCK o o| GND MOSI |o o| GND
RTCK o o| GND '---'
TDO |o o| GND
TSRST |o o| GND
DBGRQ |o o| GND
DBGACK |o o| GND
'---'
```
| Bus Blaster | FLASH_PROG |
|-------------|----------------|
| `VTG` | `3V3` |
| `GND` | `GND` |
| | |
| `VTG` | `#RESET_FLASH` |
| `GND` | `#SYSRESET` |
| | |
| `TDI` | `MOSI` |
| `TMS` | `#CS` |
| `TCK` | `SCK` |
| `TDO` | `MISO` |
With the cable in place, build U-Boot with the correct configuration:
make fireant_boot_defconfig && make
To flash it to the board, connect the cable to `J4` and run:
make board-sparx-flash-uboot
[BB3]: http://dangerousprototypes.com/docs/Bus_Blaster#Bus_Blaster_v3
[dangerspi]: https://github.com/wkz/dangerspi
+37
View File
@@ -0,0 +1,37 @@
.PHONY: board-enable-qemu-uboot
board-enable-qemu-uboot:
@$(call IXMSG,"Enabling build of QEMU compatible U-Boot")
./utils/config --file $(BR2_CONFIG) \
--enable PACKAGE_HOST_UBOOT_TOOLS \
--enable PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT \
--enable PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT \
--enable TARGET_UBOOT \
--enable TARGET_UBOOT_BUILD_SYSTEM_KCONFIG \
--enable TARGET_UBOOT_CUSTOM_VERSION \
--set-str TARGET_UBOOT_CUSTOM_VERSION_VALUE \
"2023.04-rc2" \
--set-str TARGET_UBOOT_PATCH \
'$$(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/patches' \
--set-str TARGET_UBOOT_BOARD_DEFCONFIG \
"qemu_arm64" \
--set-str TARGET_UBOOT_CONFIG_FRAGMENT_FILES \
'$$(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/extras.config' \
--enable TARGET_UBOOT_FORMAT_DTB
.PHONY: board-enable-sparx-fit
board-enable-sparx-fit:
@$(call IXMSG,"Enabling SparX-5i compatible FIT options")
@BR2_PREFIX= ./utils/config --file $(BR2_CONFIG) \
--enable FIT_IMAGE \
--set-str FIT_KERNEL_LOAD_ADDR "0x7 0x00000000"
.PHONY: board-sparx-flash-uboot
board-sparx-flash-uboot: $(BINARIES_DIR)/u-boot.bin
@grep -q 'BR2_TARGET_UBOOT_BOARD_DEFCONFIG="mscc_fireant_pcb135_emmc"' $(BR2_CONFIG) || \
{ echo Build tree does not seem to be configured for SparX-5i eval board; exit 1; }
@echo Erasing...
@dangerspi.py erase 0 0x100000
@echo Programming...
@dangerspi.py write 0 0x100000 <$<
@echo Done...
+7
View File
@@ -0,0 +1,7 @@
blkmap get boot dev devnum
load blkmap ${devnum} ${kernel_addr_r} /boot/Image
#TODO: LOAD FDT
setenv bootargs "${bootargs_root} ${bootargs_rauc} ${bootargs_log}"
booti ${kernel_addr_r} ${ramdisk} ${fdt_addr}
@@ -0,0 +1,22 @@
/* 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.
*/
/dts-v1/;
#include "microchip/sparx5_pcb135_emmc.dts"
&cpu0 {
enable-method = "spin-table";
cpu-release-addr = <0x0 0x0000fff8>;
};
&cpu1 {
enable-method = "spin-table";
cpu-release-addr = <0x0 0x0000fff8>;
};
/ {
/delete-node/ psci;
};
+25
View File
@@ -0,0 +1,25 @@
image cfg.ext4 {
ext4 {
label = "cfg"
}
empty = true
size = 16M
}
image sdcard.img {
hdimage {
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
}
partition cfg {
partition-type = 0x83
image = "cfg.ext4"
}
}
# Silence genimage warnings
config {}
+459
View File
@@ -0,0 +1,459 @@
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
CONFIG_PREEMPT=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_MEMCG=y
CONFIG_BLK_CGROUP=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PROFILING=y
CONFIG_SMP=y
CONFIG_ARCH_SPARX5=y
CONFIG_ARCH_MVEBU=y
CONFIG_ARCH_VEXPRESS=y
CONFIG_ARM64_VA_BITS_48=y
CONFIG_SCHED_MC=y
CONFIG_NR_CPUS=64
CONFIG_COMPAT=y
# CONFIG_SUSPEND is not set
CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_CPUFREQ_DT=y
CONFIG_ARM_ARMADA_37XX_CPUFREQ=y
CONFIG_ARM_ARMADA_8K_CPUFREQ=y
CONFIG_ACPI=y
CONFIG_ARM64_CRYPTO=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
# CONFIG_GCC_PLUGINS is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_KSM=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_NET_IPVTI=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETFILTER=y
CONFIG_BRIDGE_NETFILTER=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
CONFIG_NF_LOG_IPV6=m
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
CONFIG_BRIDGE_CFM=y
CONFIG_NET_DSA=y
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_L3_MASTER_DEV=y
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_IOV=y
CONFIG_PCI_AARDVARK=y
CONFIG_PCI_HOST_GENERIC=y
CONFIG_PCIE_ARMADA_8K=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_FW_CFG_SYSFS=y
CONFIG_FW_CFG_SYSFS_CMDLINE=y
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_MARVELL=y
CONFIG_MTD_SPI_NOR=y
CONFIG_OF_OVERLAY=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_NVME=y
CONFIG_SRAM=y
CONFIG_EEPROM_AT24=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_SAS_LIBSAS=y
CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_AHCI_MVEBU=y
CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_INIT=y
CONFIG_DM_VERITY=y
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
CONFIG_NETDEVICES=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_MACSEC=y
CONFIG_TUN=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
CONFIG_NET_VRF=y
CONFIG_NET_DSA_MV88E6XXX=y
CONFIG_NET_DSA_MV88E6XXX_PTP=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALACRITECH is not set
# CONFIG_NET_VENDOR_ALTEON is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_ATHEROS is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_CISCO is not set
# CONFIG_NET_VENDOR_CORTINA is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_GOOGLE is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
CONFIG_MVNETA=y
CONFIG_MVPP2=y
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
CONFIG_SPARX5_SWITCH=y
# CONFIG_NET_VENDOR_MICROSEMI is not set
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETERION is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_NET_VENDOR_PACKET_ENGINES is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_BROCADE is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RDC is not set
CONFIG_8139CP=y
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_SFP=y
CONFIG_MARVELL_PHY=y
CONFIG_MARVELL_10G_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_MICROCHIP_PHY=y
CONFIG_MICROCHIP_T1_PHY=y
CONFIG_MICROSEMI_PHY=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_MVUSB=y
CONFIG_MDIO_MSCC_MIIM=y
CONFIG_MDIO_BUS_MUX_MMIOREG=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDC_EEM=y
# CONFIG_USB_NET_CDC_NCM is not set
# CONFIG_USB_NET_NET1080 is not set
# CONFIG_USB_NET_CDC_SUBSET is not set
# CONFIG_USB_NET_ZAURUS is not set
# CONFIG_WLAN is not set
CONFIG_INPUT_EVDEV=y
CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO_SERPORT is not set
CONFIG_SERIO_AMBAKMI=y
CONFIG_VT_HW_CONSOLE_BINDING=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_XILINX_PS_UART=y
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
CONFIG_SERIAL_MVEBU_UART=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_GPIO=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_MUX_PINCTRL=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
CONFIG_I2C_MV64XXX=y
CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
CONFIG_SPI_ARMADA_3700=y
CONFIG_SPI_NXP_FLEXSPI=y
CONFIG_SPI_PL022=y
CONFIG_SPI_MUX=y
CONFIG_SPI_SPIDEV=m
CONFIG_SPMI=y
CONFIG_PINCTRL_MICROCHIP_SGPIO=y
CONFIG_PINCTRL_OCELOT=y
CONFIG_GPIO_DWAPB=y
CONFIG_GPIO_PL061=y
CONFIG_GPIO_XGENE=y
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_GPIO_MAX77620=y
CONFIG_POWER_RESET_GPIO_RESTART=y
CONFIG_POWER_RESET_XGENE=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_BATTERY_BQ27XXX=y
CONFIG_CHARGER_GPIO=y
CONFIG_SENSORS_SPARX5=y
CONFIG_SENSORS_JC42=y
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_INA2XX=m
CONFIG_THERMAL_EMULATION=y
CONFIG_ARMADA_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_SYSFS=y
CONFIG_SOFT_WATCHDOG=y
CONFIG_ARMADA_37XX_WATCHDOG=y
CONFIG_I6300ESB_WDT=y
CONFIG_MFD_MAX77620=y
CONFIG_MFD_SEC_CORE=y
CONFIG_MFD_ROHM_BD718XX=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_BD718XX=y
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_MAX77620=y
CONFIG_REGULATOR_PCA9450=y
CONFIG_REGULATOR_QCOM_SPMI=y
CONFIG_REGULATOR_S2MPS11=y
# CONFIG_HID_GENERIC is not set
# CONFIG_HID_A4TECH is not set
# CONFIG_HID_APPLE is not set
# CONFIG_HID_BELKIN is not set
# CONFIG_HID_CHERRY is not set
# CONFIG_HID_CHICONY is not set
# CONFIG_HID_CYPRESS is not set
# CONFIG_HID_EZKEY is not set
# CONFIG_HID_KENSINGTON is not set
# CONFIG_HID_LOGITECH is not set
# CONFIG_HID_MICROSOFT is not set
# CONFIG_HID_MONTEREY is not set
CONFIG_USB=y
CONFIG_USB_OTG=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_MVEBU=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC2=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_ISP1760=y
CONFIG_USB_HSIC_USB3503=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_ULPI=y
CONFIG_USB_GADGET=y
CONFIG_USB_SNP_UDC_PLAT=y
CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_TCPCI=y
CONFIG_TYPEC_RT1711H=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_ARMMMCI=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_OF_SPARX5=y
CONFIG_MMC_SPI=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_EXYNOS=y
CONFIG_MMC_DW_K3=y
CONFIG_MMC_SDHCI_XENON=y
CONFIG_SCSI_UFSHCD=y
CONFIG_SCSI_UFSHCD_PLATFORM=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_SYSCON=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_MAX77686=y
CONFIG_RTC_DRV_PCF8523=y
CONFIG_RTC_DRV_S5M=y
CONFIG_RTC_DRV_DS3232=y
CONFIG_RTC_DRV_EFI=y
CONFIG_RTC_DRV_PL031=y
CONFIG_RTC_DRV_ARMADA38X=y
CONFIG_DMADEVICES=y
CONFIG_MV_XOR=y
CONFIG_MV_XOR_V2=y
CONFIG_PL330_DMA=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
# CONFIG_SURFACE_PLATFORMS is not set
CONFIG_COMMON_CLK_CS2000_CP=y
CONFIG_COMMON_CLK_S2MPS11=y
CONFIG_COMMON_CLK_XGENE=y
CONFIG_COMMON_CLK_BD718XX=y
CONFIG_MAILBOX=y
CONFIG_ARM_SMMU=y
CONFIG_ARM_SMMU_V3=y
CONFIG_EXTCON_USB_GPIO=y
CONFIG_IIO=y
CONFIG_TI_ADC081C=y
CONFIG_PWM=y
CONFIG_PHY_XGENE=y
CONFIG_PHY_MVEBU_CP110_COMPHY=y
CONFIG_PHY_SAMSUNG_USB2=y
CONFIG_MUX_MMIO=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_9P_FS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_SECURITY=y
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=0
CONFIG_IRQ_POLL=y
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_RCU_TRACE is not set
CONFIG_FUNCTION_TRACER=y
# CONFIG_STRICT_DEVMEM is not set
CONFIG_MEMTEST=y
@@ -0,0 +1,3 @@
label Infix (aarch64)
kernel /boot/Image
append ${bootargs_root} ${bootargs_rauc} ${bootargs_log}
+21
View File
@@ -0,0 +1,21 @@
[system]
compatible=infix-aarch64
bootloader=uboot
statusfile=/var/lib/rauc/status
mountprefix=/var/lib/rauc/mnt
bundle-formats=-plain
[keyring]
directory=/etc/rauc/keys
[slot.rootfs.0]
device=/dev/disk/by-partlabel/primary
bootname=primary
[slot.rootfs.1]
device=/dev/disk/by-partlabel/secondary
bootname=secondary
[slot.net.0]
device=/dev/ram
bootname=net
+10
View File
@@ -0,0 +1,10 @@
image cfg.ext4 {
ext4 {
label = "cfg"
}
empty = true
size = 16M
}
# Silence genimage warnings
config {}
+1
View File
@@ -0,0 +1 @@
set prefix=(hd0,gpt2)/grub
+29
View File
@@ -0,0 +1,29 @@
set timeout="1"
set default="primary"
set log="loglevel=4"
load_env ORDER DEBUG
for slot in $ORDER; do
set default="$slot"
break
done
if [ "$DEBUG" ]; then
set log="debug"
fi
submenu "primary" "$log" {
set slot="$1"
set append="$2"
set root=(hd0,gpt3)
source /boot/grub/grub.cfg
}
submenu "secondary" "$log" {
set slot="$1"
set append="$2"
set root=(hd0,gpt4)
source /boot/grub/grub.cfg
}
+8
View File
@@ -0,0 +1,8 @@
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
ORDER=primary secondary
primary_OK=1
secondary_OK=1
primary_TRY=0
secondary_TRY=0
################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
+14
View File
@@ -0,0 +1,14 @@
totaltimeout 3000
default qemu
timeout 5
prompt 1
label qemu
kernel __KERNEL_PATH__
initrd __INITRD_PATH__
append root=/dev/sr0 console=ttyS0 quiet
label live
kernel __KERNEL_PATH__
initrd __INITRD_PATH__
append root=/dev/sr0 console=tty0 quiet
+183
View File
@@ -0,0 +1,183 @@
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
CONFIG_PREEMPT=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_MEMCG=y
CONFIG_BLK_CGROUP=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PROFILING=y
CONFIG_SMP=y
CONFIG_EFI=y
# CONFIG_GCC_PLUGINS is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_NET_IPVTI=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETFILTER=y
CONFIG_BRIDGE_NETFILTER=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
CONFIG_NF_LOG_IPV6=m
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
CONFIG_BRIDGE_CFM=y
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_FW_CFG_SYSFS=y
CONFIG_FW_CFG_SYSFS_CMDLINE=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_ATA_PIIX=y
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_VERITY=y
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
CONFIG_NETDEVICES=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_MACSEC=y
CONFIG_TUN=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
CONFIG_NET_VRF=y
CONFIG_E1000=y
CONFIG_NE2K_PCI=y
CONFIG_8139CP=y
# CONFIG_WLAN is not set
CONFIG_INPUT_EVDEV=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_SYSFS=y
CONFIG_SOFT_WATCHDOG=y
CONFIG_I6300ESB_WDT=y
CONFIG_DRM=y
CONFIG_DRM_QXL=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_BOCHS=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_HDA_INTEL=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_RTC_CLASS=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_EXT4_FS=y
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_9P_FS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_CRYPTO_SHA256=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
# CONFIG_FTRACE is not set
CONFIG_UNWINDER_FRAME_POINTER=y
+3
View File
@@ -0,0 +1,3 @@
menuentry "Infix" --id infix {
linux /boot/bzImage root=PARTLABEL=$slot rauc.slot=$slot console=ttyS0 $append nokaslr
}
+18
View File
@@ -0,0 +1,18 @@
[system]
compatible=infix-x86_64
bootloader=grub
grubenv=/mnt/aux/grub/grubenv
statusfile=/var/lib/rauc/status
mountprefix=/var/lib/rauc/mnt
bundle-formats=-plain
[keyring]
directory=/etc/rauc/keys
[slot.rootfs.0]
device=/dev/disk/by-partlabel/primary
bootname=primary
[slot.rootfs.1]
device=/dev/disk/by-partlabel/secondary
bootname=secondary
+79
View File
@@ -0,0 +1,79 @@
comment "Image Signing"
choice
prompt "Signing key source"
default SIGN_SRC_DIR
config SIGN_SRC_DIR
bool "Directory"
config SIGN_SRC_PKCS11
bool "PKCS#11 URL"
endchoice
config SIGN_KEY
string "Signing key"
default "${BR2_EXTERNAL_INFIX_PATH}/board/common/dev-key" if SIGN_SRC_DIR
comment "Additional Artifacts"
# For /etc/os-release, uses CondtionArchitechture= from systemd.unit(5)
config INFIX_ARCH
string
default "arm" if BR2_arm
default "arm64" if BR2_aarch64
default "mips64" if BR2_mips64
default "riscv64" if BR2_riscv
default "x86_64" if BR2_x86_64
menuconfig DISK_IMAGE
bool "Disk image"
help
Compose a full disk image with redundant firmware partitions,
configuration partition, etc.
This is useful when:
- Bringing up a blank system during manufacturing
- Creating a GNS3 appliance
- Developing/debugging issues in the boot process in QEMU
config DISK_IMAGE_SIZE
string "Image size"
depends on DISK_IMAGE
default "512M"
help
Create a disk image of this size. Suffixes like K/M/G may be
used to multiply by powers of 1024. Suffixes like KB/MB/GB may
be used to multiply by powers of 1000.
Minimum supported size is 512M.
config GNS3_APPLIANCE
bool "GNS3 Appliance"
select DISK_IMAGE
default y if BR2_x86_64
help
Create a GNS3 appliance description that, together with the
disk image, can be imported into GNS3.
menuconfig FIT_IMAGE
bool "Traditional FIT image"
help
Create a "regular" FIT image where the kernel and DTBs are
stored in the FIT rather than inside the rootfs (like it
normally is in Infix).
This is useful when trying out Infix on targets whose
bootloader might not be capable of booting a raw Squash, but
is able to handle an FIT.
config FIT_ARCH
string
depends on FIT_IMAGE
default "arm64" if BR2_aarch64
config FIT_KERNEL_LOAD_ADDR
string "Kernel load address"
depends on FIT_IMAGE
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
include $(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/uboot.mk
define RAUC_POST_BUILD_INSTALL_CERT
@$(call IXMSG,"Installing signing cert for RAUC")
mkdir -p $(TARGET_DIR)/etc/rauc/keys
$(foreach crt,$(shell ls $(SIGN_KEY)/*.crt), \
cp $(crt) $(TARGET_DIR)/etc/rauc/keys/$(shell openssl x509 -hash -noout <$(crt)).0;)
endef
RAUC_POST_BUILD_HOOKS += RAUC_POST_BUILD_INSTALL_CERT
+32
View File
@@ -0,0 +1,32 @@
-----BEGIN CERTIFICATE-----
MIIFbTCCA1WgAwIBAgIUAW8J6lminthZoomqqt4Hmv1UcJEwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAgFw0yMzAyMjAxNDEyMDZaGA8yMTIz
MDEyNzE0MTIwNlowRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx
ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCAiIwDQYJKoZIhvcN
AQEBBQADggIPADCCAgoCggIBAL2RAAmRNp688DoFAQZaeHGMHTjsYSG4vdk38xuZ
iY2GBdzKQB7JfvGSAqzrn1BVN0AsYmc5ZZG6W10CecKrHU8EbBgdEfB4iRHmYbnS
nBAB6MTv1m4TDG9Ic0E7TEHFLNWi7u+TPIQGFlqeXdoE0jh6d7tFZJlkSzJaEPGW
O4IjhWV1Ow2+Erwaz6Vgm8t6PTgrPtJMo7+UTIlLkjhIp99OR+vQdSsEBimxg0uc
E3qvDMOvyBqshYQsJn8EX+L6X5g7cigk/RmeoYZ8hu2/dwxhvoK1kfTfKSzBQzTq
d9/Y9ASVcmbRx3e9qdyK+yxfMMv0ujYoiv0sslw7ZvtJ0EvaLkzgls6BwMdZqmAC
S/JkZUtPK3J14lvDtpr5gD1yIABf36T0b3WUxVCAccmbfzDbY4EGEgHowGZW9wkF
mzVgZ1gta9mxzFsE1OipMMlVu+GOts91qESWSzj4hxn8tVNbfWraWKWXJHDAAnsF
jBZg6UHybxLIlb6igyiCeDjFzC0iVAhiPu45kfSjYqIhbngZdxVGKeTGTzrkFBT8
XT8jJazSwAJX3gCMbzVqcgwL/+JhJABAWlm8hDMI/13eYC4mDETQEeBWx0ywtNz6
hC4QItiJkHB2F51T9bJwXJiT3UUUUUy9aeFqRVI153jy9sOsXEx6Cl5u1X0JoZYB
PW5nAgMBAAGjUzBRMB0GA1UdDgQWBBTHl9X576dPVGUaJTisvr9bG91RuzAfBgNV
HSMEGDAWgBTHl9X576dPVGUaJTisvr9bG91RuzAPBgNVHRMBAf8EBTADAQH/MA0G
CSqGSIb3DQEBCwUAA4ICAQBKyqzQ1CAhGG/Thtpnu6BOkyt3Kp7XH55S2f4zShHE
AtW0L56NOF1ASBm0+bTwmd4S6AEIpcG9oO7opqcnFncJtTFcMnTPYH55ldUmp/FW
bR1ICwGgW3y5tFnC3BicTbhHBgoh73oGJFPbCCsvZgeu8duygG3ULERw60xkjJGN
ZvNTk8AEmdmwXnkKeHuEojm7WAuIJbc7wy6dIjJonffJekCgI2NjSTweA3bLb2m4
bpUSv19aRPDXH8kYjguLTpjYHF6TjV3gsWSX0gBwmYqZK/kHwObqV85oT9iCRbmy
ErP0XkYHtPyed+W/jTtW7tVPj7PctV9CYCUmLVyHS8C1JCpCkaLWlR/UUwGC2DKH
gYksFxrZbVk6ApzRAd5Oza6EExSQf5FmHf4YLj4qon7WArbY7tqBkV7k4FCjEQIk
B45oH0kg1b0zyK4LL+d0UVcPB6PN9sLQf8Dgjhu34ls14x5cjVW5rpTqpekuMAJn
E+PXXOYFhrwchCp/CC/SIWC1aglNiXr0+ZOKFyxYXNzQ0D2X7WKhRxgsCOVB9ZuX
tL1RSP4qLtEL+pMRus+uGT85pz2N7JHBc7yTX6yGecFBkZ9iXJIQTOJAb5z1+VBE
Ey/boWpVqK8sEZKAIdnOKF+GWUQEDGhdwZiTiSNzcALw1QBnBecOj1Up0RToDeQ/
wg==
-----END CERTIFICATE-----
+52
View File
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQC9kQAJkTaevPA6
BQEGWnhxjB047GEhuL3ZN/MbmYmNhgXcykAeyX7xkgKs659QVTdALGJnOWWRultd
AnnCqx1PBGwYHRHweIkR5mG50pwQAejE79ZuEwxvSHNBO0xBxSzVou7vkzyEBhZa
nl3aBNI4ene7RWSZZEsyWhDxljuCI4VldTsNvhK8Gs+lYJvLej04Kz7STKO/lEyJ
S5I4SKffTkfr0HUrBAYpsYNLnBN6rwzDr8garIWELCZ/BF/i+l+YO3IoJP0ZnqGG
fIbtv3cMYb6CtZH03ykswUM06nff2PQElXJm0cd3vancivssXzDL9Lo2KIr9LLJc
O2b7SdBL2i5M4JbOgcDHWapgAkvyZGVLTytydeJbw7aa+YA9ciAAX9+k9G91lMVQ
gHHJm38w22OBBhIB6MBmVvcJBZs1YGdYLWvZscxbBNToqTDJVbvhjrbPdahElks4
+IcZ/LVTW31q2lillyRwwAJ7BYwWYOlB8m8SyJW+ooMogng4xcwtIlQIYj7uOZH0
o2KiIW54GXcVRinkxk865BQU/F0/IyWs0sACV94AjG81anIMC//iYSQAQFpZvIQz
CP9d3mAuJgxE0BHgVsdMsLTc+oQuECLYiZBwdhedU/WycFyYk91FFFFMvWnhakVS
Ned48vbDrFxMegpebtV9CaGWAT1uZwIDAQABAoICACLGFJGst65Kzm52OIfn1KxP
nZSxl+fNsdXE862ebqMtcKnd2AFNySGbPS5nUqQz3ZzCB5MT7lPbMaNQLvHM3eV+
1C1gN8g69Dn6XvbtcX9mOkLWFCnBCMjpK2tN62EtQFo4N0hvY+x8CWG6J1E1DTMb
FBegVSHmSf0ElJMckfH/fhrsdFbDBUDIUkrt++ZJmC1TkYSWVntwQtH0sO/uNA08
mOjjJnsrk83WKFWYXeJldhv3hOePujZSuwUV0lkawKp2TSycDGnEtbCr6zx1oOr+
iyoDELEwtqblFOUCFddUPv8QQxolZUfL3Pr967FqDNN9IyOIMGbc6iMNKojyM2lF
oasOFqTcw/slGIAKOgISshT4EJulix1FNYXk8qFTjJTXkiFeNdqbgFvprE+ivoX+
qhVt+9bexWdZDf1USGX/POSb5AMoa2OAwMpv06UueF4Uin9ImxdHJhi8EGwPbqk+
czSBPz2lelgeX7Cq0tqTWnKY5SskDGKapKSMiF7L6bbmNSNg1PdE/EVSNriP5/n5
mE+b3oVpg136B3ExgGnQ1h4JmrcNp1VLa7FTaluMAbvzg6IFPx2fiKDzMwjlqDxq
sGUqTfaUB2mH5STeeidwBB9Y5NdKBc4zl5d0bjUyR8LAAgET1GHdmvFIlgUmBKZQ
u6quaFy7JtJBYGl43y2xAoIBAQDMT699Tkq/aws28UrbfMlMtIDyXjqZSdq13HDh
vFCjRBMYy4zjhbjQIxU+zXPRi2FYgMffjyuJ1MABCbGDlgwaGQ9DuKnrs+VVpw2o
UL+D25kVxQJQuwCYK+Iy1cwb2IQM+68hvnuemYqnT7zSMl3sqEwNeZ5YiZCgg90S
SIv1kYTVmjoTHsLR0jdLXfGTWr1AL3+X/vlkl0WxjcJrSNa8wlcqiMwnVdI2r9Zd
NF+HVNeh8IKrkoCvBfK7BzUhMRKtritcH0xycxxt80WO6PzcRoVDxu44HJN0cDnZ
OhsK0DoZdaBIiEWUFqzo04kDz0iSSvxKJ43+/03oVg8XBNL1AoIBAQDthltLpys6
4p6vGj7feOmJDuA1E1M+MUttnfaX3FKMYVk8idTaoRBXM/tqWhNJHldCJjliG6tt
sWLSruYWs+VwUmBntNNDH753FW1INZPN7Mrb/kiVx1JXBKNtoymCxNxQq1Jut2c9
lDEUZp1wY96RBZfUhkxAMCc23Z/S4xKNLw5X9+isC/AUlVCa1sM87zD/pVbQ1P2x
rvCcU75sa1h84FBBF7mGYd+oZBaK12Xw8ZHPsRgdznkhHwNHXlO9HgcX2DQ56vpn
Hl2syZT1UOB+W4IkGHbPWtDGUDaI9bzarEJ6T0dP7Qdqana4HioGMu4aqgxiapre
6s9CSXb1nvprAoIBAQCC31hOL+R5kRvx6cZFqj1XwRgIKIvovQI4FCjKsFIHAwgo
jdqFs5aa3J4zSG+z/lAw3O0rKw58j6ceAxOOcoL2BK9edd+CeA2jPArnkjHbSMNa
yoOdKuxKjXGrln/UJnEPz/hy6Q1OnpPOcKlHC7RWb8enqgvgMt5Ns6ncmFPuzXQF
T3F75extcvawdFDWTv2DK+nTdyRRZwThoyiyiEnlR6eGO3Jqj/LDzQbHVVEL4zDt
Lp7FQGblti2x2AAUbtbEIhjsPbA+b7X6SCZ6UIwInbOnorndf5CEuY6Usz+3QYK1
5D7ztza6kXvY+AeARTr7WsUYyxWODgPdm6K24AQxAoIBAEiRrxz7Exsnl+HZu/Hc
6EUGtXuhzuIGf4wbIfcdyl63c2MqnUy6vtpVuG+y24eQbIp6UTfnSkX2V0IVS5kO
F4BsuqWUuqMcdL2/Xycbr2/P896o3xZb0o1hjmj1273nVYSUA1huUm2e9CvOejWX
Xa2jLtMwwOUvkRuTNLxiwg0+njxEMuM1toEjaYAVM4tPbQH+Svr8yBHcaAjrERfg
6CUnB34LuJQVHRc+lSCQVMX7mFgDPGIG7j0vU3ofmKgEH5iqZrJ3V0/gGDCtWgRl
VGFmpelPTCVoErc0VKUdpziMPrdNt3T07zoVEvaHyMEiGFsvLx92gKCwzufquByt
GMcCggEATu40rFJOUA5at5WK9uI2TwR2ZVO2wgfu7kUiVmQJZmkMuQKhER0lkRxU
eWtME0JYLprWwvIBRmR0y4IBohJBGAxR7CWJsxnrBJxplc/Nf3ziFs3DY75EPKAP
pwbl41BFHqdLfee9OOJGHRXT7YlAsHxl0X2pBfrnV+HhG2hcWoFxuclVOsAGbdxt
0C4zbyjGqfpDkFLbFcGcN09NSRsBEKB2kgM4i4zAtW/kTXLl16l+UBApXx2vkkDz
XuB+ikwqAZE+LNMwy9Oxmfq6mzpt9D5wwtw3dasMzvK9Tr+DC6ctHjCNl3e2fKkP
hE4TY9HQcE7tdZysxkzni6CX77WRiQ==
-----END PRIVATE KEY-----
+65
View File
@@ -0,0 +1,65 @@
image aux.ext4 {
mountpoint = "/aux"
temporary = true
size = 2M
ext4 {
label = "aux"
}
}
image cfg.ext4 {
empty = true
temporary = true
size = 16M
ext4 {
label = "cfg"
}
}
image var.ext4 {
empty = true
temporary = true
# 44M - 24k (GPT backup)
size = 45032k
ext4 {
label = "var"
}
}
image mmc.img {
size = 512M
hdimage {
partition-table-type = "gpt"
}
partition aux {
offset = 2M
image = "aux.ext4"
}
partition primary {
image = "rootfs.squashfs"
size = 224M
}
partition secondary {
bootable = true
image = "rootfs.squashfs"
size = 224M
}
partition cfg {
image = "cfg.ext4"
}
partition var {
image = "var.ext4"
}
}
# Silence genimage warnings
config {}
+66
View File
@@ -0,0 +1,66 @@
@BOOTIMG@
image aux.ext4 {
mountpoint = "/aux"
temporary = true
size = @AUXSIZE@
ext4 {
label = "aux"
}
}
image cfg.ext4 {
empty = true
temporary = true
size = @CFGSIZE@
ext4 {
label = "cfg"
}
}
image var.ext4 {
empty = true
temporary = true
size = @VARSIZE@
ext4 {
label = "var"
}
}
image disk.img {
size = @TOTALSIZE@
hdimage {
partition-table-type = "gpt"
}
@BOOTPART@
partition aux {
offset = @AUXOFFS@
image = "aux.ext4"
}
partition primary {
image = "rootfs.squashfs"
size = @IMGSIZE@
}
partition secondary {
image = "rootfs.squashfs"
size = @IMGSIZE@
}
partition cfg {
image = "cfg.ext4"
}
partition var {
image = "var.ext4"
}
}
# Silence genimage warnings
config {}
+19
View File
@@ -0,0 +1,19 @@
ixmsg()
{
printf "\e[37;44m#!: $@\e[0m\n"
}
die()
{
echo "$@" >&2
exit 1
}
load_cfg()
{
local tmp=$(mktemp -p /tmp)
grep "$1" $BR2_CONFIG >$tmp
. $tmp
rm $tmp
}
+184
View File
@@ -0,0 +1,184 @@
#!/bin/sh
set -e
K=10
M=20
G=30
size2int()
{
# Use truncate's error message to convert input like "1K to "1024"
# for us.
#
# - What do you mean by "fragile"?!
truncate -s $1 /dev/null 2>&1 | awk '{ print($7); }'
}
dimension()
{
if [ $total -ge $((4 << G)) ]; then
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
imgsize=$(( 1 << G))
cfgsize=$((512 << M))
# var is at least ~1.5G
elif [ $total -ge $((2 << G)) ]; then
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
imgsize=$((512 << M))
cfgsize=$((256 << M))
# var is at least ~1.75G
elif [ $total -ge $((1 << G)) ]; then
bootsize=$(( 4 << M))
auxsize=$(( 4 << M))
imgsize=$((256 << M))
cfgsize=$(( 64 << M))
# var is at least ~0.5G
elif [ $total -ge $((512 << M)) ]; then
bootsize=$(( 4 << M))
auxsize=$(( 4 << M))
imgsize=$((192 << M))
cfgsize=$(( 16 << M))
# var is at least ~100M
else
echo "Can't create disk images smaller than 512M"
exit 1
fi
# Size var to fit whatever is left over. Also reserve another 32K
# at the end to make room for the backup GPT.
varsize=$(($total - $auxsize - 2 * $imgsize - $cfgsize))
if [ "$bootoffs" ]; then
varsize=$(($varsize - $bootsize))
fi
varsize=$(($varsize - (32 << K)))
if [ "$bootoffs" ]; then
# Align the end of the boot partition to an even MiB. E.g. if
# boot was dimensioned to 4M, and bootoffs is 32K, then the
# final bootsize becomes 4M - 32K, meaning aux will start on
# exactly 4M.
auxoffs=$bootsize
bootsize=$(($bootsize - $bootoffs))
else
# No bootloader, place aux after GPT, resize it to end on an
# even MiB (as is done for boot above).
auxoffs=$((32 << K))
auxsize=$(($auxsize - $auxoffs))
fi
}
probeboot()
{
# If we have built an EFI app, typically grub, make sure to
# include it.
if [ -d $BINARIES_DIR/efi-part/EFI ]; then
bootoffs=$((32 << K))
fi
}
genboot()
{
if [ -d $BINARIES_DIR/efi-part/EFI ]; then
bootimg=$(cat <<EOF
image efi-part.vfat {
size = $bootsize
vfat {
file EFI {
image = $BINARIES_DIR/efi-part/EFI
}
}
}
EOF
)
bootpart=$(cat <<EOF
partition efi {
offset = $bootoffs
partition-type-uuid = U
bootable = true
image = efi-part.vfat
}
EOF
)
fi
}
common=$(dirname $(readlink -f "$0"))
root=$BUILD_DIR/genimage.root
tmp=$BUILD_DIR/genimage.tmp
total=$((512 << M))
bootoffs=
bootimg=
bootpart=
while getopts "a:s:" opt; do
case ${opt} in
a)
arch=$OPTARG
;;
s)
total=$(size2int $OPTARG)
;;
esac
done
shift $((OPTIND - 1))
mkdir -p $root
probeboot
dimension
genboot
# Use awk over sed because replacement text may contain newlines,
# which sed does not approve of.
awk \
-vtotal=$total \
-vauxsize=$auxsize -vauxoffs=$auxoffs \
-vimgsize=$imgsize \
-vcfgsize=$cfgsize \
-vvarsize=$varsize \
-vbootimg="$bootimg" -vbootpart="$bootpart" \
'{
sub(/@TOTALSIZE@/, total);
sub(/@AUXSIZE@/, auxsize);
sub(/@AUXOFFS@/, auxoffs);
sub(/@IMGSIZE@/, imgsize);
sub(/@CFGSIZE@/, cfgsize);
sub(/@VARSIZE@/, varsize);
sub(/@BOOTIMG@/, bootimg);
sub(/@BOOTPART@/, bootpart);
}1' \
< $common/genimage.cfg.in >$root/genimage.cfg
mkdir -p $root/aux
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/primary.itbh
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/secondary.itbh
case "$arch" in
aarch64)
mkenvimage -s 0x4000 -o $root/aux/uboot.env \
$BR2_EXTERNAL_INFIX_PATH/board/common/uboot/aux-env.txt
;;
x86_64)
mkdir -p $root/aux/grub
cp -f $BR2_EXTERNAL_INFIX_PATH/board/amd64/grub.cfg \
$BR2_EXTERNAL_INFIX_PATH/board/amd64/grubenv \
$root/aux/grub/
;;
*)
;;
esac
rm -rf $tmp
genimage \
--rootpath $root \
--tmppath $tmp \
--inputpath $BINARIES_DIR \
--outputpath $BINARIES_DIR \
--config $root/genimage.cfg
+108
View File
@@ -0,0 +1,108 @@
#!/bin/sh
die()
{
echo "$@" >&2
exit 1
}
load_cfg()
{
local tmp=$(mktemp -p /tmp)
grep ^FIT_ $BR2_CONFIG >$tmp
. $tmp
rm $tmp
}
load_cfg
[ "$FIT_IMAGE" = "y" ] || exit 0
work=$(pwd)/build/fit-image-local
dtbs=$(find $BINARIES_DIR -name '*.dtb')
kernel=$(find $BINARIES_DIR -name '*Image' | head -n1)
squash=$BINARIES_DIR/rootfs.squashfs
mkdir -p $work
# mkimage will only align images to 4 bytes, but U-Boot will leave
# both DTB and ramdisk in place when starting the kernel. So we pad
# all components up to a 4k boundary.
truncate -s %4k $kernel $dtbs
: >$work/dtbs.itsi
: >$work/cfgs.itsi
for dtb in $dtbs; do
name=$(basename $dtb .dtb)
cat <<EOF >>$work/dtbs.itsi
$name-dtb {
description = "$name";
type = "flat_dt";
arch = "$FIT_ARCH";
compression = "none";
data = /incbin/("$dtb");
};
EOF
cat <<EOF >>$work/cfgs.itsi
$name {
description = "$name";
kernel = "kernel";
ramdisk = "ramdisk";
fdt = "$name-dtb";
};
EOF
done
: >$work/kernel-load.itsi
if [ "$FIT_KERNEL_LOAD_ADDR" ]; then
cat <<EOF >$work/kernel-load.itsi
load = <$FIT_KERNEL_LOAD_ADDR>;
entry = <$FIT_KERNEL_LOAD_ADDR>;
EOF
fi
cat <<EOF >$work/infix.its
/dts-v1/;
/ {
timestamp = <$(date +%s)>;
description = "Infix ($FIT_ARCH)";
creator = "infix";
#address-cells = <0x1>;
images {
kernel {
description = "Linux";
type = "kernel";
arch = "$FIT_ARCH";
os = "linux";
$(cat $work/kernel-load.itsi)
compression = "none";
data = /incbin/("$kernel");
};
ramdisk {
description = "Infix";
type = "ramdisk";
os = "linux";
arch = "$FIT_ARCH";
compression = "none";
data = /incbin/("$squash");
};
$(cat $work/dtbs.itsi)
};
configurations {
$(cat $work/cfgs.itsi)
};
};
EOF
mkimage \
-E -p 0x1000 \
-f $work/infix.its $BINARIES_DIR/infix.itb \
|| die "Unable to create FIT image"
+52
View File
@@ -0,0 +1,52 @@
#!/bin/sh
cat <<EOF >"$BINARIES_DIR/infix.gns3a"
{
"name": "infix",
"category": "router",
"description": "Infix is a Network Operating System based on Linux. It can be set up both as a switch, with offloading using switchdev, and a router with firewalling.",
"vendor_name": "KernelKit",
"vendor_url": "https://github.com/kernelkit/",
"product_name": "Infix",
"registry_version": 6,
"status": "stable",
"maintainer": "KernelKit",
"maintainer_email": "kernelkit@googlegroups.com",
"usage": "Default login is 'root', no password.\n\nType 'help' for an overview of commands and relevant configuration files.\n\nThe /etc directory is writable, use the passwd tool after login as part of your set up.\nFor networking, classify interfaces as switchports with /etc/mactab, syntax: 'MAC-address eN', where N is the port number (1-MAX).\nTo set up bridging and management interfaces, use /etc/network/interfaces, and /etc/network/interfaces.d/",
"port_name_format": "eth{0}",
"linked_clone": true,
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 10,
"ram": 512,
"cpus": 1,
"hda_disk_interface": "virtio",
"arch": "x86_64",
"console_type": "telnet",
"kvm": "allow"
},
"images": [
{
"filename": "OVMF.fd",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/OVMF.fd"),
"md5sum": "$(md5sum "$BINARIES_DIR/OVMF.fd" | awk '{print $1}')",
"version": "0.0"
},
{
"filename": "disk.img",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/disk.img"),
"md5sum": "$(md5sum "$BINARIES_DIR/disk.img" | awk '{print $1}')",
"version": "0.0"
}
],
"versions": [
{
"name": "0.0",
"images": {
"bios_image": "OVMF.fd",
"hda_disk_image": "disk.img"
}
}
]
}
EOF
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
set -e
common=$(dirname $(readlink -f "$0"))
root=$BUILD_DIR/genimage.root
tmp=$BUILD_DIR/genimage.tmp
mkdir -p $root/aux
cp -f $BINARIES_DIR/uboot-env.bin $root/aux/uboot.env
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/primary.itbh
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/secondary.itbh
rm -rf $tmp
genimage \
--rootpath $root \
--tmppath $tmp \
--inputpath $BINARIES_DIR \
--outputpath $BINARIES_DIR \
--config $common/genimage.cfg
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
set -e
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
arch=$1
sign=$2
crt=$(ls $sign/*.crt)
key=$(ls $sign/*.key)
common=$(dirname $(readlink -f "$0"))
work=$BUILD_DIR/mkrauc
mkdir -p $work
cp -f $common/rauc-hooks.sh $work/hooks.sh
# RAUC internally uses the file extension to find a suitable install
# handler, hence the name must be .img
cp -f $BINARIES_DIR/rootfs.squashfs $work/rootfs.img
cp -f $BINARIES_DIR/rootfs.itbh $work/rootfs.itbh
cat >$work/manifest.raucm <<EOF
[update]
compatible=infix-${arch}
version=${GIT_VERSION}
[bundle]
format=verity
[hooks]
filename=hooks.sh
[image.rootfs]
filename=rootfs.img
hooks=post-install
EOF
rm -f $BINARIES_DIR/infix-$arch.pkg
rauc --cert=$crt --key=$key \
bundle $work $BINARIES_DIR/infix-$arch.pkg
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
. "$BR2_CONFIG"
. "$TARGET_DIR/usr/lib/os-release"
if [ -n "${ID_LIKE}" ]; then
ID="${ID} ${ID_LIKE}"
fi
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
# This is a symlink to /usr/lib/os-release, so we remove this to keep
# original Buildroot information.
rm "$TARGET_DIR/etc/os-release"
{
echo "NAME=\"Infix\""
echo "VERSION=${GIT_VERSION}"
echo "ID=infix"
echo "ID_LIKE=\"${ID}\""
echo "VERSION_ID=${GIT_VERSION}"
echo "BUILD_ID=\"${NAME} ${VERSION}\""
echo "PRETTY_NAME=\"Infix by KernelKit\""
echo "ARCHITECTURE=\"${INFIX_ARCH}\""
echo "HOME_URL=https://github.com/KernelKit"
} > "$TARGET_DIR/etc/os-release"
echo "Infix by KernelKit $GIT_VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"
# Allow pdmenu (setup) to be a login shell
grep -qsE '^/usr/bin/pdmenu$$' "$TARGET_DIR/etc/shells" \
|| echo "/usr/bin/pdmenu" >> "$TARGET_DIR/etc/shells"
+30 -13
View File
@@ -1,16 +1,33 @@
#!/bin/sh
# shellcheck disable=SC1090
. "$BR2_CONFIG" 2>/dev/null
common=$(dirname "$(readlink -f "$0")")
. $common/lib.sh
cat <<-EOF >"$BINARIES_DIR/qemu.sh"
#!/bin/sh
line=\$(stty -g)
stty raw
qemu-system-x86_64 -M pc -cpu kvm64 -enable-kvm -nographic \\
-kernel bzImage -append "rootwait root=/dev/vda console=ttyS0" \\
-drive file=rootfs.ext2,if=virtio,format=raw \\
-net nic,model=virtio -net user
stty "\$line"
EOF
chmod +x "$BINARIES_DIR/qemu.sh"
load_cfg BR2_EXTERNAL_INFIX_PATH
load_cfg BR2_ARCH
load_cfg SIGN_KEY
ixmsg "Signing SquashFS Image"
$common/sign.sh $BR2_ARCH $SIGN_KEY
ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh $BR2_ARCH $SIGN_KEY
load_cfg DISK_IMAGE
if [ "$DISK_IMAGE" = "y" ]; then
ixmsg "Creating Disk Image"
$common/mkdisk.sh -a $BR2_ARCH
fi
load_cfg GNS3_APPLIANCE
if [ "$GNS3_APPLIANCE" = "y" ]; then
ixmsg "Creating GNS3 Appliance"
$common/mkgns3a.sh
fi
load_cfg FIT_IMAGE
if [ "$FIT_IMAGE" = "y" ]; then
ixmsg "Creating Traditional FIT Image"
$common/mkfit.sh
fi
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
set -e
case "$1" in
slot-post-install)
[ "$RAUC_SLOT_CLASS" = "rootfs" ] || break
echo "Updating signature information for $RAUC_SLOT_BOOTNAME"
itbh=$(dirname $RAUC_IMAGE_NAME)/rootfs.itbh
cp $itbh /mnt/aux/$RAUC_SLOT_BOOTNAME.itbh
sync
;;
*)
exit 1
;;
esac
+28
View File
@@ -0,0 +1,28 @@
/dts-v1/;
/ {
description = "Infix";
creator = "infix";
#address-cells = <0x1>;
images {
rootfs {
description = "Infix";
type = "ramdisk";
os = "linux";
compression = "none";
data = /incbin/("rootfs.squashfs");
signature-1 {
algo = "sha256,rsa4096";
key-name-hint = "infix";
};
};
};
configurations {
default = "verity";
verity {
ramdisk = "rootfs";
};
};
};
+116
View File
@@ -0,0 +1,116 @@
#!/bin/sh
#set -x
mode=/mnt/cfg/infix/.use_etc
boot=/tmp/.boot_mode
if [ -f $boot ]; then
current=$(cat $boot)
else
current="unknown"
fi
m=on
n=off
p=off
select_mode()
{
if [ -f $mode ]; then
m=off
if grep -qi profinet $boot; then
n=off
p=on
else
n=on
p=off
fi
fi
exec 3>&1
selection=$(dialog --erase-on-exit --no-tags \
--hline "Arrow keys + space to select, enter to confirm" \
--backtitle "Select Operating Mode" \
--title "Select Operating Mode" \
--radiolist "System currently runs in: $current mode" 13 60 1 \
"1" "Managed NETCONF, XML datastore" "$m" \
"2" "Native Linux, /etc datastore" "$n" \
"3" "PROFINET, /etc variant" "$p" \
2>&1 1>&3)
exit_status=$?
exec 3>&-
case $exit_status in
1) # cancel
exit 0
;;
255) # escape
exit 1
;;
esac
}
usage()
{
cat <<EOF
usage:
chom [-h] [etc | netconf]
options:
-h Show this help text
arguments:
etc Change to Linux native mode, /etc
netconf Change to NETCONF mode, XML
profinet Change to PROFINET mode, /etc variant
EOF
}
case $1 in
-h)
usage
exit 0
;;
net* | xml)
selection=1
;;
nat* | etc*)
selection=2
;;
profinet)
selection=3
;;
*)
;;
esac
if [ -z "$selection" ]; then
use_dialog=1
select_mode
fi
case $selection in
1)
rm -f $mode 2>/dev/null
grep -qi netconf $boot 2>/dev/null && exit 0
result="Manageed NETCONF"
;;
2)
echo "native /etc" > $mode
grep -qi native $boot 2>/dev/null && exit 0
result="Native Linux, /etc"
;;
3)
echo "PROFINET" > $mode
grep -qi profinet $boot 2>/dev/null && exit 0
result="PROFINET"
;;
esac
if [ -n "$use_dialog" ]; then
dialog --erase-on-exit --cr-wrap --title "Activate Mode Change?" --yesno "\n Reboot to $result mode now?" 8 50
if [ $? -eq 0 ]; then
reboot
fi
fi
echo "Remember to reboot later to activate the change."
exit 0
+690
View File
@@ -0,0 +1,690 @@
#!/bin/sh
# COLUMS and ROWS should be set on the console, if not, use fallback
if [ -z "$COLUMNS" ]; then
if command -v tput; then
COLUMNS=$(tput cols)
else
COLUMNS=80
fi
fi
h1()
{
STR="$*"
if [ -n "$plain" ]; then
echo "$STR" | tr '[:lower:]' '[:upper:]'
echo "$STR" | sed 's/./=/g'
else
printf "\033[7m%-${COLUMNS}s\033[0m" "$STR"
fi
}
h2()
{
STR="$*"
if [ -n "$plain" ]; then
echo "$STR"
echo "$STR" | sed 's/./-/g'
else
printf "\033[1m%-${COLUMNS}s\033[0m" "$STR"
fi
}
ul()
{
if [ -n "$plain" ]; then
echo "__${*}__"
else
printf "\033[54%s\033[0m" "$*"
fi
}
em()
{
if [ -n "$plain" ]; then
echo "**${*}**"
else
printf "\033[5m%s\033[0m" "$*"
fi
}
overview()
{
cat <<EOF
$(h1 "Help System Press 'Q' to quit | Arrow keys and PgUp/PgDn to scroll")
$(h2 "See Also")
help edit Tutorial on VI and Mg editors
help net Network set up introduction
setup User friendly setup and diagnostic tool
$(h2 "General Syntax")
cmd [optional arg] E.g., use 'date -h' to get help for date command
$(h2 "File system")
pwd | ls | cd Show directory, contents, or change directory
cat file Show file contents
vi | mg [file] Edit file with the VI or Micro Emacs editor
$(h2 "Services")
initctl list Lists all configurable services (svc's)
initctl enable svc Enable a service 'svc'
initctl reload Reload init process' state, start/stop svc's
initctl start svc Start a stopped service 'svc'
initctl stop svc Stop 'svc'
initctl restart svc Restart a running 'svc'
initctl status [svc] Display running status of all services, or one 'svc'
$(h2 "Tools")
setup User friendly setup and diagnostic tool
date [-h] Display current time, or sets the system date
factory Factory reset the device (on the next boot)
hwclock [-h] Query or set the hardware clock (RTC)
logout | Ctrl-D Log out from TTY
mdio | mvls Low-level MDIO access, also for Marvell switch status
tail -F file Continuously read from a file Useful for monitoring the
health of services, see 'ls /var/log/' for log files
less [file] Pagers provding easily scrollable content (q quits) >
more [file] > e.g., 'cat very-long-file | less'
most [file] > e.g., 'cat very-long-file | most'
passwd Change user password
pwgen Password generator
reboot Restart the device
reset Reset the shell prompt if it gets garbled
$(h2 "Network Tools")
ethtool [-h] Ethernet stats, and low-level MAC/PHY settings
traceroute [-h] Trace the route ip packets follow going to a host
tcpdump [-h] Display network packet headers in real-time
arping [-h] Ping hosts by ARP requests/replies
fping [-h] Send ICMP ECHO_REQUEST packets to multiple hosts
ping [-h] Send ICMP ECHO_REQUEST packets to a network host
lynx URL [-h] The text mode web browser
netcalc [-h] Calculate IP network settings from a IP address
netcat [-h] NetCat - TCP/IP swiss army knife (alias: nc)
socat [-h] Multipurpose socket relay program
ttyd [-h] Sharing a terminal over the web
ifconfig [--help] See/Reconfigure available network interfaces
route [--help] Edit the kernel's routing tables
ifup | ifdown IFACE Bring up/down interfaces in /etc/network/interfaces
ip [link|addr] Manage available network interfaces
ip [rule|route] Manage routing tables
bridge [link|vlan] Manage bridge ports and VLANs
scp Securely copy a file to a remote host file system
tftp Copy a file to/from a remote host
ftpput Store a local file on a remote machine via FTP
ftpget Retrieve a remote file via FTP
wget Get a file using HTTP or FTP from a remote host
$(h2 "Overview Commands")
df -h List disk usage (in human readable format)
free List memory usage
ps List running processes
show [arg] Show system status, see 'show help' for more info
top Displays CPU usage and top list of running tasks
$(h2 "Interesting Files")
/etc/default/svc Command line args for service 'svc' (see above)
/etc/rc.local Local setup, runs after all services have started
/etc/network/ Directory of networking setup, see 'help net'
$(h2 "Example Commands")
cd /tmp; wget ftp://192.168.55.43/file && cat file
cd /var/log; tftp -p -l messages 192.168.55.43
cat /proc/net/arp
edit /etc/network/interfaces
$(h2 "See Also")
help edit Tutorial on VI and Mg editors
help net Network set up introduction
setup User friendly setup and diagnostic tool
EOF
}
vi()
{
cat <<EOF
$(h1 "Visual Editor (vi)")
Vi is the de facto standard editor in UNIX systems. It comes with two modes:
- $(em "Command mode (default):") administrative tasks such as saving files,
executing commands, moving the cursor, cutting and pasting lines or words,
as well as finding and replacing. $(em "Return to command mode with Esc")
- $(em "Insert mode:") Everything that's typed in this mode is interpreted as
input and placed in the file.
$(h2 "Navigation commands")
h - move the cursor one character to the left
j - move the cursor down one character
k - mode the cursor up one character
l - move the cursor right one character
b - move to beginning of word, or previous word
w - move to next word
0 - move to beginning of line
$ - move to end of line
:0 - move to beginning of file
G - move to end of file
$(h2 "Editing commands")
u - undo last operation
x - delete the character the cursor is on
cw - change word, from position of cursor
dw - delete to end of word
dd - delete the line the character is on
p - paste (line, word, or char) after cursor
P - paste (line, word, or char) before cursor
$(h2 "Saving and quit commands")
:w - save the current file
:w filename - save a copy of the file named filename
:w! - try to save the file, even if it is read only
:wq - save and quit vi
ZZ - save and quit vi
:wq! - try to save the file if it is read only, quit if successful
:wq filename - save a copy of the file named filename and quit
:wq! filename - save a copy of the file named filename and quit,
override read only permissions if possible
:q - quit vi
:q! - quit vi even if the file has unsaved changes
$(h2 "Enter insert mode")
a - append new text after the cursor
i - insert text before the cursor
o - open a new line below the cursor
O - open a new line above the cursor
> Return to command mode with Esc
EOF
}
emacs()
{
cat <<EOF
$(h1 "Micro Emacs (mg)")
Mg is a bit more user-friendly than vi. It has the same familiar interface
as Notepad, but with slightly different keybindings.
$(h2 "Introduction")
Most commands involve using the Control ("Ctrl") or the Meta ("Alt") key.
The following conventions are used in the online help:
C-<chr> means hold down the Control key while typing the character <chr>
M-<chr> means hold down the Alt key while typing the character <chr>
If you don't have a Meta/Alt key, you can use Esc instead. Press and release
the Esc key and then type <chr>. This is equivalent to M-<chr>.
$(h2 "Navigation")
Though arrow keys, Home/End, and PgUp/PgDn usually work, using Mg over serial
console can sometimes cause these keys to be mismapped by terminal program.
C-f Move forward one character (can also use right arrow key)
C-b Move backward one character (can also use left arrow key)
C-p Move up one line (can also use up arrow key)
C-n Move down one line (can also use down arrow key)
M-f Move forward one word
M-b Move backward one word
C-a Move to beginning of line (can also use Home key)
C-e Move to end of line (can also use End key)
C-v Move forward one page (can also use PgDn/Page Down key)
M-v Move backward one page (can also use PgUp/Page Up key)
M-< Move to beginning of file
M-> Move to end of file
C-x g Move to line number
$(h2 "Editing")
All edit commands that kill (cut) text is placed in a kill ring (clipboard).
Note: when marking text, there is no visual mark.
C-_ Undo, also C-x u
M-% Replace word/string in file, from cursor position
M-q Reformat paragraph (set fill column with C-x f)
C-s Search forward (type C-s again to find next)
C-r Reversed search
C-Space Set beginning of mark (beginning of selected text)
C-x C-x Jump back and forth between mark and cursor position
C-x h Mark whole buffer
C-w Wipe (cut) region from mark to cursor position
M-w Copy region from mark to cursor position
C-y Yank (paste) text from kill ring
C-k Kill (cut) to end of line
M-Backspace Kill (delete) previous word
M-d Kill (delete) next word
C-d Delete character to the right
C-o Open new line at cursor
$(h2 "General Commands")
C-g Abort current command
C-l Recenter buffer on current line
C-h b List all keybindings
M-! Run shell command, output in new buffer
C-z Suspend Mg, return to shell, use 'fg' to get back
C-x C-f Open file
C-x C-i Insert file at cursor position
C-x C-s Save file
C-x s Save file (interactive)
C-x k Kill (close) file
C-x C-b List open buffers (files)
C-x b Switch to another buffer
C-x C-c Exit
$(h2 "Window Commands")
C-x 0 Unsplit, keep other window
C-x 1 Unsplit, keep this window
C-x 2 Split window in two
C-x o Go to other window
C-x p Go to previous window
C-x n Go to next window
C-x ^ Enlarge this split
EOF
}
editor()
{
case $1 in
vi)
vi
;;
ed* | em* | mg)
emacs
;;
*)
vi
emacs
cat <<EOF
$(h1 "Summary")
Use Mg or GNU Nano if you are a beginner. The system is set up to so you can
use the 'edit' command, which will start GNU Nano:
edit /etc/rc.local # Starts GNU Nano
EOF
;;
esac
}
networking()
{
cat <<EOF
$(h1 "Networking")
This section details how to set up everything from basic to advanced networking.
Topics covered include:
- Static vs Dynamic Addresses
- VLAN Interfaces
- Bridging Interfaces
- Link Aggregation (bonding)
- Persistent Configuration
Please note, the terms 'port' and 'interface' may be used interchangably in
the following text (and elsewher online as well). Usually the term 'port' is
reserved for Ethernet links attached to a switch or bridge, while the term
'interface' more generically refers to the physical interface in a system.
$(h2 "Static vs Dynamic Addresses")
An IPv4 address consists of four "octets" separated by periods. A static IPv4
address can look like this:
192.168.1.42
However, for networking to function properly, a device usually needs a netmask,
default route, NTP server, and at least one DNS address. Setting all these up
statically is a lot of work to maintain, in particular with many devices.
For both IPv4 and IPv6 there is an alternative called DHCP. It is a dynamic
protocol where a server on request from a client device hands out a "lease" of
an IP address, as well as lot of other network parameters, including but not
limited to the ones already mentioned. A client device can give hints to the
server, e.g., its hostname, MAC address (default), or other client identifier.
It is up to the server to honor these hints or not, but it is very common to
set up the server to honor the client's hostname and automatically update the
central name server (DNS) when the client is online.
| There are many other interesting aspects to DHCP not covered here.
| For instance, DHCP relay servers (proxies), that can be used to
| forward DHCP requests from very large networks to a central server.
| Some relay "agents" even support something called Option 82, which
| when running on a simple switch, can attach port and relay info to
| the client's DHCP request -- allowing the server to assign an IP
| address per port, even on remote switches (with a relay agent).
When your interface is setup with DHCP, use the 'ifconfig' or 'ip addr' tools
to see which address you got, if needed (see next section).
In cases when the DHCP client cannot find a DHCP server, and thus not obtain a
lesae, the system falls back to set a link-local address (169.254.*.*). This
can be disabled by editing the file /etc/dhcpcd.conf, adding:
noipv4ll
A link-local address is however very useful, in particular in combination with
mDNS to discover and access a device you do not know, or do not want to know,
the IP address to. See more in the next section.
$(h2 "DNS and mDNS")
Managing a central DNS is both painful and time consuming, most networks, and
in particular industrial, therefore only set up a DNS for static servers and
resources. Leaving end devices, switches, and in many cases even routers,
without a human-friendly name on the network. This have misled many to think
that they need to know the IP address, and often opt for static addresses on
equipment. Meaning many devices out-of-the-box have a static address set that
need to be manually changed before the device is deployed on the network.
A less time consuming, and human-friendly, way is to enable mDNS (multicast
DNS). With this protocol the device notifies all neighbors on the same LAN
of how to reach it:
"Hello everyone, my address is 169.254.47.11, you can call me device.local"
Any other device that also has mDNS enabled can then automaticall update a
local database of name-to-address mappings. Usually the name sent out is
the device's hostname. (It is up to the device manufacturer to set a useful
default hostname, i.e., model-01-02-03, where the suffix is the last octets
of the base MAC address, from the product label on the case.)
As you can see, in combination with a link-local address (previous section)
mDNS is a very attractive combination that greatly simplify device management.
Tools:
avahi-browse -a
ping foo.local
mDNS, or more correctly mDNS-SD, is also used for *Service Discovery*. E.g.,
a printer can publish IPP records with meta data on the printer type and model
or donwload URL for drivers. Switches and routers usually publish how they
can be reached: HTTP/HTTPS and SSH.
Note: there are other mechanisms for device discovery. Microsoft have been
slow to adopt mDNS, having relied on their own SSDP protocol. For the
full experince Apple's "Bonjour" can be installed in Windows.
mDNS is supported in this product and should be enabled by default. To
verify it works, open the Windows File Explorer (Win+E) and scroll to
Network in the left-hand menu. An icon with a matching hostname can be
found there which, when clicked, opens up the device's Web Interface.
macOS users have mDNS fully integrated by default. Linux users can use
'mdns-scan' or Avahi, as shown above. The latter two can also just set
their web browsers to https://hostname-01-02-03.local
$(h2 "VLAN Interfaces")
A VLAN interface in Linux is an "upper" interface, e.g., 'eth0.1'. It is
where you set an IP address and interact with th rest of the world. The
base/raw/lower interface, here 'eth0', is the physical interface on which
Ethernet packets ingress and egress with a VLAN tag. To create 'eth0.1':
ip link add eth0.1 link eth0 vlan id 1
In Linux a VLAN interface is a "stackable" entity. Many VLAN interfaces
can be built on top of each other. When injecting a packet on the top
most interface, the kernel adds the corresponding VLAN "tag" when the
packet goes down the order of stacked interfaces, and then finally hits
the physical interface and proceeds to egress onto the media.
ip link add eth0.1.2 link eth0.1 vlan id 2
Injecting a packet on 'eth0.1.2' creates a double-tagged VLAN frame when
the packet egresses 'eth0'. The outermost tag has VID 1 and the inner
VID is 2.
VLAN interfaces can be used for many things, here we will focus on their
use as upper interface on a bridge.
$(h2 "Bridging Interfaces")
A bridge is the correct name for a switch. In the context of this text,
however, we will use the term to refer to the Linux bridge module in the
kernel, which implements an advanced software switch. The Linux bridge
supports "offloading" many switching functions to an underlying switching
chipset, when available. This greatly simplifies managing that switch since
the same tools one use to manage the bridge will, by extension, also be used
to manage the switch.
To create a bridge in Linux:
ip link add br0 type bridge
To add three ports (interfaces) to the bridge we use:
ip link set eth0 master br0
ip link set eth1 master br0
ip link set eth2 master br0
Bring all ports and the bridge 'up' and you have a working switch! Any frame
injected on eth0 (from the outside) can be switched to either of eth1, eth2,
*or* br0. As soon as the bridge has learned where end devices are connected,
none of the other ports will see the traffic -- like a regular switch.
Note: these ports should not (cannot) have any IP address. Instead, any IP
address is set on 'br0'. To disable IPv6 link-local address, set the
/proc/sys/net/ipv6/conf/eth0/disable_ipv6 sysctl file to '1'.
$(h2 "Bridging and VLANs")
A VLAN-aware bridge works the same way, only with VLAN separation taken into
account. All communication, as well as MAC address learning, is limited to
ports in the same VLAN. The syntax is slightly different and requires a few
more steps:
ip link add br0 type bridge vlan_filtering 1
ip link set eth0 master br0
ip link set eth1 master br0
ip link set eth2 master br0
ip link set eth3 master br0
To assign ports to different VLANs, and make sure they are regular "access"
ports (untagged). We assign eth0 and eth1 to VLAN 1 and the others to VLAN 2:
bridge vlan add vid 1 dev eth0 pvid untagged
bridge vlan add vid 1 dev eth1 pvid untagged
bridge vlan add vid 2 dev eth2 pvid untagged
bridge vlan add vid 2 dev eth3 pvid untagged
Here's the twist, to be able to reach the bridge (switch) itself from each
VLAN, we need to ensure the bridge itself is a tagged member of each VLAN:
bridge vlan add vid 1 dev br0 self
bridge vlan add vid 2 dev br0 self
This way we can add VLAN interfaces on top of br0, which we in turn can set
a static or dynamic IP address on:
ip link add vlan1 link br0 type vlan id 1
ip link add vlan2 link br0 type vlan id 2
The resulting stack of interfaces look like this:
:
vlan1 : vlan2 Layer-3 :: IP Networking
\\ : / _________________________
.-------------.
| br0 | Layer-2 :: Switching
'-------------' _________________________
/ | : | \\
eth0 eth1 : eth2 eth3 Layer-1 :: Link layer
:
$(h2 "Persistent Configuration")
A simple end device can get by with the following in /etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
This brings up both the loopback (required for UNIX networking to function),
and the (presumed only) Ethernet interface. The loopback gets its standard
address, 127.0.0.1, and eth0 will request its IP address using DHCP.
To set up the bridge example (above), is actually quite a lot easier than
using the command line ip and bridge tools. Create the file 'bridge':
edit /etc/network/interfaces.d/bridge
Paste in the following content:
iface e0
bridge-access 1
iface e1
bridge-access 1
iface e2
bridge-access 2
iface e3
bridge-access 2
auto br0
iface br0
bridge-ports e0 e1 e2 e3
bridge-vlan-aware yes
bridge-stp on
bridge-vids 1 2
auto vlan1
iface vlan1 inet dhcp
vlan-id 1
vlan-raw-device br0
auto vlan2
iface vlan2 inet static
vlan-id 2
vlan-raw-device br0
address 192.168.2.1/24
Notice how 'vlan1' only has a DHCP and 'vlan2' uses a static address. It is
possible to combine the two if needed. Use 'inet dhcp' and add an 'address'
statement to the iface stanza.
$(h2 "Port Classification")
The bundled 'show' script is a very handy tool. It use several tricks to make
information about the system more accessible. On switching capable hardware
products, switch ports are identified early at system bootstrap and placed in
the 'port' group. See 'ip link' output:
...
4: e0: <BROADCAST,MULTICAST> master br0 state UP $(em "group port")
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
...
When running in Qemu or other hardware it may be useful to manually classify
certain interfaces as ports. This can be achieved in many ways, here we show
two. First /etc/mactab, which is read at boot to rename interfaces according
their matching MAC address, one interface per line:
e0 52:54:00:12:34:56
e1 52:54:00:12:34:57
e2 52:54:00:12:34:58
e3 52:54:00:12:34:59
Another way is to add something like this to /etc/rc.local:
for port in eth0 eth1 eth3 eth4; do
ip link set \$port group port
done
$(h2 "Interesting Files")
- /etc/dhcpcd.conf General DHCP and ZeroConf (LL) settings
- /etc/network/interfaces The original, useful for small setups
- /etc/network/interfaces.d/* Snippets, useful for non-trivial setups
- /etc/mactab Rename interfaces: 'NAME16CHARS WHITESPACE MAC'
- /etc/sysctl.conf Interface and TCP/IP settings, e.g., routing
- /etc/sysctl.d/* Snippets, useful for per-subsystem settings
$(h1 "Summary")
All persistent networking is set up in /etc/network/interfaces using the
program ifupdown-ng. The tools to reconfigure networking at runtime are:
ifup [-a] [IFACES]
ifdown [-a] [IFACES]
When changing the configuration at runtime you usually have to bring the
affected interfaces down (ifdown e0 e1 e2 e3), if they were set up with
/etc/network/interfaces before. Then do the change, and bring it all up
again.
Both tools understand dependencies between interfaces, so when a 'ifup -a'
command is received it brings up all interfaces: adding links to br0 before
adding VLANs, the vlan1 and vlan2 interfaces on top so it of it all. Then
finally it can start the DHCP client on vlan1 and set the static IP address
on vlan2.
$(em ">>> Be careful with these tools when logged in remotely! <<<")
EOF
}
topic()
{
topic=$1
[ -n "$1" ] && shift
case $topic in
ed*)
# shellcheck disable=SC2068
editor $*
;;
net*)
networking
;;
*)
overview
;;
esac
}
if [ "$1" = "-p" ]; then
shift
pager="cat"
plain="yes"
else
if command -v most; then
pager=most
elif command -v less; then
pager="less -R"
elif command -v more; then
pager="more"
else
pager="cat"
fi
fi
if [ -t 1 ] ; then
fn=$(mktemp /tmp/system-help.XXXXXX)
# shellcheck disable=SC2086,SC2068
topic $@ >"$fn"
$pager "$fn"
rm "$fn"
else
topic "$*"
fi
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
# Changes hostname in /etc/hostname and /etc/hosts
current=$(cat /etc/hostname)
newname=$1
[ -n "$newname" ] || exit 1
sed -i "s/$current/$newname/" /etc/hosts
sed -i "s/$current/$newname/" /etc/hostname
hostname $newname
initctl touch sysklogd
initctl touch dnsmasq
initctl reload
+1
View File
@@ -0,0 +1 @@
/sbin/ip
+327
View File
@@ -0,0 +1,327 @@
#!/bin/sh
# Displays basic information about the system
# shellcheck disable=SC2048,SC2086
. /etc/os-release
bopt="-c"
opt="-br"
all=""
plain=""
TTY=$(resize)
eval "$TTY"
# COLUMS and ROWS should be set on the console, if not, use fallback
if [ -z "$COLUMNS" ]; then
if command -v tput; then
COLUMNS=$(tput cols)
else
COLUMNS=80
fi
fi
h1()
{
STR="$*"
if [ -n "$plain" ]; then
echo "$STR" | tr '[:lower:]' '[:upper:]'
else
printf "\033[7m%-${COLUMNS}s\033[0m\n" "$STR"
fi
}
h2()
{
STR="$*"
if [ -n "$plain" ]; then
echo "$STR"
echo "$STR" | sed 's/./-/g'
else
printf "\033[1m%-${COLUMNS}s\033[0m\n" "$STR"
fi
}
dm()
{
if [ -n "$plain" ]; then
echo "${*}"
else
printf "\033[2m%s\033[0m\n" "$*"
fi
}
ul()
{
if [ -n "$plain" ]; then
printf "__%s__" "$*"
else
printf "\033[4%s\033[0m" "$*"
fi
}
em()
{
if [ -n "$plain" ]; then
printf "**%s**" "$*"
else
printf "\033[5m%s\033[0m" "$*"
fi
}
usage()
{
cat <<EOF
usage:
show [opt] cmd
options:
-a Show all, of something
-f Show full output, not brief port/iface listings
-h Show this help text
-n Show output without any footer
-p Show plain output, no bells or whistles
commands:
port PORT Show port configuration and link information
ports Show ports available for bridging
vlans Show port groups in bridge
ifaces Show interfaces and their addresses
fdb Show forwarding database (unicast)
mdb Show multicast forwarding database
ip route Show routing table
log [FILE] Show latest entries from syslog, or other FILE
rmon PORT Show RMON counters for PORT (when applicable)
system Show OS details
version Show OS verson
EOF
}
# Usage 1: show port eth0
# Usage 2: show port
# Usage 3: show ports
#
# The first show ethtool output for 'eth0' (in this case). The latter
# two are the same, showing a summary of all interfaces classified as
# access ports.
ports()
{
if [ $# -gt 0 ] && [ -e "/sys/class/net/$1" ]; then
for port in $*; do
ethtool "$port"
done
return
fi
h1 "PORT STATE MAC ADDRESS FLAGS"
if grep -q port /etc/iproute2/group && [ -z "$all" ]; then
ip $opt link show group port
else
ip $opt link show
fi
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "Use: '[ip|bridge] --help' and '[ip|bridge] link help' for more details."
fi
}
vlans()
{
h1 "INTERFACE VLAN FLAGS"
bridge $bopt vlan show |tail +2 | awk 'NF { iface=$1; vid=$2; printf("%-16s %4d ", iface, vid); for (i=3; i <= NF; i++) printf("%s ", $i); printf("\n"); }'
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'bridge --help' and 'bridge vlan help' for more details."
fi
}
ifaces()
{
h1 "INTERFACE STATE ADDRESS"
if [ -n "$all" ]; then
ip $opt addr show
elif grep -q iface /etc/iproute2/group; then
ip $opt addr show group iface
else
ip $opt addr show |awk '{ if ($1 !~ /eth[0-9]*/ && $1 !~ /.*@NONE/) { print }}'
fi
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'ip --help' and 'ip address help' for more details."
fi
}
log()
{
if [ -n "$1" ] && [ -r "/var/log/$1" ]; then
fn="/var/log/$1"
else
fn="/var/log/syslog"
fi
if [ -n "$all" ]; then
cat $fn
else
tail -$LINES $fn
fi
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'tail -25 /log/FILE', 'tail -F /log/FILE' to continuously monitor files."
fi
}
rmon()
{
if [ -z "$*" ]; then
echo "Missing argument, see 'show port' for available interfaces"
exit 1
fi
for port in $*; do
ethtool -S "$port"
done
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'ethtool --help' for more details."
fi
}
rstp()
{
mstpctl showbridge
echo "br0 port info"
mstpctl showport br0
}
fdb()
{
bridge $bopt fdb show
}
mdb()
{
bridge $bopt mdb show
}
routes()
{
ip $opt route show
}
igmp()
{
querierctl $@
}
system()
{
h1 "SYSTEM INFORMATION"
echo "System Name : $(uname -n)"
echo "System Boot Mode : $(cat /tmp/.boot_mode)"
echo "System Description : $PRETTY_NAME"
echo "System Contact : $HOME_URL"
echo "System Timezone : $TZ"
echo "System Type : $NAME"
echo "System Version : $(cat /etc/version)"
echo "System Arch : $(uname -m)"
echo "Kernel Version : $(uname -sr)"
}
version()
{
cat /etc/version
}
while [ "$1" != "" ]; do
case $1 in
-a)
all=1
;;
-f)
opt=""
if [ -n "$plain" ]; then
opt="-color=never"
bopt="-color=never"
fi
;;
-n)
nofoot="yes"
;;
-p)
plain="yes"
opt="$opt -color=never"
bopt="$bopt -color=never"
;;
-h)
usage
exit 0
;;
*)
break
esac
shift
done
cmd=$1
if [ -n "$cmd" ]; then
shift
fi
case $cmd in
help)
usage
;;
port*)
ports $*
;;
vlan*)
vlans
;;
fdb)
fdb
;;
mdb)
mdb
;;
if*)
ifaces
;;
ip)
cmd=$1
shift
case $cmd in
addr*)
ifaces
;;
route*)
routes
;;
igmp*)
igmp $*
;;
*)
usage
;;
esac
;;
log)
log $1
;;
rmon)
rmon $*
;;
route*)
routes
;;
span*)
rstp
;;
sys*)
system
;;
ver*)
version
;;
*)
usage
exit 1
;;
esac
+55
View File
@@ -0,0 +1,55 @@
#!/bin/sh
#set -x
usage()
{
cat <<EOF
usage:
yorn [-h] ["Do you want to run command?" command]
options:
-h Show this help text
-p Show plain output, no bells or whistles
Displays the yes-or-no question and runs command on yes.
EOF
}
if [ -z "$1" ]; then
usage
exit 1
fi
case $1 in
-h)
usage
exit 0
;;
-p)
plain=1
shift
;;
*)
;;
esac
question=$1
shift
command=$*
if [ -z "$command" ]; then
usage
exit 1
fi
if [ -z "$plain" ]; then
if dialog --erase-on-exit --colors --defaultno --yesno "\Zb$question\ZB" 0 0; then
yorn=y
fi
else
# shellcheck disable=SC2162,SC3045
read -n 1 -p "$question (y/N): " yorn
fi
if [ "$yorn" = "y" ] || [ "$yorn" = "Y" ]; then
$command
fi
View File
View File
+11
View File
@@ -0,0 +1,11 @@
# System-wide .bashrc file for interactive bash(1) shells.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Disble built-ins
enable -n help
+51
View File
@@ -0,0 +1,51 @@
# Infix's configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
#hostname
# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid
# Persist interface configuration when dhcpcd exits.
persistent
# vendorclassid is set to blank to avoid sending the default of
# dhcpcd-<version>:<os>:<machine>:<platform>
vendorclassid
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# Request a hostname from the network
option host_name
# Most distributions have NTP support.
#option ntp_servers
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private
# Background immediately, do not wait for DHCP lease (speed up boot process)
background
+144
View File
@@ -0,0 +1,144 @@
#
# Run-time configuration file for dialog
#
# Automatically generated by "dialog --create-rc <file>"
#
#
# Types of values:
#
# Number - <number>
# String - "string"
# Boolean - <ON|OFF>
# Attribute - (foreground,background,highlight?,underline?,reverse?)
# Set aspect-ration.
aspect = 0
# Set separator (for multiple widgets output).
separate_widget = ""
# Set tab-length (for textbox tab-conversion).
tab_len = 0
# Make tab-traversal for checklist, etc., include the list.
visit_items = OFF
# Shadow dialog boxes? This also turns on color.
use_shadow = ON
# Turn color support ON or OFF
use_colors = ON
# Screen color
screen_color = (WHITE,BLUE,OFF)
# Shadow color
shadow_color = (BLACK,BLACK,OFF)
# Dialog box color
dialog_color = (BLACK,CYAN,OFF)
# Dialog box title color
title_color = (BLACK,CYAN,ON)
# Dialog box border color
border_color = dialog_color
# Active button color
button_active_color = (CYAN,BLACK,ON)
# Inactive button color
button_inactive_color = dialog_color
# Active button key color
button_key_active_color = (WHITE,BLACK,ON)
# Inactive button key color
button_key_inactive_color = (WHITE,CYAN,ON)
# Active button label color
button_label_active_color = button_active_color
# Inactive button label color
button_label_inactive_color = dialog_color
# Input box color
inputbox_color = (BLACK,CYAN,OFF)
# Input box border color
inputbox_border_color = inputbox_color
# Search box color
searchbox_color = inputbox_color
# Search box title color
searchbox_title_color = (BLUE,WHITE,ON)
# Search box border color
searchbox_border_color = (WHITE,WHITE,ON)
# File position indicator color
position_indicator_color = searchbox_title_color
# Menu box color
menubox_color = dialog_color
# Menu box border color
menubox_border_color = dialog_color
# Item color
item_color = inputbox_color
# Selected item color
item_selected_color = button_key_active_color
# Tag color
tag_color = button_inactive_color
# Selected tag color
tag_selected_color = (CYAN,BLACK,OFF)
# Tag key color
tag_key_color = button_key_inactive_color
# Selected tag key color
tag_key_selected_color = (WHITE,BLACK,ON)
# Check box color
check_color = inputbox_color
# Selected check box color
check_selected_color = button_key_active_color
# Up arrow color
uarrow_color = (GREEN,WHITE,ON)
# Down arrow color
darrow_color = uarrow_color
# Item help-text color
itemhelp_color = (WHITE,BLACK,OFF)
# Active form text color
form_active_text_color = button_key_active_color
# Form text color
form_text_color = (WHITE,CYAN,ON)
# Readonly form item color
form_item_readonly_color = (CYAN,WHITE,ON)
# Dialog box gauge color
gauge_color = searchbox_title_color
# Dialog box border2 color
border2_color = dialog_color
# Input box border2 color
inputbox_border2_color = inputbox_color
# Search box border2 color
searchbox_border2_color = inputbox_color
# Menu box border2 color
menubox_border2_color = dialog_color
+14
View File
@@ -0,0 +1,14 @@
# dnsmasq is the system resolver, the file /etc/resolv.conf is
# managed by openresolv. DHCP lease, VPN tunnel establishment,
# and similar events feed servers and configuration to dnsmasq.
domain-needed
#interface=lo
listen-address=127.0.0.1
enable-dbus
# Generated by openresolv
resolv-file=/var/lib/misc/resolv.conf
# Include all files in a directory which end in .conf
conf-dir=/etc/dnsmasq.d/,*.conf
+1
View File
@@ -0,0 +1 @@
set COLORTERM=yes
@@ -0,0 +1,2 @@
run [S] /lib/infix/nameif -- Probing network interfaces
run if:<!boot/netconf> [S] /lib/infix/swup --
@@ -0,0 +1,2 @@
task [S] /lib/infix/ssh-hostkeys --
service [2345789] <usr/ssh-hostkeys> /usr/sbin/sshd -D -- OpenSSH daemon
+1
View File
@@ -0,0 +1 @@
../available/sshd.conf
+25
View File
@@ -0,0 +1,25 @@
# Virtual filesystems
devtmpfs /dev devtmpfs defaults 0 0
mkdir#-p /dev/pts helper none 0 0
devpts /dev/pts devpts mode=620,ptmxmode=0666 0 0
mkdir#-p /dev/shm helper none 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs mode=1777,nosuid,nodev 0 0
tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0
debugfs /sys/kernel/debug debugfs nofail 0 0
cfgfs /config configfs nofail,noauto 0 0
# Optional host share when running in Qemu
hostfs /host 9p nofail,cache=none,msize=16384 0 0
# The chosen backing storage for the overlays placed on /cfg, /etc,
# /home, /root, and /var, are determined dynamically by /lib/infix/mnt
# depending on the available devices.
mnttmp /mnt/tmp tmpfs defaults 0 0
LABEL=aux /mnt/aux auto noatime,nodiratime,noauto 0 0
LABEL=var /mnt/var auto noatime,nodiratime,noauto 0 0
LABEL=cfg /mnt/cfg auto noatime,nodiratime,noauto 0 0
hostfs /mnt/host 9p cache=none,msize=16384,noauto 0 0
/lib/infix/mnt# /cfg helper none 0 0
+1
View File
@@ -0,0 +1 @@
/mnt/aux/uboot.env 0 0x4000
+2
View File
@@ -0,0 +1,2 @@
1 port
2 iface
+1
View File
@@ -0,0 +1 @@
\s (\l)
+1
View File
@@ -0,0 +1 @@
\s
+3
View File
@@ -0,0 +1,3 @@
# /etc/mactab: rename interfaces, use 'eN' to classify as bridge ports
# MAC IFNAME
# 01:02:03:c0:ff:ee e0
+112
View File
@@ -0,0 +1,112 @@
# NetBox mdev.conf based on https://github.com/slashbeast/mdev-like-a-boss/
# Syntax:
# [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
#
# [-]: do not stop on this match, continue reading mdev.conf
# =: move, >: move and create a symlink
# !: do not create device node
# @|$|*: run cmd if $ACTION=remove, @cmd if $ACTION=add, *cmd in all cases
# support module loading on hotplug
$MODALIAS=.* root:root 660 @modprobe -b "$MODALIAS"
# null may already exist; therefore ownership has to be changed with command
null root:root 666 @chmod 666 $MDEV
zero root:root 666
full root:root 666
random root:root 444
urandom root:root 444
hwrandom root:root 444
grsec root:root 660
# Kernel-based Virtual Machine.
#kvm root:kvm 660
# vhost-net, to be used with kvm.
#vhost-net root:kvm 660
kmem root:root 640
mem root:root 640
port root:root 640
# console may already exist; therefore ownership has to be changed with command
console root:tty 600 @chmod 600 $MDEV
ptmx root:tty 666
pty.* root:tty 660
# Typical devices
tty root:tty 666
tty[0-9]* root:tty 660
vcsa*[0-9]* root:tty 660
ttyS[0-9]* root:dialout 660
# block devices
ram([0-9]*) root:disk 660 >rd/%1
loop([0-9]+) root:disk 660 >loop/%1
sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom
fd[0-9]* root:floppy 660
#SUBSYSTEM=block;.* root:disk 660 */lib/infix/storage-device
# Run settle-nics every time new NIC appear.
# If you don't want to auto-populate /etc/mactab with NICs,
# run 'settle-nis' without '--write-mactab' param.
#-SUBSYSTEM=net;DEVPATH=.*/net/.*;.* root:root 600 @/lib/infix/settle-nics --write-mactab
net/tun[0-9]* root:netdev 660
net/tap[0-9]* root:root 600
# alsa sound devices and audio stuff
#SUBSYSTEM=sound;.* root:audio 660 @/lib/infix/sound-control
adsp root:audio 660 >sound/
audio root:audio 660 >sound/
dsp root:audio 660 >sound/
mixer root:audio 660 >sound/
sequencer.* root:audio 660 >sound/
# raid controllers
cciss!(.*) root:disk 660 =cciss/%1
ida!(.*) root:disk 660 =ida/%1
rd!(.*) root:disk 660 =rd/%1
fuse root:root 666
card[0-9] root:video 660 =dri/
agpgart root:root 660 >misc/
psaux root:root 660 >misc/
rtc root:root 664 >misc/
# input stuff
SUBSYSTEM=input;.* root:plugdev 660
# v4l stuff
vbi[0-9] root:video 660 >v4l/
video[0-9] root:video 660 >v4l/
# dvb stuff
dvb.* root:video 660
# drm etc
dri/.* root:video 660
# Don't create old usbdev* devices.
usbdev[0-9].[0-9]* root:root 660 !
# Stop creating x:x:x:x which looks like /dev/dm-*
[0-9]+\:[0-9]+\:[0-9]+\:[0-9]+ root:root 660 !
# /dev/cpu support.
microcode root:root 600 =cpu/
cpu([0-9]+) root:root 600 =cpu/%1/cpuid
msr([0-9]+) root:root 600 =cpu/%1/msr
# Populate /dev/bus/usb.
#SUBSYSTEM=usb;DEVTYPE=usb_device;.* root:root 660 */lib/infix/dev-bus-usb
# Catch-all other devices, Right now useful only for debuging.
#.* root:root 660 */lib/infix/catch-all
+1
View File
@@ -0,0 +1 @@
make-backup-files 0
+1
View File
@@ -0,0 +1 @@
Note: use help, show, and setup commands to set up and diagnose the system.
@@ -0,0 +1,6 @@
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
source-directory /etc/network/interfaces.d
+122
View File
@@ -0,0 +1,122 @@
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /restconf/ {
fastcgi_pass unix:/var/run/clixon/restconf.sock;
include fastcgi_params;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
+76
View File
@@ -0,0 +1,76 @@
#!/usr/bin/pdmenu
title:Setup & Diagnostics
color:desktop:blue:blue
color:title:blue:white
color:base:blue:white
menu:main:Main Menu:Use arrow keys, Enter, Escape, and Q to navigate
show:_System Settings..::system
show:_Network Settings..::network
show:_Tools..::tools
nop
exec:Show _fdb:truncate:show -p fdb
exec:Show _mdb:truncate:show -p mdb
exec:Show _ports:truncate:show -p ports
exec:Show _vlans:truncate:show -p vlans
exec:Show _interfaces:truncate:show -p iface
exec:Show _routes:truncate:show -p route
nop
exec:Show _online users:truncate:w
exec:Show _CPU Load::top
nop
show:_Help..::help
exit:_Quit
menu:help:Help:Help Menu
exec:Introduction:truncate:/bin/help -p
exec:Editors:truncate:/bin/help -p edit
exec:Networking:truncate:/bin/help -p net
nop
exit:_Main menu..
menu:network:Network:Network Settings
exec:Show all _links:truncated:ip -br link
exec:Show all _addresses:truncated:ip -br address
exec:Show managed _interfaces:truncated:ifparse --all
nop
exec:Take _interface down:edit:ifdown ~Enter name of interface to take down:~
exec:Take _interface up:edit:ifup ~Enter name of interface to take up:~
nop
exec:Edit _dhcpcd.conf::edit /etc/dhcpcd.conf
exec:Edit _dnsmasq.conf::edit /etc/dnsmasq.conf
exec:Edit _interfaces::edit /etc/network/interfaces
exec:Edit _mactab::edit /etc/mactab
exec:Edit _sysctl.conf::edit /etc/sysctl.conf
nop
exit:_Main menu..
menu:system:System:System Settings
exec:List _log files:truncate:ls -l /var/log
exec:Show _log file:edit,truncate:show -p -a log ~Show logfile, Enter for syslog:syslog~
exec:Change _hostname:edit:hostnm ~Enter new hostname \[-a-zA-Z0-9\]:~
exec:Change your _password::passwd
exec:Edit _rc.local::edit /etc/rc.local
nop
exec:_Show State of Services:truncate:initctl -p
exec:_Reload services:truncate:initctl reload;sleep 2;initctl -p
exec:Show _available services:truncate:initctl -p ls
exec:_Enable service:edit:initctl enable ~Enter name of service (filename) to enable:~
exec:_Disable service:edit:initctl disable ~Enter name of service (filename) to disable:~
nop
exec:_Change Operating Mode::chom
exec:_Factory Reset::yorn "Reboot and factory reset device, are you sure?" factory -y
nop
exit:_Main menu..
menu:tools:Tools:Tools
exec:_Ping:edit,pause:ping ~Enter address (IP or name) to ping:~
exec:_Shell Prompt::/bin/bash --login
exec:_SSH:edit,pause:ssh ~Enter [username@]address (IP or name) to SSH to:~
exec:_Telnet:edit,pause:telnet ~Enter address (IP or name) to telnet to:~
exec:_Traceroute:edit,pause:mtr ~Enter address (IP or name) to traceroute to:~
exec:Browse _WWW:edit,pause:lynx ~Enter URL to browse:~
nop
exit:_Main menu..
+27
View File
@@ -0,0 +1,27 @@
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
if [ "$PS1" ]; then
if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
export PS1='# '
else
export PS1='$ '
fi
fi
export COLORTERM=truecolor
fi
export EDITOR='/bin/vi'
# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
@@ -0,0 +1,19 @@
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
export EDITOR=/usr/bin/edit
alias vim='vi'
alias view='vi -R'
alias emacs='mg'
alias sensible-editor=edit
alias sensible-pager=pager
alias ip='ip --color=auto'
alias ipb='ip -br'
alias ipaddr='ip addr'
alias iplink='ip link'
alias bridge='bridge --color=auto'
alias setup='pdmenu; clear'
alias cli='clixon_cli'
+1
View File
@@ -0,0 +1 @@
PS1='\u@\h:\w\$ '
@@ -0,0 +1,2 @@
TTY=`resize`
eval $TTY
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# This file is run at the very end of runlevel S (bootstrap)
#
# Note: 1) not all initctl commands are allowed here
# 2) to enable IP forwarding, use /etc/sysctl.conf, or /etc/sysctl.d/
# 3) ensure the script calls `exit 0` at the end
#
# Uncomment to classify all interfaces starting with 'eth' as ports.
#for port in $(ip -br link |awk '/eth/{print $1}'); do
# ip link set $port group port
#done
# Uncomment to enable IP masquerading (NAT) of all traffic egressing
# the WAN interface, here eth0. E.g., if you are a router for your
# LAN on eth1.
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
exit 0
+10
View File
@@ -0,0 +1,10 @@
# dnsmasq is the system resolver
name_servers="127.0.0.1"
resolv_conf=/etc/resolv.conf
resolv_conf_options="edns0 trust-ad"
# dnsmasq specific settings and list of
# nameservers in non-standard locations
dnsmasq_conf=/etc/dnsmasq.d/resolvconf.conf
dnsmasq_resolv=/var/lib/misc/resolv.conf
@@ -0,0 +1 @@
lo
+1
View File
@@ -0,0 +1 @@
Include /etc/ssh/sshd_config.d/*.conf
@@ -0,0 +1 @@
Subsystem cli /usr/bin/clixon_cli
@@ -0,0 +1,3 @@
HostKey /var/lib/ssh/ssh_host_rsa_key
HostKey /var/lib/ssh/ssh_host_ecdsa_key
HostKey /var/lib/ssh/ssh_host_ed25519_key
+68
View File
@@ -0,0 +1,68 @@
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
###################################################################
# Functions previously found in netbase
#
# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1
# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1
###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
###################################################################
# Magic system request Key
# 0=disable, 1=enable all, >1 bitmask of sysrq functions
# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html
# for what other values do
#kernel.sysrq=438
@@ -0,0 +1,3 @@
*.=debug;\
auth,authpriv.none;\
news.none;mail.none -/var/log/debug
@@ -0,0 +1 @@
local7.* -/var/log/profinet.log
@@ -0,0 +1 @@
d /var/lib/chrony 0755 chrony chrony
@@ -0,0 +1,2 @@
d /var/cache/nginx 0755 www-data www-data
@@ -0,0 +1 @@
d /var/run/agentx - - -
+120
View File
@@ -0,0 +1,120 @@
#!/bin/sh
# Called from /etc/fstab to ensure we have something writable mounted
# at /cfg, /etc, /home, /root, and /var.
#
# /mnt/cfg is used to store device modifications made to /etc, /home,
# /root.
#
# /mnt/var is used as the backins store for /var. If /mnt/var is not
# available, /mnt/cfg will still be be used to persist /var/lib.
#
# If a disk partiion with the corresponding label ("cfg"/"var") is
# available, that is used to persist changes to the aforementioned
# directories. Otherwise fall back to a tmpfs based RAM disk. This
# effectively brings up the system with the default configuration, but
# obviously any subsequent configuration is ephemeral.
set -e
nm=$(basename $0)
err=0
opt="-k"
mount_rw()
{
# If something is already setup, leave it be.
mountpoint -q "/$1" && return 0
# TODO: Also look for UBI partitions
mount LABEL="$1" 2>/dev/null && return 0
return 1
}
# mkdir -p -m 0755 only applies to the deepest directory
# shellcheck disable=SC2174
mount_overlay()
{
tag="$1"
src="$2"
dst="$3"
u="$src/infix/$tag.u"
w="$src/infix/$tag.w"
mkdir -p -m 0755 "$u"
mkdir -p -m 0755 "$w"
mount -t overlay "$tag-overlay" "$dst" \
-o lowerdir="$dst",upperdir="$u",workdir="$w"
}
# Fall back to console logging if sysklogd is too old
if ! logger -? |grep -q "Log to kernel"; then
opt="-c"
fi
if ! mount_rw aux >/dev/null 2>&1; then
logger $opt -p user.warn -t "$nm" \
"No auxiliary partition found, software updates not supported."
fi
varsrc=/mnt/var
if ! mount_rw var >/dev/null 2>&1; then
logger $opt -p user.warn -t "$nm" \
"No persistent storage found for /var, only /var/lib is persisted."
varsrc=/mnt/tmp
vlibsrc=/mnt/cfg
fi
cfgsrc=/mnt/cfg
etcsrc=/mnt/tmp
if ! mount_rw cfg >/dev/null 2>&1; then
err=1
logger $opt -p user.crit -t "$nm" \
"No persistent storage found for /cfg, falling back to tmpfs."
cfgsrc=/mnt/tmp
# Even if /mnt/var isn't available, if /mnt/cfg isn't either, then
# there's no point in overlaying one ramdisk on top of another.
vlibsrc=
else
# Check for factory reset
if [ -f /mnt/cfg/infix/.reset ]; then
logger $opt -p user.crit -t "$nm" "Resetting to factory defaults."
rm -rf /mnt/cfg/infix /mnt/var/infix
sync
fi
if /lib/infix/use-etc; then
etcsrc=/mnt/cfg
fi
# Ensure that all users in wheel can create the .reset file
mkdir -p /mnt/cfg/infix
chgrp wheel /mnt/cfg/infix
fi
mount_overlay cfg $cfgsrc /cfg
mount_overlay etc $etcsrc /etc
mount_overlay home $cfgsrc /home
mount_overlay root $cfgsrc /root
mount_overlay var $varsrc /var
[ "$vlibsrc" ] && mount_overlay vlib "$vlibsrc" /var/lib
# Keep transient configs in a ramdisk and symlink out to /cfg for
# startup.
mkdir -p /mnt/tmp/infix/db
ln -s /cfg/startup_db /mnt/tmp/infix/db/startup_db
for tag in $(ls /sys/bus/virtio/devices/*/mount_tag 2>/dev/null); do
if [ "$(cat $tag | tr -d '\0')" = hostfs ]; then
mount hostfs
break
fi
done
exit $err
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
# Find any switch ports, classify and rename to Infix std
#
ident=$(basename "$0")
num=0
# Perform any interface renames as dictated by, first, any Qemu
# override (for testing), and then the user specific /etc/mactab
for file in /sys/firmware/qemu_fw_cfg/by_name/opt/mactab/raw /etc/mactab; do
if [ -f $file ]; then
logger -k -p user.notice -t "$ident" "calling nameif -c $file"
nameif -c $file -s
fi
done
# Find CPU interfaces used for connecting to a switch managed by DSA
for netif in /sys/class/net/*; do
iface=$(basename "$netif")
[ -f "/sys/class/net/$iface/dsa/tagging" ] || continue
# Disable SLAAC frames and such, that's for the port interfaces, and
# bring it up so we get link events from the ports to the bridge.
sysctl -q "net.ipv6.conf.$iface.disable_ipv6=1"
dsa="dsa$num"
logger -k -p user.notice -t "$ident" "Found DSA interface, renaming $iface -> $dsa"
ip link set dev "$iface" name $dsa
num=$((num + 1))
done
# Find and mark all switch ports
ports=$(devlink port 2>/dev/null | awk '/flavour physical/{print $5}')
for iface in $ports; do
ip link set "$iface" group port
done
# Testing, e.g., using /etc/mactab may use TAP devices to create
# emulated switch ports, make sure to mark them as well
ports=$(ip -json link | jq -r '.[].ifname | match("^e[[:digit:]]+").string')
for iface in $ports; do
ip link set "$iface" group port
done
# At least loopback in iface group
ip link set lo group iface
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
for type in ecdsa ed25519 rsa; do
[ -f /var/lib/ssh/ssh_host_${type}_key ] \
|| ssh-keygen -N "" -t $type -f /var/lib/ssh/ssh_host_${type}_key \
|| exit 1
done
initctl cond set ssh-hostkeys
+38
View File
@@ -0,0 +1,38 @@
#!/bin/sh
# Only runs in native /etc and PROFINET nodes.
if initctl cond get boot/profinet; then
initctl enable snmpd
initctl disable lldpd
fi
# Factory default: all switch ports in VLAN 1 of br0
# need to check for 'length > 0' because ip command
# outputs empty json objects for non-port group ifs
ports=$(ip -json link show group port | jq -r '.[].ifname | select(length > 0)' | tr "\n" " ")
[ -f /etc/network/interfaces.d/br0 ] || [ -z "$ports" ] && exit 0
touch /etc/network/interfaces.d/br0
for port in $ports; do
cat <<-EOF >>/etc/network/interfaces.d/br0
iface $port
bridge-access 1
post-up ip link set $port group port
EOF
done
cat <<-EOF >>/etc/network/interfaces.d/br0
auto br0
iface br0
bridge-ports $ports
bridge-vlan-aware yes
bridge-stp on
bridge-vids 1
auto vlan1
iface vlan1 inet dhcp
vlan-id 1
vlan-raw-device br0
post-up ip link set vlan1 group iface
EOF
ip link set vlan1 group iface
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
if [ -f /mnt/cfg/infix/.use_etc ]; then
exit 0
fi
# Finit's condition system may not yet be bootstrapped when this script
# is called, e.g., when /etc/fstab is parsed, so we have to manually
# check for the boot/etc condition.
awk '
$0 == "finit.cond" {
cond=1;
next;
}
cond == 1 {
use_etc = index($0, "etc") != 0;
}
END {
exit(use_etc ? 0 : 1);
}
' /proc/1/cmdline
@@ -0,0 +1,26 @@
#!/bin/sh
# Override boot mode based on user input from setup tool
set_cond()
{
mkdir -p /run/finit/cond/boot
ln -s /run/finit/cond/reconf "/run/finit/cond/boot/$1"
}
# Report to the setup and show tools the current boot mode
if /lib/infix/use-etc; then
if [ -f /mnt/cfg/infix/.use_etc ]; then
cat /mnt/cfg/infix/.use_etc > /tmp/.boot_mode
if grep -qi profinet /mnt/cfg/infix/.use_etc; then
set_cond profinet
else
set_cond etc
fi
else
echo "native /etc" > /tmp/.boot_mode
set_cond etc
fi
else
echo "NETCONF" > /tmp/.boot_mode
set_cond netconf
fi
+1
View File
@@ -0,0 +1 @@
var/log
View File
View File

Some files were not shown because too many files have changed in this diff Show More