Updating method and device of read-only root file system, electronic equipment and storage medium

Through the method of extracting, processing, copying, modifying and replacing the root file system image package, the problem of difficulty in quickly updating the read-only root file system in the prior art is solved, and the rapid update and accurate replacement of the root file system without relying on specific debugging interfaces and wire brushing tools are realized.

CN120066545APending Publication Date: 2025-05-30ECARX (HUBEI) TECHCO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510128647.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The prior art is difficult to quickly update the read-only root file system of the vehicle instrument service-related processor without relying on specific debugging interfaces and wire brushing tools, and it is difficult to accurately replace programs that require verification or testing.

Method used

By extracting the original root file system image package from the target storage partition to the terminal device, removing the header information of the firmware image package, copying the image file to the backup directory, modifying the target file, generating a new root file system image package, and replacing it in the target storage partition.

Benefits of technology

It realizes rapid updates to the root file system without relying on specific debugging interfaces and wire brushing tools, can be updated on the real car, and ensures accurate replacement of programs that require verification or testing without making any changes to other peripheral content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066545A_ABST
    Figure CN120066545A_ABST
Patent Text Reader

Abstract

The invention discloses an updating method and device of a read-only root file system, electronic equipment and a storage medium. The updating method of the read-only root file system comprises the steps that an original root file system mirror image package is extracted from a target storage partition to terminal equipment; processing the original root file system mirror image package at the terminal equipment to obtain a pure root file system mirror image package; copying a mirror image file in the pure root file system mirror image package to a backup directory of the terminal equipment; under the backup directory, determining a target file from the mirror image file, and modifying the content of the target file to obtain a modified target file; and generating a new root file system mirror image package based on the modified target file, and replacing the original root file system mirror image package in the target storage partition with the new root file system mirror image package. The purpose of quickly updating the root file system under the condition of not depending on a specific debugging interface and a line brush tool is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of updating read-only root file systems, and specifically relates to a method, device, electronic device, and storage medium for updating a read-only root file system. Background Art

[0002] Currently, the root file system of the processor related to the instrument business of a vehicle is a read-only file system, so the root file system cannot be directly updated, which is not conducive to debugging.

[0003] Currently, in order to update the read-only file system, R & D personnel need to compile the binary file of the file system as a whole, and then write the file system through a flashing tool. This method has many limitations: on the one hand, it is time-consuming; on the other hand, it needs to rely on a dedicated debug board for flashing, and basically no debug board interface is reserved on the actual vehicle, so it is basically difficult to implement the flashing method on the actual vehicle; in addition, it is also difficult to accurately replace the program that needs to be verified or tested without making any changes to other surrounding contents.

[0004] In view of this, the present application is specifically proposed. Summary of the Invention

[0005] The following gives a brief overview of one or more aspects to provide a basic understanding of these aspects. This overview is not an exhaustive survey of all contemplated aspects, and is neither intended to identify key or decisive elements of any or all aspects nor to define the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that follows.

[0006] The present application provides a method, device, electronic device, and storage medium for updating a read-only root file system, achieving the purpose of quickly updating the root file system without relying on a specific debug interface and flashing tool, and can achieve the purpose of updating the root file system on an actual vehicle; in addition, it can ensure accurate replacement of the program that needs to be verified or tested without making any changes to other surrounding contents.

[0007] In a first aspect, the present application provides a method for updating a read-only root file system, including the following steps:

[0008] Extract the original root file system image package from the target storage partition to the terminal device;

[0009] Process the original root file system image package on the terminal device to remove the data header information of the firmware image package, and obtain a pure root file system image package;

[0010] Copy the image files in the pure root file system image package to the backup directory of the terminal device;

[0011] Under the backup directory, determine a target file from the mirror file, and modify the content of the target file to obtain a modified target file;

[0012] Generate a new root file system image package based on the modified target file, and use the new root file system image package to replace the original root file system image package in the target storage partition.

[0013] Further, the extracting the original root file system image package from the target storage partition to the terminal device includes:

[0014] Establish a communication connection with the in-vehicle unit through the debugging application of the in-vehicle unit;

[0015] Obtain the highest authority of the in-vehicle unit by executing a first command in the command environment of the in-vehicle unit;

[0016] When the highest authority of the in-vehicle unit is obtained, extract the original root file system image package from the target storage partition of the in-vehicle unit to the terminal device by executing a command in the command environment of the in-vehicle unit.

[0017] Further, the extracting the original root file system image package from the target storage partition of the in-vehicle unit to the terminal device by executing a command in the command environment of the in-vehicle unit includes:

