openwrt-mirror/package/base-files/files
Andreas Gnau 26ba9b609b base-files: board_detect: make resilient against power-cuts
If board_detect is interrupted by cutting power on first boot,
board.json might only be half-way written and the file will not be
written again correctly on subsequent boots.

Write to a temporary file first, then rename. Since a rename on the same
file system is an atomic operation, it ensures that either
/etc/board.json does not exist or that the complete file exists.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/20831
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 21:51:25 +01:00
..
bin base-files: board_detect: make resilient against power-cuts 2025-11-25 21:51:25 +01:00
etc base-files: allow to skip unwanted scripts 2025-11-20 17:48:18 +01:00
lib base-files: add ucidef_set_interface_netdev_range function 2025-10-06 19:06:26 +02:00
rom rename default/ to files/ 2006-11-22 23:30:57 +00:00
sbin base-files: ignore initscript output in sysupgrade 2025-06-22 19:45:02 +01:00
usr base-files: allow platform_check_image to prevent --force 2025-04-21 16:12:42 +01:00