CN115576903A - File system construction method, computing device and storage medium - Google Patents

File system construction method, computing device and storage medium Download PDF

Info

Publication number
CN115576903A
CN115576903A CN202211430429.5A CN202211430429A CN115576903A CN 115576903 A CN115576903 A CN 115576903A CN 202211430429 A CN202211430429 A CN 202211430429A CN 115576903 A CN115576903 A CN 115576903A
Authority
CN
China
Prior art keywords
hierarchy
level
file system
determining
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211430429.5A
Other languages
Chinese (zh)
Other versions
CN115576903B (en
Inventor
宋文泰
李鹤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202211430429.5A priority Critical patent/CN115576903B/en
Publication of CN115576903A publication Critical patent/CN115576903A/en
Application granted granted Critical
Publication of CN115576903B publication Critical patent/CN115576903B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/62Uninstallation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of file information security, in particular to a file system construction method, a computing device and a storage medium, wherein the method comprises the following steps: determining a plurality of hierarchies included in the file system, wherein the plurality of hierarchies have a construction sequence in the file system; determining whether a first level of a plurality of levels exists; if not, establishing a first level, and setting the established first level; determining and constructing a next level according to the construction sequence of the plurality of levels until all levels are constructed; and generating a file system according to the constructed multiple hierarchies. The file system can be divided into a plurality of levels to be constructed when the file system is constructed. And each level is respectively set, and then the file systems are generated according to the sequence of each level, so that the file systems are structurally set, and the construction efficiency of the file systems is improved.

Description

File system construction method, computing device and storage medium
Technical Field
The present invention relates to the field of operating systems, and in particular, to a file system construction method, a computing device, and a storage medium.
Background
With the development of computer technology, people are increasingly processing various jobs through computers. When the computer processes the work, software in the computer, such as an operating system and various application programs, is needed. The installation of operating systems or applications, and the construction of installation packages, becomes particularly important.
In the prior art, when an installation package is built, a file system of the installation package needs to be built step by step. The file system is also the longest and most error prone process. When a file system is constructed, a plurality of steps are needed, once a certain step is wrong, the file system needs to be constructed from the beginning, the efficiency of the whole construction process is low, and the fault tolerance rate is not high.
For this reason, a new file system construction method is required.
Disclosure of Invention
To this end, the present invention provides a file system construction method in an attempt to solve or at least alleviate the above-presented problems.
According to a first aspect of the present invention, there is provided a file system construction method, adapted to be executed in a computing device, the method comprising: determining a plurality of hierarchies included in the file system, wherein the plurality of hierarchies have a construction sequence in the file system; determining whether a first level of a plurality of levels exists; if not, establishing a first level, and setting the established first level; determining and constructing a next level according to the construction sequence of the plurality of levels until all levels are constructed; and generating a file system according to the constructed multiple hierarchies.
Optionally, in the method according to the present invention, further comprising: if the first level exists, determining whether the first level is complete; if the first level is incomplete, rolling back the first level; a first hierarchy is created and the created first hierarchy is set.
Optionally, in the method according to the present invention, determining and constructing the next hierarchy in the construction order of the plurality of hierarchies comprises: determining whether a next hierarchy exists; if the next level does not exist, the next level is created and the created next level is set.
Optionally, in the method according to the present invention, creating the first hierarchy comprises: determining hierarchy information of a first hierarchy; determining a hierarchical directory of a first hierarchy; determining a lower hierarchy list of a first hierarchy according to hierarchy information of the first hierarchy; and mounting the hierarchical directory of the first hierarchy to the target directory according to the lower hierarchical list of the first hierarchy.
Optionally, in the method according to the present invention, creating the next level comprises: determining hierarchy information of a next hierarchy; determining a hierarchical directory of a next hierarchy; determining a lower hierarchy list of a next hierarchy according to hierarchy information of the next hierarchy and hierarchy information of already constructed hierarchies; setting a hierarchical directory setting class according to a lower hierarchical list of a next hierarchy; and mounting the hierarchical directory of the next hierarchy to the target directory according to the hierarchical directory setting class.
Optionally, in the method according to the present invention, further comprising: determining whether the target directory is loaded with other hierarchical directories; if other hierarchical directories are mounted, the other hierarchical directories mounted by the target directory are unloaded so as to mount the hierarchical directory of the first hierarchy.
Optionally, in the method according to the present invention, the rolling back the first hierarchy comprises: uninstalling the mount of the target directory on the first level; the hierarchy information and hierarchy directories of the first hierarchy are deleted.
Optionally, in the method according to the present invention, further comprising: in response to a request to construct a new hierarchy, determining a hierarchical order of the new hierarchy in the file system; determining a lower layer level and an original upper layer level of a new level in the file system according to the level sequence of the new level; modifying the hierarchy information of the original upper hierarchy to generate a new upper hierarchy; and generating a file system according to the lower hierarchy, the new hierarchy and the new upper hierarchy.
According to another aspect of the present invention, there is provided a computing device comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the file system construction method according to the present invention.
According to still another aspect of the present invention, there is provided a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform a file system construction method according to the present invention.
The invention discloses a file system construction method which is suitable for being executed in computing equipment and comprises the following steps: determining a plurality of levels included by the file system, wherein the plurality of levels include a construction sequence; determining whether a first level of a plurality of levels exists; if not, establishing a first level, and setting the established first level; determining and constructing a next level according to the construction sequence of the plurality of levels until all levels are constructed; and generating a file system according to the constructed multiple hierarchies. The file system can be divided into a plurality of levels to be constructed when the file system is constructed. And each level is respectively set, and then the file systems are generated according to the sequence of each level, so that the file systems are structurally set, and the construction efficiency of the file systems is improved.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a file system construction method 100 according to an exemplary embodiment of the invention;
FIG. 2 illustrates a block diagram of a computing device 200, according to an exemplary embodiment of the invention;
FIG. 3 shows a schematic diagram of building multiple levels according to an exemplary embodiment of the invention;
FIG. 4 illustrates a schematic diagram of a layer-by-layer build file system in accordance with an exemplary embodiment of the present invention;
FIG. 5 shows a schematic diagram of a fallback level according to an exemplary embodiment of the present invention;
FIG. 6 shows a schematic diagram of a creation hierarchy according to an exemplary embodiment of the present invention;
FIG. 7 illustrates a schematic diagram of a file system in accordance with an exemplary embodiment of the present invention;
FIG. 8 shows a schematic diagram of building a new hierarchy according to an exemplary embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art. Like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a file system construction method 100 according to an exemplary embodiment of the invention. The file system construction method of the present invention is suitable for execution in a computing device.
FIG. 2 illustrates a block diagram of a computing device, according to an exemplary embodiment of the invention. In a basic configuration, computing device 200 includes at least one processing unit 220 and system memory 210. According to one aspect, depending on the configuration and type of computing device, system memory 210 includes, but is not limited to, volatile storage (e.g., random access memory), non-volatile storage (e.g., read-only memory), flash memory, or any combination of such memories. According to one aspect, system memory 210 includes an operating system 211.
According to one aspect, the operating system 211, for example, is adapted to control the operation of the computing device 200. Further, the examples are practiced in conjunction with a graphics library, other operating systems, or any other application program, and are not limited to any particular application or system. This basic configuration is illustrated in fig. 2 by those components within dashed line 215. According to one aspect, computing device 200 has additional features or functionality. For example, according to one aspect, computing device 200 includes additional data storage devices (removable and/or non-removable) such as, for example, magnetic disks, optical disks, or tape.
As stated hereinabove, according to one aspect, program modules 212 are stored in system memory 210. According to one aspect, the program modules 212 may include one or more application programs, the invention is not limited to the type of application program, for example, the application may also include: email and contacts applications, word processing applications, spreadsheet applications, database applications, slide show applications, drawing or computer-aided applications, web browser applications, and the like.
According to one aspect, examples may be practiced in a circuit comprising discrete electronic elements, a packaged or integrated electronic chip containing logic gates, a circuit utilizing a microprocessor, or on a single chip containing electronic elements or microprocessors. For example, an example may be practiced via a system on a chip (SOC) in which each or many of the components shown in fig. 2 may be integrated on a single integrated circuit. According to one aspect, such SOC devices may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or "burned") onto a chip substrate as a single integrated circuit. When operating via an SOC, the functions described herein may be operated via application-specific logic integrated with other components of the computing device 200 on a single integrated circuit (chip). Embodiments of the invention may also be practiced using other technologies capable of performing logical operations (e.g., AND, OR, AND NOT), including but NOT limited to mechanical, optical, fluidic, AND quantum technologies. In addition, embodiments of the invention may be practiced within a general purpose computer or in any other circuits or systems.
According to one aspect, computing device 200 may also have one or more input devices 231, such as a keyboard, mouse, pen, voice input device, touch input device, or the like. Output device(s) 232 such as a display, speakers, printer, etc. may also be included. The foregoing devices are examples and other devices may also be used. Computing device 200 may include one or more communication connections 233 that allow communication with other computing devices 240. Examples of suitable communication connections 233 include, but are not limited to: RF transmitter, receiver and/or transceiver circuitry; universal Serial Bus (USB), parallel, and/or serial ports. Computing device 200 may be communicatively connected to other computing devices 240 via communication connection 233.
Embodiments of the present invention also provide a non-transitory readable storage medium storing instructions for causing the computing device to perform a method according to embodiments of the present invention. The readable media of the present embodiments include permanent and non-permanent, removable and non-removable media, and the storage of information may be accomplished by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of readable 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 disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory readable storage medium.
According to one aspect, communication media is embodied by computer readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transport mechanism) and includes any information delivery media. According to one aspect, the term "modulated data signal" describes a signal that has one or more feature sets or that has been altered in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio Frequency (RF), infrared, and other wireless media.
It should be noted that although the computing device described above shows only processing unit 220, system memory 210, input device 231, output device 232, and communication connection 233, in particular implementations, the device may include other components necessary for proper operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Returning to fig. 1, as shown in fig. 1, the file system construction method of the present invention first performs step 110: a plurality of hierarchies included in the file system is determined, the plurality of hierarchies having a build order in the file system.
According to an embodiment of the present invention, the file system to be constructed in the present invention can be embodied as a file system of an installation package. The generated file system may be used to build an installation package.
According to one embodiment of the invention, the installation package may be embodied as a software installation package, such as an operating system installation package. The operating system installation package may be embodied as a type of optical disc image file (ISO file). The ISO file can be used for starting a computer to enter an installation interface for installing an operating system in a guidance mode of an optical disk, a U disk and the like.
The File System may be embodied as a Root File System (RootFS), various directories and files that are placed under the Root directory of the System and that conform to the File System hierarchy standard. RootFS includes all directories and files that are prepared to be placed under the root directory after the os is installed during the ISO image file building process, and is a static state in which the os is placed on the hard disk.
The file system constructed in the invention conforms to the hierarchical structure Standard of the file system, and can be specifically realized as a file system Hierarchy Standard (FHS). FHS is a form of file organization adopted by Linux operating system, and defines the purpose of each area in the system, the minimum required files and directories, and exception handling and contradiction handling.
According to one embodiment of the present invention, the file system in the present invention may be divided into a plurality of hierarchies having a construction order. The build order is the order in which these hierarchies make up the file system.
According to one embodiment of the invention, the file system may include first through seventh hierarchies.
Fig. 3 shows a schematic diagram of building multiple levels according to an exemplary embodiment of the present invention.
As shown in FIG. 3, the first level is used to build the minimal base system, such as executing the deboottrap command.
The second level is used for special configuration, so that the file system is suitable for a construction scenario of an installation package such as an ISO image, since a complete file system service is not run at this time.
The third level is used to install the software package of the base layer, such as using the apt command to install the software package that depends on all base layers.
The fourth level is used to install higher level software packages, such as those based on a pre-installed software package list, which may be specifically installed using apt commands.
And the fifth layer is used for analyzing the files of each layer and appropriately restoring the files, such as checking the files of the fourth layer, and if the fourth layer adds or deletes the items of the root directory of the file system, an error is reported and the file system exits. If the files provided by the first-third levels are modified at the fourth level, the files need to be restored, and a modified file list is recorded for being analyzed and corrected by a developer. This will not cause the files at the base and lower layers to be modified when installing higher level software packages at the fourth level.
The sixth level may be used to execute hook scripts in order to implement custom functions.
The seventh level may be used to restore the special configuration of the second level, cleaning up superfluous files.
Step 120 is then performed to determine whether a first level of the plurality of levels exists. Determining multiple levels refers to determining multiple levels to build. When determining whether a first level of the plurality of levels exists, determining whether the first level has already been built of the plurality of levels to be built.
According to one embodiment of the invention, if the first level exists, determining whether the first level is complete; if the first level is not complete, rolling back the first level; a first hierarchy is then created and the created first hierarchy is set.
According to an embodiment of the present invention, when determining whether the first hierarchy is complete, the determination may be made by a file of the first hierarchy that records hierarchy information. If the file records the hierarchy information that the first hierarchy has been built, the first hierarchy is complete. If the hierarchy information does not indicate that the first hierarchy has been completed, the first hierarchy is incomplete.
FIG. 4 shows a schematic diagram of a layer-by-layer build file system according to an exemplary embodiment of the present invention.
As shown in fig. 4, the constructed file system can be implemented as a RootFS system of an ISO image file, and is constructed layer by layer during construction. Specifically, the method comprises the following steps: the first level of the building is specifically realized as layer 1, and the building of layer 1 is taken as an example for explanation:
first, it is checked whether a layer 1 (i.e., a first level) exists, and if not, the layer 1 is created. If so, continue to the next step.
Subsequently, it is checked whether layer 1 is complete, if not, the next step is continued, and if complete, the construction of the subsequent layers is continued until the end.
Subsequently, if layer 1 is incomplete, the user may be presented with a warning message "this layer is not complete" to inform the user that the layer is incomplete. And ask the user if he exits, the option can be provided: "rollback this layer" and "exit".
And then judging whether the user selects to quit according to an exit option, if so, quitting the building program, and if so, returning to the layer 1, and continuing the next step.
Subsequently, layer 1 is rolled back. The specific steps of the step of retracting the layer are described in detail later.
Subsequently, layer 1 is created. The specific steps of creating the layers are described in detail later.
And then, modifying the layer 1, and performing operations of modifying, adding, deleting files and directories and the like on the rootFS file system. In this step, the setup of the created layer 1 (first hierarchy) can be realized.
Subsequently, layer 1 is turned off. Specifically, the method comprises the following steps: setting the layer 1 as read-only mounting enables a user to try to modify the file of the layer 1, which results in failure of modification, and marks that the layer 1 is constructed in the file InfoFile of the recorded hierarchy information. If in the process of modifying the layer 1, the program execution is wrong or the user operation terminates the program, and the operation of closing the layer 1 is not performed, the data of the layer 1 is considered to be incomplete, and when judging whether the layer is complete again, the incomplete result of the layer can be obtained.
Subsequently, the building of the subsequent layers is continued until the building of all the levels in the RootFS file system is completed, and the building of each level is the same as the step structure of the layer 1.
According to one embodiment of the invention, when a first hierarchy is returned, the mounting of a target directory to the first hierarchy is unloaded; the hierarchy information and the hierarchy directory of the first hierarchy are deleted.
Fig. 5 shows a schematic diagram of a fallback level according to an exemplary embodiment of the present invention. As shown in fig. 5:
the current tier is first determined. According to one embodiment of the invention, the tier to be rolled back may be the first tier. And then judging whether the current level number is 0 or not, namely whether any level is not constructed currently or not, if so, ending, and if not, continuing the next step.
Subsequently, the hierarchy of target directory mounts is unloaded, the target directories may be embodied as directories for mounting the file system and for generating the installation package: mergedDir; reducing MergedDir to be in an uninstalled state; if the target directory is populated with multiple tiers, it is necessary to loop through the tiers until it is virtually unpopulated with any tiers.
Subsequently, the level information is deleted, that is, the file InfoFile describing the level information related to the level is deleted.
Subsequently, the directory storing the hierarchical file is deleted, specifically: the recursive deletion of the directories of a hierarchy is cycled through until all the directories of the hierarchy are deleted. When a directory of a hierarchy is deleted and a directory non-modifiable error is encountered, the directory non-modifiable attribute needs to be removed first, and then deletion is continued.
And then, after the current hierarchy is subtracted from the hierarchy number, judging whether the current hierarchy number is 0 or not, if so, continuing the next step, and otherwise, setting the read-only mounting target directory MergedDir.
Subsequently, the target directory, mergedDir, is set to read-only, i.e., the rights of the directory are set to read-only for all users.
Subsequently, the attribute of the target directory is set to be read-only mounted, mergedDir, specifically, all previous hierarchies of the current hierarchy are mounted to be read-only states.
Returning to fig. 1. Then, step 130 is executed, if not, a first hierarchy is created, and the created first hierarchy is set. According to one embodiment of the invention, creating the first hierarchy includes: determining hierarchy information of a first hierarchy; determining a hierarchical directory of a first hierarchy; determining a lower hierarchy list of a first hierarchy according to hierarchy information of the first hierarchy; and mounting the hierarchical directory of the first hierarchy to the target directory according to the lower hierarchical list of the first hierarchy.
According to one embodiment of the invention, when the first hierarchy is created, whether the target directory is hung with other hierarchical directories is also determined; if other hierarchical directories are mounted, the other hierarchical directories mounted by the target directory are unloaded so as to mount the hierarchical directory of the first hierarchy.
According to an embodiment of the invention, when a hierarchy (including a first hierarchy and other hierarchies) is set, operations such as modifying, adding and deleting files and directories in a file system of the hierarchy can be performed, and functions required by the hierarchy are realized.
Then, step 140 is performed to determine and build the next level in the building order of the plurality of levels until all levels are built.
According to one embodiment of the present invention, determining and building the next hierarchy in the building order of the plurality of hierarchies comprises: determining whether a next level exists; if the next level does not exist, the next level is created and the created next level is set.
If the next level exists, judging whether the next level is complete, and if the next level is incomplete, returning to the next level.
According to one embodiment of the invention, when the next hierarchy is created: determining hierarchy information of a next hierarchy; determining a hierarchical directory of a hierarchy; determining a lower hierarchy list of a next hierarchy according to hierarchy information of the next hierarchy and hierarchy information of already constructed hierarchies; setting a hierarchy catalog setting class according to a lower hierarchy list of a next hierarchy; and mounting the hierarchical directory of the next hierarchy to the target directory according to the hierarchical directory setting class.
Fig. 6 shows a schematic diagram of creating a hierarchy according to an exemplary embodiment of the present invention. As shown in fig. 6, when creating a hierarchy, directories required by the file system are determined, and if these directories are already set, the hierarchy is created based on these directories, and if they do not exist, the hierarchy is set in advance. These directories include:
the file directory is used for storing files of all hierarchies, and according to one embodiment of the invention, the file directory can be set as follows: overlaps/layers;
a stacked file directory for serving as a working directory of the stacked file system; according to an embodiment of the invention, the file system can be set as overlay/work, the stacked file system can be specifically set as overlay FS, and different directories and files in the file system are stacked and merged in sequence. The stacked file system is used for stacking different file directories according to sequence, and the lower layer file is covered by the upper layer file.
A hierarchical information directory for storing: the file is used for recording hierarchy information of the hierarchy, and according to one embodiment of the invention, various attribute fields are used for recording the hierarchy in the hierarchy information.
Subsequently, the hierarchical directory mounted by the target directory is uninstalled, and the target directory is set to be in an uninstalled state. And if the target directory is mounted with a plurality of other hierarchical directories, circularly unloading the other hierarchical directories mounted by the target directory until all the other hierarchical directories mounted by the target directory are unloaded.
Subsequently, hierarchy information is determined, including a hierarchy identification (e.g., which may be labeled as LayerID) of the hierarchy currently to be created, and according to one embodiment of the invention, a hierarchy Identification (ID) of a hierarchy next to the current hierarchy is also recorded. The level information may be recorded in a file InfoFile.
And then, determining the hierarchy directory of the current hierarchy, and if the hierarchy directory does not exist, creating. The hierarchical directory is a directory for storing all files of the layer. According to an embodiment of the present invention, it can be specifically set as overlay/layers/$ { LayerID }, which is denoted as CurrentLayerDer.
Then, determining a lower hierarchy list (LowerDirs) of the current hierarchy, specifically, determining according to the file InfoFile of the recording hierarchy information of the current hierarchy and other hierarchies; according to the LayerID and the ParentLayerID of each layer, a list LowerDirs of directories of all levels from the previous level of the current level to the first level is obtained. Wherein the lower level list of the first level, paretlayerid, is empty. If the current hierarchy is the first hierarchy, the lower hierarchy list LowerDirs is empty, if the current hierarchy is the second hierarchy, the LowerDirs is { the directory of the first hierarchy }, if the current hierarchy is the third hierarchy, the LowerDirs is { the directory of the second hierarchy, the directory of the first hierarchy }, and in the lower hierarchy list, the newer hierarchies are in order, and the higher hierarchies are positioned more forward.
Subsequently, it is determined whether the lower hierarchy list LowerDirs is empty, if not, the next step is continued, and if it is empty, the hierarchy directory of the first hierarchy is mounted to the target directory, i.e., the CurrentLayerDir is bound and mounted to the destination mergdir directory using the option bind.
Then, a hierarchical directory setting class is set according to a lower hierarchical list of the next hierarchy: and setting upperdir according to the current hierarchy, setting lowerdir according to the lower hierarchy list, and setting workdir according to the directory of the stacked file system. The hierarchical directory setting class can be specifically realized as an overlay class, and the code of the setting process is
lowerdir=LowerDirs,
upperdir=CurrentLayerDir,
workdir=overlay/work。
Subsequently, the current hierarchy is mounted to the target directory so as to call a stack file system to stack files of the first hierarchy to the current hierarchy in the hierarchical order and provide access under the destination directory, and then a binding result of binding the current hierarchy to the destination directory is recorded in the hierarchical directory of the current hierarchy.
Returning to FIG. 1, then, step 150 is performed to generate a file system from the constructed plurality of hierarchies.
Fig. 7 shows a schematic diagram of a file system according to an exemplary embodiment of the present invention.
According to the file system constructed by the invention, when each hierarchy is constructed, the currently constructed hierarchy can be modified, and other lower hierarchies are in a read-only mode.
As shown in FIG. 7, the file system includes layers 1 through 7. If layer 7 is currently being modified, only layer 7 is readable and writable, and the underlying layers are read-only.
If the file needs to be modified, the file is searched from the 7 th layer for modification. If this layer has this file, then the modification is done using layer 7, otherwise the lookup is done at a lower layer.
According to an embodiment of the invention, the inventive method further comprises: in response to a request to construct a new hierarchy, determining a hierarchical order of the new hierarchy in the file system; determining a lower layer level and an original upper layer level of a new level in the file system according to the level sequence of the new level; modifying the hierarchy information of the original upper hierarchy to generate a new upper hierarchy; and generating a file system according to the lower hierarchy, the new hierarchy and the new upper hierarchy.
FIG. 8 shows a schematic diagram of building a new hierarchy according to an exemplary embodiment of the present invention. As shown in fig. 8: the image file can be constructed according to a preset frequency, such as an ISO file constructed automatically every day. Specifically, the method comprises the following steps: first, 1 to 4 layers are constructed, and then 5 to 7 layers are constructed. And then stacking the rootFS to generate a squashFS file, and generating an ISO file according to the squashFS file.
When a new level needs to be constructed in the ISO file, the level sequence of the new level is determined, and if the level sequence of the new level is the 5 th level, the lower levels of the new level in the file system are the 1 st level to the 4 th level. And modifying the hierarchical information of the 5 th layer to the 7 th layer of the original upper hierarchical level to generate the 6 th layer to the 8 th layer of the new upper hierarchical level. Adding a new software package results in a new level 5. And then, stacking the RootFS to generate a squashFS file according to the levels from 1 to 4 of the lower hierarchy, the level from 5 of the new hierarchy, and the level from 6 to 8 of the new upper hierarchy, and generating an ISO file according to the squashFS file.
According to the method, a layered construction mode is adopted for the file system, and the work to be done by each level is divided according to the use intention of each level. If the function of one built hierarchy needs to be tested repeatedly in the process of building the file system, the previous hierarchy can be returned conveniently and the state of the previous hierarchy can be returned accurately, and then the one hierarchy can be rebuilt by newly modified codes quickly.
According to one embodiment of the invention, an application scenario of the invention is as follows: when the influence of the software packages of different layers on the modification of the system needs to be limited and controlled, if the content of the software package of the base layer should not be modified by the software package of the upper layer, the files of each layer are separately stored by using a layered construction mode, so that the method can support the determination of whether the modification of the content of the software package of the base layer by the software package of the upper layer occurs or not and the comparison of which files are specifically modified.
According to one embodiment of the invention, another application scenario of the invention is as follows: under the scene that the image file needs to be built quickly, for example, a developer modifies a plurality of software packages, the software packages need to be built into the image file for testing, and the system automatically builds the image file at an earlier time, cache data left in the process of building the image file can be used for multiplexing the building results of the first layers of the file system, then a new layer is built, and the software packages to be tested are added into the new layer, so that the image file is built and tested quickly.
According to one embodiment of the invention, another application scenario of the invention is as follows: when developing and optimizing the function constructed by the second hierarchy, the developer can set that only the first hierarchy and the second hierarchy are constructed, and exit after completion, the application or program constructing the hierarchy will construct the first hierarchy and the second hierarchy in sequence, and then end. The developer then modifies the code building the second hierarchy and deletes the second hierarchy building results, i.e., reverts back to building only the first hierarchy results, and then reconstructs the file system and runs the build hierarchy application or program. Since the first hierarchy that was originally constructed is still present, checking whether the first hierarchy exists and the result of completion is yes, and thus the step of constructing the first hierarchy is skipped. Then, since the second hierarchy is returned by the developer, the result of checking whether the second hierarchy exists is no, the step of constructing the second hierarchy is not skipped, and the second hierarchy is constructed by using the code modified by the developer, thereby reducing the time consumption for constructing one hierarchy. With the more levels of multiplexing, the more levels of construction steps of skipping levels, the more remarkable the development efficiency can be improved.
According to one embodiment of the invention, an application scenario of the invention is as follows: the fifth level in the build file system is the one that includes the steps of: a check is made against the fourth level of files, i.e., the modification of the software packages of the upper levels to the software packages of the base and lower levels of the system. Triggered by the design and use requirements, the modification is better, because the bottom layer security mechanism of the system is realized in the base layer and the lower layers, and the inspection mechanism formed by layering the file system is utilized, so that the security mechanism of the system cannot be modified by a higher-level software package at the mirror image file construction stage, and the application security is improved by utilizing the mirror image file. Specifically, if the image file is implemented as an image file of the operating system, the security of installing the operating system by using the image file can be improved.
According to one embodiment of the invention, another application scenario of the invention is as follows: in order to build the installation package in a rapid increment manner, for example, an ISO file, a planning task is set for building the ISO file, for example, the ISO file is automatically built every morning. After the ISO file is built every day, the ISO file containing the software package required by the user can be built quickly on the basis of the ISO file. After receiving a request for quickly constructing an ISO file by a user within the working time of the user, the ISO file construction system multiplexes the existing results from the first hierarchy to the fourth hierarchy, constructs a new hierarchy based on the results, adds a software package required to be added by the user in the data modification process of the new hierarchy, and then continues the subsequent processes. The result from the first level to the fourth level is reused, so that a large amount of construction time is saved for the user, the working efficiency of the user is improved, and the timeliness of the constructed file system can be guaranteed because the first four levels are constructed on the same day.
The invention discloses a file system construction method which is suitable for being executed in computing equipment and comprises the following steps: determining a plurality of levels included by the file system, the plurality of levels including a build order; determining whether a first level of a plurality of levels exists; if the first hierarchy does not exist, creating a first hierarchy, and setting the created first hierarchy; determining and constructing a next level according to the construction sequence of the plurality of levels until all levels are constructed; and generating a file system according to the constructed multiple hierarchies. The file system can be divided into a plurality of levels to be constructed when the file system is constructed. And each level is respectively set, and then the file systems are generated according to the sequence of each level, so that the structured setting of the file systems is realized, and the construction efficiency of the file systems is improved.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects.
Those skilled in the art will appreciate that the modules or units or groups of devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. Modules or units or groups in embodiments may be combined into one module or unit or group and, in addition, may be divided into sub-modules or sub-units or sub-groups. All of the features disclosed in this specification, and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification may be replaced by an alternative feature serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor with the necessary instructions for carrying out the method or the method elements thus forms a device for carrying out the method or the method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the file system construction method of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer-readable media includes both computer storage media and communication media. Computer storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of computer readable media.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to practitioners skilled in this art. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention.

