Netgear X10 (R9000)

My build system is debian bookworm amd64.
https://github.com/egorenar/openwrt/archive/refs/heads/netgear-r9000.zip
I unzipped it then entered to directory.
And I did Quickstart process.
I only changed target for Annapurna Labs Alpine in "make menuconfig".
And just did "make".
There was no error or warning.
Flashing had no problem. Flashing went well too.
But I had no release version in Firmware Version.
What can i do fot it?
Thank you.

1 Like

Ive built this firmware more than a few times (I like to tinker). Here is a (slightly stripped down) version of my build script:


# choose where to build openWrt
buildRoot="${HOME}/openwrt_build"
mkdir -p "${buildRoot}/build"
cd "${buildRoot}/build"

# download openwrt build system for R9000
git clone https://github.com/egorenar/openwrt.git
cd "${buildRoot}/build/openwrt"
git fetch
git switch netgear-r9000

# update / install packages from feeds
echo "$(cat feeds.conf.default | sed -E s/'^#src-git targets '/'src-git targets '/)" > feeds.conf
./scripts/feeds update -a
./scripts/feeds install -a
./scripts/feeds install -a

# set GNU packages to download source from faster mirrors
echo "$(cat scripts/download.pl | sed -zE s/'(elsif \(\$mirror \=\~ \/\^\\\@GNU\\\/\(\.\+\)\$\/\) \{[^p]+push \@mirrors\, )[^\}]+\}'/'\1"https:\/\/gnu.mirror.constant.com\/$1"\n\t}'/)" > scripts/download.pl

# configure build
make defconfig
make menuconfig

# download and check source code for packages
# note: eBPF programs like qosify and bridger will fail to download here
make -k -j$(nproc) download
make -k -j$(nproc) check

# build toolchain
make -j$(nproc) -k V=sc prepare_kernel_conf

# re-run download and check to get any missing ones
# eBPF programs like qosify and bridger will successfully download now
make -k -j$(nproc) download
make -k -j$(nproc) check

# build kernel
make -j$(nproc) -k V=sc prepare

# build packages and final firmware image
make -j$(nproc) -k V=sc

Just a guess, but it might because you are building from a zipped archive. Ive never had this issue when cloning the build system using git (see above code for example).

3 Likes

@egorenar
In dmesg, seeing a lot of weird messages:

[ 1147.436532] CPU0: Spectre BHB: using loop workaround
[ 1147.440555] CPU0: Spectre BHB: using loop workaround
[ 1147.444180] CPU0: Spectre BHB: using loop workaround
[ 1147.445948] CPU1: Spectre BHB: using loop workaround
[ 1147.450938] CPU3: Spectre BHB: using loop workaround
[ 1147.456027] CPU0: Spectre BHB: using loop workaround
[ 1147.460799] CPU1: Spectre BHB: using loop workaround
[ 1147.465760] CPU3: Spectre BHB: using loop workaround
[ 1147.471812] CPU0: Spectre BHB: using loop workaround
[ 1147.475650] CPU1: Spectre BHB: using loop workaround
[ 1147.480625] CPU2: Spectre BHB: using loop workaround
[ 1147.480667] CPU3: Spectre BHB: using loop workaround
[ 1147.481959] CPU0: Spectre BHB: using loop workaround
[ 1147.482012] CPU3: Spectre BHB: using loop workaround
[ 1147.487061] CPU3: Spectre BHB: using loop workaround
[ 1147.488111] CPU0: Spectre BHB: using loop workaround
[ 1147.488155] CPU1: Spectre BHB: using loop workaround
[ 1147.490501] CPU1: Spectre BHB: using loop workaround

its spamming like crazy, is this something I configured wrong?

I got this as well after an update yesterday.
This is new, the firmware built a week ago didn't have this issue.
Investigating, will report back.

Update 1

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=bafa10435c4f34f4b9bda8fc7ee6e4330ebca3ea

So we wait for the patch to be applied by OpenWRT in their repo?

Temporary workaround :slight_smile:

make kernel_menuconfig
# Disable CONFIG_HARDEN_BRANCH_HISTORY
# Disabling CONFIG_HARDEN_BRANCH_PREDICTOR won't hurt as well

Tested right now, works.

Update

I updated the kernel config and pushed the fix to my branch.
Just rebuild the fw.

2 Likes

Oh. Thank you.
You give version number to me.

Thank you for the swift resolution!

Tried to use a Cisco GLC-TE SFP module in my R9000 today, and while al_eth found the module and initialized it, I get bizarre i2c errors during module setup.

I get i2c_dw_handle_tx_abort: lost arbitration and i2c_designware fd880000.i2c-pld: controller timed out errors, which seems to be a running theme with Annapurna hardware.

See this thread about i2c malfunctions on the Ubiquiti UDM-Pro, which also uses an Annapurna chip.

