Optimized build for IPQ40xx devices

That is the issue. On many Linksys routers, the is an option to manually pick a firmware file to install. In my GUI, the only option available is to upgrade the factory firmware with online factory firmware. There is no option to select any other file.

@reka did you sideloaded the firmware?

Also, did you check this? https://www.linksys.com/my/support-article?articleNum=316371#F1

The option to upload a local firmware file is there if you know where to look. Go to http://192.168.1.1/fwupdate.html (or whatever your router's ip is) and login with admin/admin. There you can upload the openwrt factory image file.

So, I've downloaded the RC files in message one. What else do I need, and what is the procedure to install everything? Sorry for the noob questions.

You only need notengobattery-linksys_mr9000-squashfs-factory.bin. If you have that, go to your router's firmware update page (see above), select the file and start the update. Then you just have to wait until it's finished rebooting and that's it.

So, I have OpenWRT up and running. I want to setup YAMon4.

The 1st step is to install a USB flash drive. I've been following the instructions at https://openwrt.org/docs/guide-user/storage/usb-drives-quickstart . It's not working. When I perform the 1st step which is:
opkg update && opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3
I get 2 errors. They are:

Collected errors:
opkg_download: Failed to download https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/Packages.gz, wget returned 5.
opkg_download: Failed to download https://downloads.notengobattery.com/projects/openwrt-v3.0.0/packages/arm_cortex-a7_neon-vfpv4/notengobattery_feed/Packages.gz, wget returned 5.

When I get to the last step of mounting the drive, I get this series of messages

block: No "mount.ubi" utility available
block: mounting /dev/mtdblock11 (ubi) as /mnt/mtdblock11 failed (2) - No such file or directory
block: No "mount.ubi" utility available
block: mounting /dev/mtdblock13 (ubi) as /mnt/mtdblock13 failed (2) - No such file or directory
block: No "mount.ubi" utility available
block: mounting /dev/mtdblock15 (ubi) as /mnt/mtdblock15 failed (2) - No such file or directory
block: mounting /dev/sda1 (ext4) as /mnt/sda1 failed (117) - No error information

So, basically, it's not working. This is all new to me, so help would be appreciated.

Once I have that working, I will need to change the setup so that the USB is mounted as /opt and then get YAMon4 working. I'll have to figure that out somewhere else unless someone here has the time to deal with me.

Thanks,
Mike

Please check this:

Where exactly am I supposed to use this flag?
If I put it at the end of this line, the results are the same.

opkg update --no-check-certificate && opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3 --no-check-certificate

Hi @NoTengoBattery! Great work on this and I can't say thank you enough for adding the MR9000.

I have two questions, the main one is that I can't get P910nd printing to work from a usb printer. It just does not want to recognize the printer. It works on my C2600 (ACWifiDude Build) with just kmod-usb-printer, but I can't get it to work on the MR9000. It seems like it may be missing some kernel dependencies? I've actually compared the packages between the two setups and added in kmod-usb-printer, kmod-usb2, kmod-usb3, kmod-usb-ehci, and kmod-usb-ohci.

The second question...Could I build from your github? Just curious if you have a preconfigured .config file that I could use to make it easier or are the targets setup (pre-configured)? I plan to clone the repository down today and fiddle. Basically trying to "learn to fish". Thanks again!

EDIT: Looks like I got ahead of myself. I updated from 3.0.0 to RC4 and ran the command below...Now I'm in business. Still curious about the second question. Thanks!

opkg update --no-check-certificate && opkg install kmod-usb-ehci kmod-usb-ohci luci-app-p910nd p910nd kmod-usb-printer kmod-usb-storage kmod-usb2 kmod-usb3 --force-reinstall --no-check-certificate

So I've been trying to get everything working properly and I started running into problems. I want to start the whole process over, by restoring my factory firmware. Unfortunately, it isn't working. I think I messed something up with mount points or something.

When I type dh -f I get the following

Filesystem                Size      Used Available Use% Mounted on
/dev/root                10.3M     10.3M         0 100% /rom
tmpfs                   245.2M      2.0M    243.2M   1% /tmp
/dev/ubi15_0             56.4M     68.0K     53.5M   0% /overlay
overlayfs:/overlay       56.4M     68.0K     53.5M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/ubi0_1              59.9M     32.0K     56.8M   0% /bootfs

It seems that what ever I do, I can't get the old firmware back. I have tried `firstboot && reboot now' I have tried loading the original firmware via the GUI. I have tried 'sysupgrade -F /tmp/originalfirmware.img' but when it restarts, I have the exact same setup.

Typing 'mount' gives me