[0018] When the highest authority of the in-vehicle unit is obtained, extract the original root file system image package from the target storage partition of the in-vehicle unit by executing a second command in the command environment of the in-vehicle unit, and save the extracted original root file system image package to the target location of the in-vehicle unit;

[0019] Copy the original root file system image package saved at the target location of the in-vehicle unit to the terminal device by executing a third command in the command environment of the in-vehicle unit.

[0020] Further, the processing the original root file system image package on the terminal device to remove the data header information of the firmware image package to obtain a pure root file system image package includes:

[0021] Remove the data header information of the firmware image package from the original root file system image package by executing a fourth command in the command environment of the in-vehicle unit to obtain a pure root file system image package, and save the pure root file system image package.

[0022] Further, the copying the mirror file in the pure root file system image package to the backup directory of the terminal device includes:

[0023] Copy the mirror file in the pure root file system image package to the backup directory of the terminal device by executing a fifth command in the command environment of the in-vehicle unit.

[0024] Further, generating a new root file system image package based on the modified target file includes:

[0025] Generating a new pure root file system image package based on the modified target file;

[0026] Adding data header information of the firmware image package to the new pure root file system image package to obtain a new root file system image package.

[0027] Further, using the new root file system image package to replace the original root file system image package in the target storage partition includes:

[0028] Pushing the new root file system image package to a set position of the in-vehicle computer;

[0029] Copying the new root file system image package from the set position of the in-vehicle computer, and using the copied new root file system image package to replace the original root file system image package in the target storage partition.

[0030] In a second aspect, the present application further provides an updating device for a read-only root file system, including:

[0031] An extraction module, configured to extract an original root file system image package from a target storage partition to a terminal device;

[0032] A processing module, configured to process the original root file system image package on the terminal device to remove data header information of the firmware image package, so as to obtain a pure root file system image package;

[0033] A copying module, configured to copy the image files in the pure root file system image package to a backup directory of the terminal device;

[0034] A modification module, configured to determine a target file from the image files in the backup directory, and modify the content of the target file to obtain a modified target file;

[0035] A replacement module, configured to generate a new root file system image package based on the modified target file, and use the new root file system image package to replace the original root file system image package in the target storage partition.

[0036] In a third aspect, the present application further provides an electronic device, where the electronic device includes:

[0037] One or more processors;

[0038] A storage device, configured to store one or more programs;

[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for updating the read-only root file system as described above.

[0040] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the method for updating the read-only root file system as described above.

[0041] The method for updating the read-only root file system disclosed in the present application can directly update some files in the original root file system image package without the need to re-create a new version of the root file system. The corresponding technical means are as follows: extracting the original root file system image package from the target storage partition to the terminal device; processing the original root file system image package on the terminal device to remove the data header information of the firmware image package to obtain a pure root file system image package; copying the image files in the pure root file system image package to the backup directory of the terminal device; in the backup directory, determining the target file from the image files, and modifying the content of the target file to obtain the modified target file; generating a new root file system image package based on the modified target file, and using the new root file system image package to replace the original root file system image package in the target storage partition. It can maintain the original system environment to the greatest extent, achieve the purpose of quickly updating the root file system without relying on a specific debugging interface and a wire brushing tool, and can achieve the purpose of updating the root file system on a real vehicle; in addition, it can ensure accurate replacement of the programs that need to be verified or tested without making any changes to other surrounding content. Further, when multiple debugging and verification are required, the steps of "extracting the original root file system image package from the target storage partition to the terminal device; processing the original root file system image package on the terminal device to remove the data header information of the firmware image package to obtain a pure root file system image package, and copying the image files in the pure root file system image package to the backup directory of the terminal device" only need to be executed once, and only need to execute the steps of "in the backup directory, determining the target file from the image files, and modifying the content of the target file to obtain the modified target file; generating a new root file system image package based on the modified target file, and using the new root file system image package to replace the original root file system image package in the target storage partition" multiple times according to the requirements during multiple debugging and verification processes. In this way, the time spent on debugging and verification can be saved, which is beneficial to improving the debugging and verification efficiency. Description of the Drawings

[0042] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0043] Figure 1 Schematic flow of an update method for a read-only root file system provided by an embodiment of the present application Figure 1 ;

[0044] Figure 2 Schematic flow of an update method for a read-only root file system provided by an embodiment of the present application Figure 2 ;

[0045] Figure 3 Schematic structural diagram of an update device for a read-only root file system provided by an embodiment of the present application;

