Operating system compatible control method, device and switch without BMC
By detecting the BMC status and loading the corresponding driver data and interface file packages, the SONiC operating system achieves compatibility with and without BMC hardware, solving the problem of repeated image development and testing in existing technologies and improving development and testing efficiency.
Patent Information
- Application Number
- CN202211493131.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2042-11-25
AI Technical Summary
The existing SONiC operating system requires the development and testing of two separate images to be compatible with hardware forms with and without BMC, which increases workload and time. Furthermore, the images need to be repeatedly verified during testing and production, resulting in low efficiency.
This paper provides a control method for operating system compatibility with or without a BMC. By detecting whether the BMC is present, the corresponding driver data and interface file package are loaded, and the driver data is compiled and installed in a unified manner, reducing branch management and achieving compatibility with the SONiC operating system.
It reduced the development workload and time of the SONiC operating system, reduced the number of branches and image verifications, improved development and testing efficiency, and saved overall testing and production time.
Smart Images

Figure CN115904436B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interactive machine technology, and in particular to the field of open interactive machine technology. Background Technology
[0002] A white-box switch is a switch with only hardware structure; it cannot be used without software. Each switch must have its own independent hardware operating system, similar to Linux and Windows on a server. White-box switches are developed with multiple features to meet the needs of different customers, including the customization of whether or not to include a Baseboard Management Controller (BMC) chip.
[0003] SONiC OS is currently the most popular operating system on switches. SONiC OS development needs to be implemented to accommodate hardware with or without a BMC chip. Currently, the SONiC community's code architecture lacks this compatibility design. For hardware machines without a BMC chip, a new branch needs to be added to the software, and the corresponding OS image needs to be compiled and released. For testing and factory operations, it's also necessary to flash and verify two SONiC OS images onto machines with and without BMC chips, increasing the workload at each stage and extending the overall project timeline. Summary of the Invention
[0004] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a control method, device and switch for operating system compatibility with and without BMC, for SONiC operating system compatibility with both BMC and without BMC, reducing the workload and time of developing SONiC operating system.
[0005] To achieve the above and other related objectives, the present invention provides a control method for operating system compatibility with or without a BMC (Browser Control Center). The method includes: in response to the installation of a SONiC operating system, detecting whether a BMC is present; in response to a BMC being present, loading first driver data corresponding to the presence of the BMC and installing a first interface file package corresponding to the first driver data; in response to a BMC not being present, loading second driver data corresponding to the absence of the BMC and installing a second interface file package corresponding to the second driver data; wherein the second driver data includes all driver device data, sensor data, and preset fan control strategies of the SONiC operating system.
[0006] In one embodiment of the present invention, the first driver data includes general driver device data of the SONiC operating system.
[0007] In one embodiment of the present invention, before the SONiC operating system is installed, the method further includes: in response to the compilation of the SONiC operating system, packaging the first driver data and the second driver data into the same system platform database, so that when the BMC is in place, the first driver data corresponding to the BMC being in place is loaded from the system platform database, and when the BMC is not in place, the second driver data corresponding to the BMC being not in place is loaded from the system platform database.
[0008] In one embodiment of the present invention, before detecting whether the BMC is in place, the method further includes: in response to the installation of the SONiC operating system, installing the system platform database on the SONiC operating system.
[0009] In one embodiment of the present invention, the method further includes: dividing the interface files of the system platform into BMC-in-place interface files and BMC-out-of-place interface files; in response to SONiC operating system compilation, generating the first interface file package based on the BMC-in-place interface files, and generating the second interface file package based on the BMC-out-of-place interface files.
[0010] In one embodiment of the present invention, the method further includes: enabling the general services of the SONiC operating system to complete the installation of the SONiC operating system.
[0011] To achieve the above and other related objectives, the present invention also provides an operating system compatible control device with or without a BMC, comprising: an in-situ detection module, which detects whether the BMC is in-situ in response to the installation of the SONiC operating system; a BMC in-situ control module, which, in response to the BMC being in-situ, loads first drive data corresponding to the BMC being in-situ and installs a first interface file package corresponding to the first drive data; and a BMC out-of-situ control module, which, in response to the BMC being out of-situ, loads second drive data corresponding to the BMC being out of-situ and installs a second interface file package corresponding to the second drive data; wherein the second drive data includes all drive device data, sensor data, and preset fan control strategies of the SONiC operating system.
[0012] In one embodiment of the present invention, a compilation control module is further included. The compilation control module includes: a driver data compilation unit, which, in response to the compilation of the SONiC operating system, packages the first driver data and the second driver data into the same system platform database; and an interface file compilation unit, which, in response to the compilation of the SONiC operating system, generates the first interface file package based on the BMC in-place interface file and generates the second interface file package based on the BMC out-of-place interface file; wherein, the interface files of the system platform are pre-divided into BMC in-place interface files and BMC out-of-place interface files.
[0013] To achieve the above and other related objectives, the present invention also provides a storage medium storing program instructions, which, when executed, implement the steps of the operating system compatible control method with or without BMC as described above.
[0014] To achieve the above and other related objectives, the present invention also provides a switch, including a memory for storing a computer program; and a processor for running the computer program to implement the steps of the operating system compatible control method with or without BMC as described above.
[0015] As described above, the operating system of the present invention is compatible with control methods, devices, and switches with and without BMC, which has the following advantages:
[0016] This invention enables the SONiC operating system to be compatible with both BMC and non-BMC versions, reducing the workload and time required for SONiC operating system development. It also eliminates the need for two branches for code management, reducing the number of branches and release (candidate version) counts. Common issues can be resolved with a single commit, minimizing redundant code commits and synchronization, thus facilitating development and maintenance. For testing and production, this application only requires burning and verifying one SONiC OS image, reducing redundant testing items and saving overall testing and production time. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 The diagram shows the overall principle flow of a control method with or without BMC for operating system compatibility in one embodiment of this application.
[0019] Figure 2 This is a schematic diagram illustrating the specific implementation process of a control method for operating system compatibility with or without BMC in one embodiment of this application.
[0020] Figure 3 The diagram shown is a schematic block diagram of a control device with or without a BMC, according to an embodiment of this application.
[0021] Figure 4 The diagram shown is a preferred principle block diagram of an operating system compatible with control devices with or without BMC in one embodiment of this application.
[0022] Figure 5 The diagram shown is a schematic block diagram of a switch according to one embodiment of this application.
[0023] Component designation explanation
[0024] 100% Operating system compatible with control devices with or without BMC
[0025] 110 In-situ detection module
[0026] 120 BMC In-situ Control Module
[0027] 130 BMC Off-Presence Control Module
[0028] 140 Compiler Control Module
[0029] 101 switch
[0030] 1001 processor
[0031] 1002 Memory
[0032] S100~S300 Steps Detailed Implementation
[0033] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0034] Currently, the SONiC community's code architecture does not have this compatibility design. For hardware machines without a Baseboard Management Controller (BMC) chip (NON-BMC chip), a new branch needs to be added to the software and the corresponding OS (Operating System) image needs to be compiled and released.
[0035] For testing and manufacturing, it is also necessary to burn and verify two SONiC OS images onto machines with BMC chips and machines with NON-BMC chips. This increases the workload at each stage and also increases the overall project time.
[0036] SONiC OS is currently the most popular operating system on switches. SONiC OS needs to be developed and implemented to meet hardware requirements, whether it has a BMC chip or not.
[0037] When a switch is equipped with a BMC chip, the BMC provides an I2C / IPMI interface to communicate and manage devices, monitor sensor temperatures, and adjust fan status in a timely manner to implement fan control strategies to meet terminal requirements.
[0038] When the switch's BMC chip is not present, in SONiC OS, it is necessary to develop driver device files and sensor nodes for the relevant devices, and implement fan control strategies to replace the functions of the BMC chip.
[0039] The purpose of this embodiment is to provide a control method, device, and switch that are compatible with both BMC and non-BMC operating systems, so as to reduce the workload and time of developing the SONiC operating system.
[0040] The following will elaborate on the principles and implementation methods of the operating system compatible with BMC control methods, devices, and switches of the present invention, so that those skilled in the art can understand the operating system compatible with BMC control methods, devices, and switches of the present invention without creative effort.
[0041] Example 1
[0042] This embodiment provides a control method for operating system compatibility with or without a BMC, specifically, as follows: Figure 1 As shown, the control method for operating system compatibility with or without BMC in this embodiment includes the following steps:
[0043] Step S100: In response to the installation of the SONiC operating system, check whether the BMC is in place;
[0044] Step S200: In response to the presence of BMC, load the first driver data corresponding to the presence of BMC, and install the first interface file package corresponding to the first driver data;
[0045] In step S300, in response to the absence of BMC, the second driver data corresponding to the absence of BMC is loaded, and the second interface file package corresponding to the second driver data is installed; wherein, the second driver data contains all driver device data, sensor data and preset fan control strategies of the SONiC operating system.
[0046] The following combination Figure 2 Steps S100 to S300 of the control method for operating system compatibility with or without BMC in this embodiment will be described in detail.
[0047] The difference between SONiC OS with and without a BMC chip lies in three aspects: the implementation and loading of driver devices and sensor nodes, the implementation of platform API (system interface) files, and fan control strategies.
[0048] In this embodiment, during the compilation phase, all driver devices in SONiC OS, including all driver devices adapted to BMC and NON-BMC such as FPGAs and their I2C paths, various CPLDs, optical modules, fans, PSUs, and power controllers, need to be packaged into platform-modules.deb (system platform database). Additionally, the fan control strategy service adapted to NON-BMC also needs to be packaged into this file.
[0049] Specifically, in this embodiment, the driver data of the SONiC operating system is divided into two parts. When the BMC is present, the BMC provides an I2C / IPMI interface to communicate and manage devices, monitor sensor temperatures, and adjust fan status in a timely manner to implement fan control strategies to meet terminal requirements. Therefore, it is not necessary to load all driver devices at this time; only general driver device files need to be loaded, such as FPGA devices and the I2C channel implemented by the FPGA, CPLD driver devices on the switchboard and baseboard, and optical module driver devices. At this time, the general driver device files are used as the first driver data, that is, the first driver data includes the general driver device data of the SONiC operating system. When the BMC is not present, it is necessary to develop driver device files for related devices and sensor nodes, and implement fan control strategies to replace the relevant functions of the BMC chip. Therefore, at this time, all driver devices, such as fan and PSU device drivers, power controller and power-related sensor drivers, and fan control strategy services, are used as the second driver data.
[0050] Therefore, in this embodiment, before the SONiC operating system is installed, the following is included:
[0051] In response to the SONiC operating system compilation, the first driver data and the second driver data are packaged into the same system platform database, so that when the BMC is in place, the first driver data corresponding to the BMC being in place is loaded from the system platform database, and when the BMC is not in place, the second driver data corresponding to the BMC being not in place is loaded from the system platform database.
[0052] In this embodiment, the method further includes: dividing the interface files of the system platform into BMC-in-place interface files and BMC-out-of-place interface files; in response to the compilation of the SONiC operating system, generating the first interface file package based on the BMC-in-place interface files, and generating the second interface file package based on the BMC-out-of-place interface files.
[0053] Specifically, in this embodiment, in order to compile two different interface file packages, a folder for the second interface file package is created under the platform interface file path, and all the interface files needed when the BMC is not in place are placed in it; at the same time, the compilation control files for the first and second interface file packages are distinguished, a new compilation control file is created, and the second interface file package is generated through it, so that there are two interface file packages in the compilation output.
[0054] In other words, in this embodiment, the Platform API (system interface) files are divided into two folders and named separately to distinguish them, forming BMC in-place interface files and BMC out-of-place interface files. The BMC in-place interface files and the BMC out-of-place interface files generate two different whl packages during compilation: the first interface file package: sonic_platform.whl and the second interface file package: non-bmc_sonic_platform.whl.
[0055] In this embodiment, before detecting whether the BMC is in place, the method further includes: in response to the SONiC operating system installation, installing the system platform database on the SONiC operating system. That is, in this embodiment, during the SONiC OS installation phase, platform-modules.deb is installed first. Then, the following steps S100 to S300 are executed.
[0056] Step S100: In response to the installation of the SONiC operating system, check whether the BMC is in place.
[0057] Specifically, in this embodiment, in response to the installation of the SONiC operating system, the presence of the BMC is detected by detecting the relevant driver nodes or reading the relevant registers of the CPLD.
[0058] In step S200, in response to the presence of BMC, the first driver data corresponding to the presence of BMC is loaded, and the first interface file package corresponding to the first driver data is installed.
[0059] Specifically, in this embodiment, in response to the presence of the BMC, the first driver data corresponding to the presence of the BMC is loaded in the platform_modules_init file of the control driver loading, and the first interface file package corresponding to the first driver data is installed in the install function of the control script paltform_api_mgnt.sh of the interface file package.
[0060] In this embodiment, it is determined whether the BMC chip is in place. If it is in place, the general driver device file in the package, i.e., the first driver data, is loaded, and the corresponding platform API whl package is installed: the first interface file package: sonic_platform.whl.
[0061] In step S300, in response to the absence of BMC, the second driver data corresponding to the absence of BMC is loaded, and the second interface file package corresponding to the second driver data is installed; wherein, the second driver data contains all driver device data, sensor data and preset fan control strategies of the SONiC operating system.
[0062] Specifically, in this embodiment, in response to the absence of BMC, the second driver data corresponding to the absence of BMC is loaded through the two files platform_modules_init and the control script paltform_api_mgnt.sh of the interface file package, and the second interface file package corresponding to the second driver data is installed. At the same time, the fan control strategy developed according to thermal requirements when BMC is not in the service is enabled.
[0063] In this embodiment, it is determined whether the BMC chip is in place. If it is not in place, all driver devices and fan control policy services, i.e., the second driver data, are loaded, and the corresponding platform API whl package second interface file package: non-bmc_sonic_platform.whl is installed to enable the fan control policy.
[0064] In this embodiment, the method further includes: enabling the general services of the SONiC operating system to complete the SONiC operating system installation. These general services specifically include, but are not limited to, the Redis database, various Docker containers, and the services required within those containers.
[0065] like Figure 2 As shown, the specific implementation process of the control method with and without BMC in this embodiment is as follows:
[0066] The SONiC operating system installation process involves checking if the BMC (Browser Control Center) is present. If the BMC is present, the system loads the generic driver device file (i.e., the first driver data) from the package and installs the corresponding platform API whl package: the first interface file package: sonic_platform.whl. Then, it enables the generic services of the SONiC operating system to complete the SONiC operating system installation.
[0067] If the BMC is not present, load the second driver data corresponding to the BMC's absence. This second driver data contains all driver device data, sensor data, and preset fan control policies for the SONiC operating system. Then, install the second interface file package corresponding to the second driver data: non-bmc_sonic_platform.whl, enable the fan control policy, and finally enable the general services of the SONiC operating system to complete the SONiC operating system installation.
[0068] Therefore, the operating system compatibility control method with and without BMC in this embodiment enables the SONiC operating system to be compatible with both BMC and non-BMC versions, reducing the workload and time required for developing the SONiC operating system. It also eliminates the need for two branches for code management, reducing the number of branches and release (candidate version) counts. Common issues can be resolved with a single commit, reducing redundant code commits and synchronization, thus facilitating development and maintenance. For testing and production, this application only requires burning and verifying one SONiC OS image, reducing redundant testing items and saving overall testing and production time.
[0069] Example 2
[0070] like Figure 3 As shown, this embodiment also provides an operating system compatible control device 100 with or without BMC. The operating system compatible control device 100 with or without BMC includes: an in-situ detection module 110, a BMC in-situ control module 120, and a BMC out-of-situ control module 130.
[0071] In this embodiment, as Figure 4 As shown, it also includes a compilation control module 140, which includes a driver data compilation unit and an interface file compilation unit.
[0072] The driver data compilation unit, in response to the SONiC operating system compilation, packages the first driver data and the second driver data into the same system platform database.
[0073] The difference between SONiC OS with and without a BMC chip lies in three aspects: the implementation and loading of driver devices and sensor nodes, the implementation of platform API (system interface) files, and fan control strategies.
[0074] In this embodiment, during the compilation phase, all driver devices in SONiC OS, including all driver devices adapted to BMC and NON-BMC such as FPGAs and their I2C paths, various CPLDs, optical modules, fans, PSUs, and power controllers, are packaged together with the fan control policy service adapted to NON-BMC into platform-modules.deb (system platform database).
[0075] Specifically, in this embodiment, the driver data of the SONiC operating system is divided into two parts. When the BMC is present, the BMC provides an I2C / IPMI interface to communicate and manage devices, monitor sensor temperatures, and adjust fan status in a timely manner to implement fan control strategies to meet terminal requirements. Therefore, it is not necessary to load all driver devices at this time; only general driver device files need to be loaded, such as FPGA devices and the I2C channel implemented by the FPGA, CPLD driver devices on the switchboard and baseboard, and optical module driver devices. At this time, the general driver device files are used as the first driver data, that is, the first driver data includes the general driver device data of the SONiC operating system. When the BMC is not present, it is necessary to develop driver device files for related devices and sensor nodes, and implement fan control strategies to replace the relevant functions of the BMC chip. Therefore, at this time, all driver devices, such as fan and PSU device drivers, power controller and power-related sensor drivers, and fan control strategy services, are used as the second driver data.
[0076] Therefore, in this embodiment, before installing the SONiC operating system, the SONiC operating system is compiled, and the first driver data and the second driver data are packaged into the same system platform database, so that when the BMC is in place, the first driver data corresponding to the BMC being in place is loaded from the system platform database, and when the BMC is not in place, the second driver data corresponding to the BMC being not in place is loaded from the system platform database.
[0077] The interface file compilation unit responds to the SONiC operating system compilation, generates the first interface file package based on the BMC in-place interface file, and generates the second interface file package based on the BMC out-of-place interface file; wherein the interface files of the system platform are pre-divided into BMC in-place interface files and BMC out-of-place interface files.
[0078] In this embodiment, the interface files of the system platform are divided into BMC in-place interface files and BMC out-of-place interface files; the interface file compilation unit responds to the SONiC operating system compilation, generates the first interface file package based on the BMC in-place interface files, and generates the second interface file package based on the BMC out-of-place interface files.
[0079] Specifically, in this embodiment, in order to compile two different interface file packages, a folder for the second interface file package is created under the platform interface file path, and all the interface files needed when the BMC is not in place are placed in it; at the same time, the compilation control files for the first and second interface file packages are distinguished, a new compilation control file is created, and the second interface file package is generated through it, so that there are two interface file packages in the compilation output.
[0080] In other words, in this embodiment, the Platform API (system interface) files are divided into two folders and named separately to distinguish them, forming BMC in-place interface files and BMC out-of-place interface files. The BMC in-place interface files and the BMC out-of-place interface files generate two different whl packages during compilation: the first interface file package: sonic_platform.whl and the second interface file package: non-bmc_sonic_platform.whl.
[0081] In this embodiment, the system platform database is installed on the SONiC operating system before detecting whether the BMC is in place.
[0082] The presence detection module 110 detects whether the BMC is present in response to the installation of the SONiC operating system.
[0083] Specifically, in this embodiment, the presence detection module 110, in response to the installation of the SONiC operating system, detects whether the BMC is present by detecting the relevant driver nodes or reading the relevant registers of the CPLD.
[0084] In response to the BMC being in place, the BMC in-situ control module 120 loads the first driving data corresponding to the BMC being in place and installs the first interface file package corresponding to the first driving data.
[0085] Specifically, in this embodiment, the BMC in-situ control module 120, in response to the BMC being in-situ, loads the first driver data corresponding to the BMC being in-situ in the platform_modules_init file loaded by the control driver, and installs the first interface file package corresponding to the first driver data in the install function of the control script paltform_api_mgnt.sh of the interface file package.
[0086] In this embodiment, the presence detection module 110 determines whether the BMC chip is present. If it is present, the BMC presence control module 120 loads the general driver device file, i.e., the first driver data, in the package and installs the corresponding platformAPI whl package: the first interface file package: sonic_platform.whl.
[0087] In response to the absence of the BMC, the BMC-out-of-position control module 130 loads the second drive data corresponding to the absence of the BMC and installs the second interface file package corresponding to the second drive data; wherein, the second drive data contains all drive device data, sensor data and preset fan control strategies of the SONiC operating system.
[0088] Specifically, in this embodiment, the BMC-out-of-location control module 130, in response to the BMC being out of place, also loads the second driver data corresponding to the BMC being out of place through the two files platform_modules_init and the control script paltform_api_mgnt.sh of the interface file package, and installs the second interface file package corresponding to the second driver data. At the same time, it enables the fan control strategy developed according to thermal requirements when the BMC is out of place in the service.
[0089] In this embodiment, the presence detection module 110 determines whether the BMC chip is present. If it is not present, the BMC absent control module 130 loads all the driving devices and fan control strategy services, i.e., the second driving data, and installs the corresponding platform API whl package second interface file package: non-bmc_sonic_platform.whl, and enables the fan control strategy.
[0090] This embodiment also includes a service startup module, which enables the general services of the SONiC operating system and completes the SONiC operating system installation. These general services specifically include, but are not limited to, the Redis database, various Docker containers, and the services required within those containers.
[0091] In this embodiment, the control device for operating system compatibility with or without BMC can implement the control method for operating system compatibility with or without BMC described in this invention. However, the implementation device for the control method for operating system compatibility with or without BMC described in this invention includes, but is not limited to, the structure of the control device for operating system compatibility with or without BMC listed in this embodiment. All structural modifications and substitutions of the prior art made based on the principle of this embodiment are included within the protection scope of this invention.
[0092] In this application, the control device 100 that is compatible with the operating system with or without BMC can implement the control method for compatibility with the operating system with or without BMC described in this embodiment. Therefore, the specific implementation functions of each module of the control device 100 that is compatible with the operating system with or without BMC are described in detail in the description of the control method for compatibility with the operating system with or without BMC, and will not be repeated here.
[0093] However, the implementation device of the operating system compatible control method with or without BMC described in this embodiment includes, but is not limited to, the operating system compatible control device with or without BMC listed in this embodiment. Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the above-mentioned division of functional units and modules is only used as an example. In actual applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system / device is divided into different functional units or modules to complete all or part of the functions described above.
[0094] Example 3
[0095] like Figure 5 As shown, this embodiment provides a switch 101, which includes a processor 1001 and a memory 1002. The memory 1002 is used to store computer programs. The processor 1001 is used to execute the computer programs stored in the memory 1002, so that the switch 101 performs the steps of the control method with or without BMC as described in Embodiment 1. Since the specific implementation process of the control method with or without BMC has been described in detail in Embodiment 1, it will not be repeated here.
[0096] Any references to memory, storage, database, or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0097] Furthermore, this embodiment also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by the processor 1001, it implements the steps in the control method for operating system compatibility with or without BMC described in Embodiment 1. Embodiment 1 has already provided a detailed description of the control method for operating system compatibility with or without BMC, and will not be repeated here.
[0098] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0099] In summary, this invention enables the SONiC operating system to be compatible with both BMC and non-BMC versions, reducing the workload and time required for SONiC operating system development. It also eliminates the need for two branches for code management, reducing the number of branches and release (candidate version) counts. Common issues can be resolved with a single commit, minimizing redundant code commits and synchronization, thus facilitating development and maintenance. For testing and production, this application only requires burning and verifying a single SONiC OS image, reducing redundant testing items and saving overall testing and production time. Therefore, this invention effectively overcomes the various shortcomings of existing technologies and possesses high industrial applicability.
[0100] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A control method compatible with operating systems and with or without BMC, characterized in that: The method includes: In response to SONiC operating system installation, check if BMC is in place; In response to the presence of the BMC, the first driver data corresponding to the presence of the BMC is loaded, and the first interface file package corresponding to the first driver data is installed. In response to the absence of BMC, the second driver data corresponding to the absence of BMC is loaded, and the second interface file package corresponding to the second driver data is installed; wherein, the second driver data contains all driver device data, sensor data and preset fan control strategies of the SONiC operating system.
2. The operating system compatibility control method with or without BMC according to claim 1, characterized in that: The first driver data includes general driver device data for the SONiC operating system.
3. The operating system compatibility control method with or without BMC according to claim 2, characterized in that: Before installing the SONiC operating system, the following are also included: In response to the SONiC operating system compilation, the first driver data and the second driver data are packaged into the same system platform database, so that when the BMC is in place, the first driver data corresponding to the BMC being in place is loaded from the system platform database, and when the BMC is not in place, the second driver data corresponding to the BMC being not in place is loaded from the system platform database.
4. The operating system compatibility control method with or without BMC according to claim 3, characterized in that: Before checking whether the BMC is in place, the following is also included: In response to the installation of the SONiC operating system, the system platform database is installed on the SONiC operating system.
5. The operating system compatibility control method with or without BMC according to claim 3, characterized in that: Also includes: The system platform's interface files are divided into BMC-in-place interface files and BMC-out-of-place interface files; In response to the SONiC operating system compilation, the first interface file package is generated based on the BMC in-place interface file, and the second interface file package is generated based on the BMC out-of-place interface file.
6. The operating system compatibility control method with or without BMC according to claim 1, characterized in that: Also includes: Enable the general services of the SONiC operating system to complete the SONiC operating system installation.
7. A control device with or without a BMC that is compatible with an operating system, characterized in that: include: The presence detection module, in response to the installation of the SONiC operating system, detects whether the BMC is present. The BMC in-situ control module, in response to the BMC being in-situ, loads the first drive data corresponding to the BMC being in-situ, and installs the first interface file package corresponding to the first drive data; The BMC-absent control module, in response to the absence of the BMC, loads the second drive data corresponding to the absence of the BMC and installs the second interface file package corresponding to the second drive data; wherein, the second drive data contains all drive device data, sensor data and preset fan control strategies of the SONiC operating system.
8. The operating system according to claim 7 is compatible with control devices with or without BMC, characterized in that: It also includes a compilation control module, which includes: The driver data compilation unit, in response to SONiC operating system compilation, packages the first driver data and the second driver data into the same system platform database; The interface file compilation unit, in response to the SONiC operating system compilation, generates the first interface file package based on the BMC in-place interface file and generates the second interface file package based on the BMC out-of-place interface file; wherein, the interface files of the system platform are pre-divided into BMC in-place interface files and BMC out-of-place interface files.
9. A storage medium storing program instructions, characterized in that: When the program instructions are executed, they implement the steps of the control method for operating system compatibility with or without BMC as described in any one of claims 1 to 6.
10. A switch, characterized in that: It includes a memory for storing a computer program; and a processor for running the computer program to implement the steps of the operating system compatible control method with or without BMC as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for restoring switch
CN111182033A
Switch production line test method and system, terminal and storage medium
CN114584499A