Claims (10)

1. A file system construction method, adapted to be executed in a computing device, the method comprising:
determining a plurality of hierarchies included by the file system, the plurality of hierarchies having an order of construction in the file system;
determining whether a first level of a plurality of levels exists;
if not, establishing a first level, and setting the established first level;
determining and constructing a next level according to the construction sequence of the plurality of levels until all levels are constructed;
and generating a file system according to the constructed multiple hierarchies.
2. The method of claim 1, wherein the method further comprises:
if the first hierarchy exists, determining whether the first hierarchy is complete;
rolling back a first level if the first level is incomplete;
a first hierarchy is created and the created first hierarchy is set.
3. The method of claim 1, wherein said determining and building the next level in the building order of the plurality of levels comprises:
determining whether a next level exists;
if the next level does not exist, the next level is created and the created next level is set.
4. The method of any of claims 1-3, wherein the creating a first hierarchy comprises:
determining hierarchy information for the first hierarchy;
determining a hierarchical directory of the first hierarchy;
determining a lower hierarchy list of the first hierarchy according to hierarchy information of the first hierarchy;
and mounting the hierarchical directory of the first hierarchy to a target directory according to the lower hierarchical list of the first hierarchy.
5. The method of claim 3, wherein the creating the next level comprises:
determining hierarchy information for the next hierarchy;
determining a hierarchy directory for the next hierarchy;
determining a lower hierarchy list of the next hierarchy according to the hierarchy information of the next hierarchy and the hierarchy information of the already constructed hierarchy;
setting a hierarchical directory setting class according to the lower hierarchical list of the next hierarchy;
and mounting the hierarchical directory of the next hierarchy to a target directory according to the hierarchical directory setting class.
6. The method of claim 4, wherein the method further comprises:
determining whether the target directory is loaded with other hierarchical directories;
and if other hierarchical directories are mounted, the other hierarchical directories mounted by the target directory are unloaded so as to mount the hierarchical directory of the first hierarchy.
7. The method of claim 2, wherein the fallback to the first level comprises:
unloading the mounting of the target directory to the first hierarchy;
deleting the hierarchy information and hierarchy directories of the first hierarchy.
8. The method of claim 1, wherein the method further comprises:
in response to a request to construct a new hierarchy, determining a hierarchical order of the new hierarchy in the file system;
determining a lower layer level and an original upper layer level of a new level in the file system according to the level sequence of the new level;
modifying the hierarchy information of the original upper hierarchy to generate a new upper hierarchy;
and generating a file system according to the lower layer hierarchy, the new hierarchy and the new upper layer hierarchy.
9. A computing device, comprising:
one or more processors;
a memory; and
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing the method of any of claims 1-8.
10. A computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform the method of any of claims 1-8.
CN202211430429.5A 2022-11-16 2022-11-16 File system construction method, computing device and storage medium Active CN115576903B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211430429.5A CN115576903B (en) 2022-11-16 2022-11-16 File system construction method, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211430429.5A CN115576903B (en) 2022-11-16 2022-11-16 File system construction method, computing device and storage medium