[0046] Figure 4 Schematic structural diagram of an electronic device in an embodiment of the present application. Detailed implementation manners

[0047] The following will further elaborate on the present application in combination with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. Additionally, it should be noted that for the convenience of description, only the parts related to the invention are shown in the accompanying drawings.

[0048] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The following will detail the present application with reference to the accompanying drawings and embodiments.

[0049] Figure 1 Schematic flow diagram of an update method for a read-only root file system proposed by the present application. This method is applicable to updating the read-only root file system of Linux. Typically, it can be applied to the read-only root file system of the processor corresponding to the in-vehicle instrument. Currently, the root file system (ROOTFS) of the E04 (SE1000) instrument side Linux is EROFS (Enhanced-Read-Only File System), so the root file system cannot be directly updated like Android through commands such as "adbroot / adb remount" for debugging. Therefore, the update method for the read-only root file system provided by the present application can solve this problem.

[0050] Specifically, the method for updating the read-only root file system can be executed by an update device for the read-only root file system. The update device for the read-only root file system can be implemented in the form of software and / or hardware and integrated into a terminal device (such as a computer).

[0051] As Figure 1 shown, the method for updating the read-only root file system includes the following steps:

[0052] S110. Extract the original root file system image package from the target storage partition to the terminal device.

[0053] Exemplarily, the original root file system image package is an enhanced read-only file system EROFS image package. The extracting the original root file system image package from the target storage partition to the terminal device includes: establishing a communication connection with the in-vehicle unit through the debugging application of the in-vehicle unit; obtaining the highest privilege of the in-vehicle unit by executing a first command in the command environment of the in-vehicle unit; and extracting the original root file system image package from the target storage partition of the in-vehicle unit to the terminal device by executing a command in the command environment of the in-vehicle unit when the highest privilege of the in-vehicle unit is obtained.

[0054] Among them, the terminal device can be a computer, and the debugging application of the in-vehicle unit can be ADB (Android Debug Bridge). Through ADB, the computer can establish a communication connection with the in-vehicle unit for debugging and file transfer. Specifically, turn on the in-vehicle unit debugging interface. If it is a debugging vehicle, the in-vehicle unit debugging interface can be turned on through the debugging switch; if it is a commercial vehicle, generally, the connection is achieved through the vehicle diagnosis DID (Data Identifier). The debugging interface of the commercial vehicle is generally protected when it leaves the factory, so the connection needs to be achieved through the vehicle diagnosis DID. Execute a command on the computer to extract the original root file system image. Specifically, the command "adb root:" is used to obtain the highest privilege (root privilege) of the in-vehicle unit device. Only after obtaining the highest privilege of the in-vehicle unit device can it be allowed to access and modify its root system files. Enter the command line interface of the in-vehicle unit through the command "adb shell". The dd command is used to extract the original root file system image (cp_rootfs_a) from the specified device partition and save it to a location of the in-vehicle unit, such as / data / cp_rootfs.img. dd is a low-level command used to copy data. For example, the following command can be used to extract the original root file system image package cp_rootfs_a from the target storage partition / dev / block / of the in-vehicle unit to / data / cp_rootfs.img of the in-vehicle unit.

[0055] adb shell dd if= / dev / block / by-name / cp_rootfs_a of= / data / cp_rootfs.img&&sync.

[0056] Furthermore, the files in / data / cp_rootfs.img of the in-vehicle unit are copied to the local computer through the command "adb pull / data / cp_rootfs.img. / " for subsequent processing. In particular, the above several steps (the steps for copying the original root file system image to the computer) usually only need to be executed once during debugging or testing. During the debugging process, only the files copied to the local computer need to be continuously updated. In this way, the debugging time can be saved and the debugging efficiency can be improved.

[0057] Generally speaking, extracting the original root file system image package from the target storage partition of the in-vehicle unit to the terminal device by executing commands in the command environment of the in-vehicle unit includes: when obtaining the highest permission of the in-vehicle unit, extracting the original root file system image package from the target storage partition of the in-vehicle unit by executing the second command in the command environment of the in-vehicle unit, and saving the extracted original root file system image package to the target location of the in-vehicle unit; copying the original root file system image package saved at the target location of the in-vehicle unit to the terminal device by executing the third command in the command environment of the in-vehicle unit.

[0058] By connecting the computer to the in-vehicle unit and copying the root file system image of the in-vehicle unit to the computer for modification, the purpose of quickly updating the root file system without relying on specific debugging interfaces and flashing tools can be achieved, and the purpose of updating the root file system on the actual vehicle can be achieved.

