Posted: Tue May 07, 2019 1:05 Post subject: Optware: Duplicate UI elements when bind mounting /jffs/etc
Hi All,
In order to use Optware packages for some custom kid internet controls that I scripted to run on my router (Alexa + IFFTT + JSON web service), I have to have a writeable /etc, /bin, etc. directories. In order to accomplish this, I do the seemingly recommended steps of copying /etc/* to /jffs/etc/ as part of my USB flash drive mounting script:
/bin/cp -fa /etc/* /jffs/etc/
/bin/cp -fa /bin/* /jffs/bin/
/bin/cp -fa /lib/* /jffs/lib/
/bin/cp -fa /usr/* /jffs/usr/
/bin/mount -o bind /jffs/etc /etc
/bin/mount -o bind /jffs/bin /bin
/bin/mount -o bind /jffs/lib /lib
/bin/mount -o bind /jffs/usr /usr
While everything works as normal on the router, the one problem that I have is that the web GUI has duplicate UI elements. It seems that having the /etc/www file in both /etc and /jffs/etc causes the "Services/Services" and "Administration/Management" tabs to have the same UI config elements repeated 2x. Any edits done on the page when it's displayed in this manner causes unexpected problems in the nvram as well (typically empties out settings, breaking my config).
I've found that I have to unmount the USB disk and remove it before I can make config changes on these two pages.
I've searched high and low and it doesn't seem like anyone else has run into this issue.
I have to say, I've never seen anyone who needed to bind that many folders on the router. In a way, I'm not surprised it's leading to problems.
It's only /etc that causes problems, and only with the www file. Even if I run "/bin/rm /jffs/etc/www" before I do the bind mount of /etc, I still get the duplicate UI problem.
It's only /etc that causes problems, and only with the www file. Even if I run "/bin/rm /jffs/etc/www" before I do the bind mount of /etc, I still get the duplicate UI problem.
As a test, I removed all other copies of the "www" file from the USB file system, disabled the "cp -fa ..." command in my mount script and rebooted.
Whenever the /etc/ directory is bind-mounted, the UI doubling issue is there. I really don't understand how though.
Mounting was done via a startup script. I never had the copy lines in there though. I only ever removed the drive when upgrading DD-WRT and then copy the etc folder over manually, in particular the www folder.