mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-26 18:53:01 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
deee48d36a | ||
|
|
23e24635fe | ||
|
|
eb38d4538f | ||
|
|
2910d8b9bf | ||
|
|
6bdfdbe164 | ||
|
|
ceb78d66a2 | ||
|
|
9ac77be9eb | ||
|
|
d692a3d745 | ||
|
|
597da90b05 | ||
|
|
5d524006a3 | ||
|
|
4c1de659cb | ||
|
|
3b01f2d806 | ||
|
|
4e2458e18a | ||
|
|
dc741bb567 | ||
|
|
d5d487070f | ||
|
|
7052c54165 | ||
|
|
e25eb1966e | ||
|
|
fe1c47e107 | ||
|
|
57b66ec6d3 | ||
|
|
9103d31950 | ||
|
|
32ec9887b9 | ||
|
|
e0458ca079 | ||
|
|
e9aefc517f | ||
|
|
20295b08b5 | ||
|
|
7a9f1c1d7a | ||
|
|
7e08555013 | ||
|
|
82ff83c50d | ||
|
|
d277f5a860 | ||
|
|
f537e2fc13 | ||
|
|
73070f40c4 | ||
|
|
a0fb42e46d | ||
|
|
a820beebfa | ||
|
|
204672779b | ||
|
|
6a9f9fd3cc | ||
|
|
a78fd3da0a | ||
|
|
8721255554 | ||
|
|
5079691201 | ||
|
|
a23634dd7e | ||
|
|
3840ebc9fe | ||
|
|
56abfde8ec | ||
|
|
c81b03e1ca | ||
|
|
96d200fe70 | ||
|
|
7f2f3768db | ||
|
|
dc92db4e9f | ||
|
|
be828d46c9 | ||
|
|
a4a4a49eae | ||
|
|
2a6e4402f8 | ||
|
|
3031bba047 | ||
|
|
f9e430e41d | ||
|
|
17403afeb4 | ||
|
|
bca13137a3 | ||
|
|
6ba13776df | ||
|
|
1323d2f266 | ||
|
|
79d7e8bbab | ||
|
|
5a38e8768b | ||
|
|
c23b9c2dc4 | ||
|
|
5261e4f66f | ||
|
|
a6b7b3d2c0 | ||
|
|
b4d6c787d5 | ||
|
|
58b2ade1e6 | ||
|
|
228c93e430 | ||
|
|
2938efc8a4 | ||
|
|
ae82f7fdcf | ||
|
|
fbddedb51b | ||
|
|
43e2201dd1 | ||
|
|
b8b0cd3377 | ||
|
|
6b63b2f9b4 | ||
|
|
142eda81d5 | ||
|
|
fb3c026288 | ||
|
|
b0f4192f24 | ||
|
|
b9492c7bee | ||
|
|
31061fcc10 | ||
|
|
3e8ead6f92 | ||
|
|
b00b6cd6ea | ||
|
|
ba60b8b494 | ||
|
|
1e5d4612c9 | ||
|
|
b359ac794d | ||
|
|
3b00a376b1 | ||
|
|
00cdff1d2d | ||
|
|
3e5e89b328 | ||
|
|
56d1964559 | ||
|
|
0112113028 | ||
|
|
967bfc1e67 | ||
|
|
0284e2ca58 | ||
|
|
710616f8c4 | ||
|
|
dbf0fd2514 | ||
|
|
aefb90f8f3 | ||
|
|
49660b7771 | ||
|
|
55a20bb4c7 | ||
|
|
3b2bdbf93c | ||
|
|
04c843e095 | ||
|
|
1aa5169641 | ||
|
|
594d074f7a | ||
|
|
b81407e7d9 | ||
|
|
8fc0ab9b2f | ||
|
|
3b3656c8f5 | ||
|
|
0eb1fe0ab0 | ||
|
|
9be43ed0bb | ||
|
|
604f22e315 | ||
|
|
76f0c8e3e6 | ||
|
|
d36296da42 | ||
|
|
9f33658127 | ||
|
|
767a1f194b | ||
|
|
c7760a68cb | ||
|
|
933613e6a3 | ||
|
|
14fde1bf90 | ||
|
|
64c20d96ad | ||
|
|
a1771ff5c6 | ||
|
|
a7e7b75a97 | ||
|
|
822cb93265 | ||
|
|
cedb654643 | ||
|
|
52eafa70a8 | ||
|
|
6ba8e3bf55 | ||
|
|
f119138107 | ||
|
|
5c822efa6f | ||
|
|
19d5f1db1c | ||
|
|
438e39d2fe | ||
|
|
0ee973b2b2 | ||
|
|
c0e68579c1 | ||
|
|
5b61ccd960 | ||
|
|
1dd761560d | ||
|
|
076d174579 | ||
|
|
1470c473f6 | ||
|
|
9ae7115bbf | ||
|
|
f9a0c71b1f |
@@ -0,0 +1,36 @@
|
||||
Checklists for Pull Requests and Releases
|
||||
=========================================
|
||||
|
||||
Maintainer checklists for reviewing pull requests and doing releases.
|
||||
|
||||
|
||||
Pull Requests
|
||||
-------------
|
||||
|
||||
- If applicable, is there a readable ChangeLog entry?
|
||||
- If any LICENSE file has been updated, has the `.hash` file been updated?
|
||||
- If any change to a Finit `.svc` file, does any run/task linger?
|
||||
I.e., is there a runlevel and/or condition defined to prevent them
|
||||
from running outside of their intended runlevel?
|
||||
- If any change to grub or qemu/qeneth setup, has it been tested in GNS3?
|
||||
- If any change to u-boot/buildroot, has it been tested with `<booloader>_defconfig`
|
||||
- If any change to logging, have the resulting logs been audited?
|
||||
- Check for duplicate entries, misspellings
|
||||
- Check for sneaky severity changes, e.g., error vs note, error vs warning
|
||||
- If new subsystem, or major changes to a subsystem, have the docs been updated?
|
||||
- If change to mDNS, has it been tested with netbrowse?
|
||||
- If change to `_defconfig`, verify `local.mk` and sync with other archs
|
||||
- Test manually as well, e.g., CLI changes do not have ha regression tests
|
||||
- Build from distclean, or use artifacts built by build servers, for manual tests
|
||||
|
||||
|
||||
Releases
|
||||
--------
|
||||
|
||||
- Make at least one -betaN release to verify the GitHub workflow well in time release day
|
||||
- Stuff happens, remember kernelkit/infix#735
|
||||
- Make at least one -rcN to flush out any issues in customer repos
|
||||
- Easy to forget adaptations/hacks in customer repos -- may need Infix change/support
|
||||
- Ensure the markdown link for the release diff is updated
|
||||
- Ensure subrepos are tagged (can be automated, see kernelkit/infix#393)
|
||||
- Sync tags for all repo. sync activities
|
||||
@@ -1,5 +1,5 @@
|
||||
Contributing to Infix
|
||||
=====================
|
||||
Contributing Guidelines
|
||||
=======================
|
||||
|
||||
Thank :heart: you for taking the time to read this!
|
||||
|
||||
@@ -12,6 +12,7 @@ If you are unsure how to start implementing an idea or fix:
|
||||
- :bug: open an issue, there are human friendly templates for _bugs_
|
||||
and _feature requests_ at <https://github.com/kernelkit/infix/issues>
|
||||
- :speech_balloon: use the [Q&A Forum][discuss]
|
||||
- :technologist: The [Developer's Guide][devguide] is also a useful start
|
||||
|
||||
> _Talking about code and problems first is often the best way to get
|
||||
> started before submitting a pull request. We have found it always
|
||||
|
||||
+3
-3
@@ -4,9 +4,9 @@ project on GitHub, and Discord, see <https://github.com/kernelkit>:
|
||||
:speech_balloon: <https://github.com/orgs/kernelkit/discussions>
|
||||
:bug: <https://github.com/kernelkit/infix/issues>
|
||||
|
||||
Support contracts, development of new features, customer branding of
|
||||
Infix, and even customer specific features for dedicated products is
|
||||
provided by Addiva Elektronik.
|
||||
Support contracts, development of new features, fast-tracking of reviews
|
||||
and contributions, customer branding of Infix, and even customer specific
|
||||
features for dedicated products is provided by Addiva Elektronik.
|
||||
|
||||
:globe_with_meridians: <https://www.addiva.se/electronics/>
|
||||
:e-mail: <mailto:ael@addiva.se>
|
||||
|
||||
@@ -24,4 +24,5 @@ Tick *relevant* boxes, this PR is-a or has-a:
|
||||
- [ ] Refactoring (please detail in commit messages)
|
||||
- [ ] Build related changes
|
||||
- [ ] Documentation content changes
|
||||
- [ ] ChangeLog updated (for major changes)
|
||||
- [ ] Other (please describe):
|
||||
|
||||
@@ -101,6 +101,7 @@ jobs:
|
||||
runs-on: [ self-hosted, release ]
|
||||
permissions:
|
||||
contents: write
|
||||
discussions: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -115,12 +116,14 @@ jobs:
|
||||
ver=${GITHUB_REF#refs/tags/}
|
||||
fi
|
||||
echo "ver=${ver}" >> $GITHUB_OUTPUT
|
||||
echo "cat=" >> $GITHUB_OUTPUT
|
||||
if echo $ver | grep -qE 'v[0-9.]+(-alpha|-beta|-rc)[0-9]*'; then
|
||||
echo "pre=true" >> $GITHUB_OUTPUT
|
||||
echo "latest=false" >> $GITHUB_OUTPUT
|
||||
elif echo $ver | grep -qE '^v[0-9.]+\.[0-9.]+(\.[0-9]+)?$'; then
|
||||
echo "pre=false" >> $GITHUB_OUTPUT
|
||||
echo "latest=true" >> $GITHUB_OUTPUT
|
||||
echo "cat=Releases" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "pre=false" >> $GITHUB_OUTPUT
|
||||
echo "latest=false" >> $GITHUB_OUTPUT
|
||||
@@ -150,6 +153,7 @@ jobs:
|
||||
name: Infix ${{ github.ref_name }}
|
||||
prerelease: ${{ steps.rel.outputs.pre }}
|
||||
makeLatest: ${{ steps.rel.outputs.latest }}
|
||||
discussionCategory: ${{ steps.rel.outputs.cat }}
|
||||
bodyFile: release.md
|
||||
artifacts: "*.tar.gz*"
|
||||
|
||||
|
||||
@@ -52,6 +52,17 @@ config INFIX_IMAGE_ID
|
||||
Mandatory. When INFIX_RELEASE is set, this string is appended to
|
||||
the IMAGE_ID with a '-' separator.
|
||||
|
||||
config INFIX_COMPATIBLE
|
||||
string "Operating system compatible string"
|
||||
default "${INFIX_IMAGE_ID}"
|
||||
help
|
||||
A lower-case string (no spaces or other characters outside of 0–9,
|
||||
a–z, ".", "_" and "-"), used for image identification at upgrade.
|
||||
E.g., the RAUC [system] compatible string.
|
||||
|
||||
Mandatory. Defaults to $INFIX_IMAGE_ID, which in turn is composed
|
||||
of $INFIX_ID-$BR2_ARCH.
|
||||
|
||||
config INFIX_TAGLINE
|
||||
string "Operating system tagline"
|
||||
default "Infix -- a Network Operating System"
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* RTC has no valid bit, and this board does not connect any
|
||||
* backup power (e.g. supercap) to it, so it returns garbage
|
||||
* after every cold reset.
|
||||
*/
|
||||
&cp0_rtc {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/* UART0 (Console) */
|
||||
|
||||
@@ -257,14 +265,38 @@
|
||||
};
|
||||
};
|
||||
|
||||
#define SWP_LED(_func) \
|
||||
#define SWP_LED \
|
||||
leds { \
|
||||
#address-cells = <1>; \
|
||||
#size-cells = <0>; \
|
||||
\
|
||||
led@0 { \
|
||||
reg = <0>; \
|
||||
function = _func; \
|
||||
function = "tp"; \
|
||||
color = <LED_COLOR_ID_GREEN>; \
|
||||
default-state = "keep"; \
|
||||
}; \
|
||||
led@1 { \
|
||||
reg = <1>; \
|
||||
function = "aux"; \
|
||||
color = <LED_COLOR_ID_GREEN>; \
|
||||
default-state = "off"; \
|
||||
}; \
|
||||
}
|
||||
|
||||
/* SFP LEDs
|
||||
* Rev A. LEDs do not work at all
|
||||
* Rev B. only outer-most (green) LEDs work
|
||||
*/
|
||||
|
||||
#define SFP_LED \
|
||||
leds { \
|
||||
#address-cells = <1>; \
|
||||
#size-cells = <0>; \
|
||||
\
|
||||
led@0 { \
|
||||
reg = <0>; \
|
||||
function = "sfp"; \
|
||||
color = <LED_COLOR_ID_GREEN>; \
|
||||
default-state = "keep"; \
|
||||
}; \
|
||||
@@ -279,7 +311,7 @@
|
||||
phy-mode = "10gbase-r"; \
|
||||
managed = "in-band-status"; \
|
||||
sfp = <_sfp>; \
|
||||
SWP_LED("sfp"); \
|
||||
SFP_LED; \
|
||||
}
|
||||
|
||||
#define XSWCPU(_n, _eth) \
|
||||
@@ -313,7 +345,7 @@
|
||||
nvmem-cell-names = "mac-address"; \
|
||||
phy-mode = "gmii"; \
|
||||
phy-handle = <_phy>; \
|
||||
SWP_LED("tp"); \
|
||||
SWP_LED; \
|
||||
}
|
||||
|
||||
#define GPHY(_n) \
|
||||
|
||||
@@ -539,6 +539,8 @@ CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_FS=y
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
CONFIG_PANIC_TIMEOUT=20
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
# CONFIG_SCHED_DEBUG is not set
|
||||
# CONFIG_RCU_TRACE is not set
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
}
|
||||
},
|
||||
"ietf-netconf-acm:nacm": {
|
||||
"enable-nacm": true,
|
||||
"groups": {
|
||||
"group": [
|
||||
{
|
||||
@@ -83,6 +84,21 @@
|
||||
"comment": "Allow 'admin' group complete access to all operations and data."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "default-deny-all",
|
||||
"group": [
|
||||
"*"
|
||||
],
|
||||
"rule": [
|
||||
{
|
||||
"name": "deny-password-read",
|
||||
"module-name": "ietf-system",
|
||||
"path": "/ietf-system:system/authentication/user/password",
|
||||
"access-operations": "*",
|
||||
"action": "deny"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -123,7 +139,8 @@
|
||||
"name": "ntp.org",
|
||||
"udp": {
|
||||
"address": "pool.ntp.org"
|
||||
}
|
||||
},
|
||||
"iburst": true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -169,7 +186,7 @@
|
||||
]
|
||||
},
|
||||
"infix-meta:meta": {
|
||||
"infix-meta:version": "1.0"
|
||||
"infix-meta:version": "1.2"
|
||||
},
|
||||
"infix-services:mdns": {
|
||||
"enabled": true
|
||||
|
||||
Executable
+111
@@ -0,0 +1,111 @@
|
||||
#!/bin/sh
|
||||
# Raw switch LED Control for systems that do not run iitod
|
||||
|
||||
|
||||
LEDS=$(find /sys/class/leds -iname '*mdio-mii*')
|
||||
LINK=$(find /sys/class/leds -iname '*mdio-mii*p')
|
||||
|
||||
# Disable ALL switch port LEDs
|
||||
clear()
|
||||
{
|
||||
for led in $LEDS; do
|
||||
echo 0 > "${led}/brightness"
|
||||
done
|
||||
}
|
||||
|
||||
setup()
|
||||
{
|
||||
for led in $LINK; do
|
||||
echo netdev > "${led}/trigger"
|
||||
done
|
||||
|
||||
for led in $LINK; do
|
||||
cd "$led"
|
||||
# No sleep here, it's enough with the delay from previous loop
|
||||
echo 1 > link
|
||||
sleep 0.1
|
||||
echo 1 > rx
|
||||
sleep 0.1
|
||||
echo 1 > tx
|
||||
cd - >/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
leds()
|
||||
{
|
||||
for led in $LINK; do
|
||||
printf "%3s: %s\n" "$(cat "$led/device_name" 2>/dev/null)" "$led"
|
||||
done
|
||||
}
|
||||
|
||||
list()
|
||||
{
|
||||
leds | sort | while read -r port path; do
|
||||
printf "%4s %s\n" "$port" "$(basename "$path")"
|
||||
|
||||
aux=${path%%:tp}:aux
|
||||
if [ -e "$aux" ]; then
|
||||
printf "%3s: %s\n" "" "$(basename "$aux")"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
flash()
|
||||
{
|
||||
sec=$1
|
||||
|
||||
for led in $LEDS; do
|
||||
echo timer > "${led}/trigger"
|
||||
done
|
||||
|
||||
for led in $LEDS; do
|
||||
echo 84 > "${led}/delay_on"
|
||||
echo 84 > "${led}/delay_off"
|
||||
done
|
||||
|
||||
sleep "$sec"
|
||||
clear
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "usage: $0 [command]"
|
||||
echo
|
||||
echo "flash [SEC] Flash all LEDs to locate device in rack, default: 5 sec"
|
||||
echo "list List all LEDs"
|
||||
echo "setup Set up and start normal operation"
|
||||
echo "start Call at system init, clears all LEDs and sets up normal op"
|
||||
echo "stop Clear all LEDs, may be called at system shutdown"
|
||||
echo
|
||||
echo "Please ensure no other tool or daemon is already managing the LEDs."
|
||||
}
|
||||
|
||||
cmd=$1; shift
|
||||
case $cmd in
|
||||
flash)
|
||||
flash ${1:-5}
|
||||
setup
|
||||
;;
|
||||
help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
list | ls)
|
||||
list
|
||||
;;
|
||||
setup)
|
||||
setup
|
||||
;;
|
||||
start)
|
||||
initctl -nbq cond clear led
|
||||
clear
|
||||
setup
|
||||
;;
|
||||
stop)
|
||||
clear
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
+1
@@ -0,0 +1 @@
|
||||
/usr/libexec/styx/led.sh
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Busybox version: 1.36.0
|
||||
# Thu Feb 8 08:22:32 2024
|
||||
# Busybox version: 1.36.1
|
||||
# Tue Oct 22 13:12:02 2024
|
||||
#
|
||||
CONFIG_HAVE_DOT_CONFIG=y
|
||||
|
||||
@@ -957,10 +957,10 @@ CONFIG_FEATURE_NETSTAT_PRG=y
|
||||
CONFIG_NSLOOKUP=y
|
||||
CONFIG_FEATURE_NSLOOKUP_BIG=y
|
||||
CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
|
||||
CONFIG_NTPD=y
|
||||
CONFIG_FEATURE_NTPD_SERVER=y
|
||||
CONFIG_FEATURE_NTPD_CONF=y
|
||||
CONFIG_FEATURE_NTP_AUTH=y
|
||||
# CONFIG_NTPD is not set
|
||||
# CONFIG_FEATURE_NTPD_SERVER is not set
|
||||
# CONFIG_FEATURE_NTPD_CONF is not set
|
||||
# CONFIG_FEATURE_NTP_AUTH is not set
|
||||
CONFIG_PING=y
|
||||
CONFIG_PING6=y
|
||||
CONFIG_FEATURE_FANCY_PING=y
|
||||
|
||||
+11
-2
@@ -16,13 +16,22 @@ die()
|
||||
# DISK_IMAGE_SIZE="512"
|
||||
# etc.
|
||||
#
|
||||
# Nested variables, like INFIX_COMPATIBLE="${INFIX_IMAGE_ID}"
|
||||
# are handled by sourcing the file in a subshell.
|
||||
#
|
||||
# shellcheck disable=SC1090
|
||||
load_cfg()
|
||||
{
|
||||
tmp=$(mktemp -p /tmp)
|
||||
(
|
||||
. "$BR2_CONFIG" 2>/dev/null
|
||||
|
||||
# Set *all* matching variables
|
||||
set | grep -E "^${1}[^=]*=" | while IFS= read -r line; do
|
||||
echo "$line"
|
||||
done
|
||||
) > "$tmp"
|
||||
|
||||
grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp"
|
||||
. "$tmp"
|
||||
|
||||
rm "$tmp"
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ else
|
||||
fi
|
||||
|
||||
if [ -f "$TARGET_DIR/etc/rauc/system.conf" ]; then
|
||||
sed -i "s/compatible=.*/compatible=$NAME/" "$TARGET_DIR/etc/rauc/system.conf"
|
||||
sed -i "s/compatible=.*/compatible=$INFIX_COMPATIBLE/" "$TARGET_DIR/etc/rauc/system.conf"
|
||||
fi
|
||||
|
||||
# This is a symlink to /usr/lib/os-release, so we remove this to keep
|
||||
|
||||
@@ -7,11 +7,14 @@ common=$(dirname "$(readlink -f "$0")")
|
||||
# shellcheck disable=SC1091
|
||||
. "$TARGET_DIR/etc/os-release"
|
||||
|
||||
load_cfg INFIX_ID
|
||||
# The INFIX_* variables may be composed from BR2_* variables,
|
||||
# so we source them last.
|
||||
load_cfg BR2_ARCH
|
||||
load_cfg BR2_DEFCONFIG
|
||||
load_cfg BR2_EXTERNAL_INFIX_PATH
|
||||
load_cfg BR2_TARGET_ROOTFS
|
||||
load_cfg INFIX_ID
|
||||
load_cfg INFIX_COMPATIBLE
|
||||
|
||||
# The default IMAGE_ID is infix-$BR2_ARCH but can be overridden
|
||||
# for imaage names, and compat strings, like infix-r2s
|
||||
@@ -39,7 +42,7 @@ if [ "$SIGN_ENABLED" = "y" ]; then
|
||||
$common/sign.sh $BR2_ARCH $SIGN_KEY
|
||||
|
||||
ixmsg "Creating RAUC Update Bundle"
|
||||
$common/mkrauc.sh "$NAME$(ver)" $NAME $SIGN_KEY
|
||||
$common/mkrauc.sh "$NAME$(ver)" $INFIX_COMPATIBLE $SIGN_KEY
|
||||
fi
|
||||
|
||||
load_cfg DISK_IMAGE
|
||||
|
||||
@@ -106,6 +106,8 @@ config QEMU_DTB_EXTEND
|
||||
depends on QEMU_LOADER_UBOOT
|
||||
default y if QEMU_aarch64
|
||||
|
||||
if QEMU_ROOTFS_INITRD
|
||||
|
||||
config QEMU_RW
|
||||
string "Writable /cfg layer"
|
||||
depends on QEMU_ROOTFS_INITRD
|
||||
@@ -123,6 +125,8 @@ config QEMU_RW_VAR
|
||||
default "var.ext4"
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
config QEMU_VPD
|
||||
bool "Emulate a Vital Product Data (VPD) Memory"
|
||||
|
||||
@@ -137,6 +141,51 @@ config QEMU_APPEND
|
||||
config QEMU_EXTRA
|
||||
string "Extra QEMU options"
|
||||
|
||||
|
||||
comment "RTC"
|
||||
|
||||
choice
|
||||
prompt "Mode"
|
||||
default QEMU_RTC_UTC
|
||||
|
||||
config QEMU_RTC_UTC
|
||||
bool "UTC"
|
||||
|
||||
config QEMU_RTC_LOCAL
|
||||
bool "Local time"
|
||||
|
||||
config QEMU_RTC_RANDOM
|
||||
bool "Random"
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "Clock"
|
||||
default QEMU_CLOCK_HOST
|
||||
|
||||
config QEMU_CLOCK_HOST
|
||||
bool "Host clock"
|
||||
|
||||
config QEMU_CLOCK_RT
|
||||
bool "Independent (monotonic)"
|
||||
|
||||
config QEMU_CLOCK_VM
|
||||
bool "Virtual"
|
||||
|
||||
endchoice
|
||||
|
||||
config QEMU_RTC
|
||||
string
|
||||
default "utc" if QEMU_RTC_UTC
|
||||
default "localtime" if QEMU_RTC_LOCAL
|
||||
default "random" if QEMU_RTC_RANDOM
|
||||
|
||||
config QEMU_CLOCK
|
||||
string
|
||||
default "host" if QEMU_CLOCK_HOST
|
||||
default "rt" if QEMU_CLOCK_RT
|
||||
default "vm" if QEMU_CLOCK_VM
|
||||
|
||||
comment "Networking"
|
||||
|
||||
choice
|
||||
|
||||
@@ -261,7 +261,25 @@ EOF
|
||||
|
||||
wdt_args()
|
||||
{
|
||||
echo -n "-device i6300esb -rtc clock=host"
|
||||
echo -n "-device i6300esb "
|
||||
}
|
||||
|
||||
random_date()
|
||||
{
|
||||
rand=$(($(date +%_s) * $$ + $(date +%N | sed 's/^0*//')))
|
||||
when=$((rand % 7258118400)) # 1970 - 2200
|
||||
date -d "@$when" +"%Y-%m-%dT%H:%M:%S"
|
||||
}
|
||||
|
||||
rtc_args()
|
||||
{
|
||||
rtc="${CONFIG_QEMU_RTC:-utc}"
|
||||
clock="${CONFIG_QEMU_CLOCK:-host}"
|
||||
if [ "$rtc" = "random" ]; then
|
||||
rtc=$(random_date)
|
||||
fi
|
||||
|
||||
echo -n "-rtc base=$rtc,clock=$clock"
|
||||
}
|
||||
|
||||
gdb_args()
|
||||
@@ -273,11 +291,19 @@ gdb_args()
|
||||
run_qemu()
|
||||
{
|
||||
if [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
|
||||
qemu-img create -f qcow2 -o backing_file=$CONFIG_QEMU_ROOTFS -F raw $CONFIG_QEMU_ROOTFS.qcow2 > /dev/null
|
||||
if ! qemu-img check "${CONFIG_QEMU_ROOTFS}.qcow2"; then
|
||||
rm -f "${CONFIG_QEMU_ROOTFS}.qcow2"
|
||||
fi
|
||||
if [ ! -f "${CONFIG_QEMU_ROOTFS}.qcow2" ]; then
|
||||
echo "Creating qcow2 disk image for Qemu ..."
|
||||
qemu-img create -f qcow2 -o backing_file="$CONFIG_QEMU_ROOTFS" \
|
||||
-F raw "${CONFIG_QEMU_ROOTFS}.qcow2" > /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
local qemu
|
||||
read qemu <<EOF
|
||||
$CONFIG_QEMU_MACHINE -m $CONFIG_QEMU_MACHINE_RAM \
|
||||
$CONFIG_QEMU_MACHINE -nodefaults -m $CONFIG_QEMU_MACHINE_RAM \
|
||||
$(loader_args) \
|
||||
$(rootfs_args) \
|
||||
$(serial_args) \
|
||||
@@ -286,16 +312,23 @@ run_qemu()
|
||||
$(host_args) \
|
||||
$(net_args) \
|
||||
$(wdt_args) \
|
||||
$(rtc_args) \
|
||||
$(vpd_args) \
|
||||
$(gdb_args) \
|
||||
$CONFIG_QEMU_EXTRA
|
||||
EOF
|
||||
|
||||
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
|
||||
line=$(stty -g)
|
||||
stty raw
|
||||
|
||||
if [ "$CONFIG_QEMU_KERNEL" ]; then
|
||||
$qemu -append "$(append_args)" "$@"
|
||||
else
|
||||
$qemu "$@"
|
||||
fi
|
||||
|
||||
stty "$line"
|
||||
}
|
||||
|
||||
dtb_args()
|
||||
@@ -401,8 +434,4 @@ fi
|
||||
|
||||
generate_dot
|
||||
|
||||
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
|
||||
line=$(stty -g)
|
||||
stty raw
|
||||
run_qemu $(dtb_args)
|
||||
stty "$line"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
RAUC_ARGS="-s"
|
||||
+1
@@ -0,0 +1 @@
|
||||
/var/lib/dbus/machine-id
|
||||
@@ -8,10 +8,11 @@ import struct
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
onieprom = importlib.machinery.SourceFileLoader("onieprom","/bin/onieprom").load_module()
|
||||
SYSTEM_JSON = "/run/system.json"
|
||||
onieprom = importlib.machinery.SourceFileLoader("onieprom", "/bin/onieprom").load_module()
|
||||
SYSTEM_JSON = "/run/system.json"
|
||||
KKIT_IANA_PEM = 61046
|
||||
|
||||
|
||||
class DTSystem:
|
||||
BASE = "/sys/firmware/devicetree/base"
|
||||
INFIX = BASE + "/chosen/infix"
|
||||
@@ -28,7 +29,9 @@ class DTSystem:
|
||||
if not os.path.exists(phandle):
|
||||
continue
|
||||
|
||||
ph, = struct.unpack(">L", open(phandle, "rb").read())
|
||||
with open(phandle, "rb") as f:
|
||||
data = f.read()
|
||||
ph, = struct.unpack(">L", data)
|
||||
dt[ph] = root
|
||||
|
||||
sys = {}
|
||||
@@ -40,14 +43,18 @@ class DTSystem:
|
||||
if not os.path.exists(phandle):
|
||||
continue
|
||||
|
||||
ph, = struct.unpack(">L", open(phandle, "rb").read())
|
||||
with open(phandle, "rb") as f:
|
||||
data = f.read()
|
||||
ph, = struct.unpack(">L", data)
|
||||
if ph not in sys:
|
||||
sys[ph] = []
|
||||
sys[ph].append(root)
|
||||
|
||||
phs = set(list(dt.keys()) + list(sys.keys()))
|
||||
|
||||
self.devs = { ph: [Device(ph, dt.get(ph), s if s is not None else "") for s in (sys.get(ph) or []) if ph is not None] for ph in phs }
|
||||
self.devs = {ph: [Device(ph, dt.get(ph), s if s is not None else "")
|
||||
for s in (sys.get(ph) or []) if ph is not None]
|
||||
for ph in phs}
|
||||
self.base = Device(0, None, DTSystem.BASE)
|
||||
self.infix = Device(0, None, DTSystem.INFIX)
|
||||
|
||||
@@ -56,7 +63,8 @@ class DTSystem:
|
||||
if not os.path.exists(path):
|
||||
return ()
|
||||
|
||||
data = open(path, "rb").read()
|
||||
with open(path, "rb") as f:
|
||||
data = f.read()
|
||||
elems = len(data) // struct.calcsize(">L")
|
||||
return struct.unpack(">" + elems * "L", data)
|
||||
|
||||
@@ -69,7 +77,8 @@ class DTSystem:
|
||||
return {}
|
||||
|
||||
try:
|
||||
data = onieprom.from_tlv(open(dev.attrpath("nvmem"), "rb", 0))
|
||||
with open(dev.attrpath("nvmem"), "rb", 0) as f:
|
||||
data = onieprom.from_tlv(f)
|
||||
except:
|
||||
data = {}
|
||||
|
||||
@@ -84,14 +93,18 @@ class DTSystem:
|
||||
}
|
||||
|
||||
def infix_usb_devices(self, out):
|
||||
names=self.infix.str_array("usb-port-names", ())
|
||||
phs=self.__get_phandle_array("usb-ports")
|
||||
data=dict(zip(names,phs))
|
||||
names = self.infix.str_array("usb-port-names", ())
|
||||
phs = self.__get_phandle_array("usb-ports")
|
||||
data = dict(zip(names, phs))
|
||||
if data != {}:
|
||||
out["usb-ports"] = []
|
||||
for name,ph in data.items():
|
||||
[out["usb-ports"].extend([{"name": name, "path": dev.attrpath("authorized")}, {"name": name, "path": dev.attrpath("authorized_default")}]) for dev in self.devices_from_ph(ph)]
|
||||
|
||||
for name, ph in data.items():
|
||||
[out["usb-ports"].extend([{
|
||||
"name": name,
|
||||
"path": dev.attrpath("authorized")}, {
|
||||
"name": name,
|
||||
"path": dev.attrpath("authorized_default")
|
||||
}]) for dev in self.devices_from_ph(ph)]
|
||||
|
||||
def infix_devices(self, kind):
|
||||
phs = self.__get_phandle_array(kind)
|
||||
@@ -101,6 +114,7 @@ class DTSystem:
|
||||
flat_devices = [device for sublist in self.infix_devices("vpds") for device in sublist]
|
||||
return [self.into_vpd(device) for device in flat_devices]
|
||||
|
||||
|
||||
class QEMUSystem:
|
||||
BASE = "/sys/firmware/qemu_fw_cfg"
|
||||
REV = BASE + "/rev"
|
||||
@@ -110,7 +124,8 @@ class QEMUSystem:
|
||||
data = {}
|
||||
if os.path.exists(QEMUSystem.VPD):
|
||||
try:
|
||||
data = onieprom.from_tlv(open(QEMUSystem.VPD, "rb", 0))
|
||||
with open(QEMUSystem.VPD, "rb", 0) as f:
|
||||
data = onieprom.from_tlv(f)
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -127,31 +142,27 @@ class QEMUSystem:
|
||||
def usb_ports(self):
|
||||
ports = [
|
||||
{
|
||||
"name": "USB",
|
||||
"path": "/sys/bus/usb/devices/usb1/authorized"
|
||||
|
||||
},
|
||||
{
|
||||
"name": "USB",
|
||||
"path": "/sys/bus/usb/devices/usb1/authorized_default"
|
||||
|
||||
},
|
||||
{
|
||||
"name": "USB2",
|
||||
"path": "/sys/bus/usb/devices/usb2/authorized"
|
||||
},
|
||||
{
|
||||
"name": "USB2",
|
||||
"path": "/sys/bus/usb/devices/usb2/authorized_default"
|
||||
|
||||
}]
|
||||
"name": "USB",
|
||||
"path": "/sys/bus/usb/devices/usb1/authorized"
|
||||
}, {
|
||||
"name": "USB",
|
||||
"path": "/sys/bus/usb/devices/usb1/authorized_default"
|
||||
}, {
|
||||
"name": "USB2",
|
||||
"path": "/sys/bus/usb/devices/usb2/authorized"
|
||||
}, {
|
||||
"name": "USB2",
|
||||
"path": "/sys/bus/usb/devices/usb2/authorized_default"
|
||||
}]
|
||||
return ports
|
||||
|
||||
|
||||
class Device:
|
||||
def __init__(self, ph, dtpath, syspath):
|
||||
self.ph, self.dtpath, self.syspath = ph, dtpath, syspath
|
||||
|
||||
def available(self):
|
||||
return self.syspath != None
|
||||
return self.syspath is not None
|
||||
|
||||
def __getitem__(self, attr):
|
||||
return self.attr(attr).decode("utf-8").strip("\0")
|
||||
@@ -159,7 +170,6 @@ class Device:
|
||||
def __setitem__(self, attr, value):
|
||||
return self.attr(attr, val=value.encode("utf-8"))
|
||||
|
||||
|
||||
def attrpath(self, attr):
|
||||
return os.path.join(self.syspath, attr)
|
||||
|
||||
@@ -168,13 +178,16 @@ class Device:
|
||||
|
||||
def attr(self, attr, default=None, val=None):
|
||||
if not self.hasattr(attr):
|
||||
return default if val == None else False
|
||||
return default if val is None else False
|
||||
|
||||
if val:
|
||||
open(self.attrpath(attr), "wb").write(value)
|
||||
with open(self.attrpath(attr), "wb") as f:
|
||||
f.write(val)
|
||||
return True
|
||||
|
||||
return open(self.attrpath(attr), "rb").read()
|
||||
with open(self.attrpath(attr), "rb") as f:
|
||||
data = f.read()
|
||||
return data
|
||||
|
||||
def str(self, attr, default=None):
|
||||
val = self.attr(attr)
|
||||
@@ -194,7 +207,9 @@ class Device:
|
||||
if not self.hasdtattr(attr):
|
||||
return default
|
||||
|
||||
return open(self.dtattrpath(attr), "rb").read()
|
||||
with open(self.dtattrpath(attr), "rb") as f:
|
||||
data = f.read()
|
||||
return data
|
||||
|
||||
def dtstr(self, attr, default=None):
|
||||
val = self.dtattr(attr)
|
||||
@@ -212,6 +227,7 @@ def vpd_get_json_ve(vpd, pem):
|
||||
|
||||
return out
|
||||
|
||||
|
||||
def vpd_get_pwhash(vpd):
|
||||
if not vpd.get("trusted"):
|
||||
return None
|
||||
@@ -219,8 +235,9 @@ def vpd_get_pwhash(vpd):
|
||||
kkit = vpd_get_json_ve(vpd, KKIT_IANA_PEM)
|
||||
return kkit.get("pwhash")
|
||||
|
||||
|
||||
def vpd_inject(out, vpds):
|
||||
out["vpd"] = { vpd["board"]: vpd for vpd in vpds }
|
||||
out["vpd"] = {vpd["board"]: vpd for vpd in vpds}
|
||||
|
||||
product = out["vpd"].get("product", {}).get("data", {})
|
||||
hoistattrs = ("vendor", "product-name", "part-number", "serial-number", "mac-address")
|
||||
@@ -234,6 +251,7 @@ def vpd_inject(out, vpds):
|
||||
out["factory-password-hash"] = pwhash
|
||||
break
|
||||
|
||||
|
||||
def qemu_base_mac():
|
||||
"""Find MAC address of first non-loopback interface, subtract with 1"""
|
||||
base_path = '/sys/class/net'
|
||||
@@ -244,7 +262,8 @@ def qemu_base_mac():
|
||||
continue
|
||||
try:
|
||||
# pylint: disable=invalid-name
|
||||
with open(os.path.join(base_path, iface, 'address'), 'r', encoding='ascii') as f:
|
||||
fn = os.path.join(base_path, iface, 'address')
|
||||
with open(fn, 'r', encoding='ascii') as f:
|
||||
mac = f.read().strip()
|
||||
interfaces.append((mac, iface))
|
||||
except FileNotFoundError:
|
||||
@@ -261,6 +280,7 @@ def qemu_base_mac():
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def probe_qemusystem(out):
|
||||
"""Probe Qemu based test systems and 'make run'"""
|
||||
admin_hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A"
|
||||
@@ -288,6 +308,7 @@ def probe_qemusystem(out):
|
||||
subprocess.run("initctl -nbq cond set qemu".split(), check=False)
|
||||
return 0
|
||||
|
||||
|
||||
def probe_dtsystem(out):
|
||||
"""Probe DTS based system, expects a VPD in ONIE PROM format."""
|
||||
dtsys = DTSystem()
|
||||
@@ -297,6 +318,8 @@ def probe_dtsystem(out):
|
||||
if model:
|
||||
out["product-name"] = model
|
||||
|
||||
out["compatible"] = dtsys.base.str_array("compatible")
|
||||
|
||||
staticpw = dtsys.infix.str("factory-password-hash")
|
||||
if not out["factory-password-hash"]:
|
||||
out["factory-password-hash"] = staticpw
|
||||
@@ -304,6 +327,7 @@ def probe_dtsystem(out):
|
||||
vpd_inject(out, vpds)
|
||||
return 0
|
||||
|
||||
|
||||
def main():
|
||||
out = {
|
||||
"vendor": None,
|
||||
@@ -338,5 +362,6 @@ def main():
|
||||
shutil.chown(SYSTEM_JSON, user="root", group="wheel")
|
||||
return err
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
|
||||
@@ -1,22 +1,48 @@
|
||||
#!/bin/sh
|
||||
# Find and install any product specific files in /etc before bootstrap
|
||||
# Find, install, and run product specific files and script in /etc
|
||||
# before resuming bootstrap.
|
||||
#
|
||||
# Use /etc/product/init.d/S01-myscript for scripts, may be a symlink, it
|
||||
# will be called with `start` as its only argument.
|
||||
#
|
||||
# The compatible array is listed in the same order as the device tree,
|
||||
# most significant to least. Hence the reverse.[], to ensure overrides
|
||||
# are applied in order of significance.
|
||||
ident=$(basename "$0")
|
||||
|
||||
PRODUCT_INIT=/etc/product/init.d
|
||||
PREFIXD=/usr/share/product
|
||||
PRODUCT=$(jq -r '."product-name" | ascii_downcase' /run/system.json)
|
||||
COMPATIBLES=$(jq -r '.compatible | reverse.[] | ascii_downcase' /run/system.json)
|
||||
|
||||
note()
|
||||
{
|
||||
logger -I $$ -k -p user.notice -t "$ident" "$1"
|
||||
}
|
||||
|
||||
DIR="$PREFIXD/$PRODUCT"
|
||||
if [ -z "$PRODUCT" ] || [ ! -d "$DIR" ]; then
|
||||
note "No vendor/product specific directory found, using built-in defaults."
|
||||
exit 0
|
||||
found=false
|
||||
for PRODUCT in $COMPATIBLES; do
|
||||
DIR="$PREFIXD/$PRODUCT"
|
||||
if [ -d "$DIR" ]; then
|
||||
note "Using vendor/product-specific defaults for $PRODUCT."
|
||||
for dir in "$DIR"/*; do
|
||||
[ -d "$dir" ] && cp -a "$dir" /
|
||||
done
|
||||
found=true
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$found" = false ]; then
|
||||
note "No vendor/product-specific directory found, using built-in defaults."
|
||||
fi
|
||||
|
||||
note "Using vendor/product specific defaults."
|
||||
for dir in "$DIR"/*; do
|
||||
[ -d "$dir" ] && cp -a "$dir" /
|
||||
done
|
||||
# Conditions for bootstrap services, this enables product specific
|
||||
# init scripts to prevent select services from starting.
|
||||
initctl -nbq cond set led
|
||||
|
||||
note "Calling runparts $PRODUCT_INIT/S[0-9]+.* start"
|
||||
/usr/libexec/finit/runparts -bsp "$PRODUCT_INIT"
|
||||
|
||||
# Product specific init done.
|
||||
initctl -nbq cond set product
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -14,6 +14,24 @@ for file in /sys/firmware/qemu_fw_cfg/by_name/opt/mactab/raw /etc/mactab; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Sometimes the sysfs is not populated when the switch driver is loaded, with the result
|
||||
# that the DSA interface was not found (no /dsa/tagging entry in sysfs. See issue #685.
|
||||
#
|
||||
# This mitigates that problem by waiting for sysfs to come up if a DSA switch is found
|
||||
if [ -n "$(devlink -j dev info | jq -r '.info.[].driver' | grep -q mv88e6085)" ]; then
|
||||
timeout=50
|
||||
while [ -z "$(ls /sys/class/net/*/dsa/tagging)" ]; do
|
||||
timeout=$((timeout-1))
|
||||
if [ $timeout -eq 0 ]; then
|
||||
logger -k -p user.emerg -t "$ident" "Failed to find DSA interface"
|
||||
exit 1
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
logger -k -p user.notice -t "$ident" "Found DSA interface in $timeout seconds"
|
||||
fi
|
||||
|
||||
# Find CPU interfaces used for connecting to a switch managed by DSA
|
||||
for netif in /sys/class/net/*; do
|
||||
iface=$(basename "$netif")
|
||||
|
||||
@@ -46,7 +46,11 @@ while [ "$1" ]; do
|
||||
[ $txqs -lt 2 ] && continue
|
||||
[ $txqs -gt 8 ] && txqs=8
|
||||
|
||||
tc qdisc add dev $iface root mqprio hw 1 \
|
||||
num_tc $txqs $(map $txqs) $(queues $txqs) || true
|
||||
output=$(tc qdisc add dev $iface root mqprio hw 1 \
|
||||
num_tc $txqs $(map $txqs) $(queues $txqs) 2>&1) || true
|
||||
if echo "$output" | grep -q "does not support hardware offload"; then
|
||||
echo "Skipping $iface, hardware offload not supported."
|
||||
elif [ -n "$output" ]; then
|
||||
echo "$output"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec initctl -bq cond set ixinit-done
|
||||
exec initctl -bq cond set ixinit
|
||||
|
||||
@@ -146,7 +146,7 @@ mount_overlay home "$cfgsrc" /home
|
||||
mount_overlay root "$cfgsrc" /root
|
||||
mount_bind "$varsrc" /var
|
||||
|
||||
[ "$vlibsrc" ] && mount_bind "$vlibsrc" /var/lib
|
||||
[ -n "$vlibsrc" ] && mount_bind "$vlibsrc" /var/lib
|
||||
|
||||
for tag in $(ls /sys/bus/virtio/devices/*/mount_tag 2>/dev/null); do
|
||||
if [ "$(cat $tag | tr -d '\0')" = hostfs ]; then
|
||||
|
||||
@@ -260,6 +260,8 @@ CONFIG_CRYPTO_GCM=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_FS=y
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
CONFIG_PANIC_TIMEOUT=20
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
|
||||
# CONFIG_FTRACE is not set
|
||||
|
||||
@@ -142,6 +142,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
|
||||
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_IITO=y
|
||||
|
||||
@@ -122,6 +122,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
|
||||
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_IITO=y
|
||||
|
||||
@@ -14,8 +14,8 @@ BR2_TARGET_GENERIC_ISSUE="Infix by KernelKit"
|
||||
BR2_INIT_FINIT=y
|
||||
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
|
||||
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
|
||||
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
|
||||
BR2_ROOTFS_MERGED_USR=y
|
||||
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
|
||||
BR2_SYSTEM_BIN_SH_BASH=y
|
||||
BR2_TARGET_GENERIC_GETTY_PORT="@console"
|
||||
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
|
||||
@@ -71,7 +71,9 @@ BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_GUNICORN=y
|
||||
BR2_PACKAGE_LIBSSH_OPENSSL=y
|
||||
BR2_PACKAGE_LIBSSH2=y
|
||||
BR2_PACKAGE_LIBSSH2_OPENSSL=y
|
||||
BR2_PACKAGE_LIBXCRYPT=y
|
||||
BR2_PACKAGE_LIBOPENSSL_BIN=y
|
||||
BR2_PACKAGE_LIBINPUT=y
|
||||
@@ -173,7 +175,6 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
|
||||
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
|
||||
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
|
||||
BR2_PACKAGE_CONFD=y
|
||||
# BR2_PACKAGE_CONFD_TEST_MODE is not set
|
||||
BR2_PACKAGE_EXECD=y
|
||||
BR2_PACKAGE_GENCERT=y
|
||||
BR2_PACKAGE_STATD=y
|
||||
@@ -182,6 +183,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
|
||||
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_IITO=y
|
||||
|
||||
@@ -173,6 +173,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
|
||||
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_IITO=y
|
||||
|
||||
@@ -146,6 +146,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
|
||||
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_IITO=y
|
||||
|
||||
@@ -126,6 +126,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
|
||||
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_IITO=y
|
||||
|
||||
+61
-1
@@ -3,6 +3,64 @@ Change Log
|
||||
|
||||
All notable changes to the project are documented in this file.
|
||||
|
||||
|
||||
[v24.10.2][] - 2024-11-08
|
||||
-------------------------
|
||||
|
||||
### Changes
|
||||
|
||||
- Support for showing interfaces owned by running containers in the CLI
|
||||
command `show interfaces`. This also adds support for showing the
|
||||
peer interface of VETH pairs. Issue #626
|
||||
- Reboot system on kernel "oops", on "oops" the kernel now panics and
|
||||
reboots after 20 seconds. Issue #740
|
||||
- Update static factory-config for NanoPi R2S: enable NACM, securing all
|
||||
passwords, and enabling `iburst` for the NTP client. Issue #750
|
||||
- Updated QoS documentation with pictures and more information on VLAN
|
||||
interface ingress/egress priority handling, issue #759
|
||||
- Disable RTC device in Styx device tree, issue #794
|
||||
- Support for saving and restoring system clock from a disk file. This
|
||||
allows restoring the system clock to a sane date in case the RTC is
|
||||
disabled or does not have a valid time, issue #794
|
||||
- Update device discovery chapter with information on `infix.local` mDNS
|
||||
alias, `netbrowse` support to discover *all* local units, and command
|
||||
examples for disabling LLDP and mDNS services, issue #786
|
||||
- Updated OSPF documentation to include information on *global OSPF
|
||||
settings* (`redistribution`, `explicit-router-id`, etc.), issue #812
|
||||
- Added information on *forwarding of IEEE reserved group addresses*
|
||||
to bridge section of networking documentation, issue #788
|
||||
- Add support for bootstrap conditions and early init product overrides
|
||||
- Styx: enable second Ethernet port LED in device tree, again, rename
|
||||
it: yellow -> aux, and make sure it is turned off at boot
|
||||
- Styx: disable second port LED for the 4xSFP slots, does not work
|
||||
- Styx: override iitod (LED daemon) with a product specific LED script
|
||||
|
||||
### Fixes
|
||||
- Fix #685: DSA conduit interface not always detected, randomly causing
|
||||
major issues configuring systems with multiple switch cores
|
||||
- Fix #778: reactivate OpenSSL backend for libssh/libssh2 for NanoPI R2S.
|
||||
This fixes a regression in v24.10.0 causing loss of NETCONF support
|
||||
- Fix #809: enable syslog logging for RAUC
|
||||
- Fix harmless bootstrap log error message on systems without USB ports:
|
||||
`jq: error (at <stdin>:0): Cannot iterate over null (null)`
|
||||
- Change confusing `tc` log error message: `Error: does not support
|
||||
hardware offload` to `Skipping $iface, hardware offload not supported.`
|
||||
|
||||
|
||||
|
||||
[v24.10.1][] - 2024-10-18
|
||||
-------------------------
|
||||
|
||||
### Changes
|
||||
- Add support for interface description, sometimes referred to as
|
||||
"ifAlias". Saved as an Linux interface alias (not `altname`), e.g.,
|
||||
`/sys/class/interfaces/veth0a/ifalias`, includes operational support
|
||||
|
||||
### Fixes
|
||||
- Fix #735: `copy` and `erase` commands missing from CLI, regression
|
||||
in Infix v24.10.0 defconfigs, now added as dep. in klish package
|
||||
|
||||
|
||||
[v24.10.0][] - 2024-10-18
|
||||
-------------------------
|
||||
|
||||
@@ -1235,7 +1293,9 @@ Supported YANG models in addition to those used by sysrepo and netopeer:
|
||||
- N/A
|
||||
|
||||
[buildroot]: https://buildroot.org/
|
||||
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v24.10.0...HEAD
|
||||
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v24.10.1...HEAD
|
||||
[v24.10.2]: https://github.com/kernelkit/infix/compare/v24.10.1...v24.10.2
|
||||
[v24.10.1]: https://github.com/kernelkit/infix/compare/v24.10.0...v24.10.1
|
||||
[v24.10.0]: https://github.com/kernelkit/infix/compare/v24.09.0...v24.10.0
|
||||
[v24.09.0]: https://github.com/kernelkit/infix/compare/v24.08.0...v24.09.0
|
||||
[v24.08.0]: https://github.com/kernelkit/infix/compare/v24.06.0...v24.08.0
|
||||
|
||||
+3
-1
@@ -143,7 +143,7 @@ which offers lots of benefits out-of-the-box:
|
||||
media like USB sticks or SD-cards) and from remote servers using FTP
|
||||
or HTTP(S).
|
||||
|
||||
To initiate a system upgrade, run:
|
||||
To initiate a system upgrade from the shell[^1], run:
|
||||
|
||||
rauc install <file|url>
|
||||
|
||||
@@ -349,3 +349,5 @@ can funtion reasonably well without a persistent `/var`, loosing
|
||||
If `var` is not available, Infix will still persist `/var/lib` using
|
||||
`cfg` as the backing storage.
|
||||
|
||||
[^1]: See [CLI Upgrade](cli/upgrade.md) for information on upgrading
|
||||
via CLI.
|
||||
|
||||
+15
-14
@@ -206,20 +206,18 @@ corresponding image for execution with our normal tooling:
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Infix is built from many parts, when contributing you need to set up
|
||||
your own fork, create a local branch for your change, push to your fork,
|
||||
and then use GitHub to create a *Pull Reqeuest*.
|
||||
Infix is built from many components, when contributing you need to set
|
||||
up your own fork, create a local branch for your change, push to your
|
||||
fork, and then use GitHub to create a *Pull Reqeuest*.
|
||||
|
||||
For this to work as painlessly as possible:
|
||||
For this to work as *painlessly as possible* for everyone involved:
|
||||
|
||||
1. Fork Infix to your own user or organization[^1]
|
||||
2. Fork all the Infix submodules, e.g., `kernelkit/buildroot` to your
|
||||
own user or organization as well
|
||||
3. Clone your fork of Infix to your laptop/workstation
|
||||
|
||||
If you use a GitHub organization you get the added benefit of having
|
||||
local peer reviews of changes before making a pull request to the
|
||||
upstream Infix repository.
|
||||
1. Fork Infix to your own user or organization[^1]
|
||||
2. Fork all the Infix submodules, e.g., `kernelkit/buildroot` to your
|
||||
own user or organization as well
|
||||
3. Clone your fork of Infix to your laptop/workstation
|
||||
4. [Deactivate the Actions][6] you don't want in your fork
|
||||
5. Please read the [Contributing Guidelines][5] as well!
|
||||
|
||||
```bash
|
||||
$ cd ~/Projects
|
||||
@@ -227,10 +225,10 @@ $ git clone https://github.com/YOUR_USER_NAME/infix.git
|
||||
$ cd infix/
|
||||
$ git submodule update --init
|
||||
```
|
||||
|
||||
> **Note:** when updating/synchronizing with upstream Infix changes you
|
||||
> may have to synchronize your forks as well. GitHub have a `Sync fork`
|
||||
> button in the GUI for your fork for this purpose.
|
||||
> button in the GUI for your fork for this purpose. A cronjob on your
|
||||
> server of choice can do this for you with the [GitHub CLI tool][7].
|
||||
|
||||
[^1]: Organizations should make sure to lock the `main` (or `master`)
|
||||
branch of their clones to ensure members do not accidentally merge
|
||||
@@ -243,3 +241,6 @@ $ git submodule update --init
|
||||
[2]: https://github.com/wkz/qeneth
|
||||
[3]: https://netopeer.liberouter.org/doc/sysrepo/master/html/dev_guide.html
|
||||
[4]: https://buildroot.org/downloads/manual/manual.html#_developer_guide
|
||||
[5]: https://github.com/kernelkit/infix/blob/main/.github/CONTRIBUTING.md
|
||||
[6]: https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
|
||||
[7]: https://cli.github.com/
|
||||
|
||||
+142
-28
@@ -16,14 +16,14 @@ seen in the response.
|
||||
|
||||
In the example below, the PC is connected to Infix via interface *tap0*
|
||||
(*tap0* is *if1* in Figure 1) and Infix responds with address
|
||||
*fe80::ff:fe00:0*.
|
||||
*fe80::ff:fec0:ffed*.
|
||||
|
||||
```
|
||||
linux-pc:# ping -6 -L -c 3 ff02::1%tap0
|
||||
PING ff02::1%tap0(ff02::1%tap0) 56 data bytes
|
||||
64 bytes from fe80::ff:fe00:0%tap0: icmp_seq=1 ttl=64 time=0.558 ms
|
||||
64 bytes from fe80::ff:fe00:0%tap0: icmp_seq=2 ttl=64 time=0.419 ms
|
||||
64 bytes from fe80::ff:fe00:0%tap0: icmp_seq=3 ttl=64 time=0.389 ms
|
||||
64 bytes from fe80::ff:fec0:ffed%tap0: icmp_seq=1 ttl=64 time=0.558 ms
|
||||
64 bytes from fe80::ff:fec0:ffed%tap0: icmp_seq=2 ttl=64 time=0.419 ms
|
||||
64 bytes from fe80::ff:fec0:ffed%tap0: icmp_seq=3 ttl=64 time=0.389 ms
|
||||
|
||||
--- ff02::1%tap0 ping statistics ---
|
||||
3 packets transmitted, 3 received, 0% packet loss, time 2043ms
|
||||
@@ -34,9 +34,9 @@ linux-pc:#
|
||||
The PC could connect then connect to Infix, e.g., using SSH.
|
||||
|
||||
```
|
||||
linux-pc:# ssh admin@fe80::ff:fe00:0%tap0
|
||||
admin@fe80::ff:fe00:0%tap0's password: admin
|
||||
admin@infix-00-00-00:~$
|
||||
linux-pc:# ssh admin@fe80::ff:fec0:ffed%tap0
|
||||
admin@fe80::ff:fec0:ffed%tap0's password: admin
|
||||
admin@infix-c0-ff-ee:~$
|
||||
```
|
||||
|
||||
## Discovery mechanisms available in Infix
|
||||
@@ -55,18 +55,18 @@ linux-pc:# tcpdump -i tap0 -Qin -v ether proto 0x88cc
|
||||
tcpdump: listening on tap0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
|
||||
15:51:52.061071 LLDP, length 193
|
||||
Chassis ID TLV (1), length 7
|
||||
Subtype MAC address (4): 02:00:00:00:00:00 (oui Unknown)
|
||||
Subtype MAC address (4): 02:00:00:c0:ff:ee (oui Unknown)
|
||||
Port ID TLV (2), length 7
|
||||
Subtype MAC address (3): 02:00:00:00:00:00 (oui Unknown)
|
||||
Subtype MAC address (3): 02:00:00:c0:ff:ee (oui Unknown)
|
||||
Time to Live TLV (3), length 2: TTL 120s
|
||||
System Name TLV (5), length 14: infix-00-00-00
|
||||
System Name TLV (5), length 14: infix-c0-ff-ee
|
||||
System Description TLV (6), length 91
|
||||
Infix by KernelKit Linux 5.19.17 #1 SMP PREEMPT_DYNAMIC Wed Jun 7 08:47:23 CEST 2023 x86_64
|
||||
System Capabilities TLV (7), length 4
|
||||
System Capabilities [Bridge, WLAN AP, Router, Station Only] (0x009c)
|
||||
Enabled Capabilities [Station Only] (0x0080)
|
||||
Management Address TLV (8), length 24
|
||||
Management Address length 17, AFI IPv6 (2): fe80::ff:fe00:0
|
||||
Management Address length 17, AFI IPv6 (2): fe80::ff:fec0:ffed
|
||||
Interface Index Interface Numbering (2): 2
|
||||
Port Description TLV (4), length 4: eth0
|
||||
Organization specific TLV (127), length 9: OUI IEEE 802.3 Private (0x00120f)
|
||||
@@ -97,11 +97,11 @@ linux-pc:# sudo tcpdump -i tap0 -Qin -v ether proto 0x88cc
|
||||
tcpdump: listening on tap0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
|
||||
15:46:07.908665 LLDP, length 207
|
||||
Chassis ID TLV (1), length 7
|
||||
Subtype MAC address (4): 02:00:00:00:00:00 (oui Unknown)
|
||||
Subtype MAC address (4): 02:00:00:c0:ff:ee (oui Unknown)
|
||||
Port ID TLV (2), length 7
|
||||
Subtype MAC address (3): 02:00:00:00:00:00 (oui Unknown)
|
||||
Subtype MAC address (3): 02:00:00:c0:ff:ee (oui Unknown)
|
||||
Time to Live TLV (3), length 2: TTL 120s
|
||||
System Name TLV (5), length 14: infix-00-00-00
|
||||
System Name TLV (5), length 14: infix-c0-ff-ee
|
||||
System Description TLV (6), length 91
|
||||
Infix by KernelKit Linux 5.19.17 #1 SMP PREEMPT_DYNAMIC Wed Jun 7 08:47:23 CEST 2023 x86_64
|
||||
System Capabilities TLV (7), length 4
|
||||
@@ -134,6 +134,15 @@ linux-pc:#
|
||||
(LLDP)](https://github.com/lldp/lldpd) includes *lldpcli*, which
|
||||
is handy to sniff and display LLDP packets.
|
||||
|
||||
The LLDP service can be disabled using the following commands.
|
||||
|
||||
```
|
||||
admin@infix-c0-ff-ee:/> configure
|
||||
admin@infix-c0-ff-ee:/config/> no lldp
|
||||
admin@infix-c0-ff-ee:/config/> leave
|
||||
admin@infix-c0-ff-ee:/>
|
||||
```
|
||||
|
||||
### mDNS
|
||||
|
||||
DNS-SD/mDNS can be used to discover Infix units and services. Infix
|
||||
@@ -144,33 +153,138 @@ be used to search for devices advertising their services via mDNS.
|
||||
|
||||
```
|
||||
linux-pc:# avahi-browse -ar
|
||||
+ tap0 IPv6 infix-00-00-00 SFTP File Transfer local
|
||||
+ tap0 IPv4 infix-00-00-00 SFTP File Transfer local
|
||||
+ tap0 IPv6 infix-00-00-00 SSH Remote Terminal local
|
||||
+ tap0 IPv4 infix-00-00-00 SSH Remote Terminal local
|
||||
= tap0 IPv4 infix-00-00-00 SFTP File Transfer local
|
||||
hostname = [infix-00-00-00.local]
|
||||
+ tap0 IPv6 infix-c0-ff-ee SFTP File Transfer local
|
||||
+ tap0 IPv4 infix-c0-ff-ee SFTP File Transfer local
|
||||
+ tap0 IPv6 infix-c0-ff-ee SSH Remote Terminal local
|
||||
+ tap0 IPv4 infix-c0-ff-ee SSH Remote Terminal local
|
||||
= tap0 IPv4 infix-c0-ff-ee SFTP File Transfer local
|
||||
hostname = [infix-c0-ff-ee.local]
|
||||
address = [10.0.1.1]
|
||||
port = [22]
|
||||
txt = []
|
||||
= tap0 IPv4 infix-00-00-00 SSH Remote Terminal local
|
||||
hostname = [infix-00-00-00.local]
|
||||
= tap0 IPv4 infix-c0-ff-ee SSH Remote Terminal local
|
||||
hostname = [infix-c0-ff-ee.local]
|
||||
address = [10.0.1.1]
|
||||
port = [22]
|
||||
txt = []
|
||||
= tap0 IPv6 infix-00-00-00 SFTP File Transfer local
|
||||
hostname = [infix-00-00-00.local]
|
||||
address = [fe80::ff:fe00:0]
|
||||
= tap0 IPv6 infix-c0-ff-ee SFTP File Transfer local
|
||||
hostname = [infix-c0-ff-ee.local]
|
||||
address = [fe80::ff:fec0:ffed]
|
||||
port = [22]
|
||||
txt = []
|
||||
= tap0 IPv6 infix-00-00-00 SSH Remote Terminal local
|
||||
hostname = [infix-00-00-00.local]
|
||||
address = [fe80::ff:fe00:0]
|
||||
= tap0 IPv6 infix-c0-ff-ee SSH Remote Terminal local
|
||||
hostname = [infix-c0-ff-ee.local]
|
||||
address = [fe80::ff:fec0:ffed]
|
||||
port = [22]
|
||||
txt = []
|
||||
^C
|
||||
linux-pc:#
|
||||
```
|
||||
|
||||
Additionally, *avahi-resolve-host-name* can be used to verify domain
|
||||
name mappings for IP addresses. By default, it translates from IPv4
|
||||
addresses. This function allows users to confirm that addresses are
|
||||
mapped correctly.
|
||||
|
||||
```
|
||||
linux-pc:# avahi-resolve-host-name infix-c0-ff-ee.local
|
||||
infix-c0-ff-ee.local 10.0.1.1
|
||||
linux-pc:#
|
||||
```
|
||||
|
||||
Thanks to mDNS we can use the advertised name instead of the IP
|
||||
address for operations like `ping` and `ssh` as shown below:
|
||||
|
||||
```
|
||||
linux-pc:# ping infix-c0-ff-ee.local -c 3
|
||||
PING infix-c0-ff-ee.local (10.0.1.1) 56(84) bytes of data.
|
||||
64 bytes from 10.0.1.1: icmp_seq=1 ttl=64 time=0.852 ms
|
||||
64 bytes from 10.0.1.1: icmp_seq=2 ttl=64 time=1.12 ms
|
||||
64 bytes from 10.0.1.1: icmp_seq=3 ttl=64 time=1.35 ms
|
||||
|
||||
--- infix-c0-ff-ee.local ping statistics ---
|
||||
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
|
||||
rtt min/avg/max/mdev = 0.852/1.105/1.348/0.202 ms
|
||||
|
||||
linux-pc:# ssh admin@infix-c0-ff-ee.local
|
||||
(admin@infix-c0-ff-ee.local) Password:
|
||||
.-------.
|
||||
| . . | Infix -- a Network Operating System
|
||||
|-. v .-| https://kernelkit.org
|
||||
'-'---'-
|
||||
|
||||
Run the command 'cli' for interactive OAM
|
||||
|
||||
linux-pc:#
|
||||
```
|
||||
|
||||
To disable mDNS/mDNS-SD, type the commands:
|
||||
```
|
||||
admin@infix-c0-ff-ee:/> configure
|
||||
admin@infix-c0-ff-ee:/config/> no mdns
|
||||
admin@infix-c0-ff-ee:/config/> leave
|
||||
```
|
||||
|
||||
#### Human-Friendly Hostname Alias
|
||||
|
||||
Each Infix unit will advertise itself as *infix.local*, in addition to
|
||||
its full hostname (e.g., *infix-c0-ff-ee.local* or *foo.local*). This
|
||||
alias works seamlessly on a network with a single Infix device, and
|
||||
makes it easy to connect when the exact hostname is not known in
|
||||
advance. The examples below show how the alias can be used for
|
||||
actions such as pinging or establishing an SSH connection:
|
||||
|
||||
```
|
||||
linux-pc:# ping infix.local -c 3
|
||||
PING infix.local (10.0.1.1) 56(84) bytes of data.
|
||||
64 bytes from 10.0.1.1: icmp_seq=1 ttl=64 time=0.751 ms
|
||||
64 bytes from 10.0.1.1: icmp_seq=2 ttl=64 time=2.28 ms
|
||||
64 bytes from 10.0.1.1: icmp_seq=3 ttl=64 time=1.42 ms
|
||||
|
||||
--- infix.local ping statistics ---
|
||||
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
|
||||
rtt min/avg/max/mdev = 0.751/1.482/2.281/0.626 ms
|
||||
|
||||
linux-pc:# ssh admin@infix.local
|
||||
(admin@infix.local) Password:
|
||||
.-------.
|
||||
| . . | Infix -- a Network Operating System
|
||||
|-. v .-| https://kernelkit.org
|
||||
'-'---'-
|
||||
|
||||
Run the command 'cli' for interactive OAM
|
||||
|
||||
linux-pc:#
|
||||
```
|
||||
|
||||
When multiple Infix devices are present on the LAN the alias will not
|
||||
uniquely identify a device; *infix.local* will refer to any of the
|
||||
Infix devices, likely the one that first appeared.
|
||||
|
||||
> When multiple Infix units are present, use the full hostname (e.g.,
|
||||
> *infix-c0-ff-ee.local* or *foo.local*) rather than the alias
|
||||
> infix.local to deterministically connect to a unit.
|
||||
|
||||
|
||||
#### Netbrowse service to find all your devices
|
||||
|
||||
Another mDNS alias that all Infix devices can advertise is
|
||||
*network.local*. This is a web service which basically runs avahi-browse
|
||||
and displays a table of other Infix devices and their services.
|
||||
|
||||

|
||||
|
||||
With multiple Infix devices on the LAN, one will be your portal to
|
||||
access all others, if it goes down another will take its place.
|
||||
|
||||
To disable the netbrowse service, the following commands can be used:
|
||||
```
|
||||
admin@infix-c0-ff-ee:/> configure
|
||||
admin@infix-c0-ff-ee:/config/> edit web
|
||||
admin@infix-c0-ff-ee:/config/web/> no netbrowse
|
||||
admin@infix-c0-ff-ee:/config/web/> leave
|
||||
```
|
||||
|
||||
[^2]: [mdns-scan](http://0pointer.de/lennart/projects/mdns-scan/): a
|
||||
tool for scanning for mDNS/DNS-SD published services on the local
|
||||
network
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 262 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 258 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 464 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 388 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 343 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 269 KiB |
+2
-1
@@ -15,7 +15,8 @@ managing entire fleets of installed equipment.
|
||||
Nevertheless, when it comes to initial deployment and debugging, it
|
||||
is very useful to know how to navigate and use the CLI.
|
||||
|
||||
> Proceed to the [CLI User Guide](cli/tutorial.md).
|
||||
> Proceed to the [CLI Introduction](cli/introduction.md) or [CLI
|
||||
> Configuration Tutorial](cli/configure.md).
|
||||
|
||||
|
||||
## Key Concepts
|
||||
|
||||
+112
-16
@@ -43,15 +43,17 @@ diverted to the VLAN interface before entering the bridge, while all
|
||||
other traffic would be bridged as usual.
|
||||
|
||||
| **Type** | **Yang Model** | **Description** |
|
||||
| -------- | ----------------- | ------------------------------------------------------------- |
|
||||
|----------|----------------------------|---------------------------------------------------------------|
|
||||
| bridge | infix-if-bridge | SW implementation of an IEEE 802.1Q bridge |
|
||||
| ip | ietf-ip, infix-ip | IP address to the subordinate interface |
|
||||
| vlan | infix-if-vlan | Capture all traffic belonging to a specific 802.1Q VID |
|
||||
| lag[^1] | infix-if-lag | Bonds multiple interfaces into one, creating a link aggregate |
|
||||
| lo | ietf-interfaces | Software loopback interface |
|
||||
| eth | ietf-interfaces, | Physical Ethernet device/port |
|
||||
| | ieee802-ethernet-interface | |
|
||||
| eth | ieee802-ethernet-interface | Physical Ethernet device/port. |
|
||||
| | infix-ethernet-interface | |
|
||||
| veth | infix-if-veth | Virtual Ethernet pair, typically one end is in a container |
|
||||
| *common* | ietf-interfaces, | Properties common to all interface types |
|
||||
| | infix-interfaces | |
|
||||
|
||||
|
||||
## Data Plane
|
||||
@@ -97,6 +99,10 @@ This is an extension to the ietf-interfaces YANG model, which defines
|
||||
`phys-address` as read-only[^4]. The following shows the different
|
||||
configuration options.
|
||||
|
||||
The `description` is saved as Linux `ifalias` on an interface. It is a
|
||||
free-form string, useful for describing purpose or just adding comments
|
||||
for remote debugging, e.g., using the operational datastore.
|
||||
|
||||
> **Note:** there is no validation or safety checks performed by the
|
||||
> system when using `custom-phys-address`. In particular the `offset`
|
||||
> variant can be dangerous to use -- pay attention to the meaning of
|
||||
@@ -143,6 +149,8 @@ a switch is a bridge. In Linux, setting up a bridge with ports
|
||||
connected to physical switch fabric, means you manage the actual switch
|
||||
fabric!
|
||||
|
||||
#### MAC Bridge
|
||||
|
||||
In Infix ports are by default not switch ports, unless the customer
|
||||
specific factory config sets it up this way. To enable switching
|
||||
between ports you create a bridge and then add ports to that
|
||||
@@ -165,6 +173,13 @@ Here we add two ports to bridge `br0`: `eth0` and `eth1`.
|
||||
> Other "magic" names are `ethN.M` for VLAN M on top of `ethN`, or
|
||||
> `dockerN` to create an IP masquerading container bridge.
|
||||
|
||||

|
||||
|
||||
It is possible to create multiple MAC bridges, however, it is
|
||||
currently[^5] _not recommended_ to use more than one MAC bridge on
|
||||
products with Marvell LinkStreet switching ASICs. A VLAN filtering
|
||||
bridge should be used instead.
|
||||
|
||||
#### VLAN Filtering Bridge
|
||||
|
||||
By default bridges in Linux do not filter based on VLAN tags. It can be
|
||||
@@ -189,6 +204,8 @@ This sets `eth0` as an untagged member of VLAN 10 and `eth1` as an
|
||||
untagged member of VLAN 20. Switching between these ports is thus
|
||||
prohibited.
|
||||
|
||||

|
||||
|
||||
To terminate a VLAN in the switch itself, either for switch management
|
||||
or for routing, the bridge must become a (tagged) member of the VLAN.
|
||||
|
||||
@@ -201,6 +218,7 @@ admin@example:/config/interface/br0/> set bridge vlans vlan 20 tagged br0
|
||||
> on top of the bridge, see section [VLAN Interfaces](#vlan-interfaces)
|
||||
> below for more on this topic.
|
||||
|
||||
|
||||
#### Multicast Filtering and Snooping
|
||||
|
||||
Multicast filtering in the bridge is handled by the bridge itself. It
|
||||
@@ -365,6 +383,32 @@ an IGMP/MLD fast-leave port.
|
||||
[RFC3376]: https://www.rfc-editor.org/rfc/rfc3376.html
|
||||
[RFC3810]: https://www.rfc-editor.org/rfc/rfc3810.html
|
||||
|
||||
#### Forwarding of IEEE Reserved Group Addresses
|
||||
|
||||
Addresses in range `01:80:C2:00:00:0X` are used by various bridge
|
||||
signaling protocols, and are not forwarded by default. Still, it is
|
||||
sometimes useful to let the bridge forward such packets, and Infix
|
||||
supports this by specifying protocol names or the last address
|
||||
*nibble* as decimal value `0..15`.
|
||||
|
||||
```
|
||||
admin@example:/config/> edit interface br0 bridge
|
||||
admin@example:/config/interface/br0/bridge/> set ieee-group-forward <?>
|
||||
[0..15] List of IEEE link-local protocols to forward, e.g., STP, LLDP
|
||||
dot1x 802.1X Port-Based Network Access Control.
|
||||
lacp 802.3 Slow Protocols, e.g., LACP.
|
||||
lldp 802.1AB Link Layer Discovery Protocol (LLDP).
|
||||
stp Spanning Tree (STP/RSPT/MSTP).
|
||||
admin@example:/config/interface/br0/bridge/> set ieee-group-forward
|
||||
```
|
||||
|
||||
The following example configures bridge *br0* to forward LLDP packets.
|
||||
|
||||
```
|
||||
admin@example:/config/interface/br0/bridge/> set ieee-group-forward lldp
|
||||
admin@example:/config/interface/br0/bridge/>
|
||||
```
|
||||
|
||||
### VLAN Interfaces
|
||||
|
||||
Creating a VLAN can be done in many ways. This section assumes VLAN
|
||||
@@ -415,7 +459,7 @@ top of a bridge interface *br0* is named *vlan10*.
|
||||
#### Ethernet Settings and Status
|
||||
|
||||
Physical Ethernet interfaces provide low-level settings for speed/duplex as
|
||||
well as packet status and statistics (*ieee802-ethernet-interface.yang*).
|
||||
well as packet status and [statistics](#ethernet-statistics).
|
||||
|
||||
By default, Ethernet interfaces defaults to auto-negotiating
|
||||
speed/duplex modes, advertising all speed and duplex modes available.
|
||||
@@ -497,7 +541,7 @@ require auto-negotiation to be enabled.
|
||||
|
||||
#### Ethernet statistics
|
||||
|
||||
Ethernet packet statistics can be listed as shown below.
|
||||
Ethernet packet statistics[^6] can be listed as shown below.
|
||||
|
||||
```
|
||||
admin@example:/> show interfaces name eth1
|
||||
@@ -585,6 +629,9 @@ Multiple address assignment methods are available:
|
||||
| link-local | infix-ip | Auto-assignment of IPv4 address in 169.254.x.x/16 range |
|
||||
| dhcp | infix-dhcp-client | Assignment of IPv4 address by DHCP server, e.g., *10.0.1.1/24* |
|
||||
|
||||
> **Note:** DHCP address method is only available for *LAN* interfaces
|
||||
> (Ethernet, virtual Ethernet (veth), bridge, link aggregates, etc.)
|
||||
|
||||
Supported DHCP (request) options, configurability (Cfg) and defaults,
|
||||
are listed below. Configurable options can be disabled on a per client
|
||||
interface basis, some options, like `clientid` and option 81, are
|
||||
@@ -610,8 +657,16 @@ possible to set the value of as well.
|
||||
**Default:** `router`, `dns`, `domain`, `broadcast`, `ntpsrv`, `search`,
|
||||
`address`, `staticroutes`, `msstaticroutes`
|
||||
|
||||
> **Note:** DHCP address method is only available for *LAN* interfaces
|
||||
> (Ethernet, virtual Ethernet (veth), bridge, link aggregates, etc.)
|
||||
When configuring a DHCP client, ensure that the NTP client is enabled
|
||||
for the `ntpsrv` DHCP option to be processed correctly. If the NTP
|
||||
client is not enabled, any NTP servers provided by the DHCP server will
|
||||
be ignored. For details on how to enable the NTP client, see the
|
||||
[NTP Client Configuration](system.md#ntp-client-configuration) section.
|
||||
|
||||
> **Note:** as per [RFC3442][4], if the DHCP server returns both a
|
||||
> Classless Static Routes option (121) and Router option (3), the
|
||||
> DHCP client *must* ignore the latter.
|
||||
|
||||
|
||||
### IPv6 Address Assignment
|
||||
|
||||
@@ -830,7 +885,7 @@ have changed type to *random*.
|
||||
### IPv4 forwarding
|
||||
|
||||
To be able to route (static or dynamic) on the interface it is
|
||||
required to enable forwarding. This setting controlls if packets
|
||||
required to enable forwarding. This setting controls if packets
|
||||
received on this interface can be forwarded.
|
||||
```
|
||||
admin@example:/config/> edit interface eth0
|
||||
@@ -846,12 +901,12 @@ This flag behaves totally different than for IPv4. For IPv6 the
|
||||
ability to route between interfaces is always enabled, instead this
|
||||
flag controls if the interface will be in host/router mode.
|
||||
|
||||
| **Feature** | **Forward enabled** | **Forward disabled** |
|
||||
|:------------------------------------------|:--------------------|:---------------------|
|
||||
| IsRouter set in Neighbour Advertisements. | Yes | No |
|
||||
| Transmit Router Solicitations. | No | Yes |
|
||||
| Router Advertisements are ignored | No | Yes |
|
||||
| Accept Redirects | No | Yes |
|
||||
| **Feature** | **Forward enabled** | **Forward disabled** |
|
||||
|:-----------------------------------------|:--------------------|:---------------------|
|
||||
| IsRouter set in Neighbour Advertisements | Yes | No |
|
||||
| Transmit Router Solicitations | No | Yes |
|
||||
| Router Advertisements are ignored | No | Yes |
|
||||
| Accept Redirects | No | Yes |
|
||||
|
||||
```
|
||||
admin@example:/config/> edit interface eth0
|
||||
@@ -982,6 +1037,38 @@ an Ethernet interface can be done as follows.
|
||||
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/interface/e0/> set interface-type point-to-point
|
||||
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/interface/e0/>
|
||||
|
||||
#### OSPF global settings
|
||||
|
||||
In addition to *area* and *interface* specific settings, OSPF provides
|
||||
global settings for route redistribution and OSPF router identifier.
|
||||
|
||||
```
|
||||
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default ospf
|
||||
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/> set ?
|
||||
area List of OSPF areas.
|
||||
default-route-advertise Distribute default route to network
|
||||
explicit-router-id Defined in RFC 2328. A 32-bit number
|
||||
redistribute Redistribute protocols into OSPF
|
||||
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/> set
|
||||
```
|
||||
|
||||
- Explicit router ID: By default the router will pick an IP address
|
||||
from one of its OSPF interfaces as OSPF router ID. An explicit ID is
|
||||
used to get a deterministic behavior, e.g., `set explicit-router-id
|
||||
1.1.1.1`.
|
||||
- Redistribution: `set redistribute static` and `set redistribute connected`
|
||||
can be used to include static or connected routes into the OSPF routing
|
||||
domain. These routes are redistributed as *external type-2* (E2)
|
||||
routes.
|
||||
- Advertising default route: An OSPF router can be made to distribute
|
||||
a default route into the OSPF domain by command `set
|
||||
default-route-advertise enabled`. This route is distributed as long
|
||||
as the router itself has an *active* default route in its routing
|
||||
table. By adding command `set default-route-advertise always` the
|
||||
router will distribute a default route even when it lacks a default
|
||||
route. The default route will be distributed as an *external type-2*
|
||||
(E2) route.
|
||||
|
||||
|
||||
#### Debug OSPFv2
|
||||
|
||||
@@ -1053,7 +1140,7 @@ This CLI example show the IPv6 routing table.
|
||||
|
||||
#### Route Preference
|
||||
|
||||
The operating system leverages FRRouting ([Frr][4]) as routing engine
|
||||
The operating system leverages FRRouting ([Frr][0]) as routing engine
|
||||
for both static and dynamic routing. Even routes injected from a DHCP
|
||||
client, and IPv4 link-local (IPv4) routes, are injected into Frr to let
|
||||
it weigh all routes before installing them into the kernel routing table
|
||||
@@ -1107,7 +1194,8 @@ currently supported, namely `ipv4` and `ipv6`.
|
||||
[1]: https://www.rfc-editor.org/rfc/rfc8343
|
||||
[2]: https://www.rfc-editor.org/rfc/rfc8344
|
||||
[3]: https://www.rfc-editor.org/rfc/rfc8981
|
||||
[4]: https://frrouting.org/
|
||||
[4]: https://www.rfc-editor.org/rfc/rfc3442
|
||||
[0]: https://frrouting.org/
|
||||
|
||||
[^1]: Please note, link aggregates are not yet supported in Infix.
|
||||
[^2]: Link-local IPv6 addresses are implicitly enabled when enabling
|
||||
@@ -1120,3 +1208,11 @@ currently supported, namely `ipv4` and `ipv6`.
|
||||
[^4]: A YANG deviation was previously used to make it possible to set
|
||||
`phys-address`, but this has been replaced with the more flexible
|
||||
`custom-phys-address`.
|
||||
[^5]: Infix MAC bridges on Marvell Linkstreet devices are currently
|
||||
limited to use a single MAC database, causing issues if the same
|
||||
MAC address appears on different MAC bridges.
|
||||
[^6]: Ethernet counters are described in
|
||||
*ieee802-ethernet-interface.yang* and
|
||||
*infix-ethernet-interface.yang*. [Ethernet
|
||||
Counters](eth-counters.md) page provides additional details on
|
||||
statistics support.
|
||||
|
||||
+43
-8
@@ -12,14 +12,6 @@ packets to drop and which ones to prioritize, such that critical
|
||||
services remain operational.
|
||||
|
||||
|
||||
## Software Forwarded Traffic
|
||||
|
||||
For packets which are processed by a CPU, i.e. typically routed
|
||||
traffic, and bridged traffic between interfaces that do not belong to
|
||||
the same hardware switching domain, an [nftables container][1] can be
|
||||
used to define a QoS policy.
|
||||
|
||||
|
||||
## Hardware Forwarded Traffic
|
||||
|
||||
The default QoS policy for flows which are offloaded to a switching
|
||||
@@ -34,6 +26,14 @@ chips in this family where limited to 4 output queues per port, this
|
||||
documentation is _only_ valid for newer generations with 8 output
|
||||
queues per port.
|
||||
|
||||

|
||||
|
||||
The picture illustrates packets having their priority determined at
|
||||
ingress, here interface _e1_ and _e3_. In this example, both packets
|
||||
are forwarded to the same outgoing interface (_e2_), subject to output
|
||||
queueing. The sections below provides more information on these
|
||||
topics.
|
||||
|
||||
#### Default Policy
|
||||
|
||||
##### Queueing
|
||||
@@ -73,6 +73,41 @@ set to the 3 most significant bits of it. If no priority information
|
||||
is available in the frame on ingress (i.e. untagged non-IP), then
|
||||
packets will egress out of tagged ports with PCP set to 0.
|
||||
|
||||
## Software Forwarded Traffic
|
||||
|
||||
For packets which are processed by a CPU, i.e. typically routed
|
||||
traffic, and bridged traffic between interfaces that do not belong to
|
||||
the same hardware switching domain, an [nftables container][1] can be
|
||||
used to define a QoS policy.
|
||||
|
||||
For VLAN interfaces, Infix provides support for mapping the Priority
|
||||
Code Point (PCP) to internal priority on ingress, and the reverse on
|
||||
egress.
|
||||
|
||||

|
||||
|
||||
|
||||
These `ingress-qos` and `egress-qos` settings are done per VLAN, both
|
||||
defaulting to '0'. The example below shows how to keep the PCP priority
|
||||
for packets being routed between two VLAN interfaces.
|
||||
|
||||
```
|
||||
admin@example:/config/> edit interface e1.10
|
||||
admin@example:/config/interface/e1.10/> set vlan ingress-qos priority from-pcp
|
||||
admin@example:/config/interface/e1.10/> up
|
||||
admin@example:/config/> edit interface e1.20
|
||||
admin@example:/config/interface/e1.20/> set vlan egress-qos pcp from-priority
|
||||
admin@example:/config/interface/e1.20/> leave
|
||||
admin@example:/>
|
||||
```
|
||||
|
||||
## A complex example
|
||||
|
||||
The picture below shows a packet flow being subject both to software
|
||||
forwarding and hardware offloading.
|
||||
|
||||

|
||||
|
||||
|
||||
[1]: container.md#application-container-nftables
|
||||
[2]: https://en.wikipedia.org/wiki/IEEE_802.1Q
|
||||
|
||||
+77
-1
@@ -145,7 +145,7 @@ is committed by issuing the `leave` command.
|
||||
admin@host:/config/> edit system
|
||||
admin@host:/config/system/> set hostname example
|
||||
admin@host:/config/system/> leave
|
||||
admin@example:/>
|
||||
admin@host:/>
|
||||
```
|
||||
|
||||
The hostname is advertised over mDNS-SD in the `.local` domain. If
|
||||
@@ -201,6 +201,82 @@ admin@host:/>
|
||||
> and then re-enter configure context to use your editor of choice.
|
||||
|
||||
|
||||
## NTP Client Configuration
|
||||
|
||||
Below is an example configuration for enabling NTP
|
||||
with a specific server and the `iburst` option for faster initial
|
||||
synchronization.
|
||||
|
||||
```
|
||||
admin@host:/> configure
|
||||
admin@host:/config/> set system ntp enabled
|
||||
admin@host:/config/> set system ntp server ntp-pool
|
||||
admin@host:/config/> set system ntp server ntp-pool udp address pool.ntp.org
|
||||
admin@host:/config/> set system ntp server ntp-pool iburst
|
||||
admin@host:/config/> set system ntp server ntp-pool prefer
|
||||
```
|
||||
|
||||
This configuration enables the NTP client and sets the NTP server to
|
||||
`pool.ntp.org` with the `iburst` and `prefer` options. The `iburst`
|
||||
option ensures faster initial synchronization, and the `prefer` option
|
||||
designates this server as preferred.
|
||||
|
||||
* `prefer false`: The NTP client will choose the best available source
|
||||
based on several factors, such as network delay, stratum, and other
|
||||
metrics (default config).
|
||||
* `prefer true`: The NTP client will try to use the preferred server
|
||||
as the primary source unless it becomes unreachable or unusable.
|
||||
|
||||
### Show NTP Status
|
||||
|
||||
To check the status of NTP synchronization, use the following command:
|
||||
|
||||
```
|
||||
admin@host:/> show ntp
|
||||
Reference ID : C0248F86 (192.36.143.134)
|
||||
Stratum : 2
|
||||
Ref time (UTC) : Mon Oct 21 10:06:45 2024
|
||||
System time : 0.000000001 seconds slow of NTP time
|
||||
Last offset : -3845.151367188 seconds
|
||||
RMS offset : 3845.151367188 seconds
|
||||
Frequency : 4.599 ppm slow
|
||||
Residual freq : +1293.526 ppm
|
||||
Skew : 12.403 ppm
|
||||
Root delay : 1.024467230 seconds
|
||||
Root dispersion : 0.273462683 seconds
|
||||
Update interval : 0.0 seconds
|
||||
Leap status : Normal
|
||||
admin@host:/>
|
||||
```
|
||||
|
||||
This output provides detailed information about the NTP status, including
|
||||
reference ID, stratum, time offsets, frequency, and root delay.
|
||||
|
||||
### Show NTP Sources
|
||||
|
||||
To view the sources being used by the NTP client, run:
|
||||
|
||||
```
|
||||
admin@host:/> show ntp sources
|
||||
|
||||
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
|
||||
/ .- Source state '*' = current best, '+' = combined, '-' = not combined,
|
||||
| / 'x' = may be in error, '~' = too variable, '?' = unusable.
|
||||
|| .- xxxx [ yyyy ] +/- zzzz
|
||||
|| Reachability register (octal) -. | xxxx = adjusted offset,
|
||||
|| Log2(Polling interval) --. | | yyyy = measured offset,
|
||||
|| \ | | zzzz = estimated error.
|
||||
|| | | \
|
||||
MS Name/IP address Stratum Poll Reach LastRx Last sample
|
||||
===============================================================================
|
||||
^* 192.36.143.134 1 6 177 9 +278ms[ -3845s] +/- 514ms
|
||||
admin@host:/>
|
||||
```
|
||||
|
||||
> The system uses `chronyd` for Network Time Protocol (NTP)
|
||||
> synchronization. The output shown here is best explained in the
|
||||
> [Chrony documentation](https://chrony-project.org/doc/4.6.1/chronyc.html).
|
||||
|
||||
[1]: https://www.rfc-editor.org/rfc/rfc7317
|
||||
[2]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/infix-system%402024-02-29.yang
|
||||
[3]: https://www.rfc-editor.org/rfc/rfc8341
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ Tenets
|
||||
It is also much more practical and economical to build large virtual
|
||||
networks than physical ones.
|
||||
|
||||
- **Avoid CLI scipting & scraping**. Reliably interacting with a DUT
|
||||
- **Avoid CLI scripting & scraping**. Reliably interacting with a DUT
|
||||
over a serial line in a robust way is _very_ hard to get right.
|
||||
Given that we have a proper API (RESTCONF), we should leverage that
|
||||
when testing. Front-ends can be tested by other means.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#set DEBUG=1
|
||||
|
||||
run name:bootstrap log:prio:user.notice norestart <usr/ixinit-done> \
|
||||
run name:bootstrap log:prio:user.notice norestart <usr/ixinit> \
|
||||
[S] /usr/libexec/confd/bootstrap \
|
||||
-- Bootstrapping YANG datastore
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 46ffa81f5c88ce95db011369d8bfb802313e4217 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Thu, 17 Oct 2024 14:23:24 +0200
|
||||
Subject: [PATCH] Only mark rdeps dirty if main service is nohup
|
||||
Subject: [PATCH 1/6] Only mark rdeps dirty if main service is nohup
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
This patch changes a behavior that's been default since Finit 4.0,
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 119e66a7e9c95283918639b51dd03a3d666955f8 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Mon, 28 Oct 2024 10:58:04 +0100
|
||||
Subject: [PATCH 2/6] Reset color attributes and clear screen when starting up
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Some boot loaders, like GRUB, leave background color artifacts from
|
||||
their boot menu. This patch resets the foreground and background
|
||||
color attributes, and then clears the screen, without clearing the
|
||||
scrollback buffer.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
src/helpers.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/helpers.c b/src/helpers.c
|
||||
index 8768de8..99c4557 100644
|
||||
--- a/src/helpers.c
|
||||
+++ b/src/helpers.c
|
||||
@@ -87,6 +87,9 @@ void console_init(void)
|
||||
/* Enable line wrap, if disabled previously, e.g., qemu */
|
||||
dprint(STDOUT_FILENO, "\033[?7h", 5);
|
||||
|
||||
+ /* Reset atttributes, background and foreground color */
|
||||
+ dprint(STDOUT_FILENO, "\033[49m\033[39m\e[2J", 14);
|
||||
+
|
||||
log_init();
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
From 0c0e880f3fdd38f7bbde618408378dc0a19ff005 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Sun, 3 Nov 2024 09:39:46 +0100
|
||||
Subject: [PATCH 3/6] plugins: refactor rtc.so
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Factor out time_set() and time_get() for readability and reuse.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
plugins/rtc.c | 116 +++++++++++++++++++++++++++++---------------------
|
||||
1 file changed, 68 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/plugins/rtc.c b/plugins/rtc.c
|
||||
index 238791f..9520c7d 100644
|
||||
--- a/plugins/rtc.c
|
||||
+++ b/plugins/rtc.c
|
||||
@@ -68,6 +68,60 @@ static void tz_restore(char *tz)
|
||||
tzset();
|
||||
}
|
||||
|
||||
+static int time_set(struct tm *tm)
|
||||
+{
|
||||
+ struct tm fallback = { 0 };
|
||||
+ struct timeval tv = { 0 };
|
||||
+ char tz[128];
|
||||
+ int rc = 0;
|
||||
+
|
||||
+ tz_set(tz, sizeof(tz));
|
||||
+
|
||||
+ if (!tm) {
|
||||
+ logit(LOG_NOTICE, "Resetting system clock to kernel default, %s.", rtc_timestamp);
|
||||
+ tm = &fallback;
|
||||
+
|
||||
+ /* Attempt to set RTC to a sane value ... */
|
||||
+ tv.tv_sec = rtc_date_fallback;
|
||||
+ if (!gmtime_r(&tv.tv_sec, tm)) {
|
||||
+ rc = 1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ tm->tm_isdst = -1; /* Use tzdata to figure it out, please. */
|
||||
+ tv.tv_sec = mktime(tm);
|
||||
+ if (tv.tv_sec == (time_t)-1 || tv.tv_sec < rtc_date_fallback) {
|
||||
+ errno = EINVAL;
|
||||
+ rc = 2;
|
||||
+ } else {
|
||||
+ if (settimeofday(&tv, NULL) == -1)
|
||||
+ rc = 1;
|
||||
+ }
|
||||
+out:
|
||||
+ tz_restore(tz);
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+static int time_get(struct tm *tm)
|
||||
+{
|
||||
+ struct timeval tv = { 0 };
|
||||
+ char tz[128];
|
||||
+ int rc = 0;
|
||||
+
|
||||
+ tz_set(tz, sizeof(tz));
|
||||
+
|
||||
+ rc = gettimeofday(&tv, NULL);
|
||||
+ if (rc < 0 || tv.tv_sec < rtc_date_fallback)
|
||||
+ rc = 2;
|
||||
+ else
|
||||
+ gmtime_r(&tv.tv_sec, tm);
|
||||
+
|
||||
+ tz_restore(tz);
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
static int rtc_open(void)
|
||||
{
|
||||
char *alt[] = {
|
||||
@@ -91,10 +145,8 @@ static int rtc_open(void)
|
||||
|
||||
static void rtc_save(void *arg)
|
||||
{
|
||||
- struct timeval tv = { 0 };
|
||||
struct tm tm = { 0 };
|
||||
int fd, rc = 0;
|
||||
- char tz[128];
|
||||
|
||||
if (rescue) {
|
||||
dbg("Skipping %s plugin in rescue mode.", __FILE__);
|
||||
@@ -105,38 +157,26 @@ static void rtc_save(void *arg)
|
||||
if (fd < 0)
|
||||
return;
|
||||
|
||||
- tz_set(tz, sizeof(tz));
|
||||
- rc = gettimeofday(&tv, NULL);
|
||||
- if (rc < 0 || tv.tv_sec < rtc_date_fallback) {
|
||||
+ if ((rc = time_get(&tm))) {
|
||||
print_desc(NULL, "System clock invalid, not saving to RTC");
|
||||
- invalid:
|
||||
- logit(LOG_ERR, "System clock invalid, before %s, not saving to RTC", rtc_timestamp);
|
||||
- rc = 2;
|
||||
- goto out;
|
||||
+ } else {
|
||||
+ print_desc(NULL, "Saving system clock (UTC) to RTC");
|
||||
+ rc = ioctl(fd, RTC_SET_TIME, &tm);
|
||||
}
|
||||
|
||||
- print_desc(NULL, "Saving system time (UTC) to RTC");
|
||||
-
|
||||
- gmtime_r(&tv.tv_sec, &tm);
|
||||
- if (ioctl(fd, RTC_SET_TIME, &tm) < 0) {
|
||||
- if (EINVAL == errno)
|
||||
- goto invalid;
|
||||
- rc = 1;
|
||||
- goto out;
|
||||
+ if (rc && errno == EINVAL) {
|
||||
+ logit(LOG_ERR, "System clock invalid, before %s, not saving to RTC", rtc_timestamp);
|
||||
+ rc = 2;
|
||||
}
|
||||
|
||||
-out:
|
||||
- tz_restore(tz);
|
||||
print(rc, NULL);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void rtc_restore(void *arg)
|
||||
{
|
||||
- struct timeval tv = { 0 };
|
||||
struct tm tm = { 0 };
|
||||
int fd, rc = 0;
|
||||
- char tz[128];
|
||||
|
||||
if (rescue) {
|
||||
dbg("Skipping %s plugin in rescue mode.", __FILE__);
|
||||
@@ -149,16 +189,19 @@ static void rtc_restore(void *arg)
|
||||
return;
|
||||
}
|
||||
|
||||
- tz_set(tz, sizeof(tz));
|
||||
- if (ioctl(fd, RTC_RD_TIME, &tm) < 0) {
|
||||
+ if ((rc = ioctl(fd, RTC_RD_TIME, &tm)) < 0) {
|
||||
char msg[120];
|
||||
|
||||
snprintf(msg, sizeof(msg), "Failed restoring system clock, %s",
|
||||
EINVAL == errno ? "RTC time is too old" :
|
||||
ENOENT == errno ? "RTC has no saved time" : "see log for details");
|
||||
print_desc(NULL, msg);
|
||||
+ } else {
|
||||
+ print_desc(NULL, "Restoring system clock (UTC) from RTC");
|
||||
+ rc = time_set(&tm);
|
||||
+ }
|
||||
|
||||
- invalid:
|
||||
+ if (rc) {
|
||||
logit(LOG_ERR, "Failed restoring system clock from RTC.");
|
||||
if (EINVAL == errno)
|
||||
logit(LOG_ERR, "RTC time is too old (before %s)", rtc_timestamp);
|
||||
@@ -167,33 +210,10 @@ static void rtc_restore(void *arg)
|
||||
else
|
||||
logit(LOG_ERR, "RTC error code %d: %s", errno, strerror(errno));
|
||||
|
||||
- /* Been here already? */
|
||||
- if (rc)
|
||||
- goto out;
|
||||
-
|
||||
- /* Attempt to set RTC to a sane value ... */
|
||||
- tv.tv_sec = rtc_date_fallback;
|
||||
- if (!gmtime_r(&tv.tv_sec, &tm))
|
||||
- goto out;
|
||||
-
|
||||
- logit(LOG_NOTICE, "Resetting RTC to kernel default, %s.", rtc_timestamp);
|
||||
+ time_set(NULL);
|
||||
rc = 2;
|
||||
}
|
||||
|
||||
- if (!rc)
|
||||
- print_desc(NULL, "Restoring system clock (UTC) from RTC");
|
||||
- tm.tm_isdst = -1; /* Use tzdata to figure it out, please. */
|
||||
- tv.tv_sec = mktime(&tm);
|
||||
- if (tv.tv_sec == (time_t)-1 || tv.tv_sec < rtc_date_fallback) {
|
||||
- errno = EINVAL;
|
||||
- goto invalid;
|
||||
- }
|
||||
-
|
||||
- if (settimeofday(&tv, NULL) == -1)
|
||||
- rc = 1;
|
||||
-
|
||||
-out:
|
||||
- tz_restore(tz);
|
||||
print(rc, NULL);
|
||||
close(fd);
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
From bc8118d515839dc598f437aa01f07a771646968d Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Sun, 3 Nov 2024 09:47:16 +0100
|
||||
Subject: [PATCH 4/6] Fix #418: support systems with a broken RTC
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
This patch introduces a new configure option --with-rtc-file=FILE. When
|
||||
enabled the RTC plugin detects missing RTC device and falls back to save
|
||||
and restore system time from a file instead. When --with-rtc-file is
|
||||
used without an argument the default file is /var/lib/misc/rtc, but the
|
||||
feature itself is disabled by default.
|
||||
|
||||
The usefulness of this feature may not be obvious at first, but some
|
||||
systems are equipped with an RTC that resets to a random date at power
|
||||
on. This can be really bad in the case the date is far in the future,
|
||||
because an NTP sync would then cause time skips backwards, which shows
|
||||
up in logs and causes a whole lot of pain in alarm systems.
|
||||
|
||||
The solution is to disable the RTC driver or device tree node, and when
|
||||
Finit starts up, the RTC plugin detects a the device node and instead
|
||||
restores time from the last save game. Meaning time will always only
|
||||
move forwards.
|
||||
|
||||
NOTE: when Finit is built --with-rtc-file we always save to disk, but
|
||||
only restore from the "save game" if restoring from RTC fails.
|
||||
If the system has no RTC we always restore from disk.
|
||||
|
||||
As an added bonus, this change also makes sure to periodically
|
||||
sync also the RTC with the system clock. Useful for systems
|
||||
that do not run an NTP client.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
configure.ac | 12 ++++++
|
||||
plugins/rtc.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++----
|
||||
2 files changed, 110 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 483457f..ae7cd23 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -180,6 +180,10 @@ AC_ARG_WITH(rtc-date,
|
||||
AS_HELP_STRING([--with-rtc-date=DATE], [If RTC date/time is too old, restore to DATE, format "YYYY-MM-DD HH:MM", default "2000-01-01 00:00"]),
|
||||
[rtc_date=$withval], [rtc_date=no])
|
||||
|
||||
+AC_ARG_WITH(rtc-file,
|
||||
+ AS_HELP_STRING([--with-rtc-file=FILE], [If RTC is missing, save and restore system clock from this file, default: no]),
|
||||
+ [rtc_file=$withval], [rtc_file=no])
|
||||
+
|
||||
### Enable features ###########################################################################
|
||||
|
||||
# Create config.h from selected features and fallback defaults
|
||||
@@ -281,6 +285,13 @@ AS_IF([test "x$rtc_date" != "xno"], [
|
||||
AC_DEFINE(RTC_TIMESTAMP_CUSTOM, "$rtc_date", [Custom RTC restore date, default: 2000-01-01 00:00])], [
|
||||
rtc_date=""])
|
||||
|
||||
+AS_IF([test "x$rtc_file" != "xno"], [
|
||||
+ AS_IF([test "x$rtc_file" = "xyes"], [
|
||||
+ rtc_file=/var/lib/misc/rtc])
|
||||
+ AC_EXPAND_DIR(rtcfile_path, "$rtc_file")
|
||||
+ AC_DEFINE_UNQUOTED(RTC_FILE, "$rtcfile_path", [Save and restore system time from this file if /dev/rtc is missing.])],[
|
||||
+ AC_DEFINE_UNQUOTED(RTC_FILE, NULL)])
|
||||
+
|
||||
AS_IF([test "x$with_keventd" != "xno"], [with_keventd=yes])
|
||||
|
||||
AS_IF([test "x$with_sulogin" != "xno"], [
|
||||
@@ -387,6 +398,7 @@ Behavior:
|
||||
Boot heading..........: $heading
|
||||
Plugins...............: $plugins
|
||||
RTC restore date......: $RTC_DATE
|
||||
+ RTC fallback file.....: $rtc_file
|
||||
|
||||
Optional features:
|
||||
Install doc/..........: $enable_doc
|
||||
diff --git a/plugins/rtc.c b/plugins/rtc.c
|
||||
index 9520c7d..9b4eeae 100644
|
||||
--- a/plugins/rtc.c
|
||||
+++ b/plugins/rtc.c
|
||||
@@ -36,8 +36,15 @@
|
||||
#include "helpers.h"
|
||||
#include "plugin.h"
|
||||
|
||||
-/* Kernel RTC driver validates against this date for sanity check */
|
||||
+/*
|
||||
+ * Kernel RTC driver validates against this date for sanity check. The
|
||||
+ * on NTP sync the driver can also update the RTC every 11 mins. We use
|
||||
+ * the same update interval to handle manual time set and file save.
|
||||
+ */
|
||||
#define RTC_TIMESTAMP_BEGIN_2000 "2000-01-01 00:00:00"
|
||||
+#define RTC_FMT "%Y-%m-%d %H:%M:%S"
|
||||
+#define RTC_PERIOD (11 * 60 * 1000)
|
||||
+
|
||||
#ifdef RTC_TIMESTAMP_CUSTOM
|
||||
static char *rtc_timestamp = RTC_TIMESTAMP_CUSTOM;
|
||||
#else
|
||||
@@ -45,6 +52,10 @@ static char *rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000;
|
||||
#endif
|
||||
static time_t rtc_date_fallback = 946684800LL;
|
||||
|
||||
+static char *rtc_file = RTC_FILE;
|
||||
+static uev_t rtc_timer;
|
||||
+
|
||||
+
|
||||
static void tz_set(char *tz, size_t len)
|
||||
{
|
||||
char *ptr;
|
||||
@@ -122,6 +133,68 @@ static int time_get(struct tm *tm)
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static void file_save(void *arg)
|
||||
+{
|
||||
+ struct tm tm = { 0 };
|
||||
+ int rc = 0;
|
||||
+ FILE *fp;
|
||||
+
|
||||
+ fp = fopen(rtc_file, "w");
|
||||
+ if (!fp) {
|
||||
+ logit(LOG_WARNING, "Failed saving system clock to %s, code %d: %s",
|
||||
+ rtc_file, errno, strerror(errno));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if ((rc = time_get(&tm))) {
|
||||
+ logit(LOG_ERR, "System clock invalid, before %s, not saving", rtc_timestamp);
|
||||
+ print_desc(NULL, "System clock invalid, skipping");
|
||||
+ } else {
|
||||
+ char buf[32] = { 0 };
|
||||
+
|
||||
+ print_desc(NULL, "Saving system clock to file");
|
||||
+ strftime(buf, sizeof(buf), RTC_FMT, &tm);
|
||||
+ fprintf(fp, "%s\n", buf);
|
||||
+ }
|
||||
+
|
||||
+ print(rc, NULL);
|
||||
+ fclose(fp);
|
||||
+}
|
||||
+
|
||||
+static void file_restore(void *arg)
|
||||
+{
|
||||
+ struct tm tm = { 0 };
|
||||
+ int rc = 1;
|
||||
+ FILE *fp;
|
||||
+
|
||||
+ if (!rtc_file) {
|
||||
+ logit(LOG_NOTICE, "System has no RTC (missing driver?), skipping restore.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ print_desc(NULL, "Restoring system clock from backup");
|
||||
+
|
||||
+ fp = fopen(rtc_file, "r");
|
||||
+ if (fp) {
|
||||
+ char buf[32];
|
||||
+
|
||||
+ if (fgets(buf, sizeof(buf), fp)) {
|
||||
+ chomp(buf);
|
||||
+ strptime(buf, RTC_FMT, &tm);
|
||||
+ rc = time_set(&tm);
|
||||
+ }
|
||||
+ fclose(fp);
|
||||
+ } else
|
||||
+ logit(LOG_WARNING, "Missing %s", rtc_file);
|
||||
+
|
||||
+ if (rc) {
|
||||
+ time_set(NULL);
|
||||
+ rc = 2;
|
||||
+ }
|
||||
+
|
||||
+ print(rc, NULL);
|
||||
+}
|
||||
+
|
||||
static int rtc_open(void)
|
||||
{
|
||||
char *alt[] = {
|
||||
@@ -185,7 +258,7 @@ static void rtc_restore(void *arg)
|
||||
|
||||
fd = rtc_open();
|
||||
if (fd < 0) {
|
||||
- logit(LOG_NOTICE, "System has no RTC (missing driver?), skipping restore.");
|
||||
+ file_restore(arg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -210,21 +283,37 @@ static void rtc_restore(void *arg)
|
||||
else
|
||||
logit(LOG_ERR, "RTC error code %d: %s", errno, strerror(errno));
|
||||
|
||||
- time_set(NULL);
|
||||
- rc = 2;
|
||||
- }
|
||||
+ print(2, NULL);
|
||||
+
|
||||
+ /* Try restoring from last save game */
|
||||
+ if (rtc_file)
|
||||
+ file_restore(arg);
|
||||
+ } else
|
||||
+ print(0, NULL);
|
||||
|
||||
- print(rc, NULL);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
+
|
||||
+static void save(void *arg)
|
||||
+{
|
||||
+ rtc_save(arg);
|
||||
+ file_save(arg);
|
||||
+}
|
||||
+
|
||||
+static void update(uev_t *w, void *arg, int events)
|
||||
+{
|
||||
+ save(arg);
|
||||
+}
|
||||
+
|
||||
+
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_BASEFS_UP] = {
|
||||
.cb = rtc_restore
|
||||
},
|
||||
.hook[HOOK_SHUTDOWN] = {
|
||||
- .cb = rtc_save
|
||||
+ .cb = save
|
||||
}
|
||||
};
|
||||
|
||||
@@ -237,6 +326,8 @@ PLUGIN_INIT(plugin_init)
|
||||
else
|
||||
rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000;
|
||||
|
||||
+ uev_timer_init(ctx, &rtc_timer, update, NULL, RTC_PERIOD, RTC_PERIOD);
|
||||
+
|
||||
plugin_register(&plugin);
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
From 6be16f2f6d093ef495d0fe4313f7b05b4ba3e08f Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Sun, 3 Nov 2024 10:38:38 +0100
|
||||
Subject: [PATCH 5/6] Fix buggy --with-rtc-date=DATE, introduced in Finit v4.4
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
In 42ef3d3c, for v4.4-rc1, support for setting a custom RTC restore date
|
||||
was introduced. Unfortunately the configure script was wrong and caused
|
||||
config.h to contain
|
||||
|
||||
#define RTC_TIMESTAMP_CUSTOM "$rtc_date"
|
||||
|
||||
instead of
|
||||
|
||||
#define RTC_TIMESTAMP_CUSTOM "2023-04-10 14:35:42"
|
||||
|
||||
Furthermore, the error handling for strptime() was wrong, so the restore
|
||||
date was always reverted to the default.
|
||||
|
||||
This patch fixes both issues and extends the DATE of --with-rtc-date to
|
||||
also include seconds.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
configure.ac | 4 ++--
|
||||
plugins/rtc.c | 8 +++++---
|
||||
2 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index ae7cd23..58b78ac 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -177,7 +177,7 @@ AC_ARG_WITH(plugin-path,
|
||||
[plugin_path=$withval], [plugin_path=yes])
|
||||
|
||||
AC_ARG_WITH(rtc-date,
|
||||
- AS_HELP_STRING([--with-rtc-date=DATE], [If RTC date/time is too old, restore to DATE, format "YYYY-MM-DD HH:MM", default "2000-01-01 00:00"]),
|
||||
+ AS_HELP_STRING([--with-rtc-date=DATE], [If RTC date/time is too old, restore to DATE, format "YYYY-MM-DD HH:MM:SS", default "2000-01-01 00:00:00"]),
|
||||
[rtc_date=$withval], [rtc_date=no])
|
||||
|
||||
AC_ARG_WITH(rtc-file,
|
||||
@@ -282,7 +282,7 @@ AS_IF([test "x$with_random_seed" != "xno"], [
|
||||
AC_DEFINE_UNQUOTED(RANDOMSEED, "$random_path", [Improve random at boot by seeding it with sth from before.])])
|
||||
|
||||
AS_IF([test "x$rtc_date" != "xno"], [
|
||||
- AC_DEFINE(RTC_TIMESTAMP_CUSTOM, "$rtc_date", [Custom RTC restore date, default: 2000-01-01 00:00])], [
|
||||
+ AC_DEFINE_UNQUOTED(RTC_TIMESTAMP_CUSTOM, "$rtc_date", [Custom RTC restore date, default: 2000-01-01 00:00])], [
|
||||
rtc_date=""])
|
||||
|
||||
AS_IF([test "x$rtc_file" != "xno"], [
|
||||
diff --git a/plugins/rtc.c b/plugins/rtc.c
|
||||
index 9b4eeae..a733f75 100644
|
||||
--- a/plugins/rtc.c
|
||||
+++ b/plugins/rtc.c
|
||||
@@ -321,10 +321,12 @@ PLUGIN_INIT(plugin_init)
|
||||
{
|
||||
struct tm tm = { 0 };
|
||||
|
||||
- if (!strptime(rtc_timestamp, "%Y-%m-%d %H:%M", &tm))
|
||||
- rtc_date_fallback = mktime(&tm);
|
||||
- else
|
||||
+ if (!strptime(rtc_timestamp, RTC_FMT, &tm)) {
|
||||
+ logit(LOG_ERR, "Invalid restore date '%s', reverting to '%s'",
|
||||
+ rtc_timestamp, RTC_TIMESTAMP_BEGIN_2000);
|
||||
rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000;
|
||||
+ } else
|
||||
+ rtc_date_fallback = mktime(&tm);
|
||||
|
||||
uev_timer_init(ctx, &rtc_timer, update, NULL, RTC_PERIOD, RTC_PERIOD);
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
From 49c0557cedd8d3c1a2f74d27fa7db83dd529914a Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Sun, 3 Nov 2024 20:49:04 +0100
|
||||
Subject: [PATCH 6/6] plugins: reduce log level LOG_ERR -> LOG_WARNING
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
These plugins signal success and failure directly to the console, the
|
||||
user should inspect syslog for more information.
|
||||
|
||||
This change is a follow-up to 340cae4, where kernel logs of LOG_ERR and
|
||||
higher are allowed to log directly to the console. Since syslogd has
|
||||
not been started before these plugins, the log messages would otherwise
|
||||
leak to the console.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
plugins/rtc.c | 14 +++++++-------
|
||||
plugins/urandom.c | 2 +-
|
||||
2 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/plugins/rtc.c b/plugins/rtc.c
|
||||
index a733f75..96203a0 100644
|
||||
--- a/plugins/rtc.c
|
||||
+++ b/plugins/rtc.c
|
||||
@@ -147,7 +147,7 @@ static void file_save(void *arg)
|
||||
}
|
||||
|
||||
if ((rc = time_get(&tm))) {
|
||||
- logit(LOG_ERR, "System clock invalid, before %s, not saving", rtc_timestamp);
|
||||
+ logit(LOG_WARNING, "System clock invalid, before %s, not saving", rtc_timestamp);
|
||||
print_desc(NULL, "System clock invalid, skipping");
|
||||
} else {
|
||||
char buf[32] = { 0 };
|
||||
@@ -238,7 +238,7 @@ static void rtc_save(void *arg)
|
||||
}
|
||||
|
||||
if (rc && errno == EINVAL) {
|
||||
- logit(LOG_ERR, "System clock invalid, before %s, not saving to RTC", rtc_timestamp);
|
||||
+ logit(LOG_WARNING, "System clock invalid, before %s, not saving to RTC", rtc_timestamp);
|
||||
rc = 2;
|
||||
}
|
||||
|
||||
@@ -275,13 +275,13 @@ static void rtc_restore(void *arg)
|
||||
}
|
||||
|
||||
if (rc) {
|
||||
- logit(LOG_ERR, "Failed restoring system clock from RTC.");
|
||||
+ logit(LOG_WARNING, "Failed restoring system clock from RTC.");
|
||||
if (EINVAL == errno)
|
||||
- logit(LOG_ERR, "RTC time is too old (before %s)", rtc_timestamp);
|
||||
+ logit(LOG_WARNING, "RTC time is too old (before %s)", rtc_timestamp);
|
||||
else if (ENOENT == errno)
|
||||
- logit(LOG_ERR, "RTC has no previously saved (valid) time.");
|
||||
+ logit(LOG_WARNING, "RTC has no previously saved (valid) time.");
|
||||
else
|
||||
- logit(LOG_ERR, "RTC error code %d: %s", errno, strerror(errno));
|
||||
+ logit(LOG_WARNING, "RTC error code %d: %s", errno, strerror(errno));
|
||||
|
||||
print(2, NULL);
|
||||
|
||||
@@ -322,7 +322,7 @@ PLUGIN_INIT(plugin_init)
|
||||
struct tm tm = { 0 };
|
||||
|
||||
if (!strptime(rtc_timestamp, RTC_FMT, &tm)) {
|
||||
- logit(LOG_ERR, "Invalid restore date '%s', reverting to '%s'",
|
||||
+ logit(LOG_WARNING, "Invalid restore date '%s', reverting to '%s'",
|
||||
rtc_timestamp, RTC_TIMESTAMP_BEGIN_2000);
|
||||
rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000;
|
||||
} else
|
||||
diff --git a/plugins/urandom.c b/plugins/urandom.c
|
||||
index b9f6039..6f82779 100644
|
||||
--- a/plugins/urandom.c
|
||||
+++ b/plugins/urandom.c
|
||||
@@ -154,7 +154,7 @@ static void setup(void *arg)
|
||||
close(fd);
|
||||
free(rpi);
|
||||
if (rc < 0)
|
||||
- logit(LOG_ERR, "Failed adding entropy to kernel random pool: %s", strerror(err));
|
||||
+ logit(LOG_WARNING, "Failed adding entropy to kernel random pool: %s", strerror(err));
|
||||
print_result(rc < 0);
|
||||
return;
|
||||
fallback:
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+15
-2
@@ -165,7 +165,6 @@ config BR2_PACKAGE_FINIT_PLUGIN_RTC
|
||||
For lxc/docker application builds you do not need this.
|
||||
|
||||
if BR2_PACKAGE_FINIT_PLUGIN_RTC
|
||||
|
||||
config BR2_PACKAGE_FINIT_RTC_DATE
|
||||
string "Fallback RTC date"
|
||||
help
|
||||
@@ -184,7 +183,21 @@ config BR2_PACKAGE_FINIT_RTC_DATE
|
||||
Ensuring the default system time to be closer to actual time
|
||||
for a period after releasing a firmware image.
|
||||
|
||||
endif
|
||||
config BR2_PACKAGE_FINIT_RTC_FILE
|
||||
string "Fallback file if /dev/rtc is missing"
|
||||
help
|
||||
For systems with broken RTC, where the default value can be
|
||||
completely random, e.g., a time far in the future, it might
|
||||
be better to disable the RTC driver or device tree node.
|
||||
|
||||
Enable this to allow the RTC plugin to save and restore the
|
||||
system clock from a file when the plugin does not find any
|
||||
usable device node.
|
||||
|
||||
Since /var/lib/misc is usually persistent across reboots, we
|
||||
recommend using: /var/lib/misc/rtc
|
||||
|
||||
endif # RTC_PLUGIN
|
||||
|
||||
config BR2_PACKAGE_FINIT_PLUGIN_TTY
|
||||
bool "TTY plugin"
|
||||
|
||||
+27
-10
@@ -13,11 +13,19 @@ FINIT_DEPENDENCIES = host-pkgconf libite libuev
|
||||
FINIT_INSTALL_STAGING = YES
|
||||
FINIT_D = $(TARGET_DIR)/etc/finit.d
|
||||
|
||||
# Create configure script using autoreconf when building from git
|
||||
# Create configure script using autoreconf when building from git,
|
||||
# or when patching any of the GNU build files (*.ac, *.am, etc.)
|
||||
#FINIT_VERSION = 438d6b4e638418a2a22024a3cead2f47909d72b9
|
||||
#FINIT_SITE = $(call github,troglobit,finit,$(FINIT_VERSION))
|
||||
#FINIT_AUTORECONF = YES
|
||||
#FINIT_DEPENDENCIES += host-automake host-autoconf host-libtool
|
||||
FINIT_AUTORECONF = YES
|
||||
FINIT_DEPENDENCIES += host-automake host-autoconf host-libtool
|
||||
|
||||
# Strip "" from variables
|
||||
FINIT_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
|
||||
FINIT_GROUP = $(call qstrip,$(BR2_PACKAGE_FINIT_INITCTL_GROUP))
|
||||
FINIT_FSTAB = $(call qstrip,$(BR2_PACKAGE_FINIT_CUSTOM_FSTAB))
|
||||
FINIT_RTC_DATE = $(call qstrip,$(BR2_PACKAGE_FINIT_RTC_DATE))
|
||||
FINIT_RTC_FILE = $(call qstrip,$(BR2_PACKAGE_FINIT_RTC_FILE))
|
||||
|
||||
# Buildroot defaults to /usr for both prefix and exec-prefix, this we
|
||||
# must override because we want to install into /sbin and /bin for the
|
||||
@@ -31,7 +39,7 @@ FINIT_CONF_OPTS = \
|
||||
--disable-contrib \
|
||||
--disable-rescue \
|
||||
--disable-silent-rules \
|
||||
--with-group=$(BR2_PACKAGE_FINIT_INITCTL_GROUP)
|
||||
--with-group="$(FINIT_GROUP)"
|
||||
|
||||
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
|
||||
FINIT_CONF_OPTS += --exec-prefix=/usr
|
||||
@@ -40,8 +48,8 @@ FINIT_CONF_OPTS += --exec-prefix=
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FINIT_ADVANCED),y)
|
||||
ifneq ($(BR2_PACKAGE_FINIT_CUSTOM_FSTAB),)
|
||||
FINIT_CONF_OPTS += --with-fstab=$(BR2_PACKAGE_FINIT_CUSTOM_FSTAB)
|
||||
ifneq ($(FINIT_FSTAB),)
|
||||
FINIT_CONF_OPTS += --with-fstab="$(FINIT_FSTAB)"
|
||||
else
|
||||
FINIT_CONF_OPTS += --without-fstab
|
||||
endif
|
||||
@@ -101,12 +109,18 @@ else
|
||||
FINIT_CONF_OPTS += --disable-rtc-plugin
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FINIT_RTC_DATE),y)
|
||||
FINIT_CONF_OPTS += --with-rtc-date="$(BR2_PACKAGE_FINIT_RTC_DATE)"
|
||||
ifneq ($(FINIT_RTC_DATE),)
|
||||
FINIT_CONF_OPTS += --with-rtc-date="$(FINIT_RTC_DATE)"
|
||||
else
|
||||
FINIT_CONF_OPTS += --without-rtc-date
|
||||
endif
|
||||
|
||||
ifneq ($(FINIT_RTC_FILE),)
|
||||
FINIT_CONF_OPTS += --with-rtc-file="$(FINIT_RTC_FILE)"
|
||||
else
|
||||
FINIT_CONF_OPTS += --without-rtc-file
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_TTY),y)
|
||||
FINIT_CONF_OPTS += --enable-tty-plugin
|
||||
else
|
||||
@@ -119,8 +133,11 @@ else
|
||||
FINIT_CONF_OPTS += --disable-urandom-plugin
|
||||
endif
|
||||
|
||||
ifneq ($(SKELETON_INIT_COMMON_HOSTNAME),)
|
||||
FINIT_CONF_OPTS += --with-hostname="$(SKELETON_INIT_COMMON_HOSTNAME)"
|
||||
|
||||
ifneq ($(FINIT_HOSTNAME),)
|
||||
FINIT_CONF_OPTS += --with-hostname="$(FINIT_HOSTNAME)"
|
||||
else
|
||||
FINIT_CONF_OPTS += --without-hostname
|
||||
endif
|
||||
|
||||
# Disable/Enable features depending on other packages
|
||||
|
||||
@@ -1 +1 @@
|
||||
service [S0123456789] <!pid/syslogd> iitod -- LED daemon
|
||||
service [S0123456789] <!usr/product,usr/led> iitod -- LED daemon
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
config BR2_PACKAGE_KLISH
|
||||
bool "klish"
|
||||
depends on BR2_USE_MMU
|
||||
select BR2_PACKAGE_BIN
|
||||
select BR2_PACKAGE_FAUX
|
||||
select BR2_PACKAGE_LIBXML2
|
||||
help
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 4be3e500b670f7b98e3dd6696b8e51e83f122c65 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 25 Jan 2024 21:36:59 +0100
|
||||
Subject: [PATCH 01/33] net: phy: add support for PHY LEDs polarity modes
|
||||
Subject: [PATCH 01/34] net: phy: add support for PHY LEDs polarity modes
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Add support for PHY LEDs polarity modes. Some PHY require LED to be set
|
||||
@@ -22,6 +22,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Link: https://lore.kernel.org/r/20240125203702.4552-4-ansuelsmth@gmail.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/phy/phy_device.c | 16 ++++++++++++++++
|
||||
include/linux/phy.h | 22 ++++++++++++++++++++++
|
||||
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
From 4833b140cd11a57dd9f59754cdacfd71bc564c8f Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Mon, 4 Dec 2023 11:08:11 +0100
|
||||
Subject: [PATCH 02/33] net: mvmdio: Support setting the MDC frequency on XSMI
|
||||
Subject: [PATCH 02/34] net: mvmdio: Support setting the MDC frequency on XSMI
|
||||
controllers
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -14,6 +14,7 @@ Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Tested-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Link: https://lore.kernel.org/r/20231204100811.2708884-4-tobias@waldekranz.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/marvell/mvmdio.c | 44 +++++++++++++++++++++++++++
|
||||
1 file changed, 44 insertions(+)
|
||||
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
From 50a2973e8a520a82e9f9ec15a1f69e059ce7a334 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 14 Dec 2023 14:50:23 +0100
|
||||
Subject: [PATCH 03/33] net: dsa: mv88e6xxx: Create API to read a single stat
|
||||
Subject: [PATCH 03/34] net: dsa: mv88e6xxx: Create API to read a single stat
|
||||
counter
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -16,6 +16,7 @@ Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 162 ++++++++++++++++++-------------
|
||||
drivers/net/dsa/mv88e6xxx/chip.h | 27 +++---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 5916503e23e7f85796c1f927747e66b9535bac53 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 14 Dec 2023 14:50:25 +0100
|
||||
Subject: [PATCH 04/33] net: dsa: mv88e6xxx: Give each hw stat an ID
|
||||
Subject: [PATCH 04/34] net: dsa: mv88e6xxx: Give each hw stat an ID
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
With the upcoming standard counter group support, we are no longer
|
||||
@@ -16,6 +16,7 @@ Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 138 +++++++++++++++++--------------
|
||||
1 file changed, 75 insertions(+), 63 deletions(-)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 32dda6562734ec8ee667bc546f3ef56794d5bf82 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 14 Dec 2023 14:50:26 +0100
|
||||
Subject: [PATCH 05/33] net: dsa: mv88e6xxx: Add "eth-mac" counter group
|
||||
Subject: [PATCH 05/34] net: dsa: mv88e6xxx: Add "eth-mac" counter group
|
||||
support
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -12,6 +12,7 @@ Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 39 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 39 insertions(+)
|
||||
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
From 36adbdd466ec550cab8b2ae54177f674c02cf631 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 14 Dec 2023 14:50:27 +0100
|
||||
Subject: [PATCH 06/33] net: dsa: mv88e6xxx: Limit histogram counters to
|
||||
Subject: [PATCH 06/34] net: dsa: mv88e6xxx: Limit histogram counters to
|
||||
ingress traffic
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -27,6 +27,7 @@ Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 6 +++---
|
||||
drivers/net/dsa/mv88e6xxx/global1.c | 7 +++----
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From abfa532c1149525b128b8c76d80965f55e208240 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 14 Dec 2023 14:50:28 +0100
|
||||
Subject: [PATCH 07/33] net: dsa: mv88e6xxx: Add "rmon" counter group support
|
||||
Subject: [PATCH 07/34] net: dsa: mv88e6xxx: Add "rmon" counter group support
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Report the applicable subset of an mv88e6xxx port's counters using
|
||||
@@ -11,6 +11,7 @@ Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 42 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 42 insertions(+)
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
From 4407b94b4a08536fccb6eea2826955ff12d63ec2 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 16 Nov 2023 19:44:32 +0100
|
||||
Subject: [PATCH 09/33] net: dsa: mv88e6xxx: Add LED infrastructure
|
||||
Subject: [PATCH 09/34] net: dsa: mv88e6xxx: Add LED infrastructure
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Parse DT for LEDs and register them for devices that support it,
|
||||
though no actual implementations exist yet.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/Makefile | 1 +
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 5 +-
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
From a5cf5c0353db07e74d7a29dd4d5c2cb7775d5bec Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 16 Nov 2023 21:59:35 +0100
|
||||
Subject: [PATCH 10/33] net: dsa: mv88e6xxx: Add LED support for 6393X
|
||||
Subject: [PATCH 10/34] net: dsa: mv88e6xxx: Add LED support for 6393X
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Trigger support:
|
||||
- "none"
|
||||
- "timer"
|
||||
- "netdev"
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 1 +
|
||||
drivers/net/dsa/mv88e6xxx/leds.c | 226 +++++++++++++++++++++++++++++++
|
||||
|
||||
+3
-1
@@ -1,13 +1,15 @@
|
||||
From be94ec851dbb8e55c3f5e82f197b2dc59566aea2 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 12 Mar 2024 10:27:24 +0100
|
||||
Subject: [PATCH 11/33] net: dsa: mv88e6xxx: Fix timeout on waiting for PPU on
|
||||
Subject: [PATCH 11/34] net: dsa: mv88e6xxx: Fix timeout on waiting for PPU on
|
||||
6393X
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
In a multi-chip setup, delays of up to 750ms are observed before the
|
||||
device (6393X) signals completion of PPU initialization (Global 1,
|
||||
register 0, bit 15). Therefore, increase the timeout threshold to 1s.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 69092f83541e6539ab82eec3052325c403675de4 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 16 Jan 2024 16:00:55 +0100
|
||||
Subject: [PATCH 12/33] net: dsa: Support MDB memberships whose L2 addresses
|
||||
Subject: [PATCH 12/34] net: dsa: Support MDB memberships whose L2 addresses
|
||||
overlap
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -29,6 +29,8 @@ as long as the count is positive. Fortunately, all the infrastructure
|
||||
needed to do this is already in place, since it is also needed on CPU
|
||||
and DSA ports. Thus, "implement" this by simply removing the guards
|
||||
which previously skipped reference countung on user ports.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
net/dsa/switch.c | 16 ----------------
|
||||
1 file changed, 16 deletions(-)
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 7c19df77212d0728874515e97cf297863a6ff2cd Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 19 Sep 2023 18:38:10 +0200
|
||||
Subject: [PATCH 13/33] net: phy: marvell10g: Support firmware loading on
|
||||
Subject: [PATCH 13/34] net: phy: marvell10g: Support firmware loading on
|
||||
88X3310
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -11,6 +11,8 @@ its RAM, ask userspace for the binary and load it over XMDIO.
|
||||
We have no choice but to bail out of the probe if firmware is not
|
||||
available, as the device does not have any built-in image on which to
|
||||
fall back.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/phy/marvell10g.c | 161 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 161 insertions(+)
|
||||
|
||||
+3
-1
@@ -1,13 +1,15 @@
|
||||
From 0c34b42b7a72ddf1af6f3534870d647801e493fa Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 21 Nov 2023 20:15:24 +0100
|
||||
Subject: [PATCH 14/33] net: phy: marvell10g: Fix power-up when strapped to
|
||||
Subject: [PATCH 14/34] net: phy: marvell10g: Fix power-up when strapped to
|
||||
start powered down
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
On devices which are hardware strapped to start powered down (PDSTATE
|
||||
== 1), make sure that we clear the power-down bit on all units
|
||||
affected by this setting.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/phy/marvell10g.c | 18 +++++++++++++++---
|
||||
1 file changed, 15 insertions(+), 3 deletions(-)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 6576918d3348f8e20802379d568d7632228af4d7 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 15 Nov 2023 20:58:42 +0100
|
||||
Subject: [PATCH 15/33] net: phy: marvell10g: Add LED support for 88X3310
|
||||
Subject: [PATCH 15/34] net: phy: marvell10g: Add LED support for 88X3310
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Pickup the LEDs from the state in which the hardware reset or
|
||||
@@ -17,6 +17,8 @@ Trigger support:
|
||||
software blinking
|
||||
- "netdev": Offload link or duplex information to the solid behavior;
|
||||
tx and/or rx activity to blink behavior.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/phy/marvell10g.c | 422 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 422 insertions(+)
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 1ad7f010e46133c725df5cab4d85f71f689ca191 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 12 Dec 2023 09:51:05 +0100
|
||||
Subject: [PATCH 16/33] net: phy: marvell10g: Support LEDs tied to a single
|
||||
Subject: [PATCH 16/34] net: phy: marvell10g: Support LEDs tied to a single
|
||||
media side
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -14,6 +14,8 @@ tied to a particular media side, and use that information to refine
|
||||
the offloading of the "netdev" trigger, such that LEDs attached to the
|
||||
RJ45 jack only lights up when a copper link is established, and vice
|
||||
versa for the SFP cage.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/phy/marvell10g.c | 23 ++++++++++++++++++++++-
|
||||
1 file changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 11b9a3e328241edede03b6615bb9b0f1a40b9b7d Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Fri, 24 Nov 2023 23:29:55 +0100
|
||||
Subject: [PATCH 17/33] nvmem: layouts: onie-tlv: Let device probe even when
|
||||
Subject: [PATCH 17/34] nvmem: layouts: onie-tlv: Let device probe even when
|
||||
TLV is invalid
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -13,6 +13,8 @@ be successfully probed.
|
||||
|
||||
Therefore, settle for reporting data corruption issues in the log, and
|
||||
simply refrain from registering any cells in those cases.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/nvmem/layouts/onie-tlv.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
From ce1148b5c2e33541ad13ff2c4769d0b37d4e42b9 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Mon, 4 Mar 2024 16:47:28 +0100
|
||||
Subject: [PATCH 18/33] net: bridge: avoid classifying unknown multicast as
|
||||
Subject: [PATCH 18/34] net: bridge: avoid classifying unknown multicast as
|
||||
mrouters_only
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
From ce74ee8c5461cc53851ca323b4dfc9937cab0e41 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Tue, 5 Mar 2024 06:44:41 +0100
|
||||
Subject: [PATCH 19/33] net: bridge: Ignore router ports when forwarding L2
|
||||
Subject: [PATCH 19/34] net: bridge: Ignore router ports when forwarding L2
|
||||
multicast
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
From 3c9b05198e0b7193f2dcddc1860cd77f0adbc3a2 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 21 Mar 2024 19:12:15 +0100
|
||||
Subject: [PATCH 20/33] net: dsa: Support EtherType based priority overrides
|
||||
Subject: [PATCH 20/34] net: dsa: Support EtherType based priority overrides
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
include/net/dsa.h | 4 ++++
|
||||
net/dsa/slave.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--
|
||||
|
||||
+2
-1
@@ -1,10 +1,11 @@
|
||||
From 333134a4ff2b8dd7fb00a75560254de96d1082ad Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Fri, 22 Mar 2024 16:15:43 +0100
|
||||
Subject: [PATCH 21/33] net: dsa: mv88e6xxx: Support EtherType based priority
|
||||
Subject: [PATCH 21/34] net: dsa: mv88e6xxx: Support EtherType based priority
|
||||
overrides
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 64 +++++++++++++++++++++++++++++
|
||||
drivers/net/dsa/mv88e6xxx/chip.h | 21 ++++++++++
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From cdddc24c05cedc0d0fabc48da17ec26aeb7c1ef9 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 27 Mar 2024 10:10:19 +0100
|
||||
Subject: [PATCH 22/33] net: phy: Do not resume PHY when attaching
|
||||
Subject: [PATCH 22/34] net: phy: Do not resume PHY when attaching
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
The PHY should not start negotiating with its link-partner until
|
||||
@@ -15,6 +15,8 @@ Otherwise, drivers that attached to their PHYs during
|
||||
probing (e.g. DSA) would end up with a physical link being
|
||||
established, even though the corresponding interface was still
|
||||
administratively down.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/phy/phy_device.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 1ec21a3fc54fb447501fd7edbf692b00a31fe3ec Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 27 Mar 2024 15:52:43 +0100
|
||||
Subject: [PATCH 23/33] net: dsa: mv88e6xxx: Improve indirect register access
|
||||
Subject: [PATCH 23/34] net: dsa: mv88e6xxx: Improve indirect register access
|
||||
perf on 6393
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -13,6 +13,8 @@ previous families).
|
||||
Therefore, add a new set of SMI operations which remaps accesses to
|
||||
such registers to the corresponding directly addressable register. All
|
||||
other accesses use the regular indirect interface.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 7 +++
|
||||
drivers/net/dsa/mv88e6xxx/global1.h | 3 ++
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
From 5d7be493dcaa75ee69d521043062389d7772f8dc Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Thu, 4 Apr 2024 16:36:30 +0200
|
||||
Subject: [PATCH 24/33] net: bridge: drop delay for applying strict multicast
|
||||
Subject: [PATCH 24/34] net: bridge: drop delay for applying strict multicast
|
||||
filtering
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 492a824661dbc188b5abeb7434b5cf67c2016415 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Mon, 22 Apr 2024 23:18:01 +0200
|
||||
Subject: [PATCH 25/33] net: dsa: mv88e6xxx: Honor ports being managed via
|
||||
Subject: [PATCH 25/34] net: dsa: mv88e6xxx: Honor ports being managed via
|
||||
in-band-status
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -13,6 +13,8 @@ USXGMII autoneg)
|
||||
This state is the default set up by mv88e6xxx_port_setup_mac(), so all
|
||||
we have to do is to make the phylink MAC callbacks no-ops in cases
|
||||
when in-band-status is being used.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From c9c9597a47b00b720f5223c83ab05bb89481eda8 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 24 Apr 2024 21:35:26 +0200
|
||||
Subject: [PATCH 26/33] net: dsa: mv88e6xxx: Fix port policy config on 6393X
|
||||
Subject: [PATCH 26/34] net: dsa: mv88e6xxx: Fix port policy config on 6393X
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
mv88e6393x_port_policy_{read,write} expect the `pointer` argument to
|
||||
@@ -16,6 +16,7 @@ never enabled on DSA ports, which broke standalone port isolation in
|
||||
multichip switch trees made up of 6393X decices.
|
||||
|
||||
Fixes: 6584b26020fc ("net: dsa: mv88e6xxx: implement .port_set_policy for Amethyst")
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/port.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 4ff224b5f5de1347a1f686aa85cb918a7db18879 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 24 Apr 2024 22:41:04 +0200
|
||||
Subject: [PATCH 27/33] net: dsa: mv88e6xxx: Limit rsvd2cpu policy to user
|
||||
Subject: [PATCH 27/34] net: dsa: mv88e6xxx: Limit rsvd2cpu policy to user
|
||||
ports on 6393X
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -29,6 +29,8 @@ Before this change, due to rsvd2cpu being enabled on the CPU port, the
|
||||
switch would try to trap it back to the CPU. Given that the CPU is
|
||||
trusted, instead assume that it indeed meant for the packet to be
|
||||
forwarded like any other.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/port.c | 31 +++++++++++++++++++++++++------
|
||||
1 file changed, 25 insertions(+), 6 deletions(-)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From f0d4beabe769fec594b309c3f1ebb79cfdbede8b Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Mon, 29 Apr 2024 15:14:51 +0200
|
||||
Subject: [PATCH 28/33] usb: core: adjust log level for unauthorized devices
|
||||
Subject: [PATCH 28/34] usb: core: adjust log level for unauthorized devices
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
The fact that a USB device currently is not authorized is not an error,
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 5f96d718c850084504c53ec0b8d9fcf75ea9996c Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 15 May 2024 13:50:58 +0200
|
||||
Subject: [PATCH 29/33] net: dsa: mv88e6xxx: Grab register lock during counter
|
||||
Subject: [PATCH 29/34] net: dsa: mv88e6xxx: Grab register lock during counter
|
||||
snapshotting
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -9,6 +9,8 @@ This was missing for the standard counter groups. Since no caller
|
||||
already holds the lock, opt for pushing the locking down into
|
||||
mv88e6xxx_stats_snapshot() rather than having it duplicated at each
|
||||
call site.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From 6d4c436335003259cc02a0f015fd3d1d54e988a2 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 16 May 2024 14:51:54 +0200
|
||||
Subject: [PATCH 30/33] net: bridge: Differentiate MDB additions from
|
||||
Subject: [PATCH 30/34] net: bridge: Differentiate MDB additions from
|
||||
modifications
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -21,6 +21,8 @@ generated.
|
||||
|
||||
Therefore, discriminate new groups from changes to existing groups by
|
||||
introducing a RTM_SETMDB events to be used in the latter scenario.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
include/uapi/linux/rtnetlink.h | 2 ++
|
||||
net/bridge/br_mdb.c | 4 ++--
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From c333c612688d5e974b95fcf4b04f185d7cf4f80d Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 28 May 2024 10:38:42 +0200
|
||||
Subject: [PATCH 31/33] net: dsa: tag_dsa: Use tag priority as initial
|
||||
Subject: [PATCH 31/34] net: dsa: tag_dsa: Use tag priority as initial
|
||||
skb->priority
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -19,6 +19,8 @@ Ideally we could then map this priority to an internal one, like we
|
||||
can do with an "ingress-qos-map" on VLAN interfaces. Until that is
|
||||
implemented, support the setup that is likely to be the most common; a
|
||||
1:1 mapping from FPri to skb->priority.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
net/dsa/tag_dsa.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 18c025745fd8b8c9b3e688e9d78668a56cf71217 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 28 May 2024 11:04:22 +0200
|
||||
Subject: [PATCH 32/33] net: dsa: mv88e6xxx: Add mqprio qdisc support
|
||||
Subject: [PATCH 32/34] net: dsa: mv88e6xxx: Add mqprio qdisc support
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Add support for attaching mqprio qdisc's to mv88e6xxx ports and use
|
||||
@@ -24,6 +24,8 @@ are effectively only specifying the QPri.
|
||||
Since FPri is always a 3-bit field, even on older chips with only 4
|
||||
physical queues, always report 8 queues and let the chip's policy
|
||||
handle the mapping down to the "real" number.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 70 ++++++++++++++++++++++++++++++++
|
||||
net/dsa/tag_dsa.c | 4 +-
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
From f2d4ff12c7a0e644cbeac6675b755fb4a87b362a Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 29 May 2024 13:20:41 +0200
|
||||
Subject: [PATCH 33/33] net: dsa: mv88e6xxx: Use VLAN prio over IP when both
|
||||
Subject: [PATCH 33/34] net: dsa: mv88e6xxx: Use VLAN prio over IP when both
|
||||
are available
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -22,6 +22,8 @@ main reasons for choosing the new default:
|
||||
packet's priority. As the packet then moves through the network
|
||||
core over trusted VLAN trunks, the packet should keep its original
|
||||
priority, independent of what inner protocol fields may indicate.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From ceaaa4f44f9b3ec82c4e0a24c2322aae58fa3aa0 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Wed, 6 Nov 2024 15:39:33 +0100
|
||||
Subject: [PATCH 34/34] net: dsa: mb88e6xxx: use EOPNOTSUPP for unsupported
|
||||
flags
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Make sure to return correct error code for unsupported flags, and
|
||||
propagate any error.
|
||||
|
||||
Follow-up to a5cf5c0
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/leds.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/leds.c b/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
index b2a55d96b506..fe1ed3ed2a8a 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
@@ -99,7 +99,7 @@ static int mv88e6393x_led_flags_to_mode(struct mv88e6xxx_led *led, unsigned long
|
||||
return i;
|
||||
}
|
||||
|
||||
- return -EINVAL;
|
||||
+ return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static int mv88e6393x_led_mode_to_flags(struct mv88e6xxx_led *led, u8 mode,
|
||||
@@ -216,6 +216,9 @@ static int mv88e6393x_led_hw_control_set(struct mv88e6xxx_led *led,
|
||||
{
|
||||
int mode = mv88e6393x_led_flags_to_mode(led, flags);
|
||||
|
||||
+ if (mode < 0)
|
||||
+ return mode;
|
||||
+
|
||||
return mv88e6393x_led_set(led, mode);
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+15
-11
@@ -1,19 +1,23 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
usb_ports=$(cat /run/system.json | jq -r '.["usb-ports"] | map(.name) | unique | join(" ")')
|
||||
if jq -e '.["usb-ports"]' /run/system.json > /dev/null; then
|
||||
usb_ports=$(jq -r '.["usb-ports"] | map(.name) | unique | join(" ")' /run/system.json)
|
||||
else
|
||||
usb_ports=""
|
||||
fi
|
||||
|
||||
gen_port()
|
||||
{
|
||||
local port="$1"
|
||||
cat <<EOF
|
||||
{
|
||||
"class": "infix-hardware:usb",
|
||||
"name": "$port",
|
||||
"state": {
|
||||
"admin-state": "unlocked"
|
||||
}
|
||||
}
|
||||
port="$1"
|
||||
cat <<EOF
|
||||
{
|
||||
"class": "infix-hardware:usb",
|
||||
"name": "$port",
|
||||
"state": {
|
||||
"admin-state": "unlocked"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
}
|
||||
first=1
|
||||
@@ -24,7 +28,7 @@ cat <<EOF
|
||||
EOF
|
||||
for port in $usb_ports; do
|
||||
if [ $first -eq 0 ]; then
|
||||
echo -n ','
|
||||
echo -n ','
|
||||
fi
|
||||
first=0;
|
||||
gen_port "$port"
|
||||
|
||||
@@ -1889,6 +1889,10 @@ static sr_error_t netdag_gen_iface(sr_session_ctx_t *session, struct dagger *net
|
||||
if (err)
|
||||
goto err_close_ip;
|
||||
|
||||
/* ifAlias, should skip for container-network types */
|
||||
attr = lydx_get_cattr(cif, "description");
|
||||
fprintf(ip, "link set alias \"%s\" dev %s\n", attr ?: "", ifname);
|
||||
|
||||
/* Bring interface back up, if enabled */
|
||||
attr = lydx_get_cattr(cif, "enabled");
|
||||
if (!attr || !strcmp(attr, "true"))
|
||||
|
||||
@@ -37,7 +37,7 @@ MODULES=(
|
||||
"ieee802-ethernet-interface@2019-06-21.yang"
|
||||
"infix-ethernet-interface@2024-02-27.yang"
|
||||
"infix-factory-default@2023-06-28.yang"
|
||||
"infix-interfaces@2024-10-14.yang -e vlan-filtering"
|
||||
"infix-interfaces@2024-10-28.yang -e vlan-filtering"
|
||||
|
||||
# from rousette
|
||||
"ietf-restconf@2017-01-26.yang"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- sh -*-
|
||||
# REMEMBER TO UPDATE infix-interfaces ALSO IN confd.inc
|
||||
MODULES=(
|
||||
"infix-interfaces@2024-10-14.yang -e vlan-filtering -e containers"
|
||||
"infix-interfaces@2024-10-28.yang -e vlan-filtering -e containers"
|
||||
"infix-containers@2024-10-14.yang"
|
||||
)
|
||||
|
||||
@@ -23,6 +23,10 @@ submodule infix-if-container {
|
||||
Ensures a container interface can never be a bridge port, or
|
||||
LAG member, at the same time.";
|
||||
|
||||
revision 2024-10-29 {
|
||||
description "Add read only container list to container-network";
|
||||
reference "internal";
|
||||
}
|
||||
revision 2024-01-15 {
|
||||
description "Initial revision.";
|
||||
reference "internal";
|
||||
@@ -64,7 +68,11 @@ submodule infix-if-container {
|
||||
base container-network;
|
||||
}
|
||||
}
|
||||
|
||||
leaf-list containers {
|
||||
type string;
|
||||
config false;
|
||||
description "List of containers using this interface";
|
||||
}
|
||||
list subnet {
|
||||
description "Static IP ranges to hand out addresses to containers from.
|
||||
|
||||
|
||||
@@ -23,6 +23,11 @@ module infix-interfaces {
|
||||
contact "kernelkit@googlegroups.com";
|
||||
description "Linux bridge and lag extensions for ietf-interfaces.";
|
||||
|
||||
revision 2024-10-28 {
|
||||
description "Limit description to 64 chars, matching IF-MIB max.";
|
||||
reference "internal";
|
||||
}
|
||||
|
||||
revision 2024-10-14 {
|
||||
description "Deviate link-up-down-trap-enable not-supported.";
|
||||
reference "internal";
|
||||
@@ -84,6 +89,18 @@ module infix-interfaces {
|
||||
}
|
||||
}
|
||||
|
||||
deviation "/if:interfaces/if:interface/if:description" {
|
||||
deviate replace {
|
||||
type string {
|
||||
length "0..64";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deviation "/if:interfaces/if:interface/if:link-up-down-trap-enable" {
|
||||
deviate not-supported;
|
||||
}
|
||||
|
||||
augment "/if:interfaces/if:interface" {
|
||||
description "Custom phys-address management, static or derived from chassis MAC.";
|
||||
|
||||
@@ -114,7 +131,4 @@ module infix-interfaces {
|
||||
}
|
||||
}
|
||||
}
|
||||
deviation "/if:interfaces/if:interface/if:link-up-down-trap-enable" {
|
||||
deviate not-supported;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@
|
||||
<ACTION sym="script">
|
||||
if [ -n "$KLISH_PARAM_name" ]; then
|
||||
sysrepocfg -f json -X -d operational -x \
|
||||
"/ietf-interfaces:interfaces/interface[name='$KLISH_PARAM_name']" | \
|
||||
"/ietf-interfaces:interfaces/interface[name=\"$KLISH_PARAM_name\"]" | \
|
||||
/usr/libexec/statd/cli-pretty "show-interfaces" -n "$KLISH_PARAM_name"
|
||||
else
|
||||
sysrepocfg -f json -X -d operational -m ietf-interfaces | \
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user