[0059] S120. Process the original root file system image package on the terminal device to remove the data header information of the firmware image package and obtain a pure root file system image package.

[0060] Among them, the data header information of the firmware image package usually includes ToC (Table of Contents) header file data and ToC entry data. The ToC header file data includes the name of ToC, the data currently used for verifying the header; serial_number: a non-zero number provided by the creation tool, used to identify information such as the version or batch of the firmware image package; flags: flag bits related to this data. The ToC entry data includes the predefined universal unique identifier uuid, the offset address of the corresponding payload data in the FIP file, the byte size of the corresponding payload data, and the flag bits flags related to the entry. The uuid is used to uniquely identify each file or payload. After removing the data header information of the firmware image package, it is the real root file part.

[0061] Exemplarily, when the terminal device processes the original root file system image package to remove the data header information of the firmware image package and obtain a pure root file system image package, it includes: by executing a fourth command in the command environment of the in-vehicle computer, removing the data header information of the firmware image package from the original root file system image package to obtain a pure root file system image package, and saving the pure root file system image package.

[0062] Specifically, the following fourth command is used to remove 4KB (this value may vary in different scenarios and can be flexibly modified) of the FIP (Firmware Image Package) data header information to obtain a pure root file system image package (i.e., the real root file system):

[0063] dd if=cp_rootfs.img bs=1024 skip=4 of=erofs_rootfs.img.

[0064] Furthermore, the pure root file system image package is mounted on a local directory through the mount command to display each image file in the pure root file system image package.

[0065] S130. Copy the image files in the pure root file system image package to the backup directory of the terminal device.

[0066] Since the image files in the pure root file system image package are read-only files and cannot be directly modified, they are backed up to the backup directory through a copy operation (which can be achieved through the bash command), and the image files are modified under the backup target.

[0067] Generally, by executing a fifth command in the command environment of the in-vehicle computer, the image files in the pure root file system image package are copied to the backup directory of the terminal device.

[0068] S140. In the backup directory, determine the target file from the image files and modify the content of the target file to obtain the modified target file.

[0069] For example, the following command is used to modify the bak file.

[0070] sudo vi. / erofs_root_bak / erofs_root / lib / systemd / system / file_a.service.

[0071] Among them, vi represents a text editor, and the bak file can be opened and modified through vi.

[0072] That is, modify the file that needs to be modified, without modifying the other irrelevant files, which can ensure accurate replacement of the program to be verified or tested, without making any changes to other surrounding content, and can maintain the original system environment to the greatest extent.

[0073] S150. Generate a new root file system image package based on the modified target file, and use the new root file system image package to replace the original root file system image package in the target storage partition.

[0074] Exemplarily, generating a new root file system image package based on the modified target file includes:

[0075] Generate a new pure root file system image package based on the modified target file; add the data header information of the firmware image package to the new pure root file system image package to obtain a new root file system image package.

[0076] Specifically, use the command mkfs.erofs to generate a new pure root file system image package based on the modified target file. The essence of this process is to arrange each image file as required to obtain a new pure root file system image package (cp_rootfs_new.img). The specific form of the command to implement this operation can be:

[0077] sudo mkfs.erofs cp_rootfs_new.img erofs_root_bak / erofs_root.

[0078] Furthermore, add back the data header information of the firmware image package that was removed before, so that the data header information of the firmware image package is combined with the new pure root file system image package to obtain a new root file system image package.

[0079] Specifically, the following command can be used to combine the data header information of the firmware image package and the new pure root file system image package (cp_rootfs_new.img) to obtain a new root file system image package: dd if=cp_rootfs_new.img bs=1024 seek=4 of=cp_rootfs.img.

[0080] Exemplarily, using the new root file system image package to replace the original root file system image package in the target storage partition includes: pushing the new root file system image package to a set position of the in-vehicle computer; copying the new root file system image package from the set position of the in-vehicle computer, and using the copied new root file system image package to replace the original root file system image package in the target storage partition.

[0081] Specifically, the new root file system image package (cp_rootfs_new.img) can be pushed to the set position ( / data directory) of the in-vehicle computer through the following command: adb push. / cp_rootfs_new.img / data / .

[0082] Then, use the following command to replace the original root file system image package in the target storage partition ( / dev / block / by-name / cp_rootfs_a) with the new root file system image package: adb shell dd if= / data / cp_rootfs_new.img of= / dev / block / by-name / cp_rootfs_a && sync.

