An automatic production method based on the Loongson PMON platform

By using the redhat distribution operating system as an intermediate medium on the Loongson PMON platform, the automatic installation of the debian distribution is realized, and the problem that the Loongson PMON firmware cannot mass-produce the debian system, improving production efficiency and system stability.

CN115080074BActive Publication Date: 2025-07-22CHENGDU DBAPP SECURITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210865291.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-07-22
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

The existing Loongson PMON firmware cannot unattended installation of the debian distribution operating system, resulting in low mass production efficiency, error-prone and failure to start normally.

Method used

By using the redhat distribution operating system as an intermediate medium on Loongson PMON firmware, building a TFTP server, configuring the IP address and sharing directory, using the command line interface of the PMON firmware to load the kernel and initialize the file system on the network, automatically detecting the hard disk partition and formatting, decompressing the file system, and performing personalized settings, and finally realizing the automatic installation of the debian distribution.

Benefits of technology

The mass production and installation of Loongson PMON platform has been realized, which reduces manual maintenance costs, improves automated production efficiency, ensures that the system can still start normally after power outage, and supports flexible configuration of disk partitioning and raid mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080074B_ABST
    Figure CN115080074B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of Loongson PMON technology, and discloses an automatic production method based on the Loongson PMON platform. A system supporting the debian distribution is installed on the Loongson PMON firmware with the redhat distribution operating system as an intermediate medium. The purpose of the present invention is to make full use of the characteristics of the Loongson PMON motherboard to complete batch production installation and achieve unattended installation; through a reasonable mechanism, to meet the personalized configuration of the operator for the system, including but not limited to the disk partition size and file type; to provide a general installation method to reduce the maintenance cost of personnel; after the system installation is completed and powered off, the system can be normally started the next time, greatly improving the automation production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Loongson PMON, and specifically, it is an automatic production method based on the Loongson PMON platform. Background Art

[0002] Since 2001, Loongson has developed three series of processors, namely the No. 1, No. 2, and No. 3 series, and the Loongson bridge chip series, which have been widely used in application scenarios such as government and enterprise, security, finance, and energy. Currently, the Loongson BIOS firmware is divided into two types, namely PMON firmware and UEFI firmware.

[0003] So far, for the open source community, the firmware (Bootloader) mainly used by Loongson devices is PMON. The PMON firmware is free software distributed under the BSD with additional protocols, supporting three architectures: i386, PowerPC, and MIPS. At the same time, the PMON firmware has a long history and was initially developed by Phil Bunce.

[0004] Currently, PMON only provides a way to load certain files over the network and does not directly support unattended installation by booting like PXE. In the way of installing the system on the Loongson platform, it is manually installed by burning the ISO into a USB flash drive, and the process is complex and error-prone. If large-scale production installation is required, it is extremely easy to make mistakes, resulting in the system becoming bricked and unable to boot normally, which limits the automation production efficiency.

[0005] Therefore, in view of the fact that currently PMON can only remotely load the system for booting due to its characteristics and cannot land the relevant file data on the hard disk, so that there is no data falling into the hard disk after power-off and the relevant partitions and settings of the hard disk cannot meet the requirements of users, the present invention proposes an automatic production method based on the Loongson PMON platform. Summary of the Invention

[0006] The purpose of the present invention is to provide an automatic production method based on the Loongson PMON platform, which makes full use of the characteristics of the Loongson PMON motherboard to achieve the effect of batch production and installation.

[0007] The present invention is achieved by the following technical solutions: an automatic production method based on the Loongson PMON platform, including: installing a system that supports the debian distribution on the Loongson PMON firmware with the redhat distribution operating system as an intermediate medium.

[0008] In order to better implement the present invention, further, the system that supports the debian distribution includes the UOS operating system.

[0009] To better implement the present invention, further, the process of installing a system that supports the debian distribution includes:

[0010] Set up a TFTP server on the server side, configure the IP address of the TFTP server and the shared directory of the TFTP server. The shared directory of the TFTP server includes the kernel of the medium, the initial file system, the file system, the ks configuration file, and the installation script.

[0011] After the Loongson PMON firmware boots up, enter the PMON command line.

[0012] Enter the network card name and configure the IP address of the network card.

