Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] - OpenWrt One config for new hardware support #816

Merged
merged 15 commits into from
Jan 26, 2025
Merged

Conversation

sarcasticadmin
Copy link
Member

@sarcasticadmin sarcasticadmin commented Jan 26, 2025

Description of PR

Fixes: #815
Requires: #814

This adds support for the OpenWrt One hardware for the SCaLE OpenWrt build.

I have the build currently loaded on the real hardware and its been working well. On my Lenovo t14 gen 2 (mt7921) I can confirm wifi6 connectivity:

$ iw wlp3s0 link
Connected to 20:05:b6:ff:03:4a (on wlp3s0)
	SSID: cosmonaut_guest5
	freq: 5180.0
	RX: 17781195 bytes (22247 packets)
	TX: 3529938 bytes (14354 packets)
	signal: -56 dBm
	rx bitrate: 1080.6 MBit/s 80MHz HE-MCS 10 HE-NSS 2 HE-GI 0 HE-DCM 0
	tx bitrate: 960.7 MBit/s 80MHz HE-MCS 9 HE-NSS 2 HE-GI 0 HE-DCM 0
	bss flags: short-slot-time
	dtim period: 2
	beacon int: 100

Previous Behavior

  • No support for OpenWrt hardware

New Behavior

  • Support for OpenWrt One Hardware

Tests

  • serverspec results pass:
/nix/store/xkmg185m7hv3c5dv6dsbmfs1c5vf92p6-ruby-3.1.6/bin/ruby -I/nix/store/7fl8vynr2x1vfi1d2slvhp07nmdhby35-serverspec/lib/ruby/gems/3.1.0/gems/rspec-core-3.12.2/lib:/nix/store/7fl8vynr2x1vfi1d2slvhp07nmdhby35-serverspec/lib/ruby/gems/3.1.0/gems/rspec-support-3.12.1/lib /nix/store/h751jn4jignpp48d60wlpq05ariv18r6-ruby3.1-rspec-core-3.12.2/lib/ruby/gems/3.1.0/gems/rspec-core-3.12.2/exe/rspec --pattern spec/openwrt/\*_spec.rb

Image info:
Linux OpenWrt 6.6.68 #0 SMP Fri Jan 24 07:47:00 2025 aarch64 GNU/Linux
SCALE_VER=8db52492749da0a8230ad9e518061a099b2de673
OPENWRT_VER=c8ea1aa970bf5a0275e3b0b7da777e804821ddcd
BUILD_ID="r0-8db5249"
OPENWRT_BOARD="mediatek/filogic"
OPENWRT_ARCH="aarch64_cortex-a53"

shared
  Command "which apinger 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which awk 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which bash 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which logrotate 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which rsyslogd 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which tcpdump 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which snmpd 2> /dev/null"
    exit_status
      is expected to eq 1
  Command "which dropbear 2> /dev/null"
    exit_status
      is expected to eq 1
  Command "which logd 2> /dev/null"
    exit_status
      is expected to eq 1
  Command "pgrep apinger"
    exit_status
      is expected to eq 0
  Command "pgrep crond"
    exit_status
      is expected to eq 0
  Command "pgrep rsyslogd"
    exit_status
      is expected to eq 0
  Command "pgrep lldpd"
    exit_status
      is expected to eq 0
  Command "pgrep ntpd"
    exit_status
      is expected to eq 0
  Port "80"
    is expected not to be listening
  Port "9100"
    is expected to be listening
  Command "rsyslogd -N1"
    exit_status
      is expected to eq 0
  Command "logger "serverspec test msg""
    exit_status
      is expected to eq 0
  File "/root/bin/wifi-details.sh"
    is expected to exist
    is expected to be mode 750
    is expected to be owned by "root"
    is expected to be grouped into "root"
  File "/root/bin/config-version.sh"
    is expected to exist
    is expected to be mode 750
    is expected to be owned by "root"
    is expected to be grouped into "root"
  Command "/root/bin/config-version.sh"
    exit_status
      is expected to eq 0
  Command "/root/bin/config-version.sh -c 9999"
    exit_status
      is expected to eq 1
  File "/etc/scale-release"
    is expected to exist
    is expected to be mode 644
    is expected to be owned by "root"
    is expected to be grouped into "root"
  Command "source /etc/scale-release && test -z $SCALE_VER"
    exit_status
      is expected to eq 1
  Command "source /etc/scale-release && test -z $OPENWRT_VER"
    exit_status
      is expected to eq 1
  File "/tmp/resolv.conf.d/resolv.conf.auto"
    is expected to exist
    is expected to be mode 644
    is expected to be owned by "root"
    is expected to be grouped into "root"
  File "/etc/resolv.conf"
    is expected to exist
    is expected to be symlink
    is expected to be owned by "root"
    is expected to be grouped into "root"
  File "/etc/config/network"
    is expected to exist
    is expected to be symlink
    is expected to be owned by "root"
    is expected to be grouped into "root"
  File "/etc/config/wireless"
    is expected to exist
    is expected to be symlink
    is expected to be owned by "root"
    is expected to be grouped into "root"
  correct_num_configs
    should always be equal
  ensure_dhcp_client_options
    should contain the following options
  Command "cat /etc/apinger.conf | grep "^target \"$(ip route | grep default | cut -d ' ' -f 3)\"""
    exit_status
      is expected to eq 0
  Command "wifi status | jq '.[] | select(.up == false )' | wc -l"
    stdout
      is expected to eq "0\n"
  Command "awk -F: -v user='root' '$1 == user {print $NF}' /etc/passwd"
    stdout
      is expected to match /\/bin\/bash/
  ensure_admin_ssh_key_present
    should match the following key fingerprint

Finished in 3.68 seconds (files took 0.83056 seconds to load)
56 examples, 0 failures

Copy link
Collaborator

@owendelong owendelong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work, Rob. I really hope we can get a bunch of these.

@owendelong owendelong merged commit dcb8f2f into master Jan 26, 2025
2 checks passed
@owendelong owendelong deleted the rh/issue-815 branch January 26, 2025 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support OpenWrt One (mt798x arch)
2 participants