What's new

compiling firmware for rt-ac68p --> fix dms_rescan=0

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

followmsi

Regular Contributor
I have compiled a new firmware for the RT-AC68P - based on Merlin version 378.56_2.
( https://github.com/RMerl/asuswrt-merlin/wiki/Compile-Firmware-from-source-using-Ubuntu )

Is it correct to use the "make rt-ac68u" switch .. also for the rt-ac68p version ?
The 4709 chip which seems to be used in the rt-ac68p is also supported with the "make rt-ac68u" parameter ?
Just to confirm ;)

The purpose of the own compilation is a problem with dms_rescan which is deleting the complete .minidlna folder on every restart/reboot.
If you set "nvram set dms_rescan=0" the .minidlna "files.db" should not be deleted while restarting/rebooting.

I hope the code change below will fix this problem permanently ..

If you a big USB-disk attached with a lot of files .. minidlna is scanning for ages. :)

To (hopefully) fix this .. I have changed 2 lines in the following file :

https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/rc/usb.c

// it is called by rc only
void force_stop_dms(void)
{
killall_tk(MEDIA_SERVER_APP);

// fix dms_rescan=0
//
eval("rm", "-rf", nvram_safe_get("dms_dbdir"));

}

Then I have compiled the new image .. RT-AC68U_378.56_2.trx

But the file size differs to the original build from merlin.

31903744 bytes -> original Merlin .trx
31907840 bytes -> my "special version" .trx

The file size difference (4096 bytes) seems a little bit too much for the small changes I have done.

Is this file size difference normal ?
Did I screw up my compilation ? :)

I dont´t want to brick the device straight on the first run :)

Thanks for your comments !
 
Hi.....compiled size will change depending on what development environment you use. Go for it!

One piece of advice. Just for safety as a developer now :), have a copy of the ASUS firmware restoration utility installed and ready to go. There have been times where some more complex fixes I've worked on were bugged and boot looped the router. The restoration utility always got me out of it.
 
The AC68P uses the exact same firmware as the AC68U. There's no separate build profile for it.
 
@john9527 @RMerlin

Thanks a lot for your answers !

It works like a charm .. I am a developer :)

Also the expected behaviour .. minidlna is scanning only once - and not anymore.

service restart_dms or full system reboot and the db still exists - Yes, baby !
Like in Johns fork - like it should be with dms_rescan=0.

I am so happy .. so happy that I will build the next build right now. :)

Same file :

https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/rc/usb.c
e.g.
https://github.com/john9527/asuswrt-merlin/blob/374.43_2-update/release/src/router/rc/usb.c

One more from Johns build .. the "album_art_names" - the extended version.

"album_art_names=Folder.jpg/folder.jpg/Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Thumb.jpg/thumb.jpg\n",

As well I will change the following typo (?) on my own .. the missing "s" in files.db

/* if previous dms_dbdir there, use it */
if(!strcmp(dbdir_t, nvram_default_get("dms_dbdir"))) {
sprintf(dbfile, "%s/files.db", dbdir_t);
if (check_if_file_exist(dbfile)) {
strcpy(dbdir, dbdir_t);
found = 1;

Hopefully I will not need the ASUS Firmware Restoration tool and it will just work like before.
The new "build" is just compiling .. ;)

Thanks again !

Cheers
 
One last update ... it just works !
I am so happppppy ... :)

If someone likes to have the "dms_rescan=0" fixed firmware version, please let me know.

Big thanks to @RMerlin and @john9527 for all their hard work and helping hands !
 
Here's what I did. My patch remove all traces of MiniDLNA from the Asuswrt-Merlin firmware. Then I install MiniDLNA from the Entware-ng repository for easy upgrades in the future.

cd ~/asuswrt-merlin
patch -p2 -i ../asuswrt-merlin-380.57-arm-nodms.patch
cd ~/asuswrt-merlin/release/src-rt-6.x.4708
make clean
rm .config
make rt-ac68u


~/asuswrt-merlin/asuswrt-merlin-380.57-arm-nodms.patch
Code:
diff -u -r -B -X ./excludes.txt ./asuswrt-merlin-380.57-original/release/src-rt-6.x.4708/target.mak ./asuswrt-merlin-380.57/release/src-rt-6.x.4708/target.mak
--- ./asuswrt-merlin-380.57-original/release/src-rt-6.x.4708/target.mak 2015-12-24 16:18:19.000000000 -0500
+++ ./asuswrt-merlin-380.57/release/src-rt-6.x.4708/target.mak  2016-01-14 08:36:39.541834089 -0500
@@ -1,6 +1,6 @@
# Broadcom MIPS platform
export RT-N66U := IPV6SUPP=y HTTPS=y MIPS32=r2 BCM57=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y SAMBA3=y \
-                  MEDIASRV=y MODEM=y MODEMPIN=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y WEBDAV=y CLOUDSYNC=y \
+                  MEDIASRV=n MODEM=y MODEMPIN=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y WEBDAV=y CLOUDSYNC=y \
                   USB="USB" GRO=n APP="nolocaldm" BUILD_NAME="RT-N66U" DNSMQ=y LFP=y NVRAM_64K=y NFS=y STAINFO=y \
                   RTN66U=y BECEEM=y ODMPID=y OPENVPN=y OPTIMIZE_XBOX=y JFFS2=y SSH=y DISK_MONITOR=y BCMWL6=y \
                   USER_LOW_RSSI=y  TIMEMACHINE=n MDNS=n VPNC=y JFFS2LOG=n DROPBOXCLIENT=y FTPCLIENT=y SAMBACLIENT=y \
@@ -10,7 +10,7 @@
                   TOR=y UPNPIGD2=n DNSSEC=y
export RT-AC66U := IPV6SUPP=y HTTPS=y MIPS32=r2 BCM57=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y SAMBA3=y STAINFO=y \
-                   MEDIASRV=y MODEM=y MODEMPIN=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y WEBDAV=y CLOUDSYNC=y \
+                   MEDIASRV=n MODEM=y MODEMPIN=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y WEBDAV=y CLOUDSYNC=y \
                    USB="USB" GRO=n APP="nolocaldm" BUILD_NAME="RT-AC66U" DNSMQ=y LFP=y NVRAM_64K=y ROG=y \
                    RTAC66U=y BCMWL6=y BCMNAND=y PROXYSTA=y BECEEM=y ODMPID=y OPENVPN=y JFFS2=y AUTODICT=y \
                    SSH=y BOOTLZMA=y DUAL_TRX=n DISK_MONITOR=y OPTIMIZE_XBOX=y NFS=y USER_LOW_RSSI=y SNMPD=y \
@@ -19,7 +19,7 @@
                    REBOOT_SCHEDULE=y TFAT=n HFS="none" NTFS="paragon" \
                    IPSEC=y REPEATER=y DUALWAN=y YANDEXDNS=n DNSFILTER=y SAMBA36=y DNSSEC=y
-export RT-N16 := IPV6SUPP=y  HTTPS=y MIPS32=r2 BBEXTRAS=y USBEXTRAS=y EBTABLES=y SAMBA3=y MEDIASRV=y SWEBDAVCLIENT=y \
+export RT-N16 := IPV6SUPP=y  HTTPS=y MIPS32=r2 BBEXTRAS=y USBEXTRAS=y EBTABLES=y SAMBA3=y MEDIASRV=n SWEBDAVCLIENT=y \
                  MODEM=y MODEMPIN=y PARENTAL2=y ACCEL_PPTPD=y DNSMQ=y PRINTER=y WEBDAV=y CLOUDSYNC=y AUTODICT=y \
                  USB="USB" APP="nolocaldm" BUILD_NAME="RT-N16" BECEEM=y JFFS2=y SSH=y DISK_MONITOR=y NFS=y ROG=y \
                  USER_LOW_RSSI=y  TIMEMACHINE=n MDNS=n VPNC=y JFFS2LOG=n DEBUGFS=n DROPBOXCLIENT=y SNMPD=n \
@@ -27,7 +27,7 @@
# Broadcom ARM platform
export RT-AC68U_BASE := IPV6SUPP=y HTTPS=y ARM=y BCM57=y AUTODICT=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y \
-                        SAMBA3=y MEDIASRV=y MODEM=y MODEMPIN=y BECEEM=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y STAINFO=y \
+                        SAMBA3=y MEDIASRV=n MODEM=y MODEMPIN=y BECEEM=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y STAINFO=y \
                         WEBDAV=y CLOUDSYNC=y USB="USB" GRO=y APP="nolocaldm" PROXYSTA=y FTPCLIENT=y SAMBACLIENT=y \
                         DNSMQ=y SHP=y NVRAM_64K=y RTAC68U=y BCMWL6=y BCMWL6A=y TUNEK="n" BCM5301X=y DISK_MONITOR=y \
                         BTN_WIFITOG=y TURBO=y BCM4352_5G=y OPTIMIZE_XBOX=y ODMPID=y LED_BTN=y ROG=y SSD=n EMAIL=y \
