AR-300M update openwrt 19.07

Hi Guys,
I have original firmware 3.104 on my AR-300M. openwrt is 18.06.

Can I update openwrt to 19.07 and keep GL inet GUI ?

I tried with uboot and flashing worked, but GL inet GUI is gone.

You cannot. If you flash firmware from openwrt then you only have basic functions.

All right,

thank you

I have an AR-300M-EXT

Where can I get a complete, workable, compilable image of OpenWRT? What is the most recent version, 18.06.0? v18.06.0-rc2?

I’ve tried several versions found via this site and they all seem broken one way or another and are uncompilable due to various patches needing to be applied.

I am looking to compile the .tar image for NAND flash.

You have 3 options. One is to build a clean OpenWRT image, only changes being the GL.iNet patches to make it work on the routers, without the GL UI, from here:

Two, you can build a custom image, the same as the official GL.iNet including the GL UI, but with your own custom packages. You can do that with this:

Three, is to compile a completely raw OpenWRT image using their git. Most of the GL.iNet routers are supported out of the box, but if you can’t get that to work you need to ask in the OpenWRT forums as they are the ones that handle that support.

(GitHub - gl-inet/openwrt: This repository is fork from openwrt official repo, we will update the latest tag and release GL.iNet firmware based on it.)

is broken. Yes I can compile a very bare bones image without even DHCP, as soon as I try selecting any packages then compile errors galore. Trying to use opkg from the working image yields nothing but “unknown package” errors.

(GitHub - gl-inet/imagebuilder: Warning!Please look at 'GL.iNET Imagebuilder Introduction' section.)

Is broken. Trying ./gl_image -p ar300 yields nothing but Undefined error: 0 and Makefile returned non-zero exit status 1

Unfortunately Option 3 isn’t available for the NAND device and the AR-300M-EXT GL-iNet router is NOT supported out of the box. Another dead end.

SDK just fixed. Pls try agin.

I updated the image and it compiled. I added a package and it no longer compiles even after deleting the tmp folder and starting with a brand new .config

What does the following error mean? output from make V=s -j1

make V=s -j1

ERROR: please fix package/feeds/telephony/freeswitch/Makefile - see logs/package/feeds/telephony/freeswitch/dump.txt for details

ERROR: please fix package/feeds/telephony/freeswitch-stable/Makefile - see logs/package/feeds/telephony/freeswitch-stable/dump.txt for details

Collecting package info: done

Collecting target info: done

WARNING: Makefile ‘package/feeds/gli_pub/luci-app-chinadns/Makefile’ has a dependency on ‘redsocks2’, which does not exist

WARNING: Makefile ‘package/feeds/gli_pub/luci-app-chinadns/Makefile’ has a dependency on ‘ShadowVPN’, which does not exist

WARNING: Makefile ‘package/feeds/gli_pub/shadowsocks-libev/Makefile’ has a build dependency on ‘libpcre’, which does not exist

WARNING: Makefile ‘package/feeds/gli_pub/shadowsocks-libev/Makefile’ has a build dependency on ‘libmbedtls’, which does not exist