[0083] The method for updating the read-only root file system disclosed in the embodiments of the present application can directly update some files in the original root file system image package without the need to remanufacture a new version of the root file system. It can maintain the original system environment to the greatest extent, achieve the purpose of quickly updating the root file system without relying on specific debugging interfaces and flashing tools, and can achieve the purpose of updating the root file system on a real vehicle; in addition, it can ensure accurate replacement of the programs that need to be verified or tested without making any changes to other peripheral contents. Further, when multiple debugging and verification are required, the steps "S110 - S130" only need to be executed once, and only need to execute the steps "S140 - S150" multiple times according to requirements during multiple debugging and verification processes, so as to save the time spent on debugging and verification and is conducive to improving the debugging and verification efficiency.

[0084] Based on the above embodiments, referring to the Figure 2 flow chart of a method for updating a read-only root file system as shown, the specific steps are as follows:

[0085] S210. Turn on the ADB of the in-vehicle computer and connect it to the computer.

[0086] S220. Execute the following commands on the computer:

[0087] adb root

[0088] adb shell dd if= / dev / block / by-name / cp_rootfs_a of= / data / cp_rootfs.img && sync and pull out the dumped partition image through adb:

[0089] adb pull / data / cp_rootfs.img. / .

[0090] S230. Remove the 4K FIP data header information using the dd command:

[0091] dd if=cp_rootfs.img bs=1024 skip=4 of=erofs_rootfs.img

[0092] Then mount the erofs to the local:

[0093] mkdir erofs_root

[0094] sudo mount -t erofs erofs_rootfs.img erofs_root

[0095] Since erofs is a read-only file system, the content cannot be directly modified at the original mount point. It is necessary to back up the content of the original root file rootfs:

[0096] mkdir erofs_root_bak

[0097] sudo cp -arf erofs_root. / erofs_root_bak

[0098] S240. Modify or replace the program or script to be debugged, such as:

[0099] sudo vi. / erofs_root_bak / erofs_root / lib / systemd / system / file_a.service;

[0100] Save directly after modification.

[0101] S250. Regenerate the root file system image in erofs format with an FIP format data header:

[0102] sudo mkfs.erofs cp_rootfs_new.img erofs_root_bak / erofs_root

[0103] dd if=cp_rootfs_new.img bs=1024 seek=4 of=cp_rootfs.img

[0104] adb push. / cp_rootfs.img / data /

[0105] S260. Push it to the in-vehicle system via ADB and write it to the corresponding partition:

[0106] adb push. / cp_rootfs_new.img / data /

[0107] adb shell dd if= / data / cp_rootfs_new.img of= / dev / block / by-name / cp_rootfs_a && sync。

[0108] S270. After restarting the in-vehicle computer, perform verification or testing.

[0109] If the verification result or test result is not satisfied, return to S240 to continue modifying the relevant program or script. Therefore, during one verification or test process, S210 - S230 only needs to be executed once. Therefore, the read-only root file system update method proposed in this application has the advantages of short time consumption and high efficiency.

[0110] Figure 3 It is a schematic structural diagram of an update device for a read-only root file system provided by an embodiment of this application. As Figure 3 shown, the device includes: an extraction module 310, configured to extract the original root file system image package from the target storage partition to the terminal device; a processing module 320, configured to process the original root file system image package on the terminal device to remove the data header information of the firmware image package and obtain a pure root file system image package; a copying module 330, configured to copy the image files in the pure root file system image package to the backup directory of the terminal device; a modification module 340, configured to determine the target file from the image files in the backup directory and modify the content of the target file to obtain the modified target file; a replacement module 350, configured to generate a new root file system image package based on the modified target file and use the new root file system image package to replace the original root file system image package in the target storage partition.

[0111] The update device for the read-only root file system provided by the embodiments of this disclosure can execute the steps in the update method for the read-only root file system provided by the method embodiments of this disclosure, and the implementation steps and beneficial effects are not described herein again.

[0112] Figure 4 It is a schematic structural diagram of an electronic device in the embodiments of this disclosure. Specifically refer to Figure 4 , which shows a schematic structural diagram of an electronic device 500 suitable for implementing the embodiments of this disclosure. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and usage scope of the embodiments of this disclosure.

