CN117369840A - Method for constructing embedded operating system based on customized software source - Google Patents

Method for constructing embedded operating system based on customized software source Download PDF

Info

Publication number
CN117369840A
CN117369840A CN202311501247.7A CN202311501247A CN117369840A CN 117369840 A CN117369840 A CN 117369840A CN 202311501247 A CN202311501247 A CN 202311501247A CN 117369840 A CN117369840 A CN 117369840A
Authority
CN
China
Prior art keywords
rootfs
file system
root
rpm
constructing
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.)
Pending
Application number
CN202311501247.7A
Other languages
Chinese (zh)
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.)
716th Research Institute of CSIC
Original Assignee
716th Research Institute of CSIC
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 716th Research Institute of CSIC filed Critical 716th Research Institute of CSIC
Priority to CN202311501247.7A priority Critical patent/CN117369840A/en
Publication of CN117369840A publication Critical patent/CN117369840A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an embedded operating system construction method based on a customized software source, which comprises the following steps: determining and acquiring an rpm installation package list which is required to be installed by the embedded operating system; selecting an rpm installation package repo file to be used, and acquiring a url downloading address in the repo file; circularly installing each package in the rpm install package list under the root directory of rootfs; constructing a rootfs file system; perfecting configuration parameters of a rootfs root file system; and making a rootfs root file system image. The invention improves the construction efficiency of the embedded operating system, meets diversified customization demands, constructs the embedded operating system with high portability, and realizes low-power consumption and high-stability operation.

Description