cd src && /Library/Developer/CommandLineTools/usr/bin/make default
…/libtool --quiet --tag=CC --mode=compile mips-openwrt-linux-musl-gcc -I. -I. -I./util/auxiliary -I./…/stubby/src -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/Volumes/SX5/gl-inet/openwrt/build_dir/target-mips_24kc_musl/getdns-1.4.2:getdns-1.4.2 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Wall -Wextra -D_BSD_SOURCE -D_DEFAULT_SOURCE -I/Volumes/SX5/gl-inet/openwrt/staging_dir/target-mips_24kc_musl/usr/include -I/Volumes/SX5/gl-inet/openwrt/staging_dir/target-mips_24kc_musl/include -I/Volumes/SX5/gl-inet/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/usr/include -I/Volumes/SX5/gl-inet/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include/fortify -I/Volumes/SX5/gl-inet/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include -I/Volumes/SX5/gl-inet/openwrt/staging_dir/target-mips_24kc_musl/usr/include -c ./compat/getentropy_osx.c -o getentropy_osx.lo
./compat/getentropy_osx.c:26:10: fatal error: sys/sysctl.h: No such file or directory
#include <sys/sysctl.h>
^~~~~~~~~~~~~~
compilation terminated.
make[5]: *** [getentropy_osx.lo] Error 1
make[4]: *** [default] Error 2
make[3]: *** [/Volumes/SX5/gl-inet/openwrt/build_dir/target-mips_24kc_musl/getdns-1.4.2/.built] Error 2
make[3]: Leaving directory /Volumes/SX5/gl-inet/openwrt/feeds/gli_pub/getdns' Command exited with non-zero status 2 time: package/feeds/gli_pub/getdns/compile#0.18#0.13#0.36 make[2]: *** [package/feeds/gli_pub/getdns/compile] Error 2 make[2]: Leaving directory /Volumes/SX5/gl-inet/openwrt’
make[1]: *** [/Volumes/SX5/gl-inet/openwrt/staging_dir/target-mips_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory `/Volumes/SX5/gl-inet/openwrt’
make: *** [world] Error 2

Looks like you are building with MacOSX. All the compilation guides in github assume you are running Ubuntu 20.04 LTS. Download VirtualBox and install Ubuntu 20.04 as a VM and try the guide again.

MacOSX has a lot of quirks, even when building Vanilla OpenWRT directly from their site.

Why does it work then 5 minutes later not work?

You added a package you said? Must be related to that package. The error you saw above means things are missing in your MacOSX that are required to build that package. “sys/sysctl.h: No such file or directory”

what does this error mean?

cp /Volumes/SX5/gl-inet/openwrt/build_dir/target-mips_24kc_musl/linux-ar71xx_nand/loader-generic-initramfs.elf /Volumes/SX5/gl-inet/openwrt/bin/targets/ar71xx/nand/openwrt-ar71xx-nand-vmlinux-initramfs-lzma.elf
/Volumes/SX5/gl-inet/openwrt/staging_dir/host/bin/mksquashfs4 /Volumes/SX5/gl-inet/openwrt/build_dir/target-mips_24kc_musl/root-ar71xx /Volumes/SX5/gl-inet/openwrt/build_dir/target-mips_24kc_musl/linux-ar71xx_nand/root.squashfs -nopad -noappend -root-owned -comp xz -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2 -b 256k -p ‘/dev d 755 0 0’ -p ‘/dev/console c 600 0 0 5 1’ -processors 1 -fixed-time 1534405875
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /Volumes/SX5/gl-inet/openwrt/build_dir/target-mips_24kc_musl/linux-ar71xx_nand/root.squashfs, block size 262144.
Pseudo file “/dev” exists in source filesystem “/Volumes/SX5/gl-inet/openwrt/build_dir/target-mips_24kc_musl/root-ar71xx/dev”.
Ignoring, exclude it (-e/-ef) to override.
[==============================================================================================================================\ ] 925/1162 79%
Read on destination failed
make[5]: *** [/Volumes/SX5/gl-inet/openwrt/build_dir/target-mips_24kc_musl/linux-ar71xx_nand/root.squashfs] Error 1
make[5]: Leaving directory /Volumes/SX5/gl-inet/openwrt/target/linux/ar71xx/image' make[4]: *** [install] Error 2 make[4]: Leaving directory /Volumes/SX5/gl-inet/openwrt/target/linux/ar71xx’
make[3]: *** [install] Error 2
make[3]: Leaving directory /Volumes/SX5/gl-inet/openwrt/target/linux' Command exited with non-zero status 2 time: target/linux/install#45.28#15.48#63.47 make[2]: *** [target/linux/install] Error 2 make[2]: Leaving directory /Volumes/SX5/gl-inet/openwrt’
make[1]: *** [/Volumes/SX5/gl-inet/openwrt/staging_dir/target-mips_24kc_musl/stamp/.target_install] Error 2
make[1]: Leaving directory `/Volumes/SX5/gl-inet/openwrt’
make: *** [world] Error 2

Looks like it was not able to either read the source files for the final image, or couldn’t read the final image itself. Might be some filesystem permissions issue?

Again on MacOSX things aren’t as smooth.

I was originally using VM but was finding it a royal pain having to use outdated Ubuntu and patches that matched up with the GL-inet required configuration of packages. I still ran into tons of errors with various packages. That and finding all sorts of compile error bugs in the GL-inet source and releases has been off putting overall. At least on macos I can compile faster to find the errors.

On paper the AR300M-EXT looks good as long as you don’t compile the source yourself. I’ve had less issues doing this on other vendor hardware.

Just as an update I seem to have narrowed down where the bugs are occurring and are reproducable:

The following works:

(STEP1)
git clone GitHub - gl-inet/openwrt: This repository is fork from openwrt official repo, we will update the latest tag and release GL.iNet firmware based on it.
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
->Target System (Atheros AR7xxx/AR9xxx)
→ Subtarget (Generic devices with NAND flash)
→ Taget Profile (AG-AR300M with nand flash)
→ Target Images
→ ramdisk
→ squashfs
→ GL.iNet packages choice shortcut
→ support USB
→ support rtc
Save and exit
make V=s -j5
everything compiles ok and I get a working bootable image
openwrt-ar71xx-nand-gl-ar300m-squashfs-sysupgrade.tar

Now if I go back to make menuconfig

(STEP2)
try adding either
→ GL.iNet packages choice shortcut
→ support storage
or
→ support camera

or
Utilities → mqtt

make crashes with miscellaneous and likely random errors as I posted earlier

if I delete .config and tmp directory and make menuconfig again, sometimes I get unresolvable errors, OR, I am able to compile without errors but it no longer creates any working bootable images
openwrt-ar71xx-nand-gl-ar300m-squashfs-sysupgrade.tar

The only way to fix the problem is to completely blow away the gl-inet/openwrt folder and re-download a clean image.

What I am noticing is that certain packages are seeing timeouts trying to download images from non-existing mirrors which then default to other mirrors, then those packages i.e. some openssl mirrors are generating make errors. Sorry I can’t provide specifics yet on which server mirrors are causing problems. I am suspecting that certain mirrors are not up to date and make is trying to build buggy and incomplete/broken images.
Once the files under openwrt get corrupted, no amount of
./scripts/feeds update -a
./scripts/feeds install -a
or cleaning tmp files seems to help. Maybe this is a problem relating only to the AR300M NAND, I don’t know