root@Dallas:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
pstore on /sys/fs/pstore type pstore (rw,relatime)
/dev/ubi15_0 on /overlay type ubifs (rw,relatime,bulk_read,compr=zstd,assert=read-only,ubi=15,vol=0)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
/dev/ubi0_1 on /bootfs type ubifs (rw,relatime,bulk_read,compr=zstd,assert=read-only,ubi=0,vol=1)

What did I do wrong and how do I get back to my factory image?

Thanks.

@NoTengoBattery regarding testing a build for Zyxel NBG6617 I have managed to get serial console access, is that enough?

You can go back to factory ver. easily if you didn't flash both partitions using advanced-reboot or by doing it manually. all this info is on the wiki. Wayback Machine link since openwrt is down

I appreciate the help. I was able to restore the factory build, then reload OpenWRT. Now to get the monitoring figured out.

I hate to say this, but I am still having problems. I loaded notengobattery-linksys_mr9000-squashfs-factory.bin to my MR9000 router. I went in and set the router name and password then rebooted. Everything looked fine when I connected via ssh. I did the package update with the "--no-check-certificate" option. I verified that the USB drive was not attached then attached it. I went through the steps to add the flash drive then rebooted. When I connected via SSH, the router name was gone, the password was gone and the flash drive wasn't attached.

This is a copy of my ssh session:

 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 NoTengoBattery v3.0.0, r16279-5cc0535800
 -----------------------------------------------------
root@MikeTest:~# opkg update --no-check-certificate && opkg install kmod-usb-ehci kmod-usb-ohci luci-app-p910nd p910nd kmod-usb-printer kmod-usb-storage kmod-usb2 kmod-usb3 --force-reinstall --no-check-certificate
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/notengobattery_core
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/base/Packages.gz
Updated list of available packages in /var/opkg-lists/notengobattery_base
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/notengobattery_luci
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/luci/Packages.sig
Signature check passed.
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/packages/arm_cortex-a7_neon-vfpv4/notengobattery_feed/Packages.gz
Updated list of available packages in /var/opkg-lists/notengobattery_notengobattery_feed
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/packages/arm_cortex-a7_neon-vfpv4/notengobattery_feed/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/notengobattery_packages
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/notengobattery_routing
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/notengobattery_telephony
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/telephony/Packages.sig
Signature check passed.
Removing package kmod-usb-storage from root...
Removing package kmod-usb3 from root...
Installing kmod-usb-ehci (5.4.143-1) to root...
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/kmod-usb-ehci_5.4.143-1_arm_cortex-a7_neon-vfpv4.ipk
Installing kmod-usb-ohci (5.4.143-1) to root...
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/kmod-usb-ohci_5.4.143-1_arm_cortex-a7_neon-vfpv4.ipk
Installing luci-app-p910nd (git-20.108.38431-8f34e10) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/luci/luci-app-p910nd_git-20.108.38431-8f34e10_all.ipk
Installing p910nd (0.97-9) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a7_neon-vfpv4/packages/p910nd_0.97-9_arm_cortex-a7_neon-vfpv4.ipk
Package p910nd (0.97-9) installed in root is up to date.
Installing kmod-usb-printer (5.4.143-1) to root...
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/kmod-usb-printer_5.4.143-1_arm_cortex-a7_neon-vfpv4.ipk
Installing kmod-usb-storage (5.4.143-1) to root...
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/kmod-usb-storage_5.4.143-1_arm_cortex-a7_neon-vfpv4.ipk
Installing kmod-usb2 (5.4.143-1) to root...
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/kmod-usb2_5.4.143-1_arm_cortex-a7_neon-vfpv4.ipk
Installing kmod-usb3 (5.4.143-1) to root...
Downloading https://downloads.notengobattery.com/projects/openwrt-v3.0.0/targets/ipq40xx/generic/packages/kmod-usb3_5.4.143-1_arm_cortex-a7_neon-vfpv4.ipk
Configuring kmod-usb-storage.
Configuring kmod-usb-printer.
Configuring kmod-usb-ohci.
Configuring p910nd.
Configuring kmod-usb-ehci.
Configuring kmod-usb2.
Configuring kmod-usb3.
Configuring luci-app-p910nd.
root@MikeTest:~# ls -al /dev/sd*
ls: /dev/sd*: No such file or directory
root@MikeTest:~# ls -al /dev/sd*
brw-------    1 root     root        8,   0 Oct 27 12:23 /dev/sda
brw-------    1 root     root        8,   1 Oct 27 12:23 /dev/sda1
root@MikeTest:~# block detect | uci import fstab
uci set fstab.@mount[0].enabled='1' && uci set fstab.@global[0].anon_mount='1' && uci commit fstab
/etc/init.d/fstab boot
block: No "mount.ubi" utility available
block: mounting /dev/mtdblock11 (ubi) as /mnt/mtdblock11 failed (2) - No such file or directory
block: No "mount.ubi" utility available
block: mounting /dev/mtdblock13 (ubi) as /mnt/mtdblock13 failed (2) - No such file or directory
block: No "mount.ubi" utility available
block: mounting /dev/mtdblock15 (ubi) as /mnt/mtdblock15 failed (2) - No such file or directory
root@MikeTest:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
pstore on /sys/fs/pstore type pstore (rw,relatime)
/dev/ubi15_0 on /overlay type ubifs (rw,relatime,bulk_read,compr=zstd,assert=read-only,ubi=15,vol=0)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
/dev/ubi0_1 on /bootfs type ubifs (rw,relatime,bulk_read,compr=zstd,assert=read-only,ubi=0,vol=1)
/dev/sda1 on /mnt/sda1 type ext4 (rw,relatime)
root@MikeTest:~# reboot
root@MikeTest:~#
login as: root
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 NoTengoBattery v3.0.0, r16279-5cc0535800
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@Dallas:~#