Method for constructing embedded operating system based on customized software source
Technical Field
The invention belongs to the technical field of operating system software, and particularly relates to an embedded operating system construction method based on a customized software source.
Background
With the development of computer technology and integrated circuit technology, embedded technology is becoming popular, and plays an increasingly important role in the fields of communication, network, industrial control, medical treatment, electronics and the like. Embedded systems are undoubtedly one of the most promising IT application fields at the present time. An embedded system is a computer system specifically designed for a particular application, and these systems often handle complex problems in a small space, such as performing real-time control, maintaining real-time data processing, providing high performance computing, etc.
Unlike the conventional server operating system, the embedded operating system encounters some difficulties in the design process, firstly, the embedded operating system has limited resources, such as limited performance of a processor, storage and the like, so that the system needs to be designed under limited resources; secondly, the embedded device generally operates in a specific scene and focuses on a specific function, so that the embedded operating system is required to provide the customization requirements for the software version and the special software; moreover, due to construction environment differences, the existing construction method of the embedded operating system is complex in configuration and low in development efficiency.
Disclosure of Invention
The invention aims to provide a method for constructing an embedded operating system based on a customized software source, which improves the construction efficiency of the embedded operating system, meets diversified customization requirements, constructs the embedded operating system with high portability, and realizes low-power consumption and high-stability operation.
In order to achieve the above purpose, the present invention provides the following technical solutions: the method for constructing the embedded operating system based on the customized software source comprises the following steps:
s1, defining an rpm installation package list to be installed by an embedded operating system, designating a working path of a host non-root directory, and setting the working path as a root directory of a new rootfs root file system; the rpm installation package is in a standard software package format in linux, and can be easily installed, updated and uninstalled without manually compiling software; selecting a root directory for constructing a rootfs root file system, installing a pre-installation program and a subsequent installation program under the root directory, and creating a new RPM database;
s2, selecting an rpm installation package repo file to be used, and acquiring a url downloading address in the repo file; the repo file defines the address of one or more software warehouses, and downloads the software package to be installed or upgraded according to the address of the software warehouses; the software packages in the software repository may be custom modified software packages made as needed to maintain the customizability of the embedded operating system at the software level.
S3, based on url download addresses, downloading and installing the rpm installation package filesystem to generate a corresponding file system frame under the rootfs root directory, downloading and circularly installing each rpm installation package in the rpm installation package list under the rootfs file system root directory, and deleting the downloaded rpm installation package after the installation is completed;
s4, constructing a rootfs file system, mounting virtual file systems such as a host computer' S/proc,/dev,/sys and the like under a rootfs root file system directory, and constructing an overall directory structure of the rootfs root file system;
s5, perfecting configuration parameters of the rootfs root file system, entering the rootfs root file system by using a color command, and modifying the configuration parameters of the new system;
s6, making a rootfs root file system image, wherein the system image comprises cloning of all data of the rootfs operating system; calculating the space size occupied by all files under the rootfs directory, distributing image space resources, creating a file system of ext4, generating a rootfs.img image, mounting the image under the temporary directory, synchronously copying all contents in the newly generated rootfs root file system to a mounting point of the rootfs.img, and completing the image manufacture of the file system.
Further, the specified working path is set as a root path by adopting a root option in the rpm command, and a software package list required for constructing the embedded file system is customized and modified according to requirements.
Further, the step S1 also comprises initializing an rpm database by using an-initdb option, wherein the rpm database is used for recording logs in the downloading and installing process of the rpm installation package.
Further, the rpm installation package list at least comprises a file system installation package, and the installation file system software package generates a corresponding file system frame under the embedded file system root directory.
Further, the url download address described in S2 supports specification of rpm install package software repository sources by local source, network source, or entering url address connections separated by spaces.
Further, the step S3 of downloading and installing the rpm installation package by using a dnf software package management tool specifically includes: using the- -repofrom path option in the dnf command to specify the tag and address of the software warehouse to be used, multiple software warehouse sources can be added using this option multiple times; specifying an installation path of the installation package using-installroot in the dnf command; and circularly installing according to the rpm installation package list, checking whether the installation process is wrong after the installation of each rpm installation package is completed, interrupting the program and giving a fault warning if the fault is found, and continuing to install the next rpm installation package in the list if the fault is found.
Further, constructing a rootfs file system in S4 includes: and (3) mounting/dev,/proc,/sys in the host machine under the corresponding directory of the new rootfs root file system, partitioning the rootfs root file system through a shared-s command, and adjusting the partition capacity through-resize part to expand the available space of the whole embedded system to a corresponding size.
Further, when the configuration parameters of the new system are modified in S5, the designated working path is used as the root directory of the new system by using the color command, the subsequent system command running environments all run by taking the designated directory as the root directory, the host machine environment is invisible, the instruction is run under the new system root directory, and the configuration parameters of the file system are modified.
Further, the configuration parameters include a customized file system name, a file system password, a time setting of the file system, a network configuration, and a startup self-starting setting system parameter, and other customization operations are set by updating an installation package in a software source.
Further, the allocating mirror space resources in S6 specifically includes: generating a virtual block device sparse file by using a dd command, wherein the dd command parameter of the virtual block device sparse file is a writing target, the value of the dd command parameter is an absolute path of a rootfs.img file, a space of rootfs_img is allocated, and data stored in a buffer is forcedly written into a hard disk by using a sync instruction.
Compared with the prior art, the invention has the beneficial effects that:
1. and the system is independently controllable and can customize the design. In order to meet the requirements of embedded operating systems in different software environments, the invention can construct any feasible software collocation, only needs to provide a corresponding software warehouse source and an rpm installation package list to be installed, updates and upgrades the software packages in the software source according to the requirements, cuts the software package installation list, and provides a multi-level, flexible and stable system architecture.
2. The portability is strong. The embedded operating system designed by the invention is decoupled from the kernel, that is to say, the rootfs operating system can theoretically run on other equipment platforms supporting linux kernels, and kernel files of a cpu and a board card model are required to be changed during burning, so that the embedded operating system realized by the invention can be supported to run on different processors and development boards for the diversity of hardware platforms, and has high portability.
Drawings
FIG. 1 is a diagram illustrating steps for generating an embedded operating system according to the present invention.
FIG. 2 is a diagram of a virtual file system according to the present invention.
FIG. 3 is a schematic diagram of the use of DNF tools to manage RPM packets in the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Aiming at the problem of an embedded operating system, focusing on a custom software source, the invention discloses a method for constructing the embedded operating system based on the custom software source. The embedded operating system based on the customized software source, which is generated by the invention, is not strongly bound with the hardware platform, can stably run on the embedded development boards of different hardware platforms, solves the problem of embedded hardware resource limitation, meets the customization requirement of the system software version, and realizes low-power consumption and high-stability operation.
Referring to fig. 1, the method for constructing an embedded operating system based on a customized software source provided by the invention comprises the following steps:
s1, determining and acquiring an rpm installation package list which is required to be installed by an embedded operating system; the rpm installation package is in a standard software package format in linux, and can be easily installed, updated and uninstalled without manually compiling software; selecting and constructing a root directory of a rootfs root file system; thus, both the pre-installer and the subsequent installer will be installed under this directory and create a new RPM database;
s2, selecting an rpm installation package repo file to be used, and acquiring a url downloading address in the repo file; the repo file defines the address of one or more software warehouses, and downloads or upgrades the software package according to the address of the software warehouses;
s3, installing the rpm installation packages, namely circularly installing each package in the rpm installation package list under the root directory of the rootfs by using a dnf tool, and deleting the downloaded rpm installation packages after the installation is completed; with reference to fig. 3, the method specifically includes: using the- -repofrom path option in the dnf command to specify the tag and address of the software warehouse to be used, multiple software warehouse sources can be added using this option multiple times; searching and listing an rpm installation package, displaying rpm installation package information, and designating an installation path of the installation package by using an-installroot in a dnf command; and circularly installing according to the rpm installation package list, checking whether the installation process is wrong after the installation of each rpm installation package is completed, interrupting the program and giving a fault warning if the fault is found, and continuing to install the next rpm installation package in the list if the fault is found. When the rpm installation package is detected to be updated, updating the rpm installation package and the dependence thereof;
s4, constructing a rootfs file system, mounting virtual file systems such as a host computer' S/proc,/dev,/sys and the like under a rootfs root file system directory, and constructing an overall directory structure of the rootfs root file system; installing a filesystem software package to generate a corresponding file system frame under the embedded file system root directory;
s5, perfecting configuration parameters of the rootfs root file system, entering the rootfs root file system by using a color command, and modifying passwords, system time, network configuration and the like of a new system; the color command can take the appointed directory as a root directory, and can run instructions under a new system root directory;
s6, making a rootfs root file system image, wherein the system image comprises cloning of all data of the rootfs operating system; calculating the space size occupied by all files under the rootfs directory, distributing image space resources, creating a file system of ext4, generating a rootfs.img image, mounting the image under the temporary directory, synchronously copying all contents in the newly generated rootfs root file system to a mounting point of the rootfs.img, and completing the image manufacture of the file system.
Preferably, the rpm installation package list must be arranged according to a specified format and contains necessary installation packages such as filesystem, and a specified installation directory is selected as a root directory of the new system, so that the subsequent embedded operation system is convenient to manufacture; the repo file contains a name and a baseurl value, is used for downloading the rpm installation package from a specified software warehouse, and can contain a plurality of names and baseurl information for searching the specified rpm installation package from a plurality of warehouses; the rpm installation package downloads the original package, and dnf is used for downloading and installing the software instead of yum, so that the memory occupation can be reduced, the running speed can be improved, the software dependency relationship can be analyzed more accurately, the software installation catalog can be designated, meanwhile, the installation state verification is added after the downloading and the installation of each piece of software are finished, and the system software can be built more safely.
In combination with fig. 2, in step 4, when a rootfs file system is built, proc, sysfs and the like are virtual file systems with kernels mapped to user space and are not associated with specific physical devices, so that the virtual file system is built by mounting/dev,/proc,/sys in the host under a new rootfs corresponding directory; the virtual file system adopts standard Linux system to call and read and write different file systems on different physical media, namely, a unified operation interface and an application programming interface are provided for various file systems, a unified file access interface is provided upwards, and various different types of file systems are compatible downwards. Not only file systems in the conventional sense such as Ext2, ext4, XFS, etc., but also pseudo file systems and devices such as proc, sysfs, etc.; the proc pseudo file system can interact with a data structure in the kernel to acquire relevant information of a process, and the sysfs can output information of equipment and a driver from the kernel to a user space and can also be used for setting the equipment and the driver.
Preferably, the file system is built, and can be mounted on a newly generated embedded rootfs root file system by a local virtual file system. As proc, sysfs and the like are virtual file systems of which the kernel is mapped to a user space, the proc, sys and the like in the host are mounted under a new rootfs corresponding directory, the proc is responsible for the exchange of process data in the kernel and the user space, the sys comprises the interaction of the kernel and equipment and driving information in the user space, and a file system framework of a rootfs root file system is completely constructed.
The configuration parameters of the perfect rootfs root file system enter a new system root directory by using a color command, change the name of the file system, change the password of the file system, change the time setting of the file system, change the startup self-starting setting and the like, and perfect the details of the file system.
The method comprises the steps that in the process of making the rootfs root File system mirror image, all File sizes under a new system rootfs directory are needed to be calculated, a virtual block device Sparse File (spark File) is generated, space resources of rootfs.img are allocated, an ext4 File system is created, the rootfs.img is mounted on a mounting point, all contents of the new system are synchronously copied to the mounting point, and the new rootfs mirror image File can be obtained after mounting is removed.
The described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present patent protection.

