Login
You're viewing the functional.cafe public feed.
  • Nov 11, 2026, 11:53 PM

    From now on, /etc/uci-defaults is my mortal enemy

    💬 1🔄 0⭐ 0

Replies

  • Nov 12, 2026, 12:24 AM

    So it seems OpenWrt config should be easy to version-control, right?
    Just
    ssh myrouter uci export > myrouter.conf
    git add myrouter.conf

    ...except it contains the defaults. Explicitly set, indistinguishable for something manually changed.

    And if I ever want to port my config to a newer OpenWrt version, or a different router with a different set of packages installed, I need to know which settings I changed on purpose, and which are just the defaults.

    💬 1🔄 1⭐ 0
  • Nov 12, 2026, 12:29 AM

    So, what's the problem? Just snapshot the settings of a freshly factory-reset router, and then diff your changes against that.

    Well, say hi to /etc/uci-defaults

    It's a directory any package can put scripts in

    And each of those scripts will run on every boot (and possibly also on other occasions) and try to set some uci settings. Until it succeeds, then that script won't run again.

    If you're lucky, it will only set the defaults in the file in /etc/config that belongs to the package it's from

    💬 1🔄 0⭐ 0
  • Nov 12, 2026, 12:33 AM

    But in most cases, that package won't have its own config, and the script will set things in another package's config - /etc/config/network, or system, or luci, etc.

    So if you ask "what is the default /etc/config/network", there isn't a single answer. The defaults can change every time you install a package.

    💬 1🔄 0⭐ 0
  • Nov 12, 2026, 12:36 AM

    On the plus side, I learnt one way how not to design a config system for a router xD

    💬 1🔄 0⭐ 0
  • Nov 12, 2026, 12:56 AM

    I have a newfound appreciation for systemd-style /run > /etc > /usr config layering

    💬 0🔄 0⭐ 0