mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-23 01:23:00 +02:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1854bca98b | ||
|
|
00261fb120 | ||
|
|
4a69d1564d |
@@ -9,7 +9,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
name: Build Infix ${{ matrix.platform }}
|
||||
runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [aarch64, x86_64]
|
||||
@@ -27,6 +27,11 @@ jobs:
|
||||
target=${{ matrix.platform }}
|
||||
echo "dir=infix-$target" >> $GITHUB_OUTPUT
|
||||
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
|
||||
if [ "$target" = x86_64 ]; then
|
||||
echo "out=$PWD/output" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "out=/mnt/x-$target" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Restore Cache of dl/
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
@@ -46,27 +51,31 @@ jobs:
|
||||
run: |
|
||||
target=${{ matrix.platform }}_defconfig
|
||||
echo "Building $target ..."
|
||||
sudo mkdir ${{ steps.vars.outputs.out }}
|
||||
sudo chown $(id -un):$(id -gn) ${{ steps.vars.outputs.out }}
|
||||
export O=${{ steps.vars.outputs.out }}
|
||||
make $target
|
||||
make
|
||||
- name: Prepare Artifact
|
||||
run: |
|
||||
cd output/
|
||||
cd ${{ steps.vars.outputs.out }}
|
||||
mv images ${{ steps.vars.outputs.dir }}
|
||||
ln -s ${{ steps.vars.outputs.dir }} images
|
||||
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
|
||||
- name: Test
|
||||
if: matrix.platform == 'x86_64'
|
||||
run: |
|
||||
make test
|
||||
export O=${{ steps.vars.outputs.out }}
|
||||
make test-qeneth
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: output/${{ steps.vars.outputs.tgz }}
|
||||
path: ${{ steps.vars.outputs.out }}/${{ steps.vars.outputs.tgz }}
|
||||
name: artifact-${{ matrix.platform }}
|
||||
release:
|
||||
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
|
||||
name: Upload Latest Build
|
||||
needs: build
|
||||
runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
@@ -12,7 +12,7 @@ env:
|
||||
jobs:
|
||||
coverity:
|
||||
if: ${{github.repository_owner == 'kernelkit'}}
|
||||
runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Fetch latest Coverity Scan MD5
|
||||
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
make -j
|
||||
make
|
||||
- name: Prepare Artifact
|
||||
run: |
|
||||
cd output
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
build:
|
||||
if: github.repository == 'kernelkit/infix' && startsWith(github.ref, 'refs/tags/')
|
||||
name: Build Infix ${{ github.ref_name }} [${{ matrix.platform }}]
|
||||
runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [aarch64, x86_64]
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
release:
|
||||
name: Release Infix ${{ github.ref_name }}
|
||||
needs: build
|
||||
runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
|
||||
#include "alder-mpp.h"
|
||||
|
||||
&ap_crit {
|
||||
temperature = <115000>;
|
||||
};
|
||||
|
||||
/ {
|
||||
model = "Alder";
|
||||
compatible = "alder,alder",
|
||||
@@ -354,7 +358,6 @@
|
||||
#define XSWP(_n, _label, _mac_offs, _phy) \
|
||||
port@_n { \
|
||||
SWP_COMMON(_n, _label, _mac_offs, "usxgmii", _phy); \
|
||||
managed = "in-band-status"; \
|
||||
}
|
||||
|
||||
#define GSWP(_n, _label, _mac_offs, _phy) \
|
||||
|
||||
+2
-21
@@ -18,27 +18,7 @@ endchoice
|
||||
config SIGN_KEY
|
||||
string "Signing key"
|
||||
depends on SIGN_ENABLED
|
||||
default "${BR2_EXTERNAL_INFIX_PATH}/board/common/signing-keys/development" if SIGN_SRC_DIR
|
||||
|
||||
menuconfig TRUSTED_KEYS
|
||||
bool "Trusted keys for image"
|
||||
depends on SIGN_ENABLED
|
||||
help
|
||||
Keys that will be accepted for this image
|
||||
|
||||
|
||||
config TRUSTED_KEYS_DEVELOPMENT
|
||||
bool "Development key"
|
||||
depends on TRUSTED_KEYS
|
||||
|
||||
config TRUSTED_KEYS_DEVELOPMENT_PATH
|
||||
string
|
||||
depends on TRUSTED_KEYS_DEVELOPMENT
|
||||
default "${BR2_EXTERNAL_INFIX_PATH}/board/common/signing-keys/development/infix.crt"
|
||||
|
||||
config TRUSTED_KEYS_EXTRA_PATH
|
||||
string "Path to extra keys to include in image"
|
||||
depends on TRUSTED_KEYS
|
||||
default "${BR2_EXTERNAL_INFIX_PATH}/board/common/dev-key" if SIGN_SRC_DIR
|
||||
|
||||
menuconfig DISK_IMAGE
|
||||
bool "Disk image"
|
||||
@@ -160,3 +140,4 @@ config FIT_ARCH
|
||||
config FIT_KERNEL_LOAD_ADDR
|
||||
string "Kernel load address"
|
||||
depends on FIT_IMAGE
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
ifeq ($(SIGN_ENABLED),y)
|
||||
include $(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/uboot.mk
|
||||
|
||||
TRUSTED_KEYS=$(TRUSTED_KEYS_DEVELOPMENT_PATH) $(TRUSTED_KEYS_EXTRA_PATH)
|
||||
define RAUC_POST_BUILD_INSTALL_CERT
|
||||
@$(call IXMSG,"Installing signing cert for RAUC")
|
||||
mkdir -p $(TARGET_DIR)/etc/rauc/keys
|
||||
$(foreach crt,$(shell ls $(TRUSTED_KEYS)), \
|
||||
$(foreach crt,$(shell ls $(SIGN_KEY)/*.crt), \
|
||||
cp $(crt) $(TARGET_DIR)/etc/rauc/keys/$(shell openssl x509 -hash -noout <$(crt)).0;)
|
||||
|
||||
endef
|
||||
RAUC_POST_BUILD_HOOKS += RAUC_POST_BUILD_INSTALL_CERT
|
||||
endif
|
||||
|
||||
@@ -44,19 +44,16 @@ image @DISKIMG@ {
|
||||
partition aux {
|
||||
offset = @AUXOFFS@
|
||||
image = "aux.ext4"
|
||||
partition-uuid = @AUXUUID@
|
||||
}
|
||||
|
||||
partition primary {
|
||||
image = "rootfs.squashfs"
|
||||
size = @IMGSIZE@
|
||||
partition-uuid = @PRIMARYUUID@
|
||||
}
|
||||
|
||||
partition secondary {
|
||||
image = "rootfs.squashfs"
|
||||
size = @IMGSIZE@
|
||||
partition-uuid = @SECONDARYUUID@
|
||||
}
|
||||
|
||||
partition cfg {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
. $BR2_EXTERNAL_INFIX_PATH/board/common/rootfs/etc/partition-uuid
|
||||
set -e
|
||||
|
||||
K=10
|
||||
M=20
|
||||
@@ -158,9 +157,6 @@ genboot
|
||||
# Use awk over sed because replacement text may contain newlines,
|
||||
# which sed does not approve of.
|
||||
awk \
|
||||
-vauxuuid=$AUX_UUID \
|
||||
-vprimaryuuid=$PRIMARY_UUID \
|
||||
-vsecondaryuuid=$SECONDARY_UUID \
|
||||
-vtotal=$total \
|
||||
-vauxsize=$auxsize -vauxoffs=$auxoffs \
|
||||
-vimgsize=$imgsize \
|
||||
@@ -178,10 +174,6 @@ awk \
|
||||
sub(/@DISKIMG@/, diskimg);
|
||||
sub(/@BOOTIMG@/, bootimg);
|
||||
sub(/@BOOTPART@/, bootpart);
|
||||
sub(/@AUXUUID@/, auxuuid);
|
||||
sub(/@PRIMARYUUID@/, primaryuuid);
|
||||
sub(/@SECONDARYUUID@/, secondaryuuid);
|
||||
|
||||
}1' \
|
||||
< $common/genimage.cfg.in >$root/genimage.cfg
|
||||
|
||||
|
||||
@@ -54,10 +54,11 @@ choice
|
||||
|
||||
config QEMU_CONSOLE_VIRTIO
|
||||
bool "Virtio (hvc0)"
|
||||
depends on QEMU_LOADER_KERNEL
|
||||
|
||||
config QEMU_CONSOLE_SERIAL
|
||||
bool "Serial (ttyS0/ttyAMA0)"
|
||||
depends on !QEMU_LOADER_OVMF
|
||||
|
||||
endchoice
|
||||
|
||||
config QEMU_MACHINE
|
||||
|
||||
@@ -117,7 +117,7 @@ rootfs_args()
|
||||
echo -n "-device sd-card,drive=mmc "
|
||||
echo -n "-drive id=mmc,file=$CONFIG_QEMU_ROOTFS,if=none,format=raw "
|
||||
elif [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
|
||||
echo -n "-drive file=$CONFIG_QEMU_ROOTFS.qcow2,if=virtio,format=qcow2,bus=0,unit=0 "
|
||||
echo -n "-drive file=$CONFIG_QEMU_ROOTFS,if=virtio,format=raw,bus=0,unit=0 "
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -148,14 +148,14 @@ usb_args()
|
||||
dd if=/dev/zero of=${USBSTICK} bs=8M count=1 >/dev/null 2>&1
|
||||
mkfs.vfat $USBSTICK >/dev/null 2>&1
|
||||
fi
|
||||
echo -n "-drive if=none,id=usbstick,format=raw,file=$USBSTICK "
|
||||
echo -n "-drive if=none,id=usbstick,format=raw,file=${USBSTICK} "
|
||||
echo -n "-usb "
|
||||
echo -n "-device usb-ehci,id=ehci "
|
||||
echo -n "-device usb-storage,bus=ehci.0,drive=usbstick "
|
||||
}
|
||||
rw_args()
|
||||
{
|
||||
[ "$CONFIG_QEMU_RW" ] || return
|
||||
[ "$CONFIG_QEMU_RW" ] || return
|
||||
|
||||
if ! [ -f "$CONFIG_QEMU_RW" ]; then
|
||||
dd if=/dev/zero of="$CONFIG_QEMU_RW" bs=16M count=1 >/dev/null 2>&1
|
||||
@@ -251,9 +251,6 @@ wdt_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
|
||||
fi
|
||||
local qemu
|
||||
read qemu <<EOF
|
||||
$CONFIG_QEMU_MACHINE -m $CONFIG_QEMU_MACHINE_RAM \
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
sleep 30
|
||||
|
||||
stress-ng --cpu 8 --io 4 --vm 2 --vm-bytes 128M --fork 4 -t 0
|
||||
Executable
+76
@@ -0,0 +1,76 @@
|
||||
#!/bin/sh
|
||||
|
||||
tstamp()
|
||||
{
|
||||
if [ "$1" = "head" ]; then
|
||||
printf '%9s' time
|
||||
else
|
||||
printf '%9s' $(date +%T)
|
||||
fi
|
||||
}
|
||||
|
||||
thermal()
|
||||
{
|
||||
for th in /sys/class/thermal/thermal_zone*; do
|
||||
if [ "$1" = "head" ]; then
|
||||
printf '%5s' $(cat $th/type | \
|
||||
sed -e 's/-thermal//' -e 's/ap-cpu/cpu/' -e 's/-ic//')
|
||||
else
|
||||
printf '%5d' \
|
||||
$((($(cat $th/temp) + 500) / 1000))
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
hwmon()
|
||||
{
|
||||
for hw in /sys/class/hwmon/*; do
|
||||
[ -f $hw/temp1_input ] || continue
|
||||
|
||||
if [ "$1" = "head" ]; then
|
||||
printf '%5s' \
|
||||
$(cat $hw/name | sed -e 's/cp0configspacef2000000mdio12a200switch0mdio0/p/' -e 's/f212a600mdiomii0/xp/')
|
||||
else
|
||||
printf '%5d' \
|
||||
$((($(cat $hw/temp1_input) + 500) / 1000))
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
xphys()
|
||||
{
|
||||
for xphy in 4 5; do
|
||||
mdio f212a6* $xphy:31 0xf08a 0x4d00
|
||||
|
||||
if [ "$1" = "head" ]; then
|
||||
printf '%5s' \
|
||||
p$((xphy + 5))
|
||||
else
|
||||
printf '%5d' \
|
||||
$(($(mdio f212a6* $xphy:31 0xf08a) & 0xff - 75))
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$1" != "-H" ]; then
|
||||
# tstamp head
|
||||
thermal head
|
||||
hwmon head
|
||||
# xphys head
|
||||
echo
|
||||
fi
|
||||
|
||||
while :; do
|
||||
# tstamp
|
||||
thermal
|
||||
hwmon
|
||||
# xphys
|
||||
echo
|
||||
|
||||
if [ "$1" == "-n" ]; then
|
||||
sleep ${2:-10}
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,3 @@
|
||||
service [2345789] log:/var/log/temp.log /bin/temp.sh -n 10 -- Temperature monitor
|
||||
service [2345789] log:/var/log/load.log /bin/load.sh -- CPU load generator
|
||||
service [2345789] log:/var/log/memtester.log /usr/bin/memtester 1G -- Memory load generator
|
||||
@@ -0,0 +1 @@
|
||||
../available/temp.conf
|
||||
@@ -1,3 +0,0 @@
|
||||
AUX_UUID="78460f84-de84-4fe7-89bd-4c1f433b2230"
|
||||
PRIMARY_UUID="107ae911-a97b-4380-975c-7ce1a2dde1e0"
|
||||
SECONDARY_UUID="352bd9b2-2ca9-44e2-bdc7-edbc87ba1e02"
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
. /etc/partion-uuid
|
||||
set -e
|
||||
|
||||
disk=$1
|
||||
bootoffs=$2
|
||||
@@ -30,9 +29,9 @@ fi
|
||||
sgdisk \
|
||||
-o \
|
||||
-n1:${bootoffs}:+${bootsize} -t1:8301 -c1:boot \
|
||||
-n2::+${auxsize} -t2:8301 -c2:aux -u2:${AUX_UUID}\
|
||||
-n3::+${imgsize} -t3:8300 -c3:primary -u3:${PRIMARY_UUID} \
|
||||
-n4::+${imgsize} -t4:8300 -c4:secondary -u4:${SECONDARY_UUID}\
|
||||
-n2::+${auxsize} -t2:8301 -c2:aux \
|
||||
-n3::+${imgsize} -t3:8300 -c3:primary \
|
||||
-n4::+${imgsize} -t4:8300 -c4:secondary \
|
||||
-n5::+${cfgsize} -t5:8302 -c5:cfg \
|
||||
-n6:: -t6:8310 -c6:var \
|
||||
-p \
|
||||
|
||||
@@ -3,9 +3,7 @@ INFIX_TESTS ?= $(test-dir)/case/all.yaml
|
||||
|
||||
test-env = $(test-dir)/env \
|
||||
-f $(BINARIES_DIR)/infix-x86_64.img \
|
||||
-f $(BINARIES_DIR)/infix-x86_64-disk.img \
|
||||
-f $(BINARIES_DIR)/OVMF.fd \
|
||||
-p $(BINARIES_DIR)/infix-x86_64.pkg \
|
||||
-p $(BINARIES_DIR)/infix-x86_64.pkg \
|
||||
$(1) $(2)
|
||||
|
||||
test-env-qeneth = $(call test-env,-q $(test-dir)/virt/quad,$(1))
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
search -l aux --set=aux
|
||||
search -l primary --set=primary
|
||||
search -l secondary --set=secondary
|
||||
|
||||
set prefix=($aux)/grub
|
||||
configfile ($aux)/grub/grub.cfg
|
||||
set prefix=(hd0,gpt2)/grub
|
||||
|
||||
+5
-12
@@ -33,24 +33,17 @@ else
|
||||
set log="loglevel=4"
|
||||
fi
|
||||
|
||||
# From board/common/rootfs/etc/partition-uuid
|
||||
search -p 107ae911-a97b-4380-975c-7ce1a2dde1e0 --set primary
|
||||
search -p 352bd9b2-2ca9-44e2-bdc7-edbc87ba1e02 --set secondary
|
||||
|
||||
export primary
|
||||
export secondary
|
||||
|
||||
submenu "primary" "$log" {
|
||||
set slot="$1"
|
||||
set append="console=hvc0 root=PARTLABEL=$slot $2"
|
||||
set root="($primary)"
|
||||
set append="console=ttyS0 root=PARTLABEL=$slot $2"
|
||||
set root=(hd0,gpt3)
|
||||
source /boot/grub/grub.cfg
|
||||
}
|
||||
|
||||
submenu "secondary" "$log" {
|
||||
set slot="$1"
|
||||
set append="console=hvc0 root=PARTLABEL=$slot $2"
|
||||
set root="($secondary)"
|
||||
set append="console=ttyS0 root=PARTLABEL=$slot $2"
|
||||
set root=(hd0,gpt4)
|
||||
source /boot/grub/grub.cfg
|
||||
}
|
||||
|
||||
@@ -63,7 +56,7 @@ submenu "net" "$log" {
|
||||
set root=(initrd)
|
||||
|
||||
set slot="$1"
|
||||
set append="console=hvc0 root=/dev/ram0 ramdisk_size=65536 $2"
|
||||
set append="console=ttyS0 root=/dev/ram0 ramdisk_size=65536 $2"
|
||||
source /boot/grub/grub.cfg
|
||||
else
|
||||
if [ -z "$net_efinet0_dhcp_next_server" ]; then
|
||||
|
||||
+1
-1
Submodule buildroot updated: 42182f9bef...d49f1e9e90
@@ -13,9 +13,7 @@ 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_SYSTEM_BIN_SH_BASH=y
|
||||
BR2_TARGET_GENERIC_GETTY_PORT="@console"
|
||||
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
|
||||
BR2_SYSTEM_DHCP="eth0"
|
||||
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_CA"
|
||||
@@ -47,6 +45,7 @@ BR2_PACKAGE_EUDEV_RULES_GEN=y
|
||||
BR2_PACKAGE_GPTFDISK=y
|
||||
BR2_PACKAGE_GPTFDISK_SGDISK=y
|
||||
BR2_PACKAGE_MDIO_TOOLS=y
|
||||
BR2_PACKAGE_MEMTESTER=y
|
||||
BR2_PACKAGE_RNG_TOOLS=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT=y
|
||||
@@ -155,6 +154,3 @@ BR2_PACKAGE_LIBINPUT=y
|
||||
DISK_IMAGE_BOOT_BIN=y
|
||||
GNS3_APPLIANCE_RAM=512
|
||||
GNS3_APPLIANCE_IFNUM=10
|
||||
BR2_PER_PACKAGE_DIRECTORIES=y
|
||||
TRUSTED_KEYS=y
|
||||
TRUSTED_KEYS_DEVELOPMENT=y
|
||||
|
||||
@@ -112,7 +112,7 @@ BR2_TARGET_ROOTFS_SQUASHFS=y
|
||||
BR2_TARGET_EDK2=y
|
||||
BR2_TARGET_GRUB2=y
|
||||
BR2_TARGET_GRUB2_X86_64_EFI=y
|
||||
BR2_TARGET_GRUB2_BUILTIN_MODULES_EFI="boot linux ext2 squash4 part_gpt normal efi_gop configfile loadenv test echo reboot net efinet tftp loopback cat search"
|
||||
BR2_TARGET_GRUB2_BUILTIN_MODULES_EFI="boot linux ext2 squash4 part_gpt normal efi_gop configfile loadenv test echo reboot net efinet tftp loopback"
|
||||
BR2_TARGET_GRUB2_BUILTIN_CONFIG_EFI="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/grub-embed.cfg"
|
||||
BR2_TARGET_GRUB2_INSTALL_TOOLS=y
|
||||
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
||||
@@ -156,6 +156,3 @@ BR2_PACKAGE_PODMAN_DRIVER_VFS=y
|
||||
BR2_PACKAGE_TETRIS=y
|
||||
GNS3_APPLIANCE_RAM=512
|
||||
GNS3_APPLIANCE_IFNUM=10
|
||||
BR2_PER_PACKAGE_DIRECTORIES=y
|
||||
TRUSTED_KEYS=y
|
||||
TRUSTED_KEYS_DEVELOPMENT=y
|
||||
|
||||
+1
-9
@@ -4,7 +4,7 @@ Change Log
|
||||
All notable changes to the project are documented in this file.
|
||||
|
||||
|
||||
[v24.04.0][UNRELEASED]
|
||||
[v24.03.0][UNRELEASED]
|
||||
-------------------------
|
||||
|
||||
Please note, as of this release the Infix Classic variant has been
|
||||
@@ -63,10 +63,6 @@ separate project. Going forward Infix' focus is entirely on NETCONF.
|
||||
- Fix #328: when setting up a VLAN filtering bridge, the PVID for bridge
|
||||
ports defaulted to 1, making it impossible to set up "tagged-only"
|
||||
ports which drop ingressing untagged traffic
|
||||
- Fix #357: EUI-64 based IPv6 autoconf address on bridges seem to be
|
||||
randomized. Problem caused by kernel setting a random MAC before any
|
||||
bridge port is added. Fixed by using the device's base MAC address on
|
||||
bridge interfaces. Possible to override using `phys-address` option
|
||||
- Fix #358: MAC address no longer shown for bridge interfaces in CLI
|
||||
`show interfaces` command
|
||||
- Fix #366: static routes from container host interfaces do not work.
|
||||
@@ -80,9 +76,6 @@ separate project. Going forward Infix' focus is entirely on NETCONF.
|
||||
(firewalled and NAT:ed, hidden from the rest of the network)
|
||||
- Fix #385: segfault in helper function when disabling the DHCP client
|
||||
using `no dhcp-client` from the CLI
|
||||
- Fix #406: an overly restrictive `when` expression in the bridge YANG
|
||||
model prevented users from adding VLAN interfaces as bridge ports.
|
||||
E.g., creating interface `eth0.10` and adding that to `br0`
|
||||
|
||||
|
||||
[v24.02.0][] - 2024-03-01
|
||||
@@ -778,7 +771,6 @@ Supported YANG models in addition to those used by sysrepo and netopeer:
|
||||
|
||||
[buildroot]: https://buildroot.org/
|
||||
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v24.02.0...HEAD
|
||||
[v24.04.0]: https://github.com/kernelkit/infix/compare/v24.02.0...v24.04.0
|
||||
[v24.02.0]: https://github.com/kernelkit/infix/compare/v23.11.0...v24.02.0
|
||||
[v23.11.0]: https://github.com/kernelkit/infix/compare/v23.10.0...v23.11.0
|
||||
[v23.10.0]: https://github.com/kernelkit/infix/compare/v23.09.0...v23.10.0
|
||||
|
||||
@@ -11,7 +11,7 @@ CONFD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/confd
|
||||
CONFD_LICENSE = BSD-3-Clause
|
||||
CONFD_LICENSE_FILES = LICENSE
|
||||
CONFD_REDISTRIBUTE = NO
|
||||
CONFD_DEPENDENCIES = augeas jansson libite sysrepo libsrx libglib2
|
||||
CONFD_DEPENDENCIES = augeas jansson libite sysrepo libsrx
|
||||
CONFD_AUTORECONF = YES
|
||||
define CONFD_CONF_ENV
|
||||
CFLAGS="$(INFIX_CFLAGS)"
|
||||
|
||||
@@ -22,7 +22,7 @@ EXECD_CONF_OPTS = --prefix= --disable-silent-rules
|
||||
define EXECD_INSTALL_EXTRA
|
||||
cp $(EXECD_PKGDIR)/execd.conf $(FINIT_D)/available/
|
||||
ln -sf ../available/execd.conf $(FINIT_D)/enabled/execd.conf
|
||||
cp $(EXECD_PKGDIR)/tmpfiles.conf $(TARGET_DIR)/lib/tmpfiles.d/execd.conf
|
||||
cp $(EXECD_PKGDIR)/tmpfiles.conf $(TARGET_DIR)/etc/tmpfiles.d/execd.conf
|
||||
endef
|
||||
EXECD_TARGET_FINALIZE_HOOKS += EXECD_INSTALL_EXTRA
|
||||
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
From 6a89e60fc84b90e5f09f61d37892f3b17bd14631 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Wed, 24 Apr 2024 11:33:35 +0200
|
||||
Subject: [PATCH 10/11] Fix #405: parsing >1 active consoles in tty @console
|
||||
setups
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Systems that have the following tty setup and multiple consoles listed
|
||||
in /sys/class/tty/console/active misbehave:
|
||||
|
||||
tty [12345789] @console 0 xterm noclear passenv
|
||||
|
||||
Only the first listed console is started properly, the remaining ones
|
||||
were registered using the wrong :ID and no arguments to getty.
|
||||
|
||||
This patch fixes the parsing and re-use of the base paramenters for
|
||||
all consoles listed in the active file.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
src/service.c | 45 +++++++++++++++++++++++----------------------
|
||||
1 file changed, 23 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/src/service.c b/src/service.c
|
||||
index eca9ed0..95a04b8 100644
|
||||
--- a/src/service.c
|
||||
+++ b/src/service.c
|
||||
@@ -1633,10 +1633,16 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
|
||||
|
||||
if (type == SVC_TYPE_TTY) {
|
||||
size_t i, len = 0;
|
||||
+ char *ptr;
|
||||
|
||||
if (tty_parse_args(&tty, cmd, &args))
|
||||
return errno;
|
||||
|
||||
+ if (tty_isatcon(tty.dev))
|
||||
+ dev = tty_atcon();
|
||||
+ else
|
||||
+ dev = tty.dev;
|
||||
+ next:
|
||||
if (tty.cmd)
|
||||
len += strlen(tty.cmd);
|
||||
else
|
||||
@@ -1659,14 +1665,22 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
|
||||
if (!cmd)
|
||||
return errno;
|
||||
|
||||
- if (tty_isatcon(tty.dev))
|
||||
- dev = tty_atcon();
|
||||
- else
|
||||
- dev = tty.dev;
|
||||
-
|
||||
/* tty's always respawn, never incr. restart_cnt */
|
||||
respawn = 1;
|
||||
- next:
|
||||
+
|
||||
+ /* Create name:id tuple for identity, e.g., tty:S0 */
|
||||
+ ptr = strrchr(dev, '/');
|
||||
+ if (ptr)
|
||||
+ ptr++;
|
||||
+ else
|
||||
+ ptr = dev;
|
||||
+ if (!strncmp(ptr, "tty", 3))
|
||||
+ ptr += 3;
|
||||
+
|
||||
+ name = "tty";
|
||||
+ if (!id || id[0] == 0)
|
||||
+ id = ptr;
|
||||
+
|
||||
svc = svc_find_by_tty(dev);
|
||||
} else
|
||||
svc = svc_find(name, id);
|
||||
@@ -1722,8 +1736,6 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
|
||||
conf_parse_cond(svc, cond);
|
||||
|
||||
if (type == SVC_TYPE_TTY) {
|
||||
- char *ptr;
|
||||
-
|
||||
if (dev)
|
||||
strlcpy(svc->dev, dev, sizeof(svc->dev));
|
||||
if (tty.baud)
|
||||
@@ -1738,19 +1750,6 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
|
||||
|
||||
/* TTYs cannot be redirected */
|
||||
log = NULL;
|
||||
-
|
||||
- /* Create name:id tuple for identity, e.g., tty:S0 */
|
||||
- ptr = strrchr(svc->dev, '/');
|
||||
- if (ptr)
|
||||
- ptr++;
|
||||
- else
|
||||
- ptr = svc->dev;
|
||||
- if (!strncmp(ptr, "tty", 3))
|
||||
- ptr += 3;
|
||||
- if (!id || id[0] == 0)
|
||||
- id = ptr;
|
||||
- strlcpy(svc->name, "tty", sizeof(svc->name));
|
||||
- strlcpy(svc->id, id, sizeof(svc->id));
|
||||
}
|
||||
|
||||
parse_cmdline_args(svc, cmd, &args);
|
||||
@@ -1870,8 +1869,10 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
|
||||
/* continue expanding any 'tty @console ...' */
|
||||
if (tty_isatcon(tty.dev)) {
|
||||
dev = tty_atcon();
|
||||
- if (dev)
|
||||
+ if (dev) {
|
||||
+ id = NULL; /* reset for next tty:ID */
|
||||
goto next;
|
||||
+ }
|
||||
}
|
||||
|
||||
return 0;
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
From 340cae4afd0d11979322a6c2f4d40a12ea59817b Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Wed, 24 Apr 2024 12:46:59 +0200
|
||||
Subject: [PATCH 11/11] Change default behavior, allow kernel logs to console
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
A Linux system booted with the kernel command line option 'quiet' only
|
||||
logs error (and above) severity messages to the console. For embedded
|
||||
systems, which is the primary target for Finit, this is what you want
|
||||
to see.
|
||||
|
||||
Hence, and after careful consideration, this patch changes the default
|
||||
behavior of Finit to allow kernel logs to the console. A build-time
|
||||
configure flags, --disable-kernel-logging, has been added to restore
|
||||
legacy behavior.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
configure.ac | 9 +++++++++
|
||||
src/finit.c | 14 +++++++++++---
|
||||
2 files changed, 20 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index a4470d0..31f4cff 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -71,6 +71,10 @@ AC_ARG_ENABLE(redirect,
|
||||
AS_HELP_STRING([--disable-redirect], [Disable redirection of service output to /dev/null]),,[
|
||||
enable_redirect=yes])
|
||||
|
||||
+AC_ARG_ENABLE(kernel_logging,
|
||||
+ AS_HELP_STRING([--disable-kernel-logging], [Disable kernel logging to console (use 'quiet' instead!]),,[
|
||||
+ enable_kernel_logging=yes])
|
||||
+
|
||||
AC_ARG_ENABLE(logrotate,
|
||||
AS_HELP_STRING([--disable-logrotate], [Disable built-in rotation of /var/log/wtmp]),,[
|
||||
enable_logrotate=yes])
|
||||
@@ -181,6 +185,9 @@ AS_IF([test "x$enable_auto_reload" = "xyes"], [
|
||||
AS_IF([test "x$enable_kernel_cmdline" = "xyes"], [
|
||||
AC_DEFINE(KERNEL_CMDLINE, 1, [Dumpster diving after init args from /proc/cmdline])])
|
||||
|
||||
+AS_IF([test "x$enable_kernel_logging" = "xyes"], [
|
||||
+ AC_DEFINE(KERNEL_LOGGING, 1, [Keep kernel warn/err logs to console])])
|
||||
+
|
||||
AS_IF([test "x$enable_fastboot" = "xyes"], [
|
||||
AC_DEFINE(FAST_BOOT, 1, [Skip fsck check on filesystems listed in /etc/fstab])])
|
||||
|
||||
@@ -382,6 +389,8 @@ Optional features:
|
||||
Built-in sulogin......: $with_sulogin $sulogin
|
||||
Built-in watchdogd....: $with_watchdog $watchdog
|
||||
Built-in logrotate....: $enable_logrotate
|
||||
+ Parse kernel cmdline..: $enable_kernel_cmdline
|
||||
+ Keep kernel logging...: $enable_kernel_logging
|
||||
Skip fsck check.......: $enable_fastboot
|
||||
Run fsck fix mode.....: $enable_fsckfix
|
||||
Redirect output.......: $enable_redirect
|
||||
diff --git a/src/finit.c b/src/finit.c
|
||||
index 27b81e9..38b1278 100644
|
||||
--- a/src/finit.c
|
||||
+++ b/src/finit.c
|
||||
@@ -87,14 +87,22 @@ svc_t *wdog = NULL; /* No watchdog by default */
|
||||
*/
|
||||
static void banner(void)
|
||||
{
|
||||
+#ifndef KERNEL_LOGGING
|
||||
/*
|
||||
* Silence kernel logs, assuming users have sysklogd or
|
||||
- * similar enabled to start emptying /dev/kmsg, but for
|
||||
- * our progress we want to own the console.
|
||||
+ * similar enabled to start emptying /dev/kmsg.
|
||||
+ *
|
||||
+ * Instead of using `configure --disable-kernel-logging`, we
|
||||
+ * recommend adjusting the kernel log level in the kernel's
|
||||
+ * menuconfig, or using sysctl kernel.printk, or setting the
|
||||
+ * desired log level, on the kernel cmdline, e.g. 'quiet'.
|
||||
+ *
|
||||
+ * By default KERNEL_LOGGING is enabled so you can see any
|
||||
+ * warnings/errors or higher on your system console.
|
||||
*/
|
||||
if (!debug && !kerndebug)
|
||||
klogctl(6, NULL, 0);
|
||||
-
|
||||
+#endif
|
||||
/*
|
||||
* First level hooks, if you want to run here, you're
|
||||
* pretty much on your own. Nothing's up yet ...
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -51,17 +51,6 @@ config BR2_PACKAGE_FINIT_INITCTL_GROUP
|
||||
to their shared UNIX group, usually "wheel", to allow
|
||||
them to start/stop services and reboot the system.
|
||||
|
||||
config BR2_PACKAGE_FINIT_SILENCE_KERNEL
|
||||
bool "Silence kernel logs to console"
|
||||
default n
|
||||
help
|
||||
By default, Finit >= 4.8 no longer disable kernel logging
|
||||
to console. This option can be used to re-enable legacy
|
||||
klogctl() code to silence the kernel output.
|
||||
|
||||
Please note, sysklogd has a similar command line option to
|
||||
keep kernel logging, which needs to be disabled as well.
|
||||
|
||||
config BR2_PACKAGE_FINIT_KEVENTD
|
||||
bool "finit-keventd"
|
||||
default n
|
||||
|
||||
@@ -42,12 +42,6 @@ FINIT_CONF_OPTS += --without-fstab
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FINIT_SILENCE_KERNEL),y)
|
||||
FINIT_CONF_OPTS += --disable-kernel-logging
|
||||
else
|
||||
FINIT_CONF_OPTS += --enable-kernel-logging
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FINIT_KEVENTD),y)
|
||||
FINIT_CONF_OPTS += --with-keventd
|
||||
else
|
||||
|
||||
@@ -11,7 +11,7 @@ LIBSRX_LICENSE = BSD-3-Clause
|
||||
LIBSRX_LICENSE_FILES = LICENSE
|
||||
LIBSRX_INSTALL_STAGING = YES
|
||||
LIBSRX_REDISTRIBUTE = NO
|
||||
LIBSRX_DEPENDENCIES = sysrepo libite
|
||||
LIBSRX_DEPENDENCIES = sysrepo
|
||||
LIBSRX_AUTORECONF = YES
|
||||
define LIBSRX_CONF_ENV
|
||||
CFLAGS="$(INFIX_CFLAGS)"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config BR2_PACKAGE_PYTHON_STATD
|
||||
bool "python-statd"
|
||||
select BR2_PACKAGE_HOST_PYTHON3
|
||||
select BR2_PACKAGE_STATD
|
||||
help
|
||||
Python helpers for statd.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -l :: Keep kernel looging to console
|
||||
# -m0 :: Disable periodic syslog MARK entries
|
||||
# -s :: Enable secure mode, don't listen to remote logs
|
||||
# -r 1M:5 :: Log rotation every 1 MiB and keep 5 rotated ones
|
||||
SYSLOGD_ARGS="-l -m0 -s -r 1M:10"
|
||||
SYSLOGD_ARGS="-m0 -s -r 1M:5"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ STATD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/statd
|
||||
STATD_LICENSE = BSD-3-Clause
|
||||
STATD_LICENSE_FILES = LICENSE
|
||||
STATD_REDISTRIBUTE = NO
|
||||
STATD_DEPENDENCIES = sysrepo libev libsrx jansson python-statd libyang
|
||||
STATD_DEPENDENCIES = sysrepo libev libsrx jansson python-statd
|
||||
STATD_AUTORECONF = YES
|
||||
|
||||
define STATD_CONF_ENV
|
||||
|
||||
@@ -1,205 +0,0 @@
|
||||
commit 06dda0cf4e5ed8705c474c8ecec4e56d25169033
|
||||
Author: Mattias Walström <lazzer@gmail.com>
|
||||
Date: Sat Apr 20 17:01:59 2024 +0200
|
||||
|
||||
This adds the feature to search for GPT partitions by
|
||||
partition UUID.
|
||||
|
||||
diff --git a/grub-core/Makefile.core.am b/grub-core/Makefile.core.am
|
||||
index 20efe61..f33e199 100644
|
||||
--- a/grub-core/Makefile.core.am
|
||||
+++ b/grub-core/Makefile.core.am
|
||||
@@ -8610,6 +8610,26 @@ CLEANFILES += search_fs_file.marker
|
||||
search_fs_file.marker: $(search_fs_file_module_SOURCES) $(nodist_search_fs_file_module_SOURCES)
|
||||
$(TARGET_CPP) -DGRUB_LST_GENERATOR $(CPPFLAGS_MARKER) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_fs_file_module_CPPFLAGS) $(CPPFLAGS) $^ > $@.new || (rm -f $@; exit 1)
|
||||
grep 'MARKER' $@.new | grep -v '^#' > $@; rm -f $@.new
|
||||
+platform_PROGRAMS += search_partuuid.module
|
||||
+MODULE_FILES += search_partuuid.module$(EXEEXT)
|
||||
+search_partuuid_module_SOURCES = commands/search_partuuid.c ## platform sources
|
||||
+nodist_search_partuuid_module_SOURCES = ## platform nodist sources
|
||||
+search_partuuid_module_LDADD =
|
||||
+search_partuuid_module_CFLAGS = $(AM_CFLAGS) $(CFLAGS_MODULE)
|
||||
+search_partuuid_module_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_MODULE)
|
||||
+search_partuuid_module_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_MODULE)
|
||||
+search_partuuid_module_CCASFLAGS = $(AM_CCASFLAGS) $(CCASFLAGS_MODULE)
|
||||
+search_partuuid_module_DEPENDENCIES = $(TARGET_OBJ2ELF)
|
||||
+dist_noinst_DATA +=
|
||||
+BUILT_SOURCES += $(nodist_search_partuuid_module_SOURCES)
|
||||
+CLEANFILES += $(nodist_search_partuuid_module_SOURCES)
|
||||
+MOD_FILES += search_partuuid.mod
|
||||
+MARKER_FILES += search_partuuid.marker
|
||||
+CLEANFILES += search_partuuid.marker
|
||||
+
|
||||
+search_partuuid.marker: $(search_partuuid_module_SOURCES) $(nodist_search_partuuid_module_SOURCES)
|
||||
+ $(TARGET_CPP) -DGRUB_LST_GENERATOR $(CPPFLAGS_MARKER) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_partuuid_module_CPPFLAGS) $(CPPFLAGS) $^ > $@.new || (rm -f $@; exit 1)
|
||||
+ grep 'MARKER' $@.new | grep -v '^#' > $@; rm -f $@.new
|
||||
platform_PROGRAMS += search_fs_uuid.module
|
||||
MODULE_FILES += search_fs_uuid.module$(EXEEXT)
|
||||
search_fs_uuid_module_SOURCES = commands/search_uuid.c ## platform sources
|
||||
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
|
||||
index 1571421..b8ca02d 100644
|
||||
--- a/grub-core/Makefile.core.def
|
||||
+++ b/grub-core/Makefile.core.def
|
||||
@@ -1087,6 +1087,11 @@ module = {
|
||||
extra_dist = commands/search.c;
|
||||
};
|
||||
|
||||
+module = {
|
||||
+ name = search_partuuid;
|
||||
+ common = commands/search_partuuid.c;
|
||||
+};
|
||||
+
|
||||
module = {
|
||||
name = search_fs_file;
|
||||
common = commands/search_file.c;
|
||||
diff --git a/grub-core/commands/search.c b/grub-core/commands/search.c
|
||||
index 263f150..135b27b 100644
|
||||
--- a/grub-core/commands/search.c
|
||||
+++ b/grub-core/commands/search.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/disk.h>
|
||||
#include <grub/partition.h>
|
||||
+#include <grub/gpt_partition.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -92,7 +93,55 @@ iterate_device (const char *name, void *data)
|
||||
#define compare_fn grub_strcmp
|
||||
#endif
|
||||
|
||||
-#ifdef DO_SEARCH_FILE
|
||||
+#if defined (DO_SEARCH_PARTUUID)
|
||||
+ {
|
||||
+ grub_device_t dev;
|
||||
+ char val[37] = "none";
|
||||
+
|
||||
+ dev = grub_device_open (name);
|
||||
+ if (!dev)
|
||||
+ {
|
||||
+ return grub_errno;
|
||||
+ }
|
||||
+ if (dev->disk && dev->disk->partition)
|
||||
+ {
|
||||
+ struct grub_partition *p = dev->disk->partition;
|
||||
+ grub_disk_t disk = grub_disk_open(dev->disk->name);
|
||||
+
|
||||
+ if (!disk)
|
||||
+ {
|
||||
+ grub_device_close (dev);
|
||||
+ return grub_errno;
|
||||
+ }
|
||||
+
|
||||
+ if (grub_strcmp(dev->disk->partition->partmap->name, "gpt") == 0)
|
||||
+ {
|
||||
+ struct grub_gpt_partentry entry;
|
||||
+ grub_guid_t *guid;
|
||||
+
|
||||
+ if (grub_disk_read(disk, p->offset, p->index, sizeof(entry), &entry))
|
||||
+ {
|
||||
+ grub_error_push ();
|
||||
+ grub_disk_close (disk);
|
||||
+ grub_device_close (dev);
|
||||
+ grub_error_pop ();
|
||||
+ return grub_errno;
|
||||
+ }
|
||||
+ guid = &entry.guid;
|
||||
+ guid->data1 = grub_le_to_cpu32 (guid->data1);
|
||||
+ guid->data2 = grub_le_to_cpu16 (guid->data2);
|
||||
+ guid->data3 = grub_le_to_cpu16 (guid->data3);
|
||||
+ grub_snprintf (val, sizeof(val), "%pG", guid);
|
||||
+
|
||||
+ if (grub_strcmp(val, ctx->key) == 0)
|
||||
+ found = 1;
|
||||
+ }
|
||||
+ if (disk)
|
||||
+ grub_disk_close (disk);
|
||||
+ }
|
||||
+ grub_device_close (dev);
|
||||
+ }
|
||||
+#elif defined (DO_SEARCH_FILE)
|
||||
{
|
||||
char *buf;
|
||||
grub_file_t file;
|
||||
@@ -333,6 +382,8 @@ static grub_command_t cmd;
|
||||
|
||||
#ifdef DO_SEARCH_FILE
|
||||
GRUB_MOD_INIT(search_fs_file)
|
||||
+#elif defined (DO_SEARCH_PARTUUID)
|
||||
+GRUB_MOD_INIT(search_partuuid)
|
||||
#elif defined (DO_SEARCH_FS_UUID)
|
||||
GRUB_MOD_INIT(search_fs_uuid)
|
||||
#else
|
||||
@@ -347,6 +398,8 @@ GRUB_MOD_INIT(search_label)
|
||||
|
||||
#ifdef DO_SEARCH_FILE
|
||||
GRUB_MOD_FINI(search_fs_file)
|
||||
+#elif defined (DO_SEARCH_PARTUUID)
|
||||
+GRUB_MOD_FINI(search_partuuid)
|
||||
#elif defined (DO_SEARCH_FS_UUID)
|
||||
GRUB_MOD_FINI(search_fs_uuid)
|
||||
#else
|
||||
diff --git a/grub-core/commands/search_partuuid.c b/grub-core/commands/search_partuuid.c
|
||||
new file mode 100644
|
||||
index 0000000..e4aa20b
|
||||
--- /dev/null
|
||||
+++ b/grub-core/commands/search_partuuid.c
|
||||
@@ -0,0 +1,5 @@
|
||||
+#define DO_SEARCH_PARTUUID 1
|
||||
+#define FUNC_NAME grub_search_partuuid
|
||||
+#define COMMAND_NAME "search.partuuid"
|
||||
+#define HELP_MESSAGE N_("Search devices by PARTUUID. If VARIABLE is specified, the first device found is set to a variable.")
|
||||
+#include "search.c"
|
||||
diff --git a/grub-core/commands/search_wrap.c b/grub-core/commands/search_wrap.c
|
||||
index 318581f..4a61093 100644
|
||||
--- a/grub-core/commands/search_wrap.c
|
||||
+++ b/grub-core/commands/search_wrap.c
|
||||
@@ -36,6 +36,8 @@ static const struct grub_arg_option options[] =
|
||||
0, 0},
|
||||
{"fs-uuid", 'u', 0, N_("Search devices by a filesystem UUID."),
|
||||
0, 0},
|
||||
+ {"partuuid", 'p', 0, N_("Search devices by a PARTUUID."),
|
||||
+ 0, 0},
|
||||
{"set", 's', GRUB_ARG_OPTION_OPTIONAL,
|
||||
N_("Set a variable to the first device found."), N_("VARNAME"),
|
||||
ARG_TYPE_STRING},
|
||||
@@ -72,6 +74,7 @@ enum options
|
||||
SEARCH_FILE,
|
||||
SEARCH_LABEL,
|
||||
SEARCH_FS_UUID,
|
||||
+ SEARCH_PARTUUID,
|
||||
SEARCH_SET,
|
||||
SEARCH_NO_FLOPPY,
|
||||
SEARCH_EFIDISK_ONLY,
|
||||
@@ -193,6 +196,9 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
grub_search_label (id, var, flags, hints, nhints);
|
||||
else if (state[SEARCH_FS_UUID].set)
|
||||
grub_search_fs_uuid (id, var, flags, hints, nhints);
|
||||
+ else if (state[SEARCH_PARTUUID].set)
|
||||
+ grub_search_partuuid (id, var, state[SEARCH_NO_FLOPPY].set,
|
||||
+ hints, nhints);
|
||||
else if (state[SEARCH_FILE].set)
|
||||
grub_search_fs_file (id, var, flags, hints, nhints);
|
||||
else
|
||||
@@ -213,7 +219,7 @@ GRUB_MOD_INIT(search)
|
||||
N_("[-f|-l|-u|-s|-n] [--hint HINT [--hint HINT] ...]"
|
||||
" NAME"),
|
||||
N_("Search devices by file, filesystem label"
|
||||
- " or filesystem UUID."
|
||||
+ " PARTUUID or filesystem UUID."
|
||||
" If --set is specified, the first device found is"
|
||||
" set to a variable. If no variable name is"
|
||||
" specified, `root' is used."),
|
||||
diff --git a/include/grub/search.h b/include/grub/search.h
|
||||
index ffd2411..06468a8 100644
|
||||
--- a/include/grub/search.h
|
||||
+++ b/include/grub/search.h
|
||||
@@ -35,5 +35,7 @@ void grub_search_fs_uuid (const char *key, const char *var,
|
||||
void grub_search_label (const char *key, const char *var,
|
||||
enum search_flags flags,
|
||||
char **hints, unsigned nhints);
|
||||
-
|
||||
+void grub_search_partuuid (const char *key, const char *var,
|
||||
+ enum search_flags flags,
|
||||
+ char **hints, unsigned nhints);
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
From 79abf7872e35080ca5b519bb4ad2acc1fbd96e8c 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/27] net: phy: add support for PHY LEDs polarity modes
|
||||
Subject: [PATCH 01/24] 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 424ddb5d5d8ce06c578cc08cbedf519c42dd8b69 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/27] net: mvmdio: Support setting the MDC frequency on XSMI
|
||||
Subject: [PATCH 02/24] net: mvmdio: Support setting the MDC frequency on XSMI
|
||||
controllers
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 337cf21833cef6ab456a8562338de88ab1a84ead 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/27] net: dsa: mv88e6xxx: Create API to read a single stat
|
||||
Subject: [PATCH 03/24] net: dsa: mv88e6xxx: Create API to read a single stat
|
||||
counter
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From dbdbfd57998b4f8224146ac94cd5d0a577326087 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/27] net: dsa: mv88e6xxx: Give each hw stat an ID
|
||||
Subject: [PATCH 04/24] net: dsa: mv88e6xxx: Give each hw stat an ID
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
With the upcoming standard counter group support, we are no longer
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 26815572016d9851ec6362f23746035fb933acf3 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/27] net: dsa: mv88e6xxx: Add "eth-mac" counter group
|
||||
Subject: [PATCH 05/24] net: dsa: mv88e6xxx: Add "eth-mac" counter group
|
||||
support
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From cc5badac76e76692eb516a5c086fcf54a5a93080 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/27] net: dsa: mv88e6xxx: Limit histogram counters to
|
||||
Subject: [PATCH 06/24] net: dsa: mv88e6xxx: Limit histogram counters to
|
||||
ingress traffic
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 35ecc84237bfccbe5b93c0aef6c07cc506d43070 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/27] net: dsa: mv88e6xxx: Add "rmon" counter group support
|
||||
Subject: [PATCH 07/24] net: dsa: mv88e6xxx: Add "rmon" counter group support
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Report the applicable subset of an mv88e6xxx port's counters using
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7750d0a5bfae46ab783e8e7087b70175860f808c 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/27] net: dsa: mv88e6xxx: Add LED infrastructure
|
||||
Subject: [PATCH 09/24] net: dsa: mv88e6xxx: Add LED infrastructure
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Parse DT for LEDs and register them for devices that support it,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 63fcd626fdb108d2ac07cb0aa16b91fc43894bff 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/27] net: dsa: mv88e6xxx: Add LED support for 6393X
|
||||
Subject: [PATCH 10/24] net: dsa: mv88e6xxx: Add LED support for 6393X
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Trigger support:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0bc6f19d18d7c0e374c824bcc86433b04210a378 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/27] net: dsa: mv88e6xxx: Fix timeout on waiting for PPU on
|
||||
Subject: [PATCH 11/24] net: dsa: mv88e6xxx: Fix timeout on waiting for PPU on
|
||||
6393X
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From fe60e3ad1e3b43a924c311658b15a1106e813661 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/27] net: dsa: Support MDB memberships whose L2 addresses
|
||||
Subject: [PATCH 12/24] net: dsa: Support MDB memberships whose L2 addresses
|
||||
overlap
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 5f5bf4a50e98c5aff05fe85994a981253ae85987 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/27] net: phy: marvell10g: Support firmware loading on
|
||||
Subject: [PATCH 13/24] net: phy: marvell10g: Support firmware loading on
|
||||
88X3310
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 27d5241d3ddf70d65af5f4dd029f99f0fea866a5 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/27] net: phy: marvell10g: Fix power-up when strapped to
|
||||
Subject: [PATCH 14/24] net: phy: marvell10g: Fix power-up when strapped to
|
||||
start powered down
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From e389ee690ce56ef20863aeabdf389bed842d7f42 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/27] net: phy: marvell10g: Add LED support for 88X3310
|
||||
Subject: [PATCH 15/24] net: phy: marvell10g: Add LED support for 88X3310
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Pickup the LEDs from the state in which the hardware reset or
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 3113b64290b5b7b20c294535c12ea4c732a02f51 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/27] net: phy: marvell10g: Support LEDs tied to a single
|
||||
Subject: [PATCH 16/24] net: phy: marvell10g: Support LEDs tied to a single
|
||||
media side
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 2570c2350d3d614a31e14dd87d0e99e8fcb5096b 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/27] nvmem: layouts: onie-tlv: Let device probe even when
|
||||
Subject: [PATCH 17/24] nvmem: layouts: onie-tlv: Let device probe even when
|
||||
TLV is invalid
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 681ce95c15bff94ac83eb26db3c718594f8dfa16 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/27] net: bridge: avoid classifying unknown multicast as
|
||||
Subject: [PATCH 18/24] net: bridge: avoid classifying unknown multicast as
|
||||
mrouters_only
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 2482848726a5b8185a04d90891693a1713f894b5 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/27] net: bridge: Ignore router ports when forwarding L2
|
||||
Subject: [PATCH 19/24] net: bridge: Ignore router ports when forwarding L2
|
||||
multicast
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 25efcdb13ae720ee662f4b6091b270e48ac4d375 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/27] net: dsa: Support EtherType based priority overrides
|
||||
Subject: [PATCH 20/24] net: dsa: Support EtherType based priority overrides
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 213e9a1d9145723897fbba40fc4afc5b5f70c1de 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/27] net: dsa: mv88e6xxx: Support EtherType based priority
|
||||
Subject: [PATCH 21/24] net: dsa: mv88e6xxx: Support EtherType based priority
|
||||
overrides
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 1c1c81864c9803831c2d5b7df0d7da28e566f3b2 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/27] net: phy: Do not resume PHY when attaching
|
||||
Subject: [PATCH 22/24] net: phy: Do not resume PHY when attaching
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
The PHY should not start negotiating with its link-partner until
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From b53e5007cd5be42eb5d9a510d63f89c7c6edd9b6 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/27] net: dsa: mv88e6xxx: Improve indirect register access
|
||||
Subject: [PATCH 23/24] net: dsa: mv88e6xxx: Improve indirect register access
|
||||
perf on 6393
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From f53652205b1c044fa00f896d6422c82ac808f16a 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/27] net: bridge: drop delay for applying strict multicast
|
||||
Subject: [PATCH 24/24] net: bridge: drop delay for applying strict multicast
|
||||
filtering
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -19,7 +19,6 @@ A proper fix for upstreaming could be to add a knob to disable the delay.
|
||||
[2]: https://lore.kernel.org/netdev/20240127175033.9640-1-linus.luessing@c0d3.blue/
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
---
|
||||
net/bridge/br_multicast.c | 42 +++++++--------------------------------
|
||||
net/bridge/br_private.h | 4 +---
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
From 56208d4cba23496c09f69961a32b1b9662f06aef 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/27] net: dsa: mv88e6xxx: Honor ports being managed via
|
||||
in-band-status
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Keep all link parameters in their unforced states when the port is
|
||||
declared as being managed via in-band-status, and let the MAC
|
||||
configure itself, via whatever method is being used (e.g. SGMII or
|
||||
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: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index 76bb8b492ca9..29691280cff4 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -885,6 +885,9 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port,
|
||||
const struct mv88e6xxx_ops *ops;
|
||||
int err = 0;
|
||||
|
||||
+ if (mode == MLO_AN_INBAND)
|
||||
+ return;
|
||||
+
|
||||
ops = chip->info->ops;
|
||||
|
||||
mv88e6xxx_reg_lock(chip);
|
||||
@@ -915,6 +918,9 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
|
||||
const struct mv88e6xxx_ops *ops;
|
||||
int err = 0;
|
||||
|
||||
+ if (mode == MLO_AN_INBAND)
|
||||
+ return;
|
||||
+
|
||||
ops = chip->info->ops;
|
||||
|
||||
mv88e6xxx_reg_lock(chip);
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
From 04023a449a6894c0ec46e246c52e94566b3be4b3 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/27] net: dsa: mv88e6xxx: Fix port policy config on 6393X
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
mv88e6393x_port_policy_{read,write} expect the `pointer` argument to
|
||||
be "pre-shifted" 8 bits.
|
||||
|
||||
Therefore, make sure mv88e6393x_port_set_policy adheres to this
|
||||
requirement.
|
||||
|
||||
Before this change, no policy actions from offset 1 could be
|
||||
configured. In particular, this meant that VTU policy trapping was
|
||||
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: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/port.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
index aba78838171b..3f5759992baf 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
@@ -1793,12 +1793,12 @@ int mv88e6393x_port_set_policy(struct mv88e6xxx_chip *chip, int port,
|
||||
shift %= 8;
|
||||
mask >>= ptr * 8;
|
||||
|
||||
- err = mv88e6393x_port_policy_read(chip, port, ptr, ®);
|
||||
+ err = mv88e6393x_port_policy_read(chip, port, ptr << 8, ®);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
reg &= ~mask;
|
||||
reg |= (val << shift) & mask;
|
||||
|
||||
- return mv88e6393x_port_policy_write(chip, port, ptr, reg);
|
||||
+ return mv88e6393x_port_policy_write(chip, port, ptr << 8, reg);
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
From 7529102af1693138349032b7d1339d91d2b6a578 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/27] net: dsa: mv88e6xxx: Limit rsvd2cpu policy to user
|
||||
ports on 6393X
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
For packets with a DA in the IEEE reserved L2 group range, originating
|
||||
from a CPU, forward it as normal, rather than classifying it as
|
||||
management.
|
||||
|
||||
Example use-case:
|
||||
|
||||
bridge (group_fwd_mask 0x4000)
|
||||
/ | \
|
||||
swp1 swp2 tap0
|
||||
\ /
|
||||
(mv88e6xxx)
|
||||
|
||||
We've created a bridge with a non-zero group_fwd_mask (allowing LLDP
|
||||
in this example) containing a set of ports managed by mv88e6xxx and
|
||||
some foreign interface (e.g. an L2 VPN tunnel).
|
||||
|
||||
Since an LLDP packet coming in to the bridge from the other side of
|
||||
tap0 is eligable for tx forward offloading, a FORWARD frame destined
|
||||
for swp1 and swp2 would be send to the conduit interface.
|
||||
|
||||
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: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/port.c | 31 +++++++++++++++++++++++++------
|
||||
1 file changed, 25 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
index 3f5759992baf..3dfe0f7805a0 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
@@ -1432,6 +1432,23 @@ static int mv88e6393x_port_policy_write_all(struct mv88e6xxx_chip *chip,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int mv88e6393x_port_policy_write_user(struct mv88e6xxx_chip *chip,
|
||||
+ u16 pointer, u8 data)
|
||||
+{
|
||||
+ int err, port;
|
||||
+
|
||||
+ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
|
||||
+ if (!dsa_is_user_port(chip->ds, port))
|
||||
+ continue;
|
||||
+
|
||||
+ err = mv88e6393x_port_policy_write(chip, port, pointer, data);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int mv88e6393x_set_egress_port(struct mv88e6xxx_chip *chip,
|
||||
enum mv88e6xxx_egress_direction direction,
|
||||
int port)
|
||||
@@ -1473,26 +1490,28 @@ int mv88e6393x_port_mgmt_rsvd2cpu(struct mv88e6xxx_chip *chip)
|
||||
int err;
|
||||
|
||||
/* Consider the frames with reserved multicast destination
|
||||
- * addresses matching 01:80:c2:00:00:00 and
|
||||
- * 01:80:c2:00:00:02 as MGMT.
|
||||
+ * addresses matching 01:80:c2:00:00:00 and 01:80:c2:00:00:02
|
||||
+ * as MGMT when received on user ports. Forward as normal on
|
||||
+ * CPU/DSA ports, to support bridges with non-zero
|
||||
+ * group_fwd_masks.
|
||||
*/
|
||||
ptr = MV88E6393X_PORT_POLICY_MGMT_CTL_PTR_01C280000000XLO;
|
||||
- err = mv88e6393x_port_policy_write_all(chip, ptr, 0xff);
|
||||
+ err = mv88e6393x_port_policy_write_user(chip, ptr, 0xff);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
ptr = MV88E6393X_PORT_POLICY_MGMT_CTL_PTR_01C280000000XHI;
|
||||
- err = mv88e6393x_port_policy_write_all(chip, ptr, 0xff);
|
||||
+ err = mv88e6393x_port_policy_write_user(chip, ptr, 0xff);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
ptr = MV88E6393X_PORT_POLICY_MGMT_CTL_PTR_01C280000002XLO;
|
||||
- err = mv88e6393x_port_policy_write_all(chip, ptr, 0xff);
|
||||
+ err = mv88e6393x_port_policy_write_user(chip, ptr, 0xff);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
ptr = MV88E6393X_PORT_POLICY_MGMT_CTL_PTR_01C280000002XHI;
|
||||
- err = mv88e6393x_port_policy_write_all(chip, ptr, 0xff);
|
||||
+ err = mv88e6393x_port_policy_write_user(chip, ptr, 0xff);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
From 1727f7a5ea142ab923ca07f23b2457cf8db94d1d Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Wed, 24 Apr 2024 13:19:09 +0200
|
||||
Subject: [PATCH 1/1] Fix #72: loss of raw kernel log messages to console
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
This patch adds a command line flag `-l` to keep kernel logs to console.
|
||||
A feature requested by embedded Linux users which often navigate issues
|
||||
by console output.
|
||||
|
||||
With properly configured kernel logging, e.g., `quiet`, only error and
|
||||
above in severity is logged by the kernel directly to the console. So
|
||||
for most users this would be a useful behavior.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
man/syslogd.8 | 18 +++++++++++++++++-
|
||||
src/syslogd.c | 10 +++++++++-
|
||||
src/syslogd.h | 4 ++--
|
||||
3 files changed, 28 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/man/syslogd.8 b/man/syslogd.8
|
||||
index dcfb564..70f1b8b 100644
|
||||
--- a/man/syslogd.8
|
||||
+++ b/man/syslogd.8
|
||||
@@ -38,7 +38,7 @@
|
||||
.Nd log systems messages
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
-.Op Fl ?468AcdFHKknsTtv
|
||||
+.Op Fl ?468AcdFHKklnsTtv
|
||||
.Op Fl a Ar addr[/len][:port]
|
||||
.Op Fl a Ar name[:port]
|
||||
.Op Fl b Ar addr[:port]
|
||||
@@ -292,6 +292,22 @@ Usually the
|
||||
.Dq kern
|
||||
facility is reserved for messages read directly from
|
||||
.Pa /dev/kmsg .
|
||||
+.It Fl l
|
||||
+Keep kernel console logging. By default
|
||||
+.Nm
|
||||
+call
|
||||
+.Xr klogctl 2
|
||||
+to disable the kernel's logging to console after having opened
|
||||
+.Pa /dev/kmsg .
|
||||
+With this option the kernel's log level can be adjusted using
|
||||
+.Xr sysctl 8 ,
|
||||
+or the kernel command line, to suit your logging needs to the console.
|
||||
+.Pp
|
||||
+Please note, this does not affect logging of kernel messages, see
|
||||
+.Fl K ,
|
||||
+only what the kernel logs to
|
||||
+.Pa /dev/console .
|
||||
+Also, this is only applicable to Linux.
|
||||
.It Fl m Ar interval
|
||||
Select the number of minutes between
|
||||
.Dq mark
|
||||
diff --git a/src/syslogd.c b/src/syslogd.c
|
||||
index e7b05b0..68040fe 100644
|
||||
--- a/src/syslogd.c
|
||||
+++ b/src/syslogd.c
|
||||
@@ -154,6 +154,7 @@ static int RemoteHostname; /* Log remote hostname from the message */
|
||||
static int KernLog = 1; /* Track kernel logs by default */
|
||||
static int KeepKernFac; /* Keep remotely logged kernel facility */
|
||||
static int KeepKernTime; /* Keep kernel timestamp, evern after initial read */
|
||||
+static int KeepKernConsole; /* Keep kernel logging to console */
|
||||
|
||||
static off_t RotateSz = 0; /* Max file size (bytes) before rotating, disabled by default */
|
||||
static int RotateCnt = 5; /* Max number (count) of log files to keep, set with -c <NUM> */
|
||||
@@ -363,6 +364,9 @@ int usage(int code)
|
||||
" -H Use hostname from message instead of address for remote messages\n"
|
||||
" -K Disable kernel logging, useful in container use-cases\n"
|
||||
" -k Allow logging with facility 'kernel', otherwise remapped to 'user'\n"
|
||||
+#ifdef __linux__
|
||||
+ " -l Keep kernel logging to console, use sysctl to adjust kernel.printk\n"
|
||||
+#endif
|
||||
" -m MINS Interval between MARK messages, 0 to disable, default: 20 min\n"
|
||||
" -n Disable DNS query for every request\n"
|
||||
" -P FILE File to store the process ID, default: %s\n"
|
||||
@@ -397,7 +401,7 @@ int main(int argc, char *argv[])
|
||||
char *ptr;
|
||||
int ch;
|
||||
|
||||
- while ((ch = getopt(argc, argv, "468Aa:b:C:cdHFf:Kkm:nP:p:r:sTtv?")) != EOF) {
|
||||
+ while ((ch = getopt(argc, argv, "468Aa:b:C:cdHFf:Kklm:nP:p:r:sTtv?")) != EOF) {
|
||||
switch ((char)ch) {
|
||||
case '4':
|
||||
family = PF_INET;
|
||||
@@ -464,6 +468,10 @@ int main(int argc, char *argv[])
|
||||
KeepKernFac = 1;
|
||||
break;
|
||||
|
||||
+ case 'l':
|
||||
+ KeepKernConsole = 1;
|
||||
+ break;
|
||||
+
|
||||
case 'm': /* mark interval */
|
||||
MarkInterval = atoi(optarg) * 60;
|
||||
break;
|
||||
diff --git a/src/syslogd.h b/src/syslogd.h
|
||||
index 68ceafb..1703df2 100644
|
||||
--- a/src/syslogd.h
|
||||
+++ b/src/syslogd.h
|
||||
@@ -169,8 +169,8 @@
|
||||
#define SYSLOG_ACTION_CONSOLE_ON 7
|
||||
|
||||
#ifdef __linux__
|
||||
-#define kern_console_off() klogctl(SYSLOG_ACTION_CONSOLE_OFF, NULL, 0)
|
||||
-#define kern_console_on() klogctl(SYSLOG_ACTION_CONSOLE_ON, NULL, 0)
|
||||
+#define kern_console_off() if (!KeepKernConsole) klogctl(SYSLOG_ACTION_CONSOLE_OFF, NULL, 0)
|
||||
+#define kern_console_on() if (!KeepKernConsole) klogctl(SYSLOG_ACTION_CONSOLE_ON, NULL, 0)
|
||||
#else
|
||||
#define kern_console_off() do { } while (0)
|
||||
#define kern_console_on() do { } while (0)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "core.h"
|
||||
|
||||
struct confd confd;
|
||||
static struct confd confd;
|
||||
|
||||
uint32_t core_hook_prio(void)
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
#define CB_PRIO_PRIMARY 65535
|
||||
#define CB_PRIO_PASSIVE 65000
|
||||
|
||||
extern struct confd confd;
|
||||
|
||||
|
||||
static inline void print_val(sr_val_t *val)
|
||||
{
|
||||
char *str;
|
||||
|
||||
@@ -1235,37 +1235,15 @@ static int netdag_gen_bridge(sr_session_ctx_t *session, struct dagger *net, stru
|
||||
vlan_filtering = bridge_vlan_settings(cif, &proto, &vlan_mcast);
|
||||
fwd_mask = bridge_fwd_mask(cif);
|
||||
|
||||
fprintf(ip, "link %s dev %s", op, brname);
|
||||
/*
|
||||
* Must set base mac on add to prevent kernel from seeding ipv6
|
||||
* addrgenmode eui64 with random mac, issue #357.
|
||||
*/
|
||||
if (add) {
|
||||
const char *mac;
|
||||
|
||||
mac = lydx_get_cattr(cif, "phys-address");
|
||||
if (!mac) {
|
||||
struct json_t *j;
|
||||
|
||||
j = json_object_get(confd.root, "mac-address");
|
||||
if (j)
|
||||
mac = json_string_value(j);
|
||||
}
|
||||
if (mac)
|
||||
fprintf(ip, " address %s", mac);
|
||||
|
||||
/* on failure, fall back to kernel's random mac */
|
||||
}
|
||||
|
||||
/*
|
||||
* Issue #198: we require explicit VLAN assignment for ports
|
||||
* when VLAN filtering is enabled. We strongly
|
||||
* believe this is the only sane way of doing it.
|
||||
* Issue #310: malplaced 'vlan_default_pvid 0'
|
||||
*/
|
||||
fprintf(ip, " type bridge group_fwd_mask %d mcast_flood_always 1"
|
||||
fprintf(ip, "link %s dev %s type bridge group_fwd_mask %d mcast_flood_always 1"
|
||||
" vlan_filtering %d vlan_default_pvid 0",
|
||||
fwd_mask, vlan_filtering ? 1 : 0);
|
||||
op, brname, fwd_mask, vlan_filtering ? 1 : 0);
|
||||
|
||||
if ((err = bridge_mcast_settings(ip, brname, cif, vlan_mcast)))
|
||||
goto out;
|
||||
|
||||
@@ -416,7 +416,6 @@ submodule infix-if-bridge {
|
||||
when "derived-from-or-self(if:type,'ianaift:bridge') or "+
|
||||
"derived-from-or-self(if:type,'ianaift:ethernetCsmacd') or "+
|
||||
"derived-from-or-self(if:type,'ianaift:ieee8023adLag') or "+
|
||||
"derived-from-or-self(if:type,'ianaift:l2vlan') or "+
|
||||
"derived-from-or-self(if:type,'ianaift:ilan')" {
|
||||
description "Applies when a Bridge interface exists.";
|
||||
}
|
||||
|
||||
@@ -1,26 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
# ¦ ¦
|
||||
# ¦ vlan10 IP:10.0.0.2 ¦ br0 IP:10.0.0.3
|
||||
# ¦ / ¦ /
|
||||
# ¦ br0 <-- VLAN filtering ¦ e0.10
|
||||
# ¦ u/ \t ¦ /
|
||||
# PC ------- e0 e1 ---------------------- e0
|
||||
# PING --> ¦ dut1 ¦ dut2
|
||||
#
|
||||
# vlan10 IP:10.0.0.2
|
||||
# /
|
||||
# PING --> br0 <-- VLAN filtering enabled
|
||||
# /
|
||||
# PC ---- e0
|
||||
#
|
||||
|
||||
import infamy
|
||||
|
||||
with infamy.Test() as test:
|
||||
with test.step("Initialize"):
|
||||
env = infamy.Env(infamy.std_topology("2x2"))
|
||||
dut1 = env.attach("target1", "mgmt")
|
||||
dut2 = env.attach("target2", "mgmt")
|
||||
env = infamy.Env(infamy.std_topology("1x2"))
|
||||
target = env.attach("target", "mgmt")
|
||||
|
||||
with test.step("Topology setup"):
|
||||
_, dut1_e0 = env.ltop.xlate("target1", "data")
|
||||
_, dut1_e1 = env.ltop.xlate("target1", "target2")
|
||||
_, dut2_e0 = env.ltop.xlate("target2", "target1")
|
||||
with test.step("Configure single vlan-filtering bridge with vlan10 subinterface @ IP 10.0.0.2"):
|
||||
_, tport = env.ltop.xlate("target", "data")
|
||||
|
||||
dut1.put_config_dict("ietf-interfaces", {
|
||||
target.put_config_dict("ietf-interfaces", {
|
||||
"interfaces": {
|
||||
"interface": [
|
||||
{
|
||||
@@ -33,8 +30,8 @@ with infamy.Test() as test:
|
||||
"vlan": [
|
||||
{
|
||||
"vid": 10,
|
||||
"untagged": [ dut1_e0 ],
|
||||
"tagged": [ "br0", dut1_e1 ]
|
||||
"untagged": [ tport ],
|
||||
"tagged": [ "br0" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -58,63 +55,19 @@ with infamy.Test() as test:
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": dut1_e0,
|
||||
"name": tport,
|
||||
"enabled": True,
|
||||
"infix-interfaces:bridge-port": {
|
||||
"pvid": 10,
|
||||
"bridge": "br0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": dut1_e1,
|
||||
"enabled": True,
|
||||
"infix-interfaces:bridge-port": {
|
||||
"pvid": 10,
|
||||
"bridge": "br0"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
dut2.put_config_dict("ietf-interfaces", {
|
||||
"interfaces": {
|
||||
"interface": [
|
||||
{
|
||||
"name": "br0",
|
||||
"type": "infix-if-type:bridge",
|
||||
"enabled": True,
|
||||
"ipv4": {
|
||||
"address": [
|
||||
{
|
||||
"ip": "10.0.0.3",
|
||||
"prefix-length": 24,
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": dut2_e0,
|
||||
"enabled": True
|
||||
},
|
||||
{
|
||||
"name": "e0.10",
|
||||
"type": "infix-if-type:vlan",
|
||||
"enabled": True,
|
||||
"vlan": {
|
||||
"lower-layer-if": dut2_e0,
|
||||
"id": 10,
|
||||
},
|
||||
"infix-interfaces:bridge-port": {
|
||||
"bridge": "br0"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
with test.step("Connectivity check"):
|
||||
_, hport = env.ltop.xlate("host", "data1")
|
||||
with test.step("Ping vlan10 subinterface 10.0.0.2 from host:data with IP 10.0.0.1"):
|
||||
_, hport = env.ltop.xlate("host", "data")
|
||||
|
||||
with infamy.IsolatedMacVlan(hport) as ns:
|
||||
pingtest = ns.runsh("""
|
||||
@@ -124,7 +77,6 @@ with infamy.Test() as test:
|
||||
ip addr add 10.0.0.1/24 dev iface
|
||||
|
||||
ping -c1 -w5 10.0.0.2 || exit 1
|
||||
ping -c1 -w5 10.0.0.3 || exit 1
|
||||
""")
|
||||
|
||||
if pingtest.returncode:
|
||||
|
||||
@@ -7,7 +7,7 @@ testdir=$(dirname "$(readlink -f "$0")")
|
||||
usage()
|
||||
{
|
||||
cat <<EOF
|
||||
usage: test/env [<OPTS>] -f <IMAGE> -q <QENETH-DIR> <COMMAND> [<ARGS>...]
|
||||
usage: test/env [<OPTS>] -f <IMAGE> -q <QENETH-DIR> <COMMAND> [<ARGS>...]
|
||||
test/env [<OPTS>] -C -t <TOPOLOGY> <COMMAND> [<ARGS>...]
|
||||
|
||||
Run <COMMAND> in a pre-packaged container with all the packages
|
||||
@@ -24,9 +24,8 @@ usage: test/env [<OPTS>] -f <IMAGE> -q <QENETH-DIR> <COMMAND> [<ARGS>...]
|
||||
namespaces
|
||||
|
||||
-f <IMAGE>
|
||||
Specify images required for test, squashfs image is required
|
||||
if testing with kernel. bios and disk image is required if
|
||||
testing with bios.
|
||||
Infix image to test. When starting a qeneth network, this image is
|
||||
used on all nodes.
|
||||
|
||||
-h
|
||||
Show this help message
|
||||
@@ -55,19 +54,18 @@ EOF
|
||||
start_topology()
|
||||
{
|
||||
qenethdir="$1"
|
||||
files="$*"
|
||||
imgfile="$2"
|
||||
|
||||
[ "$files" ] || { true && return; }
|
||||
[ "$qenethdir" ] || { true && return; }
|
||||
|
||||
rm -rf "$envdir/qeneth"
|
||||
cp -a "$qenethdir" "$envdir/qeneth"
|
||||
# Map files in to qeneth
|
||||
for f in $files; do
|
||||
filename="$(basename "$f")"
|
||||
file=$(readlink -f "$f")
|
||||
ln -sf "$file" "$envdir/qeneth/$filename"
|
||||
done
|
||||
if [ "$imgfile" ]; then
|
||||
imgname="$(basename "$imgfile")"
|
||||
imgfile=$(readlink -f "$imgfile")
|
||||
|
||||
ln -sf "$imgfile" "$envdir/qeneth/$imgname"
|
||||
fi
|
||||
|
||||
(cd "$envdir/qeneth/" && $qeneth generate && $qeneth start)
|
||||
INFAMY_ARGS="$INFAMY_ARGS $envdir/qeneth/topology.dot"
|
||||
@@ -109,7 +107,6 @@ name()
|
||||
# Global options
|
||||
containerize=yes
|
||||
[ -c /dev/kvm ] && kvm="--device=/dev/kvm"
|
||||
files=
|
||||
|
||||
while getopts "cCf:hiKp:q:t:" opt; do
|
||||
case ${opt} in
|
||||
@@ -123,7 +120,7 @@ while getopts "cCf:hiKp:q:t:" opt; do
|
||||
containerize=
|
||||
;;
|
||||
f)
|
||||
files="$files $OPTARG"
|
||||
imgfile="$OPTARG"
|
||||
;;
|
||||
h)
|
||||
usage && exit 0
|
||||
@@ -193,7 +190,7 @@ fi
|
||||
. "$envdir/bin/activate"
|
||||
export PYTHONPATH="$testdir"
|
||||
INFAMY_ARGS="$INFAMY_ARGS -y $envdir/yangdir"
|
||||
start_topology "$qenethdir" "$files"
|
||||
start_topology "$qenethdir" "$imgfile"
|
||||
[ "$topology" ] && INFAMY_ARGS="$INFAMY_ARGS $topology"
|
||||
export INFAMY_ARGS
|
||||
|
||||
|
||||
+1
-1
Submodule test/qeneth updated: 2778a815b0...aa8c3dccdc
@@ -7,7 +7,7 @@ graph "quad" {
|
||||
node [shape=record, fontname="monospace"];
|
||||
edge [color="cornflowerblue", penwidth="2"];
|
||||
|
||||
qn_template="infix-bios-x86_64";
|
||||
qn_template="infix-x86_64";
|
||||
qn_append="quiet";
|
||||
|
||||
host [
|
||||
|
||||
-92
@@ -1,92 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. $(dirname $(readlink -f "$0"))/libll.sh
|
||||
|
||||
usage()
|
||||
{
|
||||
local me="$(basename $0)"
|
||||
|
||||
cat <<EOF
|
||||
usage: $me [-A] <command> [<args>]
|
||||
|
||||
Wrap various existing network facilities such that an interface name
|
||||
may be supplied in places where a hostname is otherwise expected.
|
||||
|
||||
Options:
|
||||
|
||||
-A
|
||||
For commands requiring authentication, use password
|
||||
authentication with username "admin" and password "admin".
|
||||
|
||||
Commands:
|
||||
|
||||
peer <iface>
|
||||
Return the address of the first IPv6 neighbor to respond on
|
||||
<iface>'s local LAN.
|
||||
|
||||
ping <iface>
|
||||
Send ping to all-hosts group, with link-local scope, on <iface>,
|
||||
suppressing loopbacked packets.
|
||||
|
||||
ssh <iface> [<ssh-arguments>]
|
||||
ssh(1) to the neighboring host on <iface>.
|
||||
|
||||
scp <src> <dst>
|
||||
scp(1) from <src> to <dst>, but any host specified in either
|
||||
<src> or <dst> is assumed to be an interface name, which is
|
||||
expanded to a neighboring host on that interface.
|
||||
|
||||
${0} help
|
||||
Display this message.
|
||||
|
||||
Examples:
|
||||
|
||||
Start interactive ssh(1) session to the neighbor to eth0
|
||||
$me ssh eth0
|
||||
|
||||
Copy /etc/hostname from the neighbor to eth0, using admin/admin
|
||||
$me -A scp eth0:/etc/hostname /tmp/hostname
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
while getopts "A" opt; do
|
||||
case ${opt} in
|
||||
A)
|
||||
LLSSH_USER=admin
|
||||
LLSSH_PASS=admin
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
usage && exit 1
|
||||
fi
|
||||
|
||||
cmd="$1"
|
||||
shift
|
||||
|
||||
case "$cmd" in
|
||||
help)
|
||||
usage && exit 0
|
||||
;;
|
||||
peer)
|
||||
llpeer "$@"
|
||||
;;
|
||||
ping)
|
||||
llping "$@"
|
||||
;;
|
||||
scp)
|
||||
llscp "$@"
|
||||
;;
|
||||
ssh)
|
||||
llssh "$@"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown command \"$cmd\"" >2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
-146
@@ -1,146 +0,0 @@
|
||||
# Utility functions for communicating with IPv6 neighbors on the local
|
||||
# LAN
|
||||
|
||||
# Usage: llping <iface>
|
||||
#
|
||||
# Send ping to all-hosts group, with link-local scope, on <iface>,
|
||||
# suppressing loopbacked packets.
|
||||
llping()
|
||||
{
|
||||
local iface="$1"
|
||||
shift
|
||||
ping -L ff02::1%$iface "$@"
|
||||
}
|
||||
|
||||
|
||||
# Usage: llpeer <iface>
|
||||
#
|
||||
# Return the address of the first IPv6 neighbor to respond on
|
||||
# <iface>'s local LAN. It is thus typically only useful in scenarios
|
||||
# where only one neighbor exists
|
||||
llpeer()
|
||||
{
|
||||
local iface="$1"
|
||||
shift
|
||||
llping $iface -c1 "$@" | \
|
||||
awk '/bytes from/ { sub(/:$/, "", $4); print($4); exit(0); }'
|
||||
}
|
||||
|
||||
llssh_expand()
|
||||
{
|
||||
local old_ifs="$IFS"
|
||||
|
||||
local orig="$1"
|
||||
local fmt="$2"
|
||||
|
||||
local peer=
|
||||
local user=
|
||||
local iface=
|
||||
|
||||
IFS=@
|
||||
set $1
|
||||
IFS="$old_ifs"
|
||||
case $# in
|
||||
1)
|
||||
user="$LLSSH_USER"
|
||||
iface="$1"
|
||||
;;
|
||||
2)
|
||||
user="$1"
|
||||
iface="$2"
|
||||
;;
|
||||
*)
|
||||
echo "Error: Invalid peer \"$orig1\"" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -d "/sys/class/net/$iface" ]; then
|
||||
peer="$(llpeer $iface -w3)"
|
||||
else
|
||||
peer="$iface"
|
||||
fi
|
||||
|
||||
if [ ! "$peer" ]; then
|
||||
echo "Error: No peer responded on $iface" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
case "$fmt" in
|
||||
ssh)
|
||||
;;
|
||||
scp)
|
||||
peer="[$peer]"
|
||||
;;
|
||||
*)
|
||||
echo "Internal error: Invalid format \"$fmt\"" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
[ "$user" ] && peer="$user@$peer"
|
||||
echo $peer
|
||||
}
|
||||
|
||||
# Usage: llssh <destination> [<ssh-args>]
|
||||
#
|
||||
# ssh(1) to <destination>, but if the host matches an existing
|
||||
# interface name, expand it to a neighboring host on that interface.
|
||||
llssh()
|
||||
{
|
||||
local remote="$1"
|
||||
shift
|
||||
|
||||
local peer="$(llssh_expand $remote ssh)"
|
||||
[ "$peer" ] || return 1
|
||||
|
||||
local sshpasscmd=
|
||||
[ "$LLSSH_PASS" ] && sshpasscmd="sshpass -p$LLSSH_PASS $LLSSHPASS_OPTS"
|
||||
|
||||
$sshpasscmd ssh $LLSSH_OPTS $peer "$@"
|
||||
}
|
||||
|
||||
llscp_expand()
|
||||
{
|
||||
local orig="$1"
|
||||
local old_ifs="$IFS"
|
||||
|
||||
local peer=
|
||||
|
||||
IFS=:
|
||||
set $@
|
||||
IFS="$old_ifs"
|
||||
case $# in
|
||||
1)
|
||||
echo "$1"
|
||||
;;
|
||||
2)
|
||||
peer="$(llssh_expand $1 scp)"
|
||||
[ "$peer" ] || return 1
|
||||
|
||||
echo "$peer:$2"
|
||||
;;
|
||||
*)
|
||||
echo "Error: Invalid location \"$orig1\"" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Usage: llscp <src> <dst>
|
||||
#
|
||||
# scp(1) from <src> to <dst>, but expand any host specified in either
|
||||
# <src> or <dst>, which matches an existing interface name, to a
|
||||
# neighboring host on that interface.
|
||||
llscp()
|
||||
{
|
||||
local src="$(llscp_expand $1)"
|
||||
local dst="$(llscp_expand $2)"
|
||||
[ "$src" -a "$dst" ] || return 1
|
||||
shift 2
|
||||
|
||||
local sshpasscmd=
|
||||
[ "$LLSSH_PASS" ] && sshpasscmd="sshpass -p$LLSSH_PASS $LLSSHPASS_OPTS"
|
||||
|
||||
$sshpasscmd scp $LLSCP_OPTS "$src" "$dst"
|
||||
}
|
||||
Reference in New Issue
Block a user