Changing some default values before compilation

Hi,

I want to change the following before compiling the image from source code

  • root password (default value is empty, i want to change it to a specific password)
  • WiFi is enabled (default is that WiFi interfaces are disabled)
  • wifi SSID (default value is OpenWrt, I want to change it to another name)

I know that I can change the last two options through creating custom files under 'files/etc/config' folder as explained here, but I want to know where I can change those value in the main source code itself.

Thank you in advance.

Modify /package/base-files/files/etc/shadow accordingly.

IIRC the wifi configuration is dynamically created at first boot. As such, adding a uci-defaults script to change the settings after they are created is probably the best way.

(It's also possible to set a root password this way, and then you can keep your customisations in a stack of uci-default scripts without having to edit the source every time you compile. You may not even have to compile from scratch at all, as uci-default scripts can be included with images built by the image builder, online or offline.)

Here is the dynamic config generation script in source code:

Look this patch: https://github.com/openwrt-xiaomi/openwrt/commit/1e7373834f7b961d4716fc675906ac5cec629023

UPD: https://github.com/openwrt-xiaomi/openwrt/commit/1a718825f0186d50a767b16074ea1fd62fd1a8a9