Publications (2)

Publication Number Publication Date
CN115576903A true CN115576903A (en) 2023-01-06
CN115576903B CN115576903B (en) 2023-04-11

Family

ID=84589059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211430429.5A Active CN115576903B (en) 2022-11-16 2022-11-16 File system construction method, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN115576903B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878204A (en) * 2023-01-20 2023-03-31 北京国科环宇科技股份有限公司 Processing method and device of operating system, computer equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140109043A1 (en) * 2012-10-17 2014-04-17 Sap Portals Israel Ltd Displaying different hierarchy levels of computer program source code
CN107797806A (en) * 2016-08-29 2018-03-13 北京雪球信息科技有限公司 A kind of dispositions method of program
CN113254398A (en) * 2020-12-29 2021-08-13 深圳市怡化时代科技有限公司 Sample file management method, device, equipment and medium
CN114996236A (en) * 2022-06-24 2022-09-02 济南浪潮数据技术有限公司 Data processing method, device and equipment for converged storage system and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140109043A1 (en) * 2012-10-17 2014-04-17 Sap Portals Israel Ltd Displaying different hierarchy levels of computer program source code
CN107797806A (en) * 2016-08-29 2018-03-13 北京雪球信息科技有限公司 A kind of dispositions method of program
CN113254398A (en) * 2020-12-29 2021-08-13 深圳市怡化时代科技有限公司 Sample file management method, device, equipment and medium
CN114996236A (en) * 2022-06-24 2022-09-02 济南浪潮数据技术有限公司 Data processing method, device and equipment for converged storage system and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878204A (en) * 2023-01-20 2023-03-31 北京国科环宇科技股份有限公司 Processing method and device of operating system, computer equipment and medium