Can someone please tell me what I am doing wrong?

Mike

Did you try block mount?
Also, you need to install the filesystem driver for your USB device if it is not installed alredy.


@pingec Yes, it is!
With a serial console, we can see any hidden error during the boot process and debug accordingly. Please contact me via PM.

I did read your post. The problem is this:
By default, the device will use the syscfg partition to store the config and the installed packages. This is needed because the default space for that purpose is the remaining of the system partition, which is so small that is pretty much useless.
When you override the fstab and reboot, you are telling the device to not use that partition, and therefore you "lost" your config. Is not lost, is just not accessible. I would recommend adding the partitions manually using LuCI.
Another solution is to re-do what you did now that you deleted the original fstab file, which is probably what you end up doing.
I sorry for the annoyance. I didn't think anyone would replace the fstab file instead of adding the entries as needed.

I figured out a workaround for the errors I was receiving. I now have OpenWRT running on my router, with the USB drive visible and working. Now I'm having difficulty setting up YAMon4. It might be due to certificate issues with this version of the software, but I'm not entirely certain. This issue is that one of the scripts is trying to do this wget http://usage-monitoring.com/current/YAMon4/Setup/gfmd4.0.php -O /tmp/yamonsetup.txt.

When this command runs I get this error

`Downloading 'http://usage-monitoring.com/current/YAMon4/Setup/gfmd4.0.php'
Connecting to 66.96.149.32:80
Redirected to /current/YAMon4/Setup/gfmd4.0.php on usage-monitoring.com
Connection error: Invalid SSL certificate'

I know about the issues this build has with certificates. I'm aware of the --no-check-certificate option but the wget is used frequently in the installation process and it would be extremely difficult to manually add that option to the scripts everytime it is needed. I've dug around a lot and learned about setting Wgetrc defaults. I've set "check_certificate = off" but I continue to get certificate errors with every wget statement in the scripts. Would I be better off running a different version of your build that doesn't have the certificate issue? If so, what version would that be? Is there a different solution to the problem? Sorry for the constant questions, but this really is a learning process for me. I've got about 30 browser tabs open right now with relevant information regarding all of these issues.

I understand and for sure OpenWrt needs a lot of work.

The problem with the certificates is not my fault, nor OpenWrt's fault. The certificates expired making a lot of embedded devices stop working.

From the date those expired and backwards, all OpenWrt builds (mine or not) will suffer from this problem. Installing older versions won't help at all. The certificates need an update but OpenWrt hasn't issued the new packages.

I was waiting for them to do it, but it's taking a while. A new builds with the updated certificates is needed. If anyone know or has a link to a solution for this, I can build and release the new software (mostly because I don't know what to look for to update them myself).

You can try this and let us know if it works. If that's the case, I can issue a new build with the fix applied:

(hint: wget instead of uclient-fetch)

Thanks so much for your help. I think I have everything up and running now. These are the steps that I followed:

Thanks, it was pretty easy after all:

Edit /etc/opkg/distfeeds.conf changing the URLs from https to http
opkg install libopenssl
opkg install openssl-util
opkg --force-depends remove libustream-wolfssl20201210
opkg install libustream-openssl20201210
Edit /etc/opkg/distfeeds.conf changing the URLs back to https
opkg update now works
service uhttpd restart

Again, thanks for all your help. Now that I have a workaround, hopefully, it will do everything that I want it to do now.

Mike