Thanks a lot for your great job.
I've tried to get the sfp port working (it doesn't recognize my sfp module - looks like the sfp kernel module is not loaded).
While searching for the root of the problem i ran into these errors:

root@OpenWrt:~# modprobe kmod-sfp
modprobe: FATAL: Module kmod-sfp not found in directory /lib/modules/5.15.45
root@OpenWrt:~# depmod -a
depmod: WARNING: could not open modules.order at /lib/modules/5.15.45: No such file or directory
depmod: WARNING: could not open modules.builtin at /lib/modules/5.15.45: No such file or directory

what i tried to fix the problem:
-rebuild the firmware (following the build script posted by [AnthonyWBarone])
-reflash (via sysupgrade) with and without keeping the settings

looks like it doesn't include the modules into the firmware? Any idea?
Thank you.

I double checked and that is the file I downloaded. I am going to try AnthonyWBarone's directions and clone the repository and see if that makes a difference.

I think you need to enable the corresponding package with "make menuconfig" first.
See package "kmod-sfp". it's not enabled by default i think.

thank you for your feedback.
kmod-sfp it is not actived by default but i already activated it in "make menuconfig" under "Network Devices" kmod-sfp <*>.
Even tried with the "Select all kernel module packages by default" option in Global build settings.
If i check the path /lib/modules/5.15.45 on the device for the kmod-sfp file there is nothing with this name.
It is enabled in make menuconfig, compiles without error but it doesn't work.

Last thing i tried is manual install of the kmod-sfp ipk:

root@OpenWrt:~# opkg install /tmp/kmod-sfp_5.15.45-1_arm_cortex-a15_neon-vfpv4.i
pk
Package kmod-sfp (5.15.45-1) installed in root is up to date.

So the module seems to be installed but isn't working.

Is there a way to do a complete reflash (not only sysupgrade) ?

package name != kernel module name

Look for sfp.ko

See openwrt/package/kernel/linux/modules/netdevices.mk

sfp.ko is in /lib/modules/5.15.45/ folder on the r9000.

On the build system in "openwrt/package/kernel/linux/modules/netdevices.mk"

define KernelPackage/sfp
  SUBMENU:=$(NETWORK_DEVICES_MENU)
  TITLE:=SFP cage support
  DEPENDS:=+kmod-i2c-core +kmod-hwmon-core +kmod-phylink
  KCONFIG:= \
	CONFIG_SFP \
	CONFIG_MDIO_I2C
  FILES:= \
	$(LINUX_DIR)/drivers/net/phy/sfp.ko \
	$(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko@lt5.10 \
	$(LINUX_DIR)/drivers/net/mdio/mdio-i2c.ko@ge5.10
  AUTOLOAD:=$(call AutoProbe,mdio-i2c sfp)
endef

define KernelPackage/sfp/description
 Kernel module to support SFP cages
endef

seems ok?

thinking about it, you probably would need to actually run

depmod -a
modprobe sfp

You could also (just to check if it is found on the system, not to actually load it) run

depmod -a
lsmod | grep sfp

If the sfp module isnt there, then you'll need to enable it during the build with make menuconfig like @egorenar said

depmod: WARNING: could not open modules.order at /lib/modules/5.15.45: No such file or directory
depmod: WARNING: could not open modules.builtin at /lib/modules/5.15.45: No such file or directory

I get these warnings also when running depmod. Im not sure if not having them is actually causing problems, but considering these files are quite small (especially in a squashfs image) and there is a whole lot of space available on the R9000 Id argue it is probably worth including them in the firmware image.

I've done this in a few of the images Ive built (the times I remembered to manually include them) by doing the following

  1. Do initial setup: Clone repo, update/install feeds, configure build, make {download,check}, etc.

  2. make -j$(nproc) -k V=sc prepare - builds toolchain and kernel

  3. copy modules.builtin and modules.order from the kernel build directory to files/lib/modules/[openwrt kernel version]

  4. finish build with make -j$(nproc) -k V=sc

Im sure there is a more elegant (and automatic) way to do this though...

1 Like

For what it's worth, here's the script I use to build an image for the R9000:

cd openwrt
git pull
make clean
./scripts/feeds update -a
./scripts/feeds install -a
make V=sc -j$(($(nproc)+1)) download
make V=sc -j$(($(nproc)+1)) prepare
make V=sc -j$(($(nproc)+1))

Just updated it this morning using this method

1 Like

Friends, I have been looking for how to install OpenWrt on my R9000 and I found this thread and I see that they have been doing a strong job, unfortunately I do not know anything about programming so I can not help much :slightly_frowning_face:

However I would like to test the firmware if it has already been installed on the R9000, I do not know if there is already as a wiki or how to install it, I understand that it is in a testing process so if it is not very difficult I would like to try to install it