Also Published As

Publication number Publication date
CN115576903B (en) 2023-04-11

Similar Documents

Publication Publication Date Title
US10732963B2 (en) System and method for automatically managing updated UEFI variables
US6542167B1 (en) System and method for flexible software linking
US6826604B2 (en) Input/output device information management system for multi-computer system
US7913265B2 (en) Method of loading software with an intermediate object oriented language in a portable device
US7664910B2 (en) Data management method and apparatus, hierarchical storage apparatus and computer-readable storage medium
CN101308471B (en) Method and device for data restoration
CN115576903B (en) File system construction method, computing device and storage medium
US20070234328A1 (en) File handling for test environments
CN108829449A (en) A kind of method, apparatus, equipment and the medium of BIOS start-up operation system
CN115344284A (en) Automatic driving software upgrading method and device, storage medium and computer equipment
CN110209420A (en) A kind of method and device updating bootstrap loader
CN112882746B (en) Application program updating method and device, storage medium and computer equipment
CN117950763A (en) Flow processing method based on activiti workflow engine
CN117707543A (en) Application installation package manufacturing and installation method, computing device and storage medium
CN111090701B (en) Service request processing method, device, readable storage medium and computer equipment
CN117170802A (en) Method, system, equipment and medium for rapidly manufacturing operating system mirror image based on information creation platform
US6915512B1 (en) Software editing with indication of format and processing state of each process of the software
KR20210061633A (en) Apparatus and method for scheduling containers of virtualization system
CN114510375A (en) Flash chip data area dynamic sharing system and method
CN114756293A (en) Service processing method, device, computer equipment and storage medium
CN111400243B (en) Development management system based on pipeline service and file storage method and device
CN115617489B (en) Operating system migration method, migration application and migration application deployment method
CN118259936A (en) Operating system updating method, device, computing equipment and storage medium
CN115185426B (en) Data processing method and device for tree control and computing equipment
CN117539685A (en) Data processing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant