OpenWrt Forum Archive

Topic: [Ticket] Make it possible to disable USB_SUPPORT and AUDIO_SUPPORT

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

I have TP-LINK TL-WR841ND wireless router. Its chip supports USB, however,
TL-WR841ND does not have a physical USB port (although its possible to add through a hardware mod, only a few people have done it)

For all the routers with this chip, USB_SUPPORT (and AUDIO_SUPPORT, which depends on USB_SUPPORT) - are enabled and hardcoded in target/Config.in file. They can't be disabled through "make menuconfig", the only way to disable them is by manually editing target/Config.in to comment these lines:

# config AUDIO_SUPPORT <--- commented both lines
#        bool <--- commented both lines
config PCI_SUPPORT
# select AUDIO_SUPPORT <--- only this line is commented
bool
# config USB_SUPPORT <--- all three lines are commented
#        select AUDIO_SUPPORT <--- all three lines are commented
#        bool <--- all three lines are commented

Why this is a problem? TL-WR841ND has a small flash chip - just 4MB, quite hard to fit all the good stuff there. By disabling the unnecessary USB_SUPPORT and AUDIO_SUPPORT options, for a device which does not have USB port (without a hardware mod), I save about 100-150 KB which is HUGE ! Probably some people who has another router with USB port, but dont use this port, would want to disable these options to save space

dear OpenWRT developer, please:
1) Make it possible to enable/disable these options from menuconfig
2) Disable these options by default for the routers without a hardware USB port (like TL-WR841ND), but let them to be enabled just in case someone has done a hardware mod

P.S. posting this ticket here because the official place for OpenWRT tickets does not allow a registration for new users (Trac anti-spam system bans you even if you successfully enter the captcha code!)

(Last edited by mward15 on 8 Jan 2017, 13:14)

Delete .config (don't forget to make a backup first, in necessary).

Run make menuconfig and select the Target System (Atheros AR7xxx/AR9xxx) and the target Profile for your router and save and exit. Run make defconfig and make menuconfig again.

When I do this, nothing is selected, even while CONFIG_AUDIO_SUPPORT=Y in .config. I would not edit the Config.in files, if I were you; you might break something.

If you cannot disable an option in menuconfig, it's probably because you have selected something else that depends on that option. Select < Help > in menuconfig when on that option and you can see what it selects and by what it is selected.

(Last edited by maartenjd on 8 Jan 2017, 18:07)

It's because selecting that platform probably enables USB_SUPPORT=y or something similar.

You can always hit ? in the buildroot when your cursor sits on the symbol in question (in make menuconfig). THat will show you what needs or enables it, so you can do a more targeted search.

Borromini wrote:

It's because selecting that platform probably enables USB_SUPPORT=y or something similar.

It does just that.
https://github.com/openwrt/openwrt/blob … g-4.4#L425
CONFIG_USB_SUPPORT=y

Deleting that line is the "correct" (or easy) way to disable USB support.

I'm also interested in this.  My Trendnet TEW732BR v1.x board is reported to have a usb pin holes that are unpopulated with the actual usb socket.  I'm a little less compulsive, compared to the OP, about the flash/ram as the TEW732BR has 8mb flash and 64mb ram.  Still, I think the purpose of the project is to be able to tailor the firmware to the hardware - one size does not always fit all.

As an aside, If one were to attempt to optimize an AR71xx build for the TEW732BR, what is the recommended Build Platform - I mainly use OpenBSD.  My favorite Linux is Debian but my attempts with the build script in Debian amd64 Testing segfaulted.

(Last edited by shep on 9 Jan 2017, 04:11)

The discussion might have continued from here.