[0013] Enter the IP address configured for the TFTP server to obtain the kernel and initial file system of the medium.

[0014] Start the initial file system, set it to serial output, and load the remote ks configuration file.

[0015] According to the configuration options in the ks configuration file, determine whether the installed system is a system that supports the debian distribution. If so, the ks configuration file starts the installation script. If not, the ks configuration file performs a regular installation.

[0016] The installation script automatically detects the number of hard disks and performs disk partitioning and formatting.

[0017] After disk partitioning and formatting, unzip the file system compressed package.

[0018] After unzipping the file system compressed package, perform file system settings. After the settings are completed and exited, the Loongson PMON firmware shuts down.

[0019] To better implement the present invention, further, the process of disk partitioning and formatting includes:

[0020] First, clear all data on the current hard disk, create a boot partition with the LABEL set as the first partition, then perform ext4 formatting on the partition, and the remaining partitions are partitioned according to user needs.

[0021] To better implement the present invention, further, the process of unzipping the file system after disk partitioning and formatting includes:

[0022] Mount the hard disk to a certain file path of the Red Hat distribution operating system, and then remotely pull the compressed package of the file system. To prevent network fluctuations, when pulling the compressed package of the file system, an MD5 value file of the compressed package of the file system that has been calculated and stored will be pulled; after pulling the remote file system compressed package, MD5 value verification will be performed, and the installation will exit when the verification fails; after pulling is completed, the compressed package will be decompressed to the path where the hard disk was mounted before.

[0023] To better implement the present invention, further, the operations after installing the system that supports the Debian distribution include:

[0024] Install the system according to user requirements;

[0025] Start the personalized settings, and after the settings are completed, the system that supports the Debian distribution needs to be shut down;

[0026] Insert the USB flash drive and use the system on the USB flash drive that does not use the hard disk data to start the USB flash drive. The system that does not use the hard disk data includes the livecd system;

[0027] Mount the partition file in the hard disk, compress it using compression parameters after mounting, and finally store it in the mounted partition.

[0028] To better implement the present invention, further, the personalized settings include whether sshd is enabled by default, the name of the current user, the system language settings, and the system service configuration.

[0029] To better implement the present invention, further, the setting of the compression parameters includes:

[0030] The compression parameters need to ensure the correct user permissions, compress the specified partition file in gzip format, ensure the correct soft link of the partition file, and select the shortest mounted path.

[0031] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0032] (1) The present invention aims to make full use of the characteristics of the Loongson PMON motherboard to complete batch production installation and achieve unattended installation; through a reasonable mechanism, it meets the operator's personalized configuration of the system, including but not limited to the disk partition size and file type; provides a general installation method to reduce the maintenance cost of personnel; after the system installation is completed and powered off, the system can be started normally next time, greatly improving the automated production efficiency;

[0033] (2) The present invention realizes the isolation between the production and R & D stages, realizes the automated production of software, and does not require manual participation, improving the production efficiency;

[0034] (3) The present invention overcomes the defect that the UOS system cannot be mass-produced on the Loongson PMON firmware;

[0035] (4) The production speed using the production solution of the present invention is faster than the ordinary manual installation speed, and the efficiency is better. It can flexibly combine the current number of hard disks for disk partitioning and RAID mode.

[0036] (5) The present invention provides a general installation method. The installation method uses the redhat distribution operating system as an intermediate medium. If the target installation system is the redhat distribution operating system, it is normally installed through the kickstart installation mechanism provided by it. If the target installation system is UOS, the kickstart installation mechanism provided by redhat is used for disk partitioning, and then the pre-made UOS file is decompressed to the hard disk and then the system settings are performed, overcoming the defect that the UOS system cannot be mass-produced on the Loongson PMON firmware, and greatly improving the efficiency of automated production in industry or enterprises. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The present invention will be further described in conjunction with the following drawings and embodiments. All creative concepts of the present invention should be regarded as the disclosed content and the protection scope of the present invention.

[0038] Figure 1 It is a schematic diagram of the overall process for installing the UOS operating system on the Loongson PMON firmware with the redhat distribution operating system as an intermediate medium provided by the present invention.

