This invention relates to an automatic
software update method based on an in-vehicle
embedded operating system, belonging to the field of
computer software technology. It solves the problem that existing methods cannot simultaneously achieve reliable
system startup and flexible, secure automatic
software updates. The method includes: partitioning the physical disk into a
system root partition, a user data partition, and an OverlayFS working partition; automatically entering safe mode by detecting kernel boot parameters, mounting the
system root partition as read-only, and mounting specified directories as read-write overlays based on the OverlayFS
file system and
whitelist configuration files; dynamically switching the safe mode on and off via system services and command lines; upon detecting an external update device, entering
maintenance mode, performing security
verification on the update
package from the external update device, and then performing an atomic update operation on the user data partition. This achieves both reliable
operating system startup and flexible automatic
software updates.