Claims (10)

1. The method for constructing the embedded operating system based on the customized software source is characterized by comprising the following steps:
s1, determining and acquiring an rpm installation package list which is required to be installed by an embedded operating system, designating a working path of a host non-root directory, and setting the working path as a root directory of a new rootfs root file system;
s2, selecting an rpm installation package repo file to be used, and acquiring a url downloading address in the repo file;
s3, based on url download addresses, downloading and installing the rpm installation package filesystem to generate a corresponding file system frame under the rootfs root directory, downloading and circularly installing each rpm installation package in the rpm installation package list under the rootfs file system root directory, and deleting the downloaded rpm installation package after the installation is completed;
s4, constructing a rootfs file system, mounting a virtual file system of a host under a rootfs root file system directory, and constructing a rootfs root file system integral directory structure;
s5, perfecting configuration parameters of the rootfs root file system, entering the rootfs root file system by using a color command, and modifying the configuration parameters of the new system;
s6, making a rootfs root file system image, distributing image space resources according to the space size occupied by the rootfs root file system directory, creating a file system of ext4, generating a rootfs.img image, mounting the image under a temporary directory, synchronously copying all contents in the newly generated rootfs root file system to a mounting point of the rootfs.img, and finishing the file system image making.
2. The method for constructing an embedded operating system based on a customized software source according to claim 1, wherein: and setting the designated working path as a root path by adopting a root option in an rpm command, and customizing and modifying a software package list required for constructing the embedded file system according to requirements.
3. The method for constructing an embedded operating system based on a customized software source according to claim 2, wherein: the S1 further includes initializing an rpm database for recording logs during the download installation of the rpm installation package using the-initdb option.
4. The method for constructing an embedded operating system based on a customized software source according to claim 1, wherein: the rpm setup package list includes at least a filesystem setup package.
5. The method for constructing an embedded operating system based on a customized software source according to claim 1, wherein: the url download address described in S2 supports specification of the rpm install package software repository source by a local source, a network source, or entering url address connections separated by spaces.
6. The method for constructing an embedded operating system based on a customized software source according to claim 1, wherein: the step S3 adopts dnf software package management tools to download and install the rpm installation package, and specifically comprises the following steps: using the- -repofrom path option in the dnf command to specify the tag and address of the software warehouse to be used, multiple software warehouse sources can be added using this option multiple times; specifying an installation path of the installation package using-installroot in the dnf command; and circularly installing according to the rpm installation package list, checking whether the installation process is wrong after the installation of each rpm installation package is completed, interrupting the program and giving a fault warning if the fault is found, and continuing to install the next rpm installation package in the list if the fault is found.
7. The method for constructing an embedded operating system based on a customized software source according to claim 1, wherein: the step S4 of constructing the rootfs file system comprises the following steps: and (3) mounting/dev,/proc,/sys in the host machine under the corresponding directory of the new rootfs root file system, partitioning the rootfs root file system through a shared-s command, and adjusting the partition capacity through-resize part to expand the available space of the whole embedded system to a corresponding size.
8. The method for constructing an embedded operating system based on a customized software source according to claim 1, wherein: when the configuration parameters of the new system are modified in S5, the designated working path is used as the root directory of the new system by using the color command, the subsequent system command running environment runs by taking the designated directory as the root directory, the host machine environment is invisible, the command is run under the root directory of the new system, and the configuration parameters of the file system are modified.
9. The method for constructing an embedded operating system based on a customized software source according to claim 8, wherein: the configuration parameters include the name of the customized file system, the password of the file system, the time setting of the file system, the network configuration and the system parameters of the startup self-starting setting, and other customization operations are set by updating the installation package in the software source.
10. The method for constructing an embedded operating system based on a customized software source according to any one of claims 1 to 9, wherein: the allocating mirror space resources described in S6 specifically includes: generating a virtual block device sparse file by using a dd command, wherein the dd command parameter of the virtual block device sparse file is a writing target, the value of the dd command parameter is an absolute path of a rootfs.img file, a space of rootfs_img is allocated, and data stored in a buffer is forcedly written into a hard disk by using a sync instruction.
CN202311501247.7A 2023-11-10 2023-11-10 Method for constructing embedded operating system based on customized software source Pending CN117369840A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311501247.7A CN117369840A (en) 2023-11-10 2023-11-10 Method for constructing embedded operating system based on customized software source

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311501247.7A CN117369840A (en) 2023-11-10 2023-11-10 Method for constructing embedded operating system based on customized software source

