CN105138362B - The method and device of user configuration is preserved under a kind of Linux system - Google Patents

The method and device of user configuration is preserved under a kind of Linux system Download PDF

Info

Publication number
CN105138362B
CN105138362B CN201510515998.3A CN201510515998A CN105138362B CN 105138362 B CN105138362 B CN 105138362B CN 201510515998 A CN201510515998 A CN 201510515998A CN 105138362 B CN105138362 B CN 105138362B
Authority
CN
China
Prior art keywords
file
configuration
compressed
configuration file
new
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.)
Active
Application number
CN201510515998.3A
Other languages
Chinese (zh)
Other versions
CN105138362A (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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510515998.3A priority Critical patent/CN105138362B/en
Publication of CN105138362A publication Critical patent/CN105138362A/en
Application granted granted Critical
Publication of CN105138362B publication Critical patent/CN105138362B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses the method and device for preserving user configuration under a kind of linux system, this method includes:Root file system is established using Open-Source Tools, and creates new directory;Configuration file is found out in root file system, beating compressed package becomes configuring compressed file, and other system files, which are beaten compressed package, becomes system compresses file;It will configure in compressed file and system compresses file migration to nonvolatile memory, configuration compressed file solution is depressed into formation configuration file copy in new directory;Under the action of changing configuration file instruction, configuration file copy is modified to obtain new configuration file, new configuration file is beaten into compressed package, compression forms new configuration compressed file;When restarting root file system, decompresses new configuration compressed file and obtain new configuration file and as the configuration file under current linux system.This method is realized while ensureing system file security, is solved the problems, such as the preservation of user configuration, can be preserved user configuration.

Description

The method and device of user configuration is preserved under a kind of Linux system
Technical field
Linux system technical field of the present invention, more particularly to preservation user configuration under a kind of linux system Method and device.
Background technology
Currently, when for device build Linux system, it is many by the way of, it is broadly divided into two classes:One kind is root text Directly on nonvolatile memory, the file of user's operation is on nonvolatile memory part system, such as directly selects The file system on the nonvolatile memories such as disk, CF cards, DOM cards and onboard flash is selected as linux root files system System;Another kind of is that system file is stored in RAM, and what user directly operated is the file in RAM.
The first kind described above can be romfs etc. by the root file system of carry on nonvolatile memory Type is read, can also be the read-write type such as jiffs, yaffs, ext4.The file system of read-only type meets file Safety issue, user cannot change file and delete file, user can not be allowed to protect so also having led to this type Deposit configuration;If it is the file system of read-write type, then that user's operation is file on nonvolatile memory, behaviour Make to complete to complete preservations, equipment restart after be still file after operating, but this mode just loses the peace of file Quan Xing, it is irrecoverable that the maloperation of user may result in system.
Second class system file of top description is stored in RAM, before no ramfs and tmpfs, usually RAM A part be fabricated to ramdisk, then the system file of final system is rather than true non-volatile all in ramdisk In memory.Whether older ramdisk or newer ramfs and tmpfs, are that system file is put into RAM, are used What family directly operated is the file in RAM, in this case, if the file in user's modification or deletion system, it is practical with File on nonvolatile memory is unrelated, all restore as former state after equipment is restarted.This mode meets the safety of file, But without the preservation for solving the problems, such as user configuration, also without solving daily record and the real-time preservation of exception information.
Invention content
The object of the present invention is to provide the method and devices that user configuration is preserved under a kind of linux system, are being protected with realizing While demonstrate,proving system file security, solves the problems, such as the preservation of user configuration, user configuration can be preserved.
In order to solve the above technical problems, the present invention provides a kind of method for preserving user configuration under linux system, this method Including:
The root file system initrd under linux system is established using Open-Source Tools, and creates new directory in memory newroot;
Configuration file is found out in the root file system initrd, the configuration file, which is beaten compressed package, to be become configuring Other system files in addition to the configuration file in the root file system initrd are beaten compressed package and are become and are by compressed file System compressed file;
By in the configuration compressed file and the system compresses file migration to nonvolatile memory, and will described in match Set formation configuration file copy in the new directory newroot that compressed file solution is depressed into the memory;
Change configuration file instruction input by user is received, under the action of the change configuration file instructs, to described Configuration file copy in memory is modified to obtain new configuration file;
Order is preserved using configuration, the new configuration file is beaten into compressed package, the new configuration file is compressed to described non- New configuration compressed file is formed in volatile memory;
When restarting the root file system initrd, the new configuration pressure is decompressed in the nonvolatile memory Contracting file obtains the new configuration file, using the new configuration file as the configuration file under current linux system.
Preferably, after the newroot of establishment new directory in memory, further include:
By the new directory newroot carry ramfs file system or tmpfs file system.
Preferably, described to find out configuration file in the root file system initrd, the configuration file is suppressed Contracting packet becomes configuring compressed file, and other system files in addition to the configuration file in the root file system initrd are beaten Compressed package becomes system compresses file, including:
The configuration file for being related to user configuration preservation is found out in the root file system initrd;
The configuration file is individually beaten into compressed package, form configuration file compressed package and is named as config- origin.tar.gz;
Compressed package is beaten into other system file classification in the root file system initrd, forms each system of classification Compressed file.
Preferably, described that the new configuration file is beaten into compressed package using configuration preservation order, by the new configuration file It is compressed in the nonvolatile memory and forms new configuration compressed file, including:
Order config-save is preserved using configuration, compressed package is beaten to the new configuration file, and be named as config- User.tar.gz forms config-user.tar.gz compressed files;
Nonvolatile memory described in carry preserves config-user.tar.g compressed files and non-volatile is deposited to described Reservoir;
It preserves and unloads the nonvolatile memory after completing.
Preferably, it when the restarting root file system initrd, is decompressed in the nonvolatile memory The new configuration compressed file obtains the new configuration file, using the new configuration file as under current linux system Configuration file, including:
When the root file system initrd starts initializtion script, using non-volatile described in mount order carries Memory is to the root file system initrd;
It detects and whether there is config-user.tar.gz compressed files in the nonvolatile memory;If it does, Config-user.tar.gz compressed files are decompressed to newroot/etc catalogues, form the new configuration file and as current The configuration file of Linux system.
The present invention also provides the devices that user configuration is preserved under a kind of linux system, including:
Module is established, for establishing the root file system initrd under linux system using Open-Source Tools, and in memory Create new directory newroot;
First compression module, for finding out configuration file in the root file system initrd, by configuration text Part, which beats compressed package, to be become configuring compressed file, by other systems in addition to the configuration file in the root file system initrd File, which beats compressed package, becomes system compresses file;
Transferring module, for by the configuration compressed file and the system compresses file migration to nonvolatile memory In, and the configuration compressed file solution is depressed into formation configuration file copy in the new directory newroot in the memory;
Module is changed, for receiving change configuration file instruction input by user, in the change configuration file instruction Under effect, the configuration file copy in the memory is modified to obtain new configuration file;
The new configuration file is beaten compressed package for preserving order using configuration, newly matched described by the second compression module It sets and forms new configuration compressed file in compressing file to the nonvolatile memory;
Starting module when for restarting the root file system initrd, solves in the nonvolatile memory The new configuration compressed file is pressed to obtain the new configuration file, using the new configuration file as under current linux system Configuration file.
Preferably, described device further includes:
Carry module is used for the new directory newroot carry ramfs file system or tmpfs file system.
Preferably, first compression module includes:
Searching unit, for finding out the configuration text for being related to user configuration preservation in the root file system initrd Part;
Independent compression unit, for the configuration file individually to be beaten compressed package, form configuration file compressed package and is named For config-origin.tar.gz;
Classified compression unit, for compressed package to be beaten in other system file classification in the root file system initrd, Form each system compresses file of classification.
Preferably, second compression module includes:
Storage unit is ordered config-save for being preserved using configuration, compressed package is beaten to the new configuration file, and It is named as config-user.tar.gz, forms config-user.tar.gz compressed files;
Carry unit preserves config-user.tar.g compressed files to institute for nonvolatile memory described in carry State nonvolatile memory;
Unloading unit is completed to unload the nonvolatile memory later for preserving.
Preferably, the starting module includes:
Initialization module, for when the root file system initrd starts initializtion script, being hung using mount orders The nonvolatile memory is carried to the root file system initrd;
Detection module, for detecting in the nonvolatile memory with the presence or absence of config-user.tar.gz compression texts Part;If it does, decompression config-user.tar.gz compressed files form the new configuration text to newroot/etc catalogues Part and as the configuration file of current Linux system.
The method and device of user configuration is preserved under a kind of linux system provided by the present invention, configuration file is independent Separated from root file system, individually be packaged compressed, other systems file become compressed package be stored in it is non-volatile In property memory, then be system file being to store in the nonvolatile memory, user cannot be on nonvolatile memory Data be modified, then system file cannot be modified, and the safety of such system file is to ensure.
Moreover, for configuration file, configuration file is that independent be packaged becomes compressed file, the compressed file of configuration file In the nonvolatile memory, which is exactly original configuration file in fact for storage, then the compression text of original configuration file Part is to store in the nonvolatile memory, and the configuration file obtained after being decompressed to the compressed file of configuration file is to be stored in In catalogue on memory, that is, the configuration file after decompressing is located in memory directory, and user can be modified the data on memory, Then the configuration file on memory directory can be changed by user, and the new configuration file after change is compressed to nonvolatile memory On, then the compressed compressed file of new configuration file is to store in the nonvolatile memory, non-easy after system restarting There are the compressed files of the compressed file of original configuration file and new configuration file on the property lost memory, in the pressure of new configuration file In the presence of contracting file, using new configuration file, original configuration file is not used, by the compressed file solution of new configuration file It is pressed into configuration file of the new configuration file as current system, saves user setting in this way, so provided by the present invention one The method and device that user configuration is preserved under kind linux system, realizes while ensureing system file security, solves use The preservation problem of family configuration, can preserve user configuration.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is the flow chart for the method that user configuration is preserved under a kind of linux system provided by the present invention;
Fig. 2 is the structural schematic diagram for the device that user configuration is preserved under a kind of linux system provided by the present invention.
Specific implementation mode
Core of the invention is to provide the method and device that user configuration is preserved under a kind of linux system, is being protected with realizing While demonstrate,proving system file security, solves the problems, such as the preservation of user configuration, user configuration can be preserved.
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Referring to FIG. 1, Fig. 1 is the flow for the method for preserving user configuration under a kind of linux system provided by the present invention Figure, this method include:
S11:The root file system initrd under linux system is established using Open-Source Tools, and creates new mesh in memory Record newroot;
Wherein, Open-Source Tools include busybox tools, can create simple file system.New directory is created After newrooot, carry ramfs file system or tmpfs file system.It can improve ramdisk using ramfs or tmpfs Performance, and it is not necessarily to extra occupancy Installed System Memory, ramfs and tmpfs can dynamically adjust committed memory size, rather than Ramdisk equally wastes memory headroom in advance.
S12:Configuration file is found out in root file system initrd, configuration file, which is beaten compressed package, becomes configuration compression File, other system files in addition to configuration file in root file system initrd, which are beaten compressed package, becomes system compresses file;
Wherein, the configuration file for being related to user configuration preservation is found out in root file system initrd, by configuration file Compressed package is individually beaten, configuration file compressed package is formed and is named as config-origin.tar.gz, by root file system Compressed package is beaten in other system file classification in initrd, forms each system compresses file of classification.
S13:It will configure in compressed file and system compresses file migration to nonvolatile memory, and will configuration compression text Part solution is depressed into formation configuration file copy in the new directory newroot in memory;
S14:Change configuration file instruction input by user is received, under the action of changing configuration file instruction, to memory In configuration file copy be modified to obtain new configuration file;
S15:Order being preserved using configuration, new configuration file being beaten into compressed package, new configuration file is compressed to non-volatile deposit New configuration compressed file is formed in reservoir;
Wherein, order config-save is preserved using configuration, compressed package is beaten to new configuration file, and be named as config- User.tar.gz forms config-user.tar.gz compressed files, and nonvolatile memory described in carry preserves config- User.tar.g compressed files preserve to nonvolatile memory and unload nonvolatile memory after completing.
S16:When new startup root file system initrd, the new configuration compressed file of decompression obtains in the nonvolatile memory New configuration file, using new configuration file as the configuration file under current linux system.
Wherein, when root file system initrd starts initializtion script, mount order carry non-volatile memories are utilized Device detects in nonvolatile memory to the root file system initrd with the presence or absence of config-user.tar.gz compression texts Part, if it does, decompression config-user.tar.gz compressed files form new configuration file simultaneously to newroot/etc catalogues Configuration file as current Linux system.
Above specifically, for example, easy file system is made, for making using busybox tools first initrd。
Compressed package is beaten in the system file classification finally run, such as the file that/user configuration involved in etc catalogues preserves It individually makes a call to a compressed package and is named as config-origin.tar.gz, other system files are pressed the needs classification of oneself and beaten again Compressed package.All compressed packages are placed into nonvolatile memory, nonvolatile memory can be hard disk, DOM disks, CF cards, Onboard flash etc..
Then, increase following functions in initrd starts initializtion script:Create newroot catalogues, newroot catalogues Carry ramfs or tmpfs;
Secondly, continue to add following procedure in initrd starts initializtion script:Mount order carries are non-volatile to be deposited Reservoir to initrd /mnt catalogues, check for config-user.tar.gz, if there is decompression config- User.tar.gz to newroot/etc catalogues, the configuration file as final system;If there is no config- User.tar.gz then decompresses config-origin.tar.gz, uses the content of config-origin.tar.gz as final system The configuration file of system.
Again, start the last of initializtion script in initrd, decompress other necessary system files to newroot mesh Record is used in combination umount to unload nonvolatile memory, finally executes chroot switch_root orders, system is switched To newroot, after operating above, the root for being presented to the user the final system of operation is initrd's Newroot catalogues.
After being switched to final system using orders such as switch_root, the non-of daily record is stored using mount order carries Volatile memory is to/var/log catalogues.
Finally, it needs to increase the order that a user configuration preserves in the final system of making, such as names config- Save, the function of this order are to beat compressed package to configuration file, and compressed package is named as config-user.tar.gz, and carry is non-easily The property lost memory preserves config-user.tar.gz to nonvolatile memory, unloads nonvolatile memory.
Therefore, ramdisk performances can be improved using ramfs or tmpfs, and be not necessarily to extra occupancy Installed System Memory, ramfs Committed memory size can be dynamically adjusted with tmpfs, memory headroom is equally wasted in advance rather than ramdisk.Solution system While file security sex chromosome mosaicism, there is independent order that user is allowed to preserve configuration, improve the reliability of modification configuration file, use Family arbitrary disposition, when causing confusion, it is easy to restore factory-said value, it is only necessary to which provide order is config-user.tar.gz deletions It can complete, i.e., when user configuration causes confusion, it is only necessary to which the new configuration compressed file deleted on nonvolatile memory can To leave configuration compressed file, which is exactly the compressed file of original configuration file, is easy to restore former in this way Begin to configure.Moreover, there is the independent nonvolatile memory for preserving daily record, exception information is facilitated to track.
The method that user configuration is preserved under a kind of linux system provided by the present invention, configuration file are individually from root text It is separated in part system, is individually packaged and is compressed, it is to be stored in non-volatile memories that other systems file, which becomes compressed package, In device, then be system file being to store in the nonvolatile memory, user cannot be to the data on nonvolatile memory It is modified, then system file cannot be modified, and the safety of such system file is to ensure.
Moreover, for configuration file, configuration file is that independent be packaged becomes compressed file, the compressed file of configuration file In the nonvolatile memory, which is exactly original configuration file in fact for storage, then the compression text of original configuration file Part is to store in the nonvolatile memory, and the configuration file obtained after being decompressed to the compressed file of configuration file is to be stored in In catalogue on memory, that is, the configuration file after decompressing is located in memory directory, and user can be modified the data on memory, Then the configuration file on memory directory can be changed by user, and the new configuration file after change is compressed to nonvolatile memory On, then the compressed compressed file of new configuration file is to store in the nonvolatile memory, non-easy after system restarting There are the compressed files of the compressed file of original configuration file and new configuration file on the property lost memory, in the pressure of new configuration file In the presence of contracting file, using new configuration file, original configuration file is not used, by the compressed file solution of new configuration file It is pressed into configuration file of the new configuration file as current system, saves user setting in this way, realizes ensureing in this way It while system file security, solves the problems, such as the preservation of user configuration, user configuration can be preserved.
Referring to FIG. 2, Fig. 2 is the structure for the device for preserving user configuration under a kind of linux system provided by the present invention Schematic diagram, the device include:
Module 101 is established, for establishing the root file system initrd under linux system using Open-Source Tools, and inside Deposit middle establishment new directory newroot;
First compression module 102 suppresses configuration file for finding out configuration file in root file system initrd Contracting packet becomes configuring compressed file, and other system files in addition to configuration file in root file system initrd, which are beaten compressed package, to be become For system compresses file;
Transferring module 103, for that will configure in compressed file and system compresses file migration to nonvolatile memory, and Configuration compressed file solution is depressed into formation configuration file copy in the new directory newroot in memory;
Module 104 is changed, for receiving change configuration file instruction input by user, in the work of change configuration file instruction Under, the configuration file copy in memory is modified to obtain new configuration file;
New configuration file is beaten compressed package, by new configuration file by the second compression module 105 for preserving order using configuration It is compressed in nonvolatile memory and forms new configuration compressed file;
Starting module 106 decompresses in the nonvolatile memory when for restarting the root file system initrd New configuration compressed file obtains new configuration file, using new configuration file as the configuration file under current linux system.
Wherein, described device further includes:
Carry module is used for new directory newroot carry ramfs file system or tmpfs file system.
Wherein, first compression module includes:
Searching unit, for finding out the configuration file for being related to user configuration preservation in root file system initrd;
Independent compression unit, for configuration file individually to be beaten compressed package, form configuration file compressed package and is named as config-origin.tar.gz;
Classified compression unit is formed for compressed package to be beaten in other system file classification in root file system initrd Each system compresses file of classification.
Wherein, second compression module includes:
Storage unit beats compressed package, and name for preserving order config-save using configuration to new configuration file For config-user.tar.gz, config-user.tar.gz compressed files are formed;
Carry unit preserves config-user.tar.g compressed files to non-for nonvolatile memory described in carry Volatile memory;
Unloading unit is completed to unload nonvolatile memory later for preserving.
Wherein, the starting module includes:
Initialization module is used for when root file system initrd starts initializtion script, non-using mount order carries Volatile memory is to root file system initrd;
Detection module whether there is config-user.tar.gz compressed files for detecting in nonvolatile memory; If it does, decompression config-user.tar.gz compressed files form new configuration file and conduct to newroot/etc catalogues The configuration file of current Linux system.
The device of user configuration is preserved under a kind of linux system provided by the present invention, which includes establishing module, the One compression module, transferring module, change module, the second compression module and starting module.In the apparatus, configuration file is independent Separated from root file system, individually be packaged compressed, other systems file become compressed package be stored in it is non-volatile In property memory, then be system file being to store in the nonvolatile memory, user cannot be on nonvolatile memory Data be modified, then system file cannot be modified, and the safety of such system file is to ensure.
Moreover, for configuration file, configuration file is that independent be packaged becomes compressed file, the compressed file of configuration file In the nonvolatile memory, which is exactly original configuration file in fact for storage, then the compression text of original configuration file Part is to store in the nonvolatile memory, and the configuration file obtained after being decompressed to the compressed file of configuration file is to be stored in In catalogue on memory, that is, the configuration file after decompressing is located in memory directory, and user can be modified the data on memory, Then the configuration file on memory directory can be changed by user, and the new configuration file after change is compressed to nonvolatile memory On, then the compressed compressed file of new configuration file is to store in the nonvolatile memory, non-easy after system restarting There are the compressed files of the compressed file of original configuration file and new configuration file on the property lost memory, in the pressure of new configuration file In the presence of contracting file, using new configuration file, original configuration file is not used, by the compressed file solution of new configuration file It is pressed into configuration file of the new configuration file as current system, saves user setting in this way, so device realization is ensureing It while system file security, solves the problems, such as the preservation of user configuration, user configuration can be preserved.
The method and device that user configuration is preserved under a kind of linux system provided by the present invention has been carried out in detail above It introduces.Principle and implementation of the present invention are described for specific case used herein, the explanation of above example It is merely used to help understand the method and its core concept of the present invention.It should be pointed out that for the ordinary skill people of the art Member for, without departing from the principle of the present invention, can with several improvements and modifications are made to the present invention, these improve and Modification is also fallen within the protection scope of the claims of the present invention.

Claims (10)

1. a kind of method for preserving user configuration under linux system, which is characterized in that including:
The root file system initrd under linux system is established using Open-Source Tools, and creates new directory in memory newroot;
Configuration file is found out in the root file system initrd, the configuration file, which is beaten compressed package, becomes configuration compression File, other system files in addition to the configuration file in the root file system initrd, which are beaten compressed package, becomes system pressure Contracting file;
It is pressed by the configuration compressed file and the system compresses file migration to nonvolatile memory, and by the configuration Contracting file solution is depressed into formation configuration file copy in the new directory newroot in the memory;
Change configuration file instruction input by user is received, under the action of the change configuration file instructs, to the memory In configuration file copy be modified to obtain new configuration file;
Order is preserved using configuration, the new configuration file is beaten into compressed package, the new configuration file is compressed to described non-volatile Property memory in form new configuration compressed file;
When restarting the root file system initrd, the new configuration compression text is decompressed in the nonvolatile memory Part obtains the new configuration file, using the new configuration file as the configuration file under current linux system.
2. the method as described in claim 1, which is characterized in that after the newroot of establishment new directory in memory, also wrap It includes:
By the new directory newroot carry ramfs file system or tmpfs file system.
3. method as claimed in claim 1 or 2, which is characterized in that described to be found out in the root file system initrd Configuration file, by the configuration file beat compressed package become configure compressed file, by the root file system initrd in addition to Other system files of the configuration file, which beat compressed package, becomes system compresses file, including:
The configuration file for being related to user configuration preservation is found out in the root file system initrd;
The configuration file is individually beaten into compressed package, form configuration file compressed package and is named as config- origin.tar.gz;
Compressed package is beaten into other system file classification in the root file system initrd, forms each system compresses of classification File.
4. method as claimed in claim 3, which is characterized in that described to be beaten the new configuration file using configuration preservation order The new configuration file is compressed in the nonvolatile memory and forms new configuration compressed file by compressed package, including:
Order config-save is preserved using configuration, compressed package is beaten to the new configuration file, and be named as config- User.tar.gz forms config-user.tar.gz compressed files;
Nonvolatile memory described in carry preserves config-user.tar.g compressed files to the nonvolatile memory;
It preserves and unloads the nonvolatile memory after completing.
5. method as claimed in claim 4, which is characterized in that when the restarting root file system initrd, The new configuration compressed file is decompressed in the nonvolatile memory and obtains the new configuration file, by the new configuration file As the configuration file under current linux system, including:
When the root file system initrd starts initializtion script, non-volatile memories described in mount order carries are utilized Device is to the root file system initrd;
It detects and whether there is config-user.tar.gz compressed files in the nonvolatile memory;If it does, decompression Config-user.tar.gz compressed files form the new configuration file and as current linux to newroot/etc catalogues The configuration file of system.
6. the device of user configuration is preserved under a kind of linux system, including:
Module is established, for establishing the root file system initrd under linux system using Open-Source Tools, and is created in memory New directory newroot;
First compression module beats the configuration file for finding out configuration file in the root file system initrd Compressed package becomes configuring compressed file, by other system files in addition to the configuration file in the root file system initrd Beating compressed package becomes system compresses file;
Transferring module, for by the configuration compressed file and the system compresses file migration to nonvolatile memory, And the configuration compressed file solution is depressed into formation configuration file copy in the new directory newroot in the memory;
Module is changed, for receiving change configuration file instruction input by user, in the effect of the change configuration file instruction Under, the configuration file copy in the memory is modified to obtain new configuration file;
The new configuration file is beaten compressed package by the second compression module for preserving order using configuration, by the new configuration text Part, which is compressed in the nonvolatile memory, forms new configuration compressed file;
Starting module when for restarting the root file system initrd, decompresses institute in the nonvolatile memory It states new configuration compressed file and obtains the new configuration file, using the new configuration file as matching under current linux system Set file.
7. device as claimed in claim 6, which is characterized in that described device further includes:
Carry module is used for the new directory newroot carry ramfs file system or tmpfs file system.
8. device as claimed in claims 6 or 7, which is characterized in that first compression module includes:
Searching unit, for finding out the configuration file for being related to user configuration preservation in the root file system initrd;
Independent compression unit, for the configuration file individually to be beaten compressed package, form configuration file compressed package and is named as config-origin.tar.gz;
Classified compression unit is formed for compressed package to be beaten in other system file classification in the root file system initrd Each system compresses file of classification.
9. device as claimed in claim 8, which is characterized in that second compression module includes:
Storage unit beats compressed package, and name for preserving order config-save using configuration to the new configuration file For config-user.tar.gz, config-user.tar.gz compressed files are formed;
Carry unit preserves config-user.tar.g compressed files to described non-for nonvolatile memory described in carry Volatile memory;
Unloading unit is completed to unload the nonvolatile memory later for preserving.
10. device as claimed in claim 9, which is characterized in that the starting module includes:
Initialization module, for when the root file system initrd starts initializtion script, utilizing mount orders carry institute Nonvolatile memory is stated to the root file system initrd;
Detection module whether there is config-user.tar.gz compressed files for detecting in the nonvolatile memory; If it does, decompression config-user.tar.gz compressed files form the new configuration file simultaneously to newroot/etc catalogues Configuration file as current Linux system.
CN201510515998.3A 2015-08-20 2015-08-20 The method and device of user configuration is preserved under a kind of Linux system Active CN105138362B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510515998.3A CN105138362B (en) 2015-08-20 2015-08-20 The method and device of user configuration is preserved under a kind of Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510515998.3A CN105138362B (en) 2015-08-20 2015-08-20 The method and device of user configuration is preserved under a kind of Linux system

Publications (2)

Publication Number Publication Date
CN105138362A CN105138362A (en) 2015-12-09
CN105138362B true CN105138362B (en) 2018-09-07

Family

ID=54723719

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510515998.3A Active CN105138362B (en) 2015-08-20 2015-08-20 The method and device of user configuration is preserved under a kind of Linux system

Country Status (1)

Country Link
CN (1) CN105138362B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105786489B (en) * 2016-02-18 2019-05-17 山东乾云启创信息科技股份有限公司 A kind of construction method of the stateless virtualization calculate node of safety
CN105825126A (en) * 2016-03-08 2016-08-03 北京网康科技有限公司 File protecting method and device
CN107861751A (en) * 2017-11-22 2018-03-30 出门问问信息科技有限公司 The amending method and device of configuration file
CN109271206B (en) * 2018-08-24 2022-01-21 晶晨半导体(上海)股份有限公司 Memory compression and storage method for abnormal site
CN111367854B (en) * 2018-12-25 2023-02-28 成都鼎桥通信技术有限公司 Construction method of multi-container root file system
CN109739823A (en) * 2018-12-27 2019-05-10 郑州云海信息技术有限公司 A kind of method and device for building parallel file system
CN111242577A (en) * 2020-01-13 2020-06-05 中国建设银行股份有限公司 RPA process automation robot deployment method and device and electronic equipment
CN111813460A (en) * 2020-06-01 2020-10-23 北京百卓网络技术有限公司 Access method, device, equipment and storage medium for application program matching file
CN113132354B (en) * 2021-03-19 2023-04-07 重庆扬成大数据科技有限公司 Working method for carrying out file processing optimization configuration by remotely logging in government affair data network
CN115629811B (en) * 2022-12-21 2023-03-21 苏州浪潮智能科技有限公司 System stability control method and device
CN115640758B (en) * 2022-12-23 2023-03-28 南京维拓科技股份有限公司 Three-dimensional model digital quality inspection method based on knowledge construction

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831022A (en) * 2012-07-27 2012-12-19 曙光信息产业(北京)有限公司 Method and device for modifying system configuration
CN103634144A (en) * 2013-11-15 2014-03-12 新浪网技术(中国)有限公司 Method, system and equipment for managing multi-IDC (internet data center) cluster configuration file
CN103888491A (en) * 2012-12-20 2014-06-25 鸿富锦精密工业(深圳)有限公司 Diskless workstation start system and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831022A (en) * 2012-07-27 2012-12-19 曙光信息产业(北京)有限公司 Method and device for modifying system configuration
CN103888491A (en) * 2012-12-20 2014-06-25 鸿富锦精密工业(深圳)有限公司 Diskless workstation start system and method
CN103634144A (en) * 2013-11-15 2014-03-12 新浪网技术(中国)有限公司 Method, system and equipment for managing multi-IDC (internet data center) cluster configuration file

Also Published As

Publication number Publication date
CN105138362A (en) 2015-12-09

Similar Documents

Publication Publication Date Title
CN105138362B (en) The method and device of user configuration is preserved under a kind of Linux system
US11068349B2 (en) Selective processing of file system objects for image level backups
US9823877B2 (en) Virtual machine backup from storage snapshot
JP6073854B2 (en) Electronic equipment and firmware recovery program
US11681590B2 (en) File level recovery using virtual machine image level backup with selective compression
CN103218224B (en) A kind of method improving memory space utilization rate and terminal
US8112392B1 (en) Methods and systems for creating snapshots of virtualized applications
US9317373B2 (en) Snapshots in a hybrid storage device comprising a magnetic disk and a solid state disk
US9984090B1 (en) Method and system for compressing file system namespace of a storage system
US20070208893A1 (en) File-based compression on a fat volume
TW200814721A (en) A data storage management method and device
US20100138692A1 (en) Electronic device and method for restoring function settings
RU2016137900A (en) OPERATING SYSTEMS WITH OPTIONS BY THE USER
CN109905770A (en) Terminal starting up method, apparatus and terminal
CN105824678A (en) Method and device for installing operating system
CN108241550A (en) A kind of operating system backup and reduction method
CN103324456B (en) A kind of method to set up of display mode and display mode configuration-system
JP2021527291A (en) Chunk base data deduplication
CA2636160A1 (en) System and method for storing a program using partial compression
CN101228509B (en) Device and method for generating binary image
CN104750492A (en) Startup control method and device for mobile device on basis of embedded operating system
CN103942126A (en) Electronic device and data backup method thereof
KR101674176B1 (en) Method and apparatus for fsync system call processing using ordered mode journaling with file unit
KR101604222B1 (en) Recording apparatus and method
CN103942120B (en) A kind of reading/writing method and system based on Intel Virtualization Technology

Legal Events

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