[0039] Figure 2 It is a schematic diagram of the installation process for installing the UOS operating system on the Loongson PMON firmware with the redhat distribution operating system as an intermediate medium provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. It should be understood that the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments, and therefore should not be regarded as a limitation of the protection scope. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0041] PXE, Preboot eXecution Environment, also known as the Pre-Execution Environment, provides a mechanism to boot a computer using a network interface. This mechanism allows the computer to boot without relying on local data storage devices (such as hard drives) or locally installed operating systems.

[0042] UOS, whose full name is Unity Operating System and Chinese full name is Unified Operating System. UOS is a Chinese domestic operating system jointly developed by multiple domestic system enterprises including China Electronics Corporation, Wuhan Deepin Technology Co., Ltd., Nanjing CMGE Technology Group Co., Ltd., and Zhongxing Newpoint. The platform supports domestic CPUs such as Huawei HiSilicon, Kunpeng, Loongson, Sunway, Zhaoxin, Feiteng, and Haiguang. Now the Chinese name of UOS has been changed to Tongxin Operating System, which is more in line with its positioning (more high-end) and has greater market influence (greater value).

[0043] Redhat should be referred to as the Redhat series, including RHEL (Redhat Enterprise Linux, that is, the so-called paid version of Redhat Advance Server), FedoraCore (developed from the original Redhat desktop version, free version), and CentOS (a community clone version of RHEL, free). Redhat is arguably the Linux version with the largest user base in China. Some people even equate Redhat with Linux, and some veterans only use this version of Linux. So the characteristic of this version is that the number of users is large and there is a lot of information. In other words, if you don't understand something, it's easy to find someone to ask, and general Linux tutorials on the Internet are usually explained using Redhat as an example. The package management method of the Redhat series uses the YUM package management method based on RPM packages, and the package distribution method is pre-compiled binary files. In terms of stability, RHEL and CentOS are very stable and suitable for server use, but FedoraCore has poor stability and is best only used for desktop applications.

[0044] Kickstart provides an automated system installation mechanism.

[0045] Example 1:

[0046] An automatic production method based on the Loongson PMON platform in this embodiment. The present invention aims to make full use of the characteristics of the Loongson PMON mainboard to complete batch production and installation, achieving unattended installation; through a reasonable mechanism, it meets the personalized configuration requirements of operators for the system, including but not limited to the size of disk partitions and the types of partition files; it provides a general installation method to reduce the maintenance cost of personnel; after the system installation is completed and powered off, the system can be started normally the next time, greatly improving the automation production efficiency.

[0047] Different from the automatic installation of CentOS through Kickstart and the automatic installation through Debian-Installer, since Kickstart is the installation mechanism of the Red Hat derivative, it is adapted to the CentOS or Fedora series, but it cannot be compatible with the Debian distribution. The current PMON automatic production solution is to simulate the resource initialization process of PXE, obtain the kernel and initialize the file system from a remote server, and then simulate the unattended installation of PXE. However, the same method cannot install operating systems of the Debian series such as the UOS operating system, which has great limitations. At the same time, during the installation process of the Debian series, Debian-Installer cannot determine the installation location of GRUB according to the size of the current storage device or extremely complex installations, resulting in the inability to deploy applications excellently. It is also different from some system manufacturers who have modified the installation logic of Debian-Installer in their own software sources, resulting in Debian-Installer being unable to achieve the goal of automatic production in some cases. The present invention aims to provide an installation method based on the Loongson PMON platform to compatibly install Linux of the two distributions in a general installation method. That is, the installation method provided by the present invention can achieve the corresponding automatic installations of both without using Kickstart and Debian-Installer separately.

[0048] Embodiment 2:

[0049] This embodiment is further optimized on the basis of Embodiment 1, such as Figure 1 As shown, first, a UOS operating system that meets the user's needs needs to be installed on the Loongson PMON firmware. Systems that support the Debian distribution include but are not limited to the UOS operating system, but currently only the UOS operating system in the distribution can be installed on the Loongson PMON platform.

[0050] Install the UOS operating system according to user requirements. During the installation process, it is necessary to partition the hard disk and determine whether to group the partitions into a soft RAID mode. If it is grouped into a soft RAID mode, there will be a RAID kernel module in the operating system, and when starting up later, the hard disk partitions can be recognized as soft RAID hard disks, and relevant systems can be loaded from them.

