TWI881649B - Method of recovering a configuration file - Google Patents
Method of recovering a configuration file Download PDFInfo
- Publication number
- TWI881649B TWI881649B TW113100271A TW113100271A TWI881649B TW I881649 B TWI881649 B TW I881649B TW 113100271 A TW113100271 A TW 113100271A TW 113100271 A TW113100271 A TW 113100271A TW I881649 B TWI881649 B TW I881649B
- Authority
- TW
- Taiwan
- Prior art keywords
- configuration file
- current
- compared
- current configuration
- check code
- Prior art date
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本發明是有關於一種回復方法,特別是指一種組態檔回復方法。The present invention relates to a recovery method, and more particularly to a configuration file recovery method.
基板管理控制器(Baseboard Management Controller,以下簡稱BMC)在電腦開機時系統初始化的過程中會存取相關的參數作爲組態檔(Configuration File),並在系統運行期間隨時更新組態檔。若BMC在將組態檔寫入記憶體時遇到非預期的斷電,便可能會因組態檔資料寫入不完全而造成組態檔異常或損毀,使得下次開機時初始化失敗,進而導致系統出現異常(例如,發生不斷重複開機等不可預期行為)。現有的處理異常組態檔的方式多是將異常的組態檔回復至出廠設定,使組態檔回復為正常狀態,以使系統可以順利初始化。然而由於組態檔回復成了出廠設定,因此用戶在後續使用時便需重新設定系統參數,造成用戶使用上的不便。The Baseboard Management Controller (BMC) accesses relevant parameters as a configuration file during the system initialization process when the computer is turned on, and updates the configuration file at any time during system operation. If the BMC encounters an unexpected power outage when writing the configuration file to the memory, the configuration file data may be incompletely written, causing the configuration file to be abnormal or damaged, resulting in initialization failure at the next startup, which in turn causes the system to be abnormal (for example, unexpected behaviors such as repeated startup). The existing method of handling abnormal configuration files is mostly to restore the abnormal configuration file to the factory settings, so that the configuration file is restored to a normal state so that the system can be initialized smoothly. However, since the configuration file is restored to the factory settings, users will need to reconfigure system parameters when using the system in the future, causing inconvenience to users.
因此,如何在保持組態檔正常並使系統順利初始化的同時儘量不影響用戶的使用方便性,已成為相關技術領域所欲解決的議題之一。Therefore, how to keep the configuration file normal and initialize the system smoothly while minimizing the impact on user convenience has become one of the issues that the relevant technical fields want to solve.
因此,本發明之目的,即在提供一種組態檔回復方法,其能克服現有技術至少一個缺點。Therefore, the purpose of the present invention is to provide a configuration file recovery method, which can overcome at least one disadvantage of the prior art.
於是,本發明所提供的一種組態檔回復方法,利用一基板管理控制器且在該基板管理控制器進行一開機初始化程序時來執行,並包含以下步驟:(A)判定一與該基板管理控制器連接的儲存模組中是否儲存有一當前組態檔、一待比對校驗碼及一備份組態檔;(B)當判定出該儲存模組中儲存有該當前組態檔、該待比對校驗碼及該備份組態檔時,獲得一對應於該當前組態檔的當前校驗碼,並判定該當前校驗碼是否與該待比對校驗碼一致;(C)當判定出該當前校驗碼不與該待比對校驗碼一致時,以該備份組態檔作為該當前組態檔;(D)獲得一對應於該當前組態檔的待更新校驗碼,並以該待更新校驗碼作為該待比對校驗碼;及(E)複製該當前組態檔以獲得一複製組態檔,並以該複製組態檔作為該備份組態檔。Therefore, the present invention provides a configuration file recovery method, which utilizes a baseboard management controller and is executed when the baseboard management controller performs a boot initialization procedure, and includes the following steps: (A) determining whether a storage module connected to the baseboard management controller stores a current configuration file, a verification code to be compared, and a backup configuration file; (B) when it is determined that the storage module stores the current configuration file, the verification code to be compared, and the backup configuration file, obtaining a corresponding (C) when it is determined that the current verification code is not consistent with the verification code to be compared, using the backup configuration file as the current configuration file; (D) obtaining a verification code to be updated corresponding to the current configuration file, and using the verification code to be updated as the verification code to be compared; and (E) copying the current configuration file to obtain a copy configuration file, and using the copy configuration file as the backup configuration file.
本發明之功效在於:藉由判定此次開機時的該當前組態檔的該當前校驗碼是否與前次開機時的該待比對校驗碼一致來判定該當前組態檔是否發生異常,並在發生異常時以前次開機時的該備份組態檔取代異常的該當前組態檔,從而保證了該當前組態檔的正常,使系統的初始化可以順利進行。此外,由於是以此次開機前最近一次開機產生的組態檔作為回復用的該備份組態檔,因此在使用該備份組態檔進行初始化後用戶並不需重新設定系統參數,從而避免了將該當前組態檔回復出廠設定給用戶帶來的不便。The utility model has the following effects: by determining whether the current check code of the current configuration file at the time of this startup is consistent with the check code to be compared at the previous startup, it is determined whether the current configuration file is abnormal, and when an abnormality occurs, the abnormal current configuration file is replaced by the backup configuration file at the previous startup, thereby ensuring the normality of the current configuration file and enabling the initialization of the system to proceed smoothly. In addition, since the configuration file generated by the last startup before the current startup is used as the backup configuration file for recovery, the user does not need to reset the system parameters after initialization using the backup configuration file, thereby avoiding the inconvenience brought to the user by restoring the current configuration file to the factory settings.
在本發明被詳細描述之前,應當注意在以下的説明內容中,類似的元件是以相同的編號來表示。Before the present invention is described in detail, it should be noted that similar elements are represented by the same reference numerals in the following description.
參閱圖1及圖2,本發明實施例的一種組態檔回復方法,利用一電連接於一儲存模組2的基板管理控制器1來執行。在本實施例中,該儲存模組2例如可實施成一快閃記憶體。當設置有該基板管理控制器1的一電腦裝置被開機時,該基板管理控制器1進行一開機初始化程序並同時執行該組態檔回復方法。該組態檔回復方法包含以下步驟S21~S27。Referring to FIG. 1 and FIG. 2 , a configuration file recovery method of an embodiment of the present invention is executed by a
在步驟S21中,該基板管理控制器1判定該儲存模組2中是否儲存有一當前組態檔、一待比對校驗碼及一備份組態檔。該步驟S21係用來判定該電腦裝置是否爲第一次被開機。當該儲存模組2中未儲存有該當前組態檔、該待比對校驗碼及該備份組態檔其中至少一者時,該電腦裝置為第一次被開機,流程進行步驟S22,以獲得該當前組態檔;當該基板管理控制器1判定出該儲存模組2中儲存有該當前組態檔、該待比對校驗碼及該備份組態檔時,該電腦裝置並非第一次被開機,流程進行步驟S23,以判定該當前組態檔是否正常。In step S21, the
在步驟S22中,該基板管理控制器1繼續執行該開機初始化程序以獲得一初始組態檔作為該當前組態檔。由於該基板管理控制器1為第一次被開機,并不存在對應的當前組態檔,因此需等待該開機初始化程序執行完畢後生成該初始組態檔,從而獲得所需的該當前組態檔。在本實施例中,該基板管理控制器1利用一Linux作業系統中的一inotify模組監控該初始組態檔是否被建立。當該初始組態檔被建立時,該inotify模組發出一指示出該初始組態檔已被建立的建立通知。當該基板管理控制器1接收到該建立通知時,該基板管理控制器1將該初始組態檔作為該當前組態檔。此後流程進行步驟S25,以啟用一組態檔監控程序。In step S22, the
在步驟S23中,該基板管理控制器1獲得一對應於該當前組態檔的當前校驗碼,並判定該當前校驗碼是否與該待比對校驗碼一致,以此判定該當前組態檔是否正常。在本實施例中,該當前校驗碼係該基板管理控制器1根據該當前組態檔中的內容,利用一md5sum雜湊演算法產生的。當該基板管理控制器1判定出該當前校驗碼與該待比對校驗碼不一致時,該當前組態檔異常,流程進行步驟S24;當該基板管理控制器1判定出該當前校驗碼與該待比對校驗碼一致時,該當前組態檔正常,流程進行步驟S25,以啟用該組態檔監控程序。In step S23, the
在步驟S24中,該基板管理控制器1以該備份組態檔作為該當前組態檔。利用前次正常開機時使用的組態檔(即該備份組態檔)來取代異常的該當前組態檔,以使該開機初始化程序及該組態檔監控程序能繼續順利執行。In step S24, the
在確保該當前組態檔存在(第一次被開機),或該當前組態檔正常(非第一次被開機)後,該基板管理控制器1執行該組態檔監控程序。該組態檔監控程序被實施成該組態檔回復方法中的以下步驟S25~S27。After ensuring that the current configuration file exists (first time booting), or the current configuration file is normal (not first time booting), the
在步驟S25中,該基板管理控制器1獲得一對應於該當前組態檔的待更新校驗碼,並以該待更新校驗碼作為該待比對校驗碼。在本實施例中,該待更新校驗碼係該基板管理控制器1根據該當前組態檔中的內容,利用該md5sum雜湊演算法產生的。In step S25, the
在步驟S26中,該基板管理控制器1複製該當前組態檔以獲得一複製組態檔,並以該複製組態檔作為該備份組態檔。藉由此步驟,保證了在下一次開機時用於回復的備份組態檔總是最近一次正常開機時產生的最新的組態檔。In step S26, the
在步驟S27中,該基板管理控制器1判定該當前組態檔是否被更新。在本實施例中,該基板管理控制器1係利用該inotify模組監控該當前組態檔是否被更新。當該當前組態檔被更新時,該inotify模組發出一指示出該當前組態檔已完成更新(即,該當前組態檔已從寫入模式關閉)的更新通知。因此,該基板管理控制器1藉由判定是否接收到該更新通知,以判定該當前組態檔是否被更新。當判定出接收到該更新通知時,流程回到步驟S25;否則,流程再次進行步驟S27。In step S27, the
該基板管理控制器1藉由重複執行步驟S25~S27來重複執行該組態檔監控程序,以達成在該電腦裝置運行時不斷監控並更新該備份組態檔的目的,使得該備份組態檔總是處於最新狀態。The
需要注意的是,當該電腦裝置為第一次被開機時,流程僅會依序進行步驟S21、步驟S22及步驟S25~S27;而當該電腦裝置並非第一次被開機時,流程則會依序進行步驟S21、步驟S23、步驟S24(該當前組態檔正常時不執行)及步驟S25~S27。It should be noted that when the computer device is powered on for the first time, the process will only proceed to step S21, step S22 and steps S25~S27 in sequence; and when the computer device is not powered on for the first time, the process will proceed to step S21, step S23, step S24 (not executed when the current configuration file is normal) and steps S25~S27 in sequence.
綜上所述,藉由判定此次開機時的該當前組態檔的該當前校驗碼是否與前次開機時的該待比對校驗碼一致來判定該當前組態檔是否發生異常,並在發生異常時以前次開機時的該備份組態檔取代異常的該當前組態檔,從而保證了該當前組態檔的正常,使系統的初始化可以順利進行。此外,由於是以此次開機前最近一次開機產生的組態檔作為回復用的該備份組態檔,因此在使用該備份組態檔進行初始化後用戶並不需重新設定系統參數,從而避免了將該當前組態檔回復出廠設定給用戶帶來的不便。故確實能達成本發明之目的。In summary, by determining whether the current checksum of the current configuration file at this startup is consistent with the checksum to be compared at the previous startup, it is determined whether the current configuration file is abnormal, and when an abnormality occurs, the abnormal current configuration file is replaced by the backup configuration file at the previous startup, thereby ensuring that the current configuration file is normal and the system initialization can proceed smoothly. In addition, since the configuration file generated by the most recent startup before this startup is used as the backup configuration file for recovery, the user does not need to reset the system parameters after initialization using the backup configuration file, thereby avoiding the inconvenience brought to the user by restoring the current configuration file to the factory settings. Therefore, the purpose of the present invention can be achieved.
惟以上所述者,僅為本發明之實施例而已,當不能以此限定本發明實施之範圍,凡是依本發明申請專利範圍及專利說明書內容所作之簡單的等效變化與修飾,皆仍屬本發明專利涵蓋之範圍內。However, the above is only an example of the implementation of the present invention, and it should not be used to limit the scope of the implementation of the present invention. All simple equivalent changes and modifications made according to the scope of the patent application of the present invention and the content of the patent specification are still within the scope of the patent of the present invention.
1:基板管理控制器 2:儲存模組 S21~S27:步驟 1: Baseboard management controller 2: Storage module S21~S27: Steps
本發明之其他的特徵及功效,將於參照圖式的實施方式中清楚地呈現,其中: 圖1是一方塊圖,示例性地説明本發明實施例的一種組態檔回復方法所使用的一基板管理控制器及一儲存模組;及 圖2是一流程圖,示例性地説明該實施例的該基板管理控制器如何執行該組態檔回復方法。 Other features and effects of the present invention will be clearly presented in the implementation method with reference to the drawings, wherein: FIG. 1 is a block diagram, exemplarily illustrating a baseboard management controller and a storage module used in a configuration file recovery method of an embodiment of the present invention; and FIG. 2 is a flow chart, exemplarily illustrating how the baseboard management controller of the embodiment executes the configuration file recovery method.
S21~S27:步驟 S21~S27: Steps
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW113100271A TWI881649B (en) | 2024-01-03 | 2024-01-03 | Method of recovering a configuration file |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW113100271A TWI881649B (en) | 2024-01-03 | 2024-01-03 | Method of recovering a configuration file |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI881649B true TWI881649B (en) | 2025-04-21 |
| TW202528933A TW202528933A (en) | 2025-07-16 |
Family
ID=96141958
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW113100271A TWI881649B (en) | 2024-01-03 | 2024-01-03 | Method of recovering a configuration file |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI881649B (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI709036B (en) * | 2019-10-03 | 2020-11-01 | 神雲科技股份有限公司 | Method of recovering the bios configuration parameter and server system |
| US10824517B2 (en) * | 2017-05-08 | 2020-11-03 | American Megatrends International, Llc | Backup and recovery of configuration files in management device |
| CN115712523A (en) * | 2022-10-28 | 2023-02-24 | 北京东土科技股份有限公司 | Configuration file backup and recovery method, device, switch and storage medium |
| CN115951949A (en) * | 2022-12-26 | 2023-04-11 | 超聚变数字技术有限公司 | Method, device and computing device for recovering configuration parameters of BIOS |
| CN112559059B (en) * | 2020-11-19 | 2023-07-14 | 山东云海国创云计算装备产业创新中心有限公司 | A BIOS option configuration method and related device |
-
2024
- 2024-01-03 TW TW113100271A patent/TWI881649B/en active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10824517B2 (en) * | 2017-05-08 | 2020-11-03 | American Megatrends International, Llc | Backup and recovery of configuration files in management device |
| TWI709036B (en) * | 2019-10-03 | 2020-11-01 | 神雲科技股份有限公司 | Method of recovering the bios configuration parameter and server system |
| CN112559059B (en) * | 2020-11-19 | 2023-07-14 | 山东云海国创云计算装备产业创新中心有限公司 | A BIOS option configuration method and related device |
| CN115712523A (en) * | 2022-10-28 | 2023-02-24 | 北京东土科技股份有限公司 | Configuration file backup and recovery method, device, switch and storage medium |
| CN115951949A (en) * | 2022-12-26 | 2023-04-11 | 超聚变数字技术有限公司 | Method, device and computing device for recovering configuration parameters of BIOS |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202528933A (en) | 2025-07-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106598635B (en) | Recovery method of baseboard management controller and baseboard management controller | |
| US8601255B2 (en) | Approaches for updating bios | |
| US11163886B2 (en) | Information handling system firmware bit error detection and correction | |
| US20070022328A1 (en) | Firmware Update for Consumer Electronic Device | |
| CN101364193A (en) | Method for automatically recovering BIOS and computer and system using the same | |
| TW201520895A (en) | System and method for automatically recovering BIOS of a computer | |
| CN102270144A (en) | Embedded network equipment and method for upgrading firmware by using same | |
| TW201843583A (en) | Method and computer system for automatically recovering the BIOS image file | |
| US11550655B2 (en) | System and method for monitoring and upgrading a dual-flash device | |
| US11481278B2 (en) | System and method for recovering an operating system after a runtime hang using a dual-flash device | |
| US11797389B2 (en) | System and method for recovering an operating system after an upgrade hang using a dual-flash device | |
| TWI764454B (en) | Firmware corruption recovery | |
| CN113867807A (en) | Method, device, equipment and storage medium for shortening power-on time of server | |
| US11243780B2 (en) | System and method for operating system installation using a dual-flash device | |
| WO2021103745A1 (en) | Method for protectively desiging boot program | |
| WO2015184732A1 (en) | Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium | |
| US20210357298A1 (en) | Recovery via backups of recovery information | |
| TWI881649B (en) | Method of recovering a configuration file | |
| TWI650646B (en) | Cable data machine and its operation method | |
| CN113050887A (en) | Flash partition data processing method and device, computer equipment and storage medium | |
| KR101850275B1 (en) | Method for generating boot image for fast booting and image forming apparatus for performing the same, method for performing fast booting and image forming apparatus for performing the same | |
| TWI786945B (en) | Data storage device and method capable of quickly updating operating system | |
| US11762756B2 (en) | System and method for startup data verification | |
| CN120371598A (en) | Configuration file recovery method | |
| TWI541724B (en) | Circuit and method for writing bios code into bios |