OpenWrt Forum Archive

Topic: Settings don't survive reboot

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I had to build a custom firmware for my E-Lins H685 3G router since it's not supported in trunk. I had to patch some drivers and create a new DTS file (it's Ralink 5350 based). I managed to get everything working including 3G except one important detail: settings don't survive a reboot. I played with the mtd layout and no matter what I do, there's no jffs overlay. How can I make it work?

Here's my mtd layout:

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "Bootloader"
mtd1: 00020000 00010000 "Config"
mtd2: 00010000 00010000 "Factory"
mtd3: 00600000 00010000 "firmware"

These are all sequential (no overlap). I tried naming the mtd partition firmware, rootfs, rootfs_data, but still no dice. Here's the output of mount:

# mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)


Thanks!

If you created a custom image and you don't know what you were doing you can't expect others to help you... Best advice I can give you is to just stick with official images they work as you expect them to work and keep settings.

Safe way to create custom firmware is to use Imagebuilder. Search for it on the wiki or google for it.

No worries, I figured it out. I couldn't use a prebuilt image since the hardware is not supported. For reference, I needed to change quite a few things in my DTS file and disable rootfs split in kernel config since the H685 already has a mtd region to save settings before the kernel image. There are quite a few holes in the wiki for custom RT5350 devices but nothing that can't be overcome with some tinkering.

(Last edited by mattwylde on 2 Jul 2015, 22:15)

Matt (I guess that is your name),

Please don't be put off by unhelpful replies, there are quite a few helpful people around here.

I am not an expert but I will try to help with the little I know:

1. here is the link to the wiki for  building OpenWrt; the image generator is the 7th one on the list
http://wiki.openwrt.org/doc/start#building_openwrt

2. I recently bought a 3G/4G router, more commonly known around here as the A5-V11. This router is Ralink 5350 based, just like your hardware, Although not fully supported yet, it does have its own wiki, and one of the known issues is similar to what you have reported. see link
http://wiki.openwrt.org/toh/unbranded/a … own_issues

I hope this helps, I shall go back to my corner now.

Thanks Elmesito. Everything is working perfectly now and actually, your comment kinda explained what I did to make it work. I also used the Dlink DIR320 as a reference since the H685 can boot the ramdisk image (albeit with non working 3G and some other issues). I also patched the USB option driver to add the 3g modem to the device list.

Hi Matt,

Did you (or would you consider) publishing the source for the custom build? I've got a H685, it's H685 decent hardware but the standard firmware has some issues, so mine's been sitting around for the last few months. It'd be nice to get some use out of it smile

Hi, I wanted to but I didn't know the procedure/have time for it.

Here's a link to the files I changed in my Google Drive. Feel free to use it and merge the changes:

https://drive.google.com/folderview?id= … sp=sharing

This is for the E-Lins H685 and H820T. They are identical hardware except for the number of LAN ports. The only new file is the DTS (place it in openwrt/target/linux/ramips/dts). The others are modified versions of existing files. The Makefile is the one in openwrt/target/linux/ramips/image/Makefile. There are 2 new lines for the H820T. The location for the other files is in the comments for the file.

Please report if it works fine for you smile

Wow, that was a quick response! Thanks! I'll take a look and see where I get to smile

@matt,
i bought also two of this device, but unfortunately the openvpn client is not supported by stock firmware.
The manufacturer (e-lins) suggested me to try openwrt, so i found this topic per google.

I setup a VM with Debian 8.3 arm64, and installed the openwrt trunk. Afterwards i compiled a test firmware - everything fine.

After replacing the files, with yours from google drive, the compiling interrupts with:

#                               cp /home/tefo/test/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/vmlinux-initramfs /home/tefo/test/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/vmlinux-3g-6200n-initramfs
/home/tefo/test/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/linux-3.10.49/scripts/dtc/dtc -O dtb -o /home/tefo/test/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/3G-6200N.dtb ../dts/3G-6200N.dts
/home/tefo/test/openwrt/staging_dir/host/bin/patch-dtb /home/tefo/test/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/vmlinux-3g-6200n-initramfs /home/tefo/test/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/3G-6200N.dtb
Could not open kernel imageMakefile:1147: recipe for target 'install' failed
make[5]: *** [install] Error 255
make[5]: Leaving directory '/home/tefo/test/openwrt/target/linux/ramips/image'
Makefile:25: recipe for target 'install' failed
make[4]: *** [install] Error 2
make[4]: Leaving directory '/home/tefo/test/openwrt/target/linux/ramips'
Makefile:13: recipe for target 'install' failed
make[3]: *** [install] Error 2
make[3]: Leaving directory '/home/tefo/test/openwrt/target/linux'
target/Makefile:21: recipe for target 'target/linux/install' failed
make[2]: *** [target/linux/install] Error 2
make[2]: Leaving directory '/home/tefo/test/openwrt'
target/Makefile:17: recipe for target '/home/tefo/test/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.target_install' failed
make[1]: *** [/home/tefo/test/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/tefo/test/openwrt'
/home/tefo/test/openwrt/include/toplevel.mk:171: recipe for target 'world' failed
make: *** [world] Error 2

You wrote, that the locations of the replacement files are in written down in the comments, but I didnt find this comments.
Could you explain it in little more detail, where to replace the files and what I have to consider for a proper compiler run?

In addition, how I can upload the compiled image - do I need a programmer, or just per webfrontend of the stock firmware?

Thank you..

The discussion might have continued from here.