@@ -46,7 +46,7 @@
export RT-AC69U += BUILD_NAME="RT-AC69U" XHCIMODE=y
export RT-AC56U := IPV6SUPP=y HTTPS=y ARM=y BCM57=y AUTODICT=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y ROMCCODE=y \
-                   SAMBA3=y MEDIASRV=y MODEM=y MODEMPIN=y BECEEM=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y STAINFO=y \
+                   SAMBA3=y MEDIASRV=n MODEM=y MODEMPIN=y BECEEM=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y STAINFO=y \
                    WEBDAV=y CLOUDSYNC=y USB="USB" GRO=y APP="nolocaldm" BUILD_NAME="RT-AC56U" PROXYSTA=y BCM_RECVFILE=y \
                    DNSMQ=y SHP=y NVRAM_64K=y RTAC56U=y BCMWL6=y BCMWL6A=y TUNEK="n" BCM5301X=y DISK_MONITOR=y \
                    BTN_WIFITOG=y TURBO=y BCM4352_5G=y LANWAN_LED=y OPTIMIZE_XBOX=y ODMPID=y BCMSMP=y DROPBOXCLIENT=y \
@@ -58,7 +58,7 @@
                    DNSSEC=y
export RT-AC87U := IPV6SUPP=y HTTPS=y ARM=y BCM57=y AUTODICT=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y WPS_DUALBAND=y ROG=y \
-                   SAMBA3=y MEDIASRV=y MODEM=y MODEMPIN=y BECEEM=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y STAINFO=y \
+                   SAMBA3=y MEDIASRV=n MODEM=y MODEMPIN=y BECEEM=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y STAINFO=y \
                    WEBDAV=y CLOUDSYNC=y USB="USB" GRO=y APP="installed" BUILD_NAME="RT-AC87U" PROXYSTA=y \
                    DNSMQ=y SHP=y NVRAM_64K=y BCMWL6=y BCMWL6A=y TUNEK="n" BCM5301X=y DISK_MONITOR=y JFFS2=y BCM_RECVFILE=y \
                    BTN_WIFITOG=y BCM4352_5G=y OPTIMIZE_XBOX=y ODMPID=y LED_BTN=y LED2_BTN=y LED_BTN_MODE=y DUMP_OOPS_MSG=y \
@@ -69,7 +69,7 @@
                    SWEBDAVCLIENT=y FTPCLIENT=y SAMBACLIENT=y TEMPROOTFS=y JFFS2ND_BACKUP=y SNMPD=y TOR=y REBOOT_SCHEDULE=y \
                    TFAT=y HFS="tuxera" NTFS="tuxera" NFS=y SSH=y IPSEC=n DNSFILTER=y SAMBA36=y UPNPIGD2=n DNSSEC=y
-export RT-AC3200 := IPV6SUPP=y HTTPS=y ARM=y BCM57=y AUTODICT=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y SAMBA3=y MEDIASRV=y \
+export RT-AC3200 := IPV6SUPP=y HTTPS=y ARM=y BCM57=y AUTODICT=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y SAMBA3=y MEDIASRV=n \
                     MODEM=y MODEMPIN=y BECEEM=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y WEBDAV=y CLOUDSYNC=y SWEBDAVCLIENT=y \
                     USB="USB" GRO=y APP="installed" BUILD_NAME="RT-AC3200" PROXYSTA=y DNSMQ=y SHP=y NVRAM_64K=y STAINFO=y \
                     RTAC3200=y BCMWL6=y BCMWL6A=y BCM7=y TUNEK="n" BCM5301X=y DISK_MONITOR=y BTN_WIFITOG=y OPTIMIZE_XBOX=y \
@@ -81,7 +81,7 @@
                     ADBLOCK=n NFS=y IPSEC=n DNSFILTER=y SAMBA36=y SNMPD=y TOR=y UPNPIGD2=n DNSSEC=y
-export RT-AC88U_BASE := IPV6SUPP=y HTTPS=y ARM=y BCM57=y AUTODICT=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y SAMBA3=y MEDIASRV=y \
+export RT-AC88U_BASE := IPV6SUPP=y HTTPS=y ARM=y BCM57=y AUTODICT=y BBEXTRAS=y USBEXTRAS=y EBTABLES=y SAMBA3=y MEDIASRV=n \
                         MODEM=y MODEMPIN=y BECEEM=y PARENTAL2=y ACCEL_PPTPD=y PRINTER=y WEBDAV=y CLOUDSYNC=y SWEBDAVCLIENT=y \
                         USB="USB" GRO=y APP="installed" DNSMQ=y SHP=y BCMWL6=y BCMWL6A=y TUNEK="n" BCM5301X=y \
                         DISK_MONITOR=y BTN_WIFITOG=y OPTIMIZE_XBOX=y LED_BTN=y ODMPID=y BCMSMP=y XHCI=y \
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top