[0051] Start for personalized settings: Regarding whether sshd is enabled by default, settings such as the name of the current user and the system language, and system service configuration settings. These personalized settings can be customized and optimized according to project or product requirements to configure the system flexibly.

[0052] After the personalized settings are completed, the UOS operating system needs to be shut down.

[0053] At this time, it is necessary to insert a USB flash drive burned with the livecd system and start in livecd mode. After the livecd system starts, it will neither use the data on the hard disk nor damage the installed UOS operating system.

[0054] Mount the partition files in the hard disk to the / mnt path, and the path has no requirements.

[0055] After all partition files are mounted to the above path, compress them using tar -C / mnt –numeric-onwer -zcpf / dev / shm / rootfs.tar.gz. -C is to specify the extraction path, -zxphf is to keep the permissions consistent and not damage the soft links of the system. The compression parameters –numeric-owner -zcpf have requirements. --numeric-owner can ensure correct user permissions. For example, if there is a user named jhin in the current livecd system with a corresponding uid number of 1000, then when extracting this compressed file in a new system, there is a user named jhin in the system, but the uid is 2000, and the relevant file permissions will not be displayed as the user jhin, but the original uid of 1000. The -zcpf parameter is mainly to compress the partition files in gzip format and ensure the correct soft links in the partition files. And placing the partition files in the / dev / shm directory is because the mount directory is the place where the memory is mounted, and using this path for compression takes less time and is more efficient.

[0056] After compression, place rootfs on the hard disk, copy out the results, and then shut down.

[0057] Since the livecd system runs in memory and cannot store data, it is necessary to place the prepared files in the mounted partition, and the files can be copied out from the partition after the next startup.

[0058] The other parts of this embodiment are the same as those of Embodiment 2, so they will not be described in detail.

[0059] Embodiment 3:

[0060] This embodiment is further optimized on the basis of the above Embodiment 1 or 2. For example, Figure 2 As shown, it is the installation process of the UOS operating system. The server side needs to set up a TFTP server, configure the IP address as 192.168.0.125, and configure the TFTP sharing directory. The TFTP sharing directory includes the kernel of the medium, the initial file system, the file system, the ks configuration file, and its own installation script. After the server configures the directory, the client can obtain the required resources from this directory.

[0061] After the Loongson PMON firmware boots up, it enters the PMON command line.

[0062] Enter the IP address for configuring the network card. Enter "ifaddr fxp0 192.168.0.158" to configure the IP address of the network card, where fxp0 is the network card name and 192.168.0.158 is the IP address.

[0063] Obtain the kernel of the intermediate medium system, that is, obtain the kernel of the Red Hat distribution operating system. Enter "loadtftp: / / 192.168.0.125 / vmlinux".

[0064] Obtain the initial file of the intermediate medium system, that is, obtain the initial file of the Red Hat distribution operating system. Enter "initrd tftp: / / 192.168.0.125 / initrd.img", where initrd.img is the file that will be loaded during system startup.

[0065] Start the initial file system, set it to serial output, and load the remote ks file; enter "gconsole=ttyS0,115200 inst.ks=tftp: / / 192.168.0.125 / ks.cfg". According to the configuration options in ks, determine whether the installed system is the UOS operating system. If it is, the ks starts the installation script. If not, continue with the normal installation logic of ks, install normally and exit.

[0066] The ks starts the installation script and files. The installation script will automatically detect the current number of hard disks and perform disk partitioning. It will clear all data on the current hard disk and create a partition with the LABEL of boot, called the boot partition. The boot partition is the first partition of the hard disk (this is mandatory, otherwise the system cannot start), and the partition format is ext4, which is mounted to the / boot path. Other partitions are partitioned according to the installer's needs and then formatted.

[0067] After the disk partitioning and formatting are completed, the hard disk is mounted to a certain file path of the current intermediate media system. Subsequently, files will be pulled from the remote end. To prevent network fluctuations, when pulling the compressed package of the file, the md5 value file of a previously calculated and stored file compressed package will be pulled. After pulling the remote file compressed package, the md5 value verification will be performed. If the verification fails, the installation will exit. After pulling is completed, the compressed package will be decompressed to the path where the hard disk was mounted before. -C is used to specify the decompression path, and -zxphf is used to keep the permissions consistent and not damage the soft links of the system.

