Arduino Forum

Products => Arduino Yún => Topic started by: frello on Feb 18, 2019, 11:26 am

Title: OpenWRT 18.06 on YUN, is it possible?
Post by: frello on Feb 18, 2019, 11:26 am
Dear all,

I was wondering why the official support for openWRT on YUN stopped around 5 years ago with Attitude Adjustment porting. There's any technical limitation or is it just about commercial reasons?

If it concerns the business only, I would like to buil a custom version for my YUN of a vanilla version of OpenWRT 18.06 (last version) since I need some feature of the new kernel in my application (a project POC build on top of YUN and Raspberry).

Any suggestions regarding where to start (tutorial, wiki, etc) it's more than welcome... and on top of all:

which YUN-specific features I will lose?

Thanks!

PS I've found this build (https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/openwrt-18.06.2-ar71xx-generic-arduino-yun-squashfs-sysupgrade.bin) on openwrt website, but it does not work
Title: OpenWRT 18.06 on YUN rev 1 is possible..
Post by: core_cc on Jan 24, 2020, 12:56 am
1 year old post, but read 310 times.. so i just respond anyway:

Making a custom firmware for the rev 1 Yun, is exactly what we did for a project.
We used LEDE 17.04, which was the latest version at that time, where we cross-compiled it with some special kernel setting (FPU_EMULATION=y), because we wanted to run NodeJS.
It all worked well, but the Yun wasn't up for the task (NodeJS was running way too slow for our purposes).
We also had to compile the packages from the feeds, because the usual available feeds did not have the packages in that same fpu_emulation format.
But if you don't do such drastic changes to the kernel, you can compile your own firmware (kernel+rootfs) "easy" enough.

If you use an old revision 1 Yun, you will also have problems compiling a kernel that fits. the old Yun had a "limit" of 1280KB for the kernel. Your initial kernel can not have many libs included, because that limit is quickly exceeded.
But, if you update the bootloader, and you compile the firmware yourself, you can flash the kernel and rootfs seperately. You know the sizes of those files, and you can set uboot environment vars to set the yun up for a bigger kernel.

We decided to drop the use of the nvram flash partition (i couldn't find the reason for that partition on a Yun.. broadcom?). The Yun worked perfectly without that nvram partition, and it gives you 64KB extra space for your kernel (and/or rootfs).

If you extroot the Yun (using an SDcard), you can extend the memory and you're able to install any size library you wish. You can choose to have a big kernel with lots of stuff installed, and a smaller rootfs.   You can install the less important stuff later (or the software that is simply too big to fit in the remaining rootfs space).

I haven't tried to upgrade a Yun rev 2 yet, but i'm about to  :) I just got one yesterday.. so i first read about other people's experiences.
Title: OpenWRT 19.07 on YUN
Post by: core_cc on Feb 26, 2020, 08:51 pm
To cross-compile OpenWRT yourself, perhaps with creating your own package, and whatever modules you include in the kernel, i did this:
Quote
mkdir OpenWRT1907
cd OpenWRT1907

apt-get update
apt install git
git clone --depth=1 --branch openwrt-19.07 --single-branch https://git.openwrt.org/openwrt/openwrt.git

cd openwrt

* prereq stuff:
apt install subversion g++ zlib1g-dev build-essential git python python3
apt install libncurses5-dev gawk gettext unzip file libssl-dev wget
apt install libelf-dev ecj fastjar java-propose-classpath

./scripts/feeds update -a
./scripts/feeds install -a

make menuconfig
make -j1 V=s
I did that on a VirtualBox 6.0 VM running Linux Debian 10.
(https://i.imgur.com/hYjE8Yh.png)
But.. you probably have to install addition libs, and setup some additional stuff to make the full cross-compile execute successfully.

I still flashed the firmware manually (rootfs & kernel bins), using TFTP, some ethernet cables and the uboot prompt.
(That sysupgrade bin creation is next on my list. append-metadata?).
I upgraded the Yun's bootloader to uboot 1.1.5 prior flashen the firmware. You need to do that, because the rev1 Yun's original bootloader is missing some needed abilities.
In the source code i changed the definition of the "arduino-yun" device (mainly edited the mtdparts line).

The custom firmware has a self-made package included. That's easy to accomplish.

For the Yun i cross-compiled a LEDE 17.04 before. After some fiddling with the Yun-specific stuff, all that was working.