[0113] As Figure 3As shown, the electronic device 500 may include a processing device (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device 508 into a random access memory (RAM) to implement the method of the embodiments as described in this disclosure. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An I / O interface 505 is also connected to the bus 504. An input device 506, an output device 507, a storage device 508, and a communication device 509 are all connected to the I / O interface 505.

[0114] In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for executing the method shown in the flowchart, so as to implement the update method of the read-only root file system as described above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiments of the present disclosure are executed.

[0115] It should be noted that the computer-readable medium described above in the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0116] The above computer-readable medium may be included in the above electronic device; or it may exist separately and not be assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to execute the method steps in the present application.

[0117] Optionally, when the one or more programs are executed by the electronic device, the electronic device may also execute the other steps described in the above embodiments.

[0118] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0119] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0120] Specific examples are used herein to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only for helping to understand the method and its core idea of the present application. The above is only the preferred implementation manner of the present application. It should be noted that due to the limited nature of written expression and the objectively infinite specific structures, for those of ordinary skill in the art, without departing from the principles of the present application, several improvements, refinements, or changes can be made, or the above technical features can be combined in an appropriate manner; these improvements, refinements, changes, or combinations, or directly applying the inventive concept and technical solution to other occasions without improvement, should all be regarded as the protection scope of the present application.

Claims

1. A method for updating a read-only root file system, applied to a terminal device, characterized in that: include: Extract the original root file system image package from the target storage partition to the terminal device; Processing the original root file system image package on the terminal device to remove data header information of the firmware image package to obtain a pure root file system image package; Copy the image file in the pure root file system image package to the backup directory of the terminal device; In the backup directory, determining a target file from the image file, and modifying the content of the target file to obtain a modified target file; A new root file system image package is generated based on the modified target file, and the new root file system image package is used to replace the original root file system image package in the target storage partition.

2. The method for updating a read-only root file system according to claim 1, characterized in that: The step of extracting the original root file system image package from the target storage partition to the terminal device includes: Establish a communication connection with the vehicle computer through the vehicle computer's debugging application; By executing the first command in the command environment of the vehicle computer, the highest authority of the vehicle computer is obtained; When the highest authority of the vehicle computer is obtained, the original root file system image package is extracted from the target storage partition of the vehicle computer to the terminal device by executing commands in the command environment of the vehicle computer.

3. The method for updating a read-only root file system according to claim 2, characterized in that: The method of extracting the original root file system image package from the target storage partition of the vehicle computer to the terminal device by executing a command in the command environment of the vehicle computer includes: When the highest authority of the vehicle computer is obtained, the original root file system image package is extracted from the target storage partition of the vehicle computer by executing the second command in the command environment of the vehicle computer, and the extracted original root file system image package is saved to the target location of the vehicle computer; By executing the third command in the command environment of the vehicle computer, the original root file system image package stored in the target location of the vehicle computer is copied to the terminal device.

4. The method for updating a read-only root file system according to claim 1, characterized in that: The processing of the original root file system image package on the terminal device to remove the data header information of the firmware image package to obtain a pure root file system image package includes: By executing the fourth command in the command environment of the vehicle computer, the data header information of the original root file system image package and the firmware image package is removed to obtain a pure root file system image package, and the pure root file system image package is saved.

5. The method for updating a read-only root file system according to claim 1, characterized in that: The step of copying the image file in the pure root file system image package to a backup directory of the terminal device includes: By executing the fifth command in the command environment of the vehicle computer, the image file in the pure root file system image package is copied to the backup directory of the terminal device.

6. The method for updating a read-only root file system according to claim 1, characterized in that: The step of generating a new root file system image package based on the modified target file includes: Generate a new pure root file system image package based on the modified target file; The data header information of the firmware image package is added to the new pure root file system image package to obtain a new root file system image package.

7. The method for updating a read-only root file system according to claim 1, characterized in that: The step of replacing the original root file system image package in the target storage partition with the new root file system image package includes: Push the new root file system image package to the set location of the vehicle computer; The new root file system image package is copied from the set position of the vehicle computer, and the copied new root file system image package is used to replace the original root file system image package in the target storage partition.

8. A read-only root file system update device, characterized in that: include: An extraction module is used to extract the original root file system image package from the target storage partition to the terminal device; A processing module, used for processing the original root file system image package on the terminal device to remove the data header information of the firmware image package and obtain a pure root file system image package; A copy module, used for copying the image file in the pure root file system image package to the backup directory of the terminal device; A modification module, used to determine a target file from the image file in the backup directory, and modify the content of the target file to obtain a modified target file; The replacement module is used to generate a new root file system image package based on the modified target file, and use the new root file system image package to replace the original root file system image package in the target storage partition.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for updating the read-only root file system according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for updating the read-only root file system as described in any one of claims 1 to 7 is implemented.