[LEDE-DEV] [RFC 00/12] Rework /etc/config/system generation

Jo-Philipp Wich jo at mein.io
Tue May 31 07:24:46 PDT 2016


Instead of shipping a base /etc/config/system and amending it in-place with
board_generate generate the entire file from scratch, similar to how we handle
the /etc/config/network file already.

This change series solves multiple problems:

 - Currently the generation of /etc/config/system is skipped if an
   /etc/config/network file exists already, leading to a missing LED setup
   when an image is built which already embeds a network config

 - It makes it easier for config_generate to detect whether the system
   config parts are already processed yet

 - It paves the way for future support of in-place updates, e.g. to migrate
   LED settings while keeping the rest of the config intact

 - It allows us to get rid of various target specific system config copies

While doing this rework I decided to generalize the ath25 button config
framework but I am not yet sure whether we should drop it instead as there
is /etc/rc.button/$BUTTON available which allows users and targets to ship
their own specific button handlers.

Jo-Philipp Wich (12):
  ath25: generalize button hotplug
  base-files: support button actions through board.d
  ath25: register button actions through board.d
  ath25: remove target specific /etc/config/system
  base-files: support hostname and ntp servers through board.d
  xburst: add /etc/config/system overrides via board.d
  xburst: remove target specific /etc/config/system
  base-files: support port_state LED types in board.d
  adm5120: convert LED setup to board.d
  adm5120: remove target specific /etc/config/system
  base-files: rework config generation logic
  base-files: drop /etc/config/system

 package/base-files/files/bin/board_detect          |   6 +-
 package/base-files/files/bin/config_generate       | 107 ++++++++++++++++++---
 package/base-files/files/etc/config/system         |  12 ---
 .../files/etc/hotplug.d/button/00-button           |  24 +++++
 .../base-files/files/lib/functions/uci-defaults.sh |  58 +++++++++++
 .../linux/adm5120/base-files/etc/board.d/01_leds   |  17 ++++
 target/linux/adm5120/base-files/etc/config/system  |  40 --------
 target/linux/ath25/base-files/etc/board.d/01_leds  |  13 ---
 .../linux/ath25/base-files/etc/board.d/01_system   |  16 +++
 target/linux/ath25/base-files/etc/config/system    |  23 -----
 .../base-files/etc/hotplug.d/button/00-button      |  24 -----
 .../linux/xburst/base-files/etc/board.d/01_system  |  12 +++
 target/linux/xburst/base-files/etc/config/system   |   3 -
 13 files changed, 225 insertions(+), 130 deletions(-)
 delete mode 100644 package/base-files/files/etc/config/system
 create mode 100644 package/base-files/files/etc/hotplug.d/button/00-button
 create mode 100755 target/linux/adm5120/base-files/etc/board.d/01_leds
 delete mode 100644 target/linux/adm5120/base-files/etc/config/system
 delete mode 100755 target/linux/ath25/base-files/etc/board.d/01_leds
 create mode 100755 target/linux/ath25/base-files/etc/board.d/01_system
 delete mode 100644 target/linux/ath25/base-files/etc/config/system
 delete mode 100644 target/linux/ath25/base-files/etc/hotplug.d/button/00-button
 create mode 100755 target/linux/xburst/base-files/etc/board.d/01_system
 delete mode 100644 target/linux/xburst/base-files/etc/config/system

-- 
2.1.4




More information about the Lede-dev mailing list