[0068] After the file decompression is completed, the system settings can be performed by using the chroot command to enter the system, that is, the personalized settings are started as in Embodiment 2, such as setting the user name, enabling the sshd service, etc. After the settings are completed and exited, the system will shut down.

[0069] Other parts of this embodiment are the same as those of the above Embodiment 1 or 2, so they will not be described in detail.

[0070] The above are only the preferred embodiments of the present invention, and do not impose any form of limitation on the present invention. Any simple modifications and equivalent changes made to the above embodiments based on the technical essence of the present invention all fall within the protection scope of the present invention.

Claims

1. An automatic production method based on the Loongson PMON platform, characterized in that, Including: Install a system that supports the Debian distribution on the Loongson PMON firmware with the Red Hat distribution operating system as an intermediate medium; The operations after installing the system that supports the Debian distribution include: Install the system according to user requirements; Start the personalized settings. After the settings are completed, the system that supports the Debian distribution needs to be shut down; Insert a USB flash drive and use a system that does not use hard disk data to boot the USB flash drive. The system that does not use hard disk data includes the livecd system; Mount the partition files in the hard disk, compress them using compression parameters, and finally store them in the mounted partition; After mounting all partition files to the / mnt path, compress them using tar -C / mnt –numeric-onwer -zcpf / dev / shm / rootfs.tar.gz. Among them, -C is used to specify the decompression path, -zxphf is used to keep the permissions consistent and not damage the soft links of the system, --numeric-owner ensures the correct user permissions, and the -zcpf parameter is used to compress the partition files in gzip format and ensure the correct soft links in the partition files; The process of installing the system that supports the Debian distribution includes: Set up a TFTP server on the server side, configure the IP address of the TFTP server and the shared directory of the TFTP server. The shared directory of the TFTP server includes the kernel of the medium, the initial file system, the file system, the ks configuration file, and the installation script; After the Loongson PMON firmware boots, enter the PMON command line; Enter the network card name and configure the IP address of the network card; Enter the IP address configured by the TFTP server to obtain the kernel and initial file system of the medium; Start the initial file system, set it to serial output, and load the remote ks configuration file; Judge whether the installed system is a system that supports the Debian distribution according to the configuration options in the ks configuration file. If so, the ks configuration file starts the installation script. If not, the ks configuration file performs a regular installation; The installation script automatically detects the number of hard disks and formats the disk partitions; After the disk partitions are formatted, decompress the file system compressed package; After the file system compressed package is decompressed, perform file system settings. After the settings are completed and exited, the Loongson PMON firmware shuts down.

2. The automatic production method based on the Loongson PMON platform according to claim 1, wherein, The system that supports the Debian distribution includes the UOS operating system.

3. The automatic production method based on the Loongson PMON platform according to claim 2, wherein, The process of formatting the disk partitions includes: First, clear all data on the current hard disk, create a partition with the LABEL of boot and set it as the first partition, then perform ext4 formatting on the partition, and the remaining partitions are partitioned according to user requirements.

4. The automatic production method based on the Loongson PMON platform according to claim 2, wherein The process of decompressing the file system compressed package after formatting the disk partitions includes: Mount the hard disk to a certain file path of the Red Hat distribution operating system, and then remotely pull the compressed package of the file system. To prevent network fluctuations, when pulling the compressed package of the file system, an MD5 value file of the compressed package of the file system that has been calculated and stored will be pulled; after pulling the remote file system compressed package, MD5 value verification will be performed, and the installation will exit when the verification fails; after pulling is completed, the compressed package will be decompressed to the path where the hard disk was mounted before.

5. The automatic production method based on the Loongson PMON platform according to claim 3, characterized in that The personalized settings include whether sshd is enabled by default, the name of the current user, system language settings, and system service configurations.

6. The automatic production method based on the Loongson PMON platform according to claim 3, wherein, The setting of the compression parameters includes: The compression parameters need to ensure correct user permissions, specify that the partition file is compressed in gzip format, ensure correct soft links of the partition file, and select the shortest mount path.

Citation Information

Patent Citations

  • Automatic deployment method and system supporting multiple domestic operating systems

    CN112230942A