Building kernel 6.6 for MikroTik RB5009UG

I recovered the RB5009 with Mikrotik's Netinstall method.
It's now back to the RouterOS.
Do I need to follow the same procedures as the first time I installed OpenWrt?

Install the modified RouterBOOT by @adron, then tftpboot from openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-fit-uImage.elf
and then flash the sysupgrade.

Yes, always. There is no need to return to RouterOS BTW. Just boot the OpenWrt ramdisk image, and reflash OpenWrt from there.

Edit: unless you instructed RouterOS to do so, the hacked RouterBOOT will not have been overwritten. So there's no need to replace it again. Next time you're in a pickle, just reboot to the bootloader and have it boot the OpenWrt ramdisk image.

1 Like

I follow adron's readme and issue /system/routerboard/settings/set boot-device=ethernet on RouterOS terminal but I get input doesn't match any value of boot-device
I've found in older posts what I should set.

try-ethernet-once-then-nand ?

/system/routerboard/settings/set boot-device=
flash-boot  flash-boot-once-then-nand  nand-if-fail-then-ethernet  nand-only  try-ethernet-once-then-nand  

Exactly that.

Thanks. I've returned to OpenWrt making a good training jumping to RouterOS and back to OpenWrt. Will continue tomorrow with kernel 6.6.

4 posts were merged into an existing topic: Add support for MikroTik RB5009UG

Probably yes, but what do you want to know?

1 Like

I've used your diffconfig just to see and I get the same error as well as if I use mine.

make[5]: Entering directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0'
make[6]: Entering directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0'
 /usr/bin/mkdir -p '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-install/usr/bin'
 /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/host/bin/install -c curl-config '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-install/usr/bin'
 /usr/bin/mkdir -p '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-install/usr/lib/pkgconfig'
 /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/host/bin/install -c -m 644 libcurl.pc '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-install/usr/lib/pkgconfig'
make  install-data-hook
make[7]: Entering directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0'
(cd include && make install)
make[8]: Entering directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include'
Making install in curl
make[9]: Entering directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include/curl'
make[10]: Entering directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include/curl'
make[10]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-install/usr/include/curl'
 /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/host/bin/install -c -m 644 curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h typecheck-gcc.h system.h urlapi.h options.h header.h websockets.h '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-install/usr/include/curl'