Publications (1)

Publication Number Publication Date
CN117369840A true CN117369840A (en) 2024-01-09

Family

ID=89398387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311501247.7A Pending CN117369840A (en) 2023-11-10 2023-11-10 Method for constructing embedded operating system based on customized software source

Country Status (1)

Country Link
CN (1) CN117369840A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117908908A (en) * 2024-03-18 2024-04-19 麒麟软件有限公司 OSTree-based embedded system installation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117908908A (en) * 2024-03-18 2024-04-19 麒麟软件有限公司 OSTree-based embedded system installation method
CN117908908B (en) * 2024-03-18 2024-05-24 麒麟软件有限公司 OSTree-based embedded system installation method

Similar Documents

Publication Publication Date Title
CN106227579B (en) Docker container construction method and Docker management console
US5903753A (en) Name space registry with backward compatibility for older applications
CN107577475B (en) Software package management method and system of data center cluster system
KR100952251B1 (en) Servicing a component base software product
US7062764B2 (en) System and method for manipulating offline software
US8347263B1 (en) Repository including installation metadata for executable applications
US8745601B1 (en) Methods and systems for using data structures for operating systems
US6901590B2 (en) System and method for single transparent deployment flow
US7873960B2 (en) Generic packaging tool for packaging application and component therefor to be installed on computing device
CN101165654A (en) Method and process for using common preinstallation environment for heterogeneous operating systems
JP2008234673A (en) System and method for managing application installation for mobile device
US10338910B2 (en) Multi-tenant upgrading
JP6089065B2 (en) Update method and computer system
CN117369840A (en) Method for constructing embedded operating system based on customized software source
TW201721412A (en) Selecting and loading firmware volumes
CN115480801A (en) Multi-project development, deployment and operation method and system based on Vue framework
US20070028228A1 (en) Software upgrades with user advisement
US20060041567A1 (en) Inventory and configuration management
US10514940B2 (en) Virtual application package reconstruction
KR100578955B1 (en) Method and apparatus for determining the drive letter assignment of a CD ROM drive during initial system setup of a computer system
US20100162234A1 (en) Method for installing application and computer system thereof
US20050060378A1 (en) Method and apparatus for providing language modularization
CN112235132A (en) Method, device, medium and server for dynamically configuring service
US11372627B2 (en) System and method for providing integrated development environment (IDE) for programmable software system
KR20080027293A (en) Managing multiple languages in a data language

Legal Events

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