File system software presetting method and device, electronic equipment and carrier
By building a virtual environment in the file system and automatically installing application software packages, the problems of long installation time, high cost and complex operation during the file system software preset process are solved, and cross-platform automated preset and low-cost maintenance are realized.
Patent Information
- Application Number
- CN202410846137.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, when pre-configuring file system software, there are problems such as long installation time, high cost, complex operation and high mirror maintenance costs.
By building a root file system virtual environment on the first hardware platform, the second hardware platform is run in the virtual environment, the application software package is obtained and installed using preset installation policies. When the installation fails, determine the exception handling strategy based on the failure type and process it, and finally package the installed file system into a system image file.
It realizes the automated presetting of application software in cross-platform file systems, reduces development, maintenance and production costs, simplifies operation processes, and reduces the maintenance costs of system images, ensures the consistency of mirror compilation, and improves scalability.
Smart Images

Figure CN119493579A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a file system software presetting method, device, electronic device, and carrier. Background Art
[0002] At present, when developing systems, self-developed domain controllers or edge computing devices, the pre-installed application software function development will be considered, mainly including JetPack algorithm software, development and debugging application software, etc. However, the development and debugging environment is generally an x86 architecture platform, and the file system operating environment and application software environment are generally ARM architecture platforms, which brings troubles to the pre-installation of application software. At present, the main software pre-installation solutions are mainly the following:
[0003] 1) The software installation package is pre-set in the Rootfs file system, and the initialization script is executed for installation after the system is flashed. However, this method requires the software to be installed by executing the script after the system is turned on, which will result in a long installation time and increase the production cost.
[0004] 2) First use the basic system image to flash the machine, and then install the application software after booting up the machine. However, this method still requires manual installation after booting up the machine, which is troublesome and complicated, and increases production costs.
[0005] 3) Using the image cloning method, the application software is pre-installed in the system and the image is cloned, and the cloned image is used as the production version image. However, this method will increase the production and maintenance costs of the system image when the application software is updated, and reduce the image accuracy. Summary of the invention
[0006] The embodiments of the present application provide a method, device, electronic device, and carrier for presetting file system software to reduce the cost of presetting file system software and facilitate image maintenance.
[0007] The present application embodiment adopts the following technical solutions:
[0008] In a first aspect, an embodiment of the present application provides a file system software presetting method, wherein the file system software presetting method comprises:
[0009] Constructing a virtual environment for the root file system on the first hardware platform, and running the second hardware platform in the virtual environment;
[0010] In the virtual environment, obtaining an application software package of the second hardware platform, and installing the software in the application software package into the root file system using a preset installation strategy;
[0011] In the case of software installation failure, a corresponding exception handling strategy is determined according to the type of installation failure, and the software that failed to be installed is processed using the corresponding exception handling strategy to obtain a file system with the software finally installed;
[0012] The file system with the software finally installed is packaged into a system image file to complete the software pre-setting of the file system.
[0013] Optionally, constructing a virtual environment where the root file system on the first hardware platform resides, and running the second hardware platform in the virtual environment includes:
[0014] Building a root file system on the first hardware platform;
[0015] Loading the application software package of the second hardware platform into the root file system;
[0016] The root file system is mounted to the root directory of the virtual machine using QEMU virtual machine technology, so that the second hardware platform can be run in the virtual environment where the first hardware platform is located.
[0017] Optionally, obtaining the application software package of the second hardware platform in the virtual environment and installing the software in the application software package into the root file system by using a preset installation strategy includes:
[0018] Under the virtual environment, traverse all application software packages of the second hardware platform under a designated directory of the root file system;
[0019] Decompressing the application software package to obtain a decompressed software installation package;
[0020] Execute the corresponding installation program based on the decompressed application software installation package.
[0021] Optionally, in the case of software installation failure, determining a corresponding exception handling strategy according to the type of installation failure includes:
[0022] In case of software installation failure, obtain the software installation error log;
[0023] The software installation error log is parsed, and the type of installation failure is determined according to the parsing result, wherein the type of installation failure includes at least one of the following: a dependent package corresponding to the application software package is missing in the root file system, the application software package is damaged or incomplete, and there is a conflicting software package in the root file system.
[0024] Optionally, in the case of software installation failure, determining a corresponding exception handling strategy according to the type of installation failure, and using the corresponding exception handling strategy to handle the software that failed to be installed, to obtain a file system in which the software is finally installed includes:
[0025] In the case that the type of installation failure is that the dependent package corresponding to the application software package is missing in the root file system, the missing dependent software package is obtained and then the corresponding installation program is re-executed.
[0026] Optionally, in the case of software installation failure, determining a corresponding exception handling strategy according to the type of installation failure, and using the corresponding exception handling strategy to handle the software that failed to be installed, to obtain a file system in which the software is finally installed includes:
[0027] In the case that the type of installation failure is that the application software package is damaged or incomplete, the damaged or incomplete application software package is automatically repaired and then reinstalled.
[0028] Optionally, in the case of software installation failure, determining a corresponding exception handling strategy according to the type of installation failure, and using the corresponding exception handling strategy to handle the software that failed to be installed, to obtain a file system in which the software is finally installed includes:
[0029] When the type of installation failure is that conflicting software packages exist in the root file system, dependencies of the software packages are automatically repaired.
[0030] In a second aspect, an embodiment of the present application further provides a file system software pre-setting device, wherein the file system software pre-setting device comprises:
[0031] A virtualization unit, used to construct a virtual environment where the root file system on the first hardware platform is located, and run the second hardware platform in the virtual environment;
[0032] An installation unit, configured to obtain an application software package of a second hardware platform in the virtual environment, and install the software in the application software package into the root file system using a preset installation strategy;
[0033] The exception handling unit is used to determine the corresponding exception handling strategy according to the type of installation failure when the software installation fails, and use the corresponding exception handling strategy to handle the software that failed to be installed, so as to obtain the file system of the software that is finally installed;
[0034] The packaging unit is used to package the file system of the finally installed software into a system image file to complete the pre-installation of the file system software.
[0035] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0036] A processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the aforementioned file system software presetting methods.
[0037] In a fourth aspect, an embodiment of the present application further provides a carrier, which is a computer-readable storage medium, and the computer-readable storage medium stores one or more programs, which, when executed by an electronic device including multiple application programs, enables the electronic device to execute any of the aforementioned file system software pre-setting methods.
[0038] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the file system software presetting method of the embodiment of the present application first constructs a virtual environment where the root file system on the first hardware platform is located, and runs the second hardware platform in the virtual environment; then, in the virtual environment, obtains the application software package of the second hardware platform, and uses the preset installation strategy to install the software in the application software package into the root file system; then, in the case of software installation failure, determines the corresponding exception handling strategy according to the type of installation failure, and uses the corresponding exception handling strategy to handle the software that failed to install, and finally obtains the file system with the software installed; finally, the file system with the software finally installed is packaged into a system image file to complete the software presetting of the file system. The file system software presetting method of the embodiment of the present application adopts virtual technology to realize the presetting of application software in a cross-platform file system, which reduces the overall development, maintenance and production costs compared with software post-installation and cloning, and realizes the automatic presetting function of multiple application software and automatic handling of abnormal situations, reduces the maintenance cost of the system image, ensures the consistency of multiple image compilations, and improves the overall scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0040] Figure 1 A flowchart of a method for presetting file system software in an embodiment of the present application;
[0041] Figure 2 This is a schematic diagram of a file system software presetting process in an embodiment of the present application;
[0042] Figure 3 This is a schematic diagram of the structure of a file system software presetting device in an embodiment of the present application;
[0043] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0045] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0046] The present application embodiment provides a file system software presetting method, such as Figure 1 As shown, a flowchart of a file system software presetting method in an embodiment of the present application is provided, and the file system software presetting method at least includes the following steps S110 to S140:
[0047] Step S110: construct a virtual environment where the root file system on the first hardware platform resides, and run the second hardware platform in the virtual environment.
[0048] When performing software presetting of the file system in the embodiment of the present application, it is necessary to first use virtual machine technology to mount the root file system Rootfs on the first hardware platform on a preset virtual machine, so that the root file system is in a virtual environment, and the second hardware platform is run in the constructed virtual environment, thereby achieving the purpose of simulating the second hardware platform on the first hardware platform, and then meeting the subsequent development needs of the file system software presetting function of the second hardware platform in the virtual environment created by the first hardware platform, and solving the problem of software presetting difficulties caused by differences in cross-platform hardware architectures.
[0049] The first hardware platform and the second hardware platform are two different architecture platforms. For example, the current self-developed domain controller will consider the development of pre-installed application software functions during system development. The development and debugging environment adopted is the x86 architecture platform, and the file system operating environment and application software environment are both ARM architecture platforms. Therefore, the first hardware platform can be the x86 architecture platform, and the second hardware platform can be the ARM architecture platform. Of course, the specific hardware platforms between which cross-platform application software pre-installed functions need to be developed can be flexibly set by technicians in this field according to actual needs, and no specific restrictions are made here.
[0050] The file system software presetting method of the embodiment of the present application can be automatically executed through a Shell script, thereby realizing the automatic presetting functions of multiple application software and the automatic processing of abnormal situations, thereby reducing the system image maintenance cost.
[0051] Step S120: obtaining an application software package of the second hardware platform in the virtual environment, and installing the software in the application software package into the root file system using a preset installation strategy.
[0052] Through the above steps, the second hardware platform is run in the virtual environment where the first hardware platform is located. At this time, it is necessary to further obtain the application software package of the second hardware platform, that is, the file package of the application software that the second hardware platform needs to pre-install in the file system, and adopt a certain installation strategy to pre-install these application software into the file system. The installation strategy here can be flexibly set according to actual needs. For example, it can be installed one by one in sequence, or non-conflicting application software can be installed in parallel. The specific installation method can be flexibly set by technicians in this field according to actual needs, and is not specifically limited here.
[0053] Step S130, in the case of software installation failure, determining a corresponding exception handling strategy according to the type of installation failure, and using the corresponding exception handling strategy to handle the software that failed to be installed, to obtain a file system with the software finally installed.
[0054] During the installation of application software, installation failure may occur. At this time, it is necessary to automatically adopt corresponding exception handling strategies according to the specific type of installation failure to handle the software that failed to install, such as reinstalling or uninstalling the installed related software after solving the exception problem, so as to obtain the file system of the final installed application software.
[0055] Step S140, packaging the file system with the software finally installed into a system image file to complete the software pre-installation of the file system.
[0056] After the application software is pre-installed in the file system, the file system with the application software pre-installed can be packaged into a system image file in a certain format for subsequent device burning.
[0057] The file system software presetting method of the embodiment of the present application adopts virtual technology to realize the presetting of application software in a cross-platform file system. Compared with software post-installation and cloning, it reduces the overall development maintenance and production costs, and realizes the automatic presetting function of multiple application software and automatic handling of abnormal situations, thereby reducing the maintenance cost of the system image, ensuring the consistency of multiple image compilations, and improving the overall scalability.
[0058] In some embodiments of the present application, constructing a virtual environment where the root file system on the first hardware platform is located and running the second hardware platform in the virtual environment includes: constructing a root file system on the first hardware platform; loading an application software package of the second hardware platform into the root file system; and mounting the root file system to the root directory of the virtual machine using QEMU virtual machine technology to run the second hardware platform in the virtual environment where the first hardware platform is located.
[0059] In the embodiment of the present application, a Shell script can be used to create a basic file system, namely, a root file system Rootfs, on a first hardware platform, and then a deb application software package of a second hardware platform is loaded into the base file system. The Shell script application chroot program is started and logs into the virtual machine to mount the root file system of the first hardware platform to the root directory of the virtual machine, thereby realizing the virtual operation of the second hardware platform under the first hardware platform.
[0060] The virtual machine of the embodiment of the present application can be constructed based on QEMU (Quick EMUlator), which is an open source virtual machine monitor and simulator that can simulate multiple hardware platforms, including x86, ARM, PowerPC, etc. QEMU is widely used in virtualization, embedded system development and simulation and other fields. Of course, the specific virtual machine construction technology to be adopted can be flexibly selected by those skilled in the art in combination with the prior art, and will not be listed here one by one.
[0061] In some embodiments of the present application, obtaining the application software package of the second hardware platform under the virtual environment and installing the software in the application software package into the root file system using a preset installation strategy includes: traversing all application software packages of the second hardware platform under a specified directory of the root file system under the virtual environment; decompressing the application software package to obtain a decompressed software installation package; and executing a corresponding installation program based on the decompressed application software installation package.
[0062] When installing application software, you can use Shell scripts to enter the root file system in the virtual environment, then traverse all deb application software packages in the specified directory, obtain the names of all deb application software packages and use the dpkg command to install them. The dpkg method can automatically sort out the dependencies among all software packages without distinguishing the order. The Shell script will also decompress the files in the installation package from the deb software package to the specified path in the root file system in the corresponding virtual environment.
[0063] In addition, since the second hardware platform is running in the virtual environment, before installation, a Shell script can be used to clear the default system environment variables in the virtual machine and set the specified system environment variables for the second hardware platform, and finally execute the corresponding installation program.
[0064] In some embodiments of the present application, in the event of a software installation failure, determining a corresponding exception handling strategy based on the type of installation failure includes: in the event of a software installation failure, obtaining a software installation error log; parsing the software installation error log, and determining the type of installation failure based on the parsing result, the type of installation failure including at least one of a lack of a dependency package corresponding to an application software package in the root file system, a damaged or incomplete application software package, and a conflicting software package in the root file system.
[0065] During the installation process, Shell scripts can be used to automatically determine whether the software pre-installation is successful and the cause of failure. Installation failures mainly include the following situations:
[0066] 1) The root file system lacks the dependency packages corresponding to the application software package, which will cause installation exceptions;
[0067] 2) The application software package is damaged or incomplete;
[0068] 3) There are conflicting software dependency packages in the root file system.
[0069] The above-mentioned installation failure situations can be determined by automatically parsing the error log using a Shell script. According to the specific installation failure type parsed, the corresponding exception handling strategy is automatically adopted to handle it.
[0070] In some embodiments of the present application, in the event of a software installation failure, a corresponding exception handling strategy is determined based on the type of installation failure, and the software that failed to install is processed using the corresponding exception handling strategy to obtain a file system in which the software is finally installed, including: in the event that the type of installation failure is the lack of a dependency package corresponding to the application software package in the root file system, the missing dependency software package is obtained and then the corresponding installation program is re-executed.
[0071] If the error log shows that the current installation failure is caused by the lack of the corresponding dependency package of the application software package in the root file system, you can use the download function of the apt tool to download the corresponding missing software dependency package, and then re-execute the dpkg command to install it. apt is a command-line utility used to install, update, delete, and manage deb application software packages on Ubuntu, Debian, and related Linux distributions.
[0072] In some embodiments of the present application, in the event of a software installation failure, a corresponding exception handling strategy is determined based on the type of installation failure, and the software that failed to install is processed using the corresponding exception handling strategy to obtain a file system in which the software is finally installed, including: in the event that the type of installation failure is a damaged or incomplete application software package, the damaged or incomplete application software package is automatically repaired and then reinstalled.
[0073] If the error log shows that the current installation failure is caused by a damaged or incomplete application package, the Shell script can automatically repair the damaged or incomplete package file and then re-execute the installation program. The package file can be repaired using the configure function of the dpkg tool.
[0074] In some embodiments of the present application, in the event of a software installation failure, a corresponding exception handling strategy is determined based on the type of installation failure, and the software that failed to install is processed using the corresponding exception handling strategy to obtain a file system in which the software is finally installed, including: when the type of installation failure is a conflicting software package in the root file system, the dependencies of the software packages are automatically repaired.
[0075] If the error log shows that the current installation failure is caused by conflicting software packages in the root file system, such as a software package version conflict, the Shell script can use the apt tool to automatically repair dependencies based on the conflict log, such as uninstalling the conflicting software and then reinstalling the current application software package.
[0076] In some embodiments of the present application, after the software pre-setting of the file system is completed, the created QEMU virtual machine is deleted and the deb software package loaded in the first hardware platform is cleared, thereby releasing the space of the first hardware platform in time.
[0077] In order to facilitate the understanding of the above embodiments, Figure 2 As shown, a schematic diagram of a file system software pre-setting process in an embodiment of the present application is provided. First, a root file system Rootfs is created on the x86 platform, the deb application software package of the ARM platform is loaded into the base file system, the chroot program is used to start and log in to the QEMU virtual machine, and the root file system of the x86 platform is mounted to the root directory of the QEMU virtual machine, so as to realize the virtual operation of the ARM platform system under the x86 platform.
[0078] Then enter the root file system in the virtual environment where the ARM platform is mounted, clear and specify the system environment variables in the virtual machine, then traverse all deb application software packages in the specified directory, obtain the names of all deb application software packages and install them using the dpkg command. The dpkg method automatically sorts out the dependencies in all software packages without distinguishing the order of precedence. At the same time, it will decompress the files in the installation package from the deb application software package to the specified path of the root file system in the virtual environment, and then execute the corresponding installation program.
[0079] During the installation process, the Shell script automatically determines whether the software pre-installation is successful and determines the cause of failure. The failure situations are mainly as follows:
[0080] 1) The corresponding deb software dependency package is missing in the file system. The lack of dependency will cause an exception. The Shell script automatically parses the error log and uses the download function of the apt tool to download the corresponding missing dependency software package, and then re-executes the dpkg command to install it;
[0081] 2) The deb application software package in the file system is damaged or incomplete. After the Shell script parses the corresponding error log, it automatically repairs the damaged package file and reinstalls it. The automatic repair can be achieved using the configure function of the dpkg tool.
[0082] 3) If there is a software package conflict in the file system, the Shell script automatically interprets the error log and then uses the apt tool to automatically repair the dependencies based on the conflict log.
[0083] In summary, the file system software presetting method of the present application has achieved at least the following technical effects:
[0084] 1) Using QEMU virtual machine technology to pre-install application software in the cross-platform file system reduces the overall development, maintenance and production costs compared to post-installation and cloning methods;
[0085] 2) The use of shell automated file system compilation and exception handling strategies can ensure the consistency of system image compilation each time, and the overall scalability is strong.
[0086] The present application embodiment also provides a file system software presetting device 300, such as Figure 3 As shown, a schematic diagram of the structure of a file system software presetting device in an embodiment of the present application is provided, wherein the file system software presetting device includes: a virtualization unit 310, an installation unit 320, an exception handling unit 330, and a packaging unit 340, wherein:
[0087] A virtualization unit 310 is used to construct a virtual environment where the root file system on the first hardware platform is located, and run the second hardware platform in the virtual environment;
[0088] An installation unit 320 is used to obtain an application software package of the second hardware platform in the virtual environment, and install the software in the application software package into the root file system using a preset installation strategy;
[0089] The exception handling unit 330 is used to determine a corresponding exception handling strategy according to the type of installation failure when the software installation fails, and use the corresponding exception handling strategy to handle the software that failed to be installed, so as to obtain a file system with the software finally installed;
[0090] The packaging unit 340 is used to package the file system with the software finally installed into a system image file to complete the pre-installation of the file system software.
[0091] In some embodiments of the present application, the virtualization unit 310 is specifically used to: build a root file system on the first hardware platform; load the application software package of the second hardware platform into the root file system; use QEMU virtual machine technology to mount the root file system to the root directory of the virtual machine, so as to run the second hardware platform in the virtual environment where the first hardware platform is located.
[0092] In some embodiments of the present application, the installation unit 320 is specifically used to: traverse all application software packages of the second hardware platform under the specified directory of the root file system under the virtual environment; decompress the application software package to obtain a decompressed software installation package; and execute a corresponding installation program based on the decompressed application software installation package.
[0093] In some embodiments of the present application, the exception handling unit 330 is specifically used to: in the event of a software installation failure, obtain a software installation error log; parse the software installation error log, and determine the type of installation failure based on the parsing result, the type of installation failure including at least one of the following: a dependent package corresponding to the application software package is missing in the root file system, the application software package is damaged or incomplete, and there is a conflicting software package in the root file system.
[0094] In some embodiments of the present application, the exception handling unit 330 is specifically used to: when the type of installation failure is the lack of a dependency package corresponding to the application software package in the root file system, obtain the missing dependency software package and then re-execute the corresponding installation program.
[0095] In some embodiments of the present application, the exception handling unit 330 is specifically used to: when the type of installation failure is a damaged or incomplete application software package, automatically repair the damaged or incomplete application software package and then reinstall it.
[0096] In some embodiments of the present application, the packaging unit 340 is specifically used to automatically repair the dependencies of the software packages when the type of installation failure is that there are conflicting software packages in the root file system.
[0097] It can be understood that the above-mentioned file system software presetting device can implement each step of the file system software presetting method provided in the above-mentioned embodiment, and the relevant explanations about the file system software presetting method are applicable to the file system software presetting device, which will not be repeated here.
[0098] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0099] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0100] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0101] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a file system software pre-set device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0102] Constructing a virtual environment for the root file system on the first hardware platform, and running the second hardware platform in the virtual environment;
[0103] In the virtual environment, obtaining an application software package of the second hardware platform, and installing the software in the application software package into the root file system using a preset installation strategy;
[0104] In the case of software installation failure, a corresponding exception handling strategy is determined according to the type of installation failure, and the software that failed to be installed is processed using the corresponding exception handling strategy to obtain a file system with the software finally installed;
[0105] The file system with the software finally installed is packaged into a system image file to complete the software pre-setting of the file system.
[0106] The above application Figure 1The method performed by the file system software presetting device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in software form. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0107] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 1 The method executed by the file system software presetting device in the illustrated embodiment is specifically used to execute:
[0108] Constructing a virtual environment for the root file system on the first hardware platform, and running the second hardware platform in the virtual environment;
[0109] In the virtual environment, obtaining an application software package of the second hardware platform, and installing the software in the application software package into the root file system using a preset installation strategy;
[0110] In the case of software installation failure, a corresponding exception handling strategy is determined according to the type of installation failure, and the software that failed to be installed is processed using the corresponding exception handling strategy to obtain a file system with the software finally installed;
[0111] The file system with the software finally installed is packaged into a system image file to complete the software pre-setting of the file system.
[0112] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0113] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0116] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0117] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0118] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0119] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0120] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0121] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for presetting file system software, wherein: The file system software presetting method comprises: Constructing a virtual environment for the root file system on the first hardware platform, and running the second hardware platform in the virtual environment; In the virtual environment, obtaining an application software package of the second hardware platform, and installing the software in the application software package into the root file system using a preset installation strategy; In the case of software installation failure, a corresponding exception handling strategy is determined according to the type of installation failure, and the software that failed to be installed is processed using the corresponding exception handling strategy to obtain a file system with the software finally installed; The file system with the software finally installed is packaged into a system image file to complete the software pre-setting of the file system.
2. The file system software presetting method as claimed in claim 1, wherein: The step of constructing a virtual environment where the root file system on the first hardware platform resides and running the second hardware platform in the virtual environment includes: Building a root file system on the first hardware platform; Loading the application software package of the second hardware platform into the root file system; The root file system is mounted to the root directory of the virtual machine using QEMU virtual machine technology, so that the second hardware platform can be run in the virtual environment where the first hardware platform is located.
3. The file system software presetting method as claimed in claim 2, wherein: The step of obtaining the application software package of the second hardware platform under the virtual environment and installing the software in the application software package into the root file system by using a preset installation strategy includes: Under the virtual environment, traverse all application software packages of the second hardware platform under a designated directory of the root file system; Decompressing the application software package to obtain a decompressed software installation package; Execute the corresponding installation program based on the decompressed application software installation package.
4. The file system software presetting method as claimed in claim 1, wherein: In the case of software installation failure, determining a corresponding exception handling strategy according to the type of installation failure includes: In case of software installation failure, obtain the software installation error log; The software installation error log is parsed, and the type of installation failure is determined according to the parsing result, wherein the type of installation failure includes at least one of the following: a dependent package corresponding to the application software package is missing in the root file system, the application software package is damaged or incomplete, and there is a conflicting software package in the root file system.
5. The file system software presetting method as claimed in claim 4, wherein: In the case of software installation failure, the corresponding exception handling strategy is determined according to the type of installation failure, and the software that fails to be installed is processed using the corresponding exception handling strategy to obtain a file system in which the software is finally installed, including: When the type of installation failure is that the dependent package corresponding to the application software package is missing in the root file system, the missing dependent software package is obtained and then the corresponding installation program is re-executed.
6. The file system software presetting method as claimed in claim 4, wherein: In the case of software installation failure, the corresponding exception handling strategy is determined according to the type of installation failure, and the software that fails to be installed is processed using the corresponding exception handling strategy to obtain a file system in which the software is finally installed, including: In the case that the type of installation failure is that the application software package is damaged or incomplete, the damaged or incomplete application software package is automatically repaired and then reinstalled.
7. The file system software presetting method as claimed in claim 4, wherein: In the case of software installation failure, the corresponding exception handling strategy is determined according to the type of installation failure, and the software that fails to be installed is processed using the corresponding exception handling strategy to obtain a file system in which the software is finally installed, including: When the type of installation failure is that conflicting software packages exist in the root file system, dependencies of the software packages are automatically repaired.
8. A file system software presetting device, wherein: The file system software presetting device comprises: A virtualization unit, used to construct a virtual environment where the root file system on the first hardware platform resides, and to run the second hardware platform in the virtual environment; An installation unit, configured to obtain an application software package of a second hardware platform in the virtual environment, and install the software in the application software package into the root file system using a preset installation strategy; The exception handling unit is used to determine the corresponding exception handling strategy according to the type of installation failure when the software installation fails, and use the corresponding exception handling strategy to handle the software that failed to be installed, so as to obtain the file system of the software that is finally installed; The packaging unit is used to package the file system of the finally installed software into a system image file to complete the pre-installation of the file system software.
9. An electronic device, comprising: processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the file system software presetting method according to any one of claims 1 to 7.
10. A carrier, wherein the carrier is a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes any one of the file system software presetting methods of claims 1 to 7.