make[10]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include/curl'
make[9]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include/curl'
make[9]: Entering directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include'
make[10]: Entering directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include'
make[10]: Nothing to be done for 'install-exec-am'.
make[10]: Nothing to be done for 'install-data-am'.
make[10]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include'
make[9]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include'
make[8]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/include'
make[7]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0'
make[6]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0'
make[5]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0'
make[4]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0'
touch /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/.built
rm -rf /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/.pkgdir/libcurl.installed /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/.pkgdir/libcurl
mkdir -p /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/.pkgdir/libcurl
install -d -m0755 /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/.pkgdir/libcurl/usr/lib
cp -fpR /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-install/usr/lib/* /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/.pkgdir/libcurl/usr/lib/
touch /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/.pkgdir/libcurl.installed
mkdir -p /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/target-aarch64_cortex-a72_musl/root-mvebu/stamp
echo '4' | cmp -s - /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/target-aarch64_cortex-a72_musl/pkginfo/libcurl.version || { echo '4' > /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/target-aarch64_cortex-a72_musl/pkginfo/libcurl.version;  } 
SHELL= flock /home/debian/openwrt-RB5009UG-master-6.6/tmp/.root-copy.flock -c 'cp -fpR /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/.pkgdir/libcurl/. /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/target-aarch64_cortex-a72_musl/root-mvebu/'
touch /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/target-aarch64_cortex-a72_musl/root-mvebu/stamp/.libcurl_installed
mkdir -p /home/debian/openwrt-RB5009UG-master-6.6/bin/targets/mvebu/cortexa72/packages /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-aarch64_cortex-a72/libcurl/CONTROL /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/target-aarch64_cortex-a72_musl/pkginfo
install -d -m0755 /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-aarch64_cortex-a72/libcurl/usr/lib
cp -fpR /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-install/usr/lib/* /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-aarch64_cortex-a72/libcurl/usr/lib/
find /home/debian/openwrt-RB5009UG-master-6.6/build_dir/target-aarch64_cortex-a72_musl/curl-8.6.0/ipkg-aarch64_cortex-a72/libcurl -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package libcurl is missing dependencies for the following libraries:
make[3]: *** [Makefile:197: /home/debian/openwrt-RB5009UG-master-6.6/bin/packages/aarch64_cortex-a72/packages/libcurl4_8.6.0-r1_aarch64_cortex-a72.ipk] Error 1
make[3]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6/feeds/packages/net/curl'
time: package/feeds/packages/curl/compile#62.87#10.14#73.69
    ERROR: package/feeds/packages/curl failed to build.
make[2]: *** [package/Makefile:129: package/feeds/packages/curl/compile] Error 1
make[2]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6'
make[1]: *** [package/Makefile:123: /home/debian/openwrt-RB5009UG-master-6.6/staging_dir/target-aarch64_cortex-a72_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/debian/openwrt-RB5009UG-master-6.6'
make: *** [/home/debian/openwrt-RB5009UG-master-6.6/include/ world] Error 2

I think it's better to split your questions from this thread, since were deviating.

Run a make package/curl/{clean,compile} V=sc and see where that gets you.

1 Like

I didn't have any intention to pollute this excellent thread, just had some spare time and decided to test the new kernel. I'll stick with 6.1 for now and wait for the PR to be merged. If I have time I may try to find out myself what's going on.
Thanks a lot.

And that's much appreciated, but in this case it seems something else is wrong, so better to open a separate topic for that.

1 Like

@sppmaster As requested before, open a topic about any issues you're seeing that go beyond actual support for the RB5009UG. Don't PM for support.

Why did you delete your post? Did you find out what went wrong? You know you can grab a patch set in one go, right, instead of having to download every single patch in it?

First of all thanks for splitting the thread.
I deleted my post because I've sorted out the patching/compilation errors. It was my stupid fault missing a simple step. Reading the message I realized my fault.
Now I just have to figure out why my working 6.1 diffconfig doesn't work with kernel 6.6.
Both sysupgrade.bin and initram.elf images don't start.
Both 6.1 images run OK. I've tried both.
Now I compare your diffconfig with mine and will recompile.
Can you tell me if I need to set anything else besides using testing kernel in menuconfig.
@Borromini In my build environment I cannot compile using your diffconfig. It fails.

I'm unsure, and without serial, it's a black box when boot breaks. It's running fine here, and we have other reports of 6.6 running on the RB5009UG, so it looks like it's something on your end. You're sure you're not seeing any 'Your configuration is out of date' messages when you start compiling with 6.6?

Can you share a diff between your 6.1 and 6.6 OpenWrt diffconfig?

My advice would be to start with a minimal config and then build it up, see when it breaks. You have my diffconfig, you can strip that of extra packages. And also make sure CONFIG_STRIP_KERNEL_EXPORTS is unset.

Here it is

diff diffconfig6.1 diffconfig6.6
> CONFIG_PACKAGE_kmod-crypto-kpp=y
> CONFIG_PACKAGE_kmod-crypto-geniv=y
> CONFIG_PACKAGE_kmod-crypto-sha3=y
> CONFIG_PACKAGE_kmod-fs-netfs=y
> CONFIG_PACKAGE_kmod-nls-ucs2-utils=y
> CONFIG_PACKAGE_kmod-usb2=y
> CONFIG_PACKAGE_luci-app-irqbalance=y
> CONFIG_PACKAGE_luci-lib-chartjs=y
< # CONFIG_PACKAGE_kmod-crypto-kpp is not set
> # CONFIG_LIBCURL_FTP is not set

I've tried to start from scratch and opened menuconfig after deleting my old config and then I just selected the target profile and testing kernel for minimal configuration but it still doesn't run.

Use $ diff -Naur, that's easier to read.

Try dropping the fs-netfs and nls-ucs2-utils kmods, although I don't think that's what breaks it. If you haven't cleaned your buildroot yet - backup your configuration, run a make distclean, restore your config and compile again. It's heavy-handed, but without serial, we're grasping at straws. If that does not work then you should stick with 6.1 for now.

Thanks for your help.
I cannot really say what was wrong.
I finally started Adron initramfs.elf image and flashed the 6.6 sysupgrade without keeping the settings and it booted. I used my 6.1 config.
Then restored my backup config and everything is OK.

Sounds like a settings issue then. Glad you got it up and running.

1 Like

Yes, it sounds like that. But actually I had difficulties to reset the settings to default using the Reset button. Although I followed the official MikroTik procedures from their website I couldn't reset OpenWrt settings to default.
And that was a pain because I didn't have access to the router (there was even no ping).
I had to load the initramfs.elf from bootloader. Only that worked. I didn't have enough spare time to try anything else.

@robimarko, @Ansuel, @Borromini Don't you think below situation is a bug?
I think I have found what's going on even without a serial. But someone else will have to help with the solution if that is a bug.
Currently I only test this unit in my spare time and because of this I don't have the common usage environment as most of the other regular users.
If the unit is booted without any LAN cable plugged into any of the LAN ports and then later a cable is plugged into any of the LAN ports the connected device cannot get IP address and even setting manually IP, the router will still not be reachable and General failure error is printed during ping command.
The only proper way is to boot the OpenWrt with LAN cable plugged into any LAN port and then everything is OK.

And one "special" case. Flashing the newer firmware (tried it today) still don't give IP address to the PC after the first reboot even though the LAN cable was connected.
I had to disconnect the power and reboot it in order for the DHCP to start working. At least with kernel 6.6, for older cannot say.

All of this made me confused late at night as I was trying to test different things on the unit and had to reflash the firmware several times.

That seems important and I don't know if this is a coincidence but sometimes I had to do the same cold reboot on my other ipq807x unit after firmware flash. Otherwise the devices simply cannot get IPs from the DHCP.

Can anyone try the same just to confirm or not this behaviour?