CN109828786B - Automated tool based on code-level support sw _64 architecture - Google Patents

Automated tool based on code-level support sw _64 architecture Download PDF

Info

Publication number
CN109828786B
CN109828786B CN201711182567.5A CN201711182567A CN109828786B CN 109828786 B CN109828786 B CN 109828786B CN 201711182567 A CN201711182567 A CN 201711182567A CN 109828786 B CN109828786 B CN 109828786B
Authority
CN
China
Prior art keywords
source code
srpm
architecture
code packet
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711182567.5A
Other languages
Chinese (zh)
Other versions
CN109828786A (en
Inventor
王淑莉
朱健伟
徐斌
韩雪
申利飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Standard Software Co Ltd
Original Assignee
China Standard Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Standard Software Co Ltd filed Critical China Standard Software Co Ltd
Priority to CN201711182567.5A priority Critical patent/CN109828786B/en
Publication of CN109828786A publication Critical patent/CN109828786A/en
Application granted granted Critical
Publication of CN109828786B publication Critical patent/CN109828786B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to an automation tool based on code level support sw _64 architecture, which comprises the following steps: step S1: performing one-time batch processing on the source code packets, and filtering out the source code packets related to the code level support sw _64 architecture; step S2: installing the srpm source code packet in the filtered source code packet list; step S3: executing an aname command on the srpm source code packet in the filtered source code packet list so as to filter and replace the text; step S4: and generating patch files for the files before and after replacement. In the process of transplanting the software package, the invention only needs to pay attention to the source code related to the architecture, and when a brand-new architecture platform is used for transplanting the source code package, the automatic tool can be applied to other platforms by slightly modifying the automatic tool, so that the readability is strong, the maintenance is convenient, the transportability is strong, the work content can be greatly simplified, the labor is saved, and the work efficiency is improved.

Description

Automated tool based on code-level support sw _64 architecture
Technical Field
The invention relates to the technical field of computer software programs, in particular to an automation tool based on a code level support sw _64 architecture.
Background
For an operating system, the operating system is composed of thousands of software packages, and a great deal of eyesight and mental effort is needed to transplant the source code packages in a brand-new architecture.
The Shenwei architecture is originated from an alpha architecture, and the Shenwei initial instruction set is originated from an alpha instruction set and is subsequently modified and expanded. When the Source code packet is transplanted and the architecture-related code is carried out on the Shenwei platform, the sw _64 architecture and the alpha architecture go through the same code branch, and text replacement is carried out on the part of the code, so that the Source code packet of the Shenwei platform can be transplanted.
However, when the source code package with thousands of file system layers is migrated in the way of the Shenwei architecture, it is necessary to know whether the source code package is related to the architecture, and in the case of being related to the architecture, text replacement is also necessary for the source code package.
Therefore, it is desirable to provide a new source code package migration tool to solve the above problems.
Disclosure of Invention
In order to solve the defects in the prior art, the invention provides an automation tool based on a code level support sw _64 architecture, and the execution process of the automation tool comprises the following steps:
step S1: performing one-time batch processing on the source code packets, and filtering out the source code packets related to the code level support sw _64 architecture;
step S2: installing the srpm source code packet in the filtered source code packet list;
step S3: executing an aname command on the srpm source code packet in the filtered source code packet list so as to filter and replace the text;
step S4: and generating patch files for the files before and after replacement.
Wherein, the execution process of the automation tool further comprises:
step S5: if the generated patch file is not empty, directly generating a higher-version srpm source code package, wherein the higher-version srpm source code package contains the newly generated patch file, and executing step S6; if the generated patch file is empty, directly executing step S6;
step S6: adding the higher version of the srpm source code packet name as success.txt;
step S7: and ending the source code packet transplantation.
Wherein the step S2 includes:
step S21: reading an srpm source code packet list line by line;
step S22: searching an srpm source code packet from a specified directory; if found, go to step S23, otherwise go to step S24;
step S23: calling an rpm command to install the srpm source code packet, and then performing step S3;
step S24: fail is added to the srpm source code packet name, and step S21 is executed again.
In step S4, a patch file is generated by performing diff operation on the file before and after replacement.
The automatic tool based on the code-level support sw _64 architecture provided by the invention only needs to pay attention to the source code related to the architecture in the process of software package transplantation, and can be applied to other platforms by slightly modifying the automatic tool when a brand-new architecture platform carries out source code package transplantation, so that the readability is strong, the maintenance is convenient, the portability is strong, the work content can be greatly simplified, the labor is saved, and the work efficiency is improved.
Drawings
FIG. 1: the invention discloses a flow chart for realizing an automation tool based on code level supporting sw _64 architecture.
Detailed Description
In order to further understand the technical scheme and the advantages of the present invention, the following detailed description of the technical scheme and the advantages thereof is provided in conjunction with the accompanying drawings.
The design concept of the invention is to realize a tool, after a source code package list is input, the relevant source codes of the architecture can be automatically filtered out, text replacement is carried out, and finally patch files corresponding to all the source code packages are output, so that the transplanting efficiency is greatly improved. Based on the assumption, the inventor conducts modeling test, gradual improvement and improvement on a large number of source code packages, and finally provides a source code package transplanting method based on an automation tool supporting sw _64 architecture at a code level.
The code level supports the automation tool of the sw _64 architecture and has two main functional points, namely an srpm software package transplanting technology and a text filtering and replacing technology based on an name command.
The srpm software package transplanting technology means that an srpm package is compiled on a target architecture and finally generates an rpm package which can run on the target architecture. The source redmat release of the srpm packet supports the mainstream architecture of the world, and the ideal situation is that the srpm source code packet is directly compiled and passed on the target architecture and runs well. When problems occur in the period, the source code packet needs to be patched according to the characteristics of a target environment and a framework, so that the smooth transplantation of the srpm source code packet is realized. The srpm software package transplanting technology is a basic skill for manufacturers who release operating system versions based on reddat release. The proficiency in this skill is mainly reflected in the transplantation of source codes related to the architecture. The transplantation of the srpm software package is also an inspection of the system compiling and running environment, and a series of processes for generating the rpm package by the srpm package and basic principles of the compiling process and the running process of the target program need to be known.
The filtering and replacing technology based on the name command text is to run the name command, the parameter is the text to be filtered and replaced, and the replaced text is output. The name command was specifically developed for an automation tool that supports the sw _64 architecture at the code level, as well as some text filtering and replacement commands in the system, say sed. The aname command is specific to the Shenwei architecture, and filters the text according to a series of judgment conditions, and replaces the text related to the alpha architecture meeting the conditions with the Shenwei architecture (sw _ 64).
Therefore, the essence of the automation tool supporting the sw _64 architecture based on the code level is a shell script, which is equivalent to a batch processing tool, the script firstly installs the srpm source code packet in the packet list, then performs text filtering and replacement on the file operation name command in the source code packet, and finally performs diff operation on the files before and after the replacement to generate the patch file. If the source code architecture is not relevant, then the generated patch file will be empty. The code level supports the automation tool of the sw _64 architecture and has a higher function, if the patch file is not empty, an srpm source code packet with one higher version can be directly generated, and the source code packet contains the newly generated patch file.
Fig. 1 is a flowchart of an implementation of an automation tool based on a code-level support sw _64 architecture, as shown in fig. 1, an implementation process of the automation tool provided by the present invention includes the following steps:
step S1: because the sw _64 architecture is a domestic CPU power-on architecture, the power-on architecture is a completely new architecture, does not belong to a mainstream architecture supported by an official, but is similar to an alpha architecture, the source code packets are required to be processed in batch at one time in the first step of the invention, and the source code packets related to the code-level support sw _64 architecture are filtered out, so that the power-on architecture is supported by the source code packets, and meanwhile, the working efficiency is greatly improved;
step S2: installing the srpm source code packet in the filtered source code packet list;
step S3: executing an aname command on the srpm source code packet in the filtered source code packet list so as to filter and replace the text;
step S4: diff operation is carried out on the files before and after replacement to generate a patch file;
step S5: if the generated patch file is not empty, directly generating a higher-version srpm source code package, wherein the higher-version srpm source code package contains the newly generated patch file, and executing step S6; if the generated patch file is empty, directly executing step S6;
step S6: adding the higher version of the srpm source code packet name as success.txt;
step S7: and ending the source code packet transplantation.
Wherein, step S2 specifically includes:
step S21: reading an srpm source code packet list line by line;
step S22: searching an srpm source code packet from a specified directory; if found, go to step S23, otherwise go to step S24;
step S23: calling an rpm command to install the srpm source code packet, and then performing step S3;
step S24: the srm source code packet name is appended with fail.txt, and step S21 is executed again.
The automatic tool based on the code level supporting sw _64 framework runs on a normalized kylin operating system (Shenwei edition), mainly comprises a shell script remove _ alpah.sh and an aname command component, and the remove _ alpha.sh can be called to the aname.
The aname command component is realized by C language design, and finally generates a target code aname which is stored under a/usr/bin directory. The aname Schwann platform belongs to the basic command component and belongs to the packet components.
The function of the aname is to filter and replace the text, the text to be filtered is transmitted to the aname as a command line parameter, and the replaced text is output.
The replacement of text is performed according to the following rules:
Figure BDA0001479480220000051
Figure BDA0001479480220000061
in the invention, the "sw _64 architecture" refers to an English identifier of a domestic CPU Shenwei architecture, and the sw _64 architecture is the Shenwei architecture.
In the invention, the "automation tool with code level supporting sw _64 architecture" refers to a Shenwei architecture tool kit, which is mainly used for transplanting a source code kit and outputting a patch file by running the tool.
In the invention, the so-called rpm is a packet management system used by a redhat release, and is convenient for installing, uninstalling, inquiring and upgrading software. The file system is constructed by an rpm packet, the source code of which is an srpm packet.
In the invention, the shell script refers to a script running on a linux system, which is similar to a batch file of a windows system, namely, a program file which is conveniently executed at one time by putting various commands into a file in advance.
In the present invention, the so-called "name" is a command component of the system base toolset that allows text filtering and replacement.
In the present invention, the so-called "diff" is a command of the system tool set, and the patch file can be generated according to the text difference by running the command.
The invention has the following beneficial effects:
1. the code level-based automated tool supporting the sw _64 architecture is essentially a shell script, and when a brand-new architecture platform is used for source code packet transplantation, the automated tool can be applied to other platforms by slightly modifying the automated tool, so that the code level-based automated tool has the advantages of strong readability, convenience in maintenance and strong transportability, and can be flexibly customized according to self requirements.
2. By running an automation tool of a code level supporting sw _64 architecture, patch files of source code packages related to the architecture can be directly output according to an input source code package list, and the efficiency of transplanting software packages can be greatly improved.
3. By using the automatic tool with the code level supporting the sw _64 architecture, in the process of transplanting the software package, only the source code related to the architecture needs to be concerned, the patch file generated by the tool is checked and verified, the script is continuously perfected after the process of returning, the reliability of the patch file can be greatly enhanced, the work content can be greatly simplified, the labor is saved, and the work efficiency is improved.
Although the present invention has been described with reference to the preferred embodiments, it should be understood that the scope of the present invention is not limited thereto, and those skilled in the art will appreciate that various changes and modifications can be made without departing from the spirit and scope of the present invention.

Claims (3)

1. An automation tool supporting sw _64 architecture based on code level, characterized in that the execution process of the automation tool comprises the following steps:
step S1: performing one-time batch processing on the source code packets, and filtering out the source code packets related to the sw _64 architecture supported by the code level;
step S2: installing the srpm source code packet in the filtered source code packet list;
step S3: executing an aname command on the srpm source code packet in the filtered source code packet list so as to filter and replace the text;
step S4: generating a patch file for the files before and after replacement;
step S5: if the generated patch file is not empty, directly generating a higher-version srpm source code package, where the higher-version srpm source code package contains the newly generated patch file, and executing step S6; if the generated patch file is empty, directly executing step S6;
step S6: adding the higher version of the srpm source code packet name as success.txt;
step S7: and ending the source code packet transplantation.
2. The code-level supported sw _64 architecture based automation tool of claim 1, wherein the step S2 includes:
step S21: reading an srpm source code packet list line by line;
step S22: searching an srpm source code packet from a specified directory; if found, go to step S23, otherwise go to step S24;
step S23: calling an rpm command to install the srpm source code packet, and then performing step S3;
step S24: the srm source code packet name is appended with fail.txt, and step S21 is executed again.
3. The code-level supported sw _64 architecture based automation tool of claim 1, wherein: in step S4, a patch file is generated by performing diff operation on the file before and after replacement.
CN201711182567.5A 2017-11-23 2017-11-23 Automated tool based on code-level support sw _64 architecture Active CN109828786B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711182567.5A CN109828786B (en) 2017-11-23 2017-11-23 Automated tool based on code-level support sw _64 architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711182567.5A CN109828786B (en) 2017-11-23 2017-11-23 Automated tool based on code-level support sw _64 architecture

Publications (2)

Publication Number Publication Date
CN109828786A CN109828786A (en) 2019-05-31
CN109828786B true CN109828786B (en) 2022-05-13

Family

ID=66859301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711182567.5A Active CN109828786B (en) 2017-11-23 2017-11-23 Automated tool based on code-level support sw _64 architecture

Country Status (1)

Country Link
CN (1) CN109828786B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750298B (en) * 2019-10-29 2021-03-09 南京星环智能科技有限公司 AI model compiling method, equipment and storage medium
CN112860316B (en) * 2021-02-08 2024-03-08 中科院软件研究所南京软件技术研究院 Kernel and BSP transplanting method of openEular open source system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070011669A1 (en) * 2005-07-06 2007-01-11 International Business Machines Corporation Software migration
US8185872B2 (en) * 2006-11-27 2012-05-22 Red Hat, Inc. Cross-platform software package generation
US9158538B2 (en) * 2007-05-21 2015-10-13 International Business Machines Corporation User-extensible rule-based source code modification
US9176773B2 (en) * 2011-06-29 2015-11-03 Microsoft Technology Licensing, Llc Virtual machine migration tool
CN103605520A (en) * 2013-11-22 2014-02-26 中标软件有限公司 Rpm software package conversion method and Rpm software package conversion system
US10162612B2 (en) * 2016-01-04 2018-12-25 Syntel, Inc. Method and apparatus for inventory analysis
CN106293756A (en) * 2016-08-16 2017-01-04 汉柏科技有限公司 A kind of for quick-replaceable self-defined linux kernel system

Also Published As

Publication number Publication date
CN109828786A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
US8745585B2 (en) Meta-data for single development test environment
CN107729066B (en) Automatic construction and release method and device based on SVN (singular value decomposition) resource library
US8533676B2 (en) Single development test environment
CN103955363B (en) A kind of manufacture method of program upgrade installation package
CN105446712B (en) Application program defect repairing method and device
US20130174124A1 (en) Version numbering in single development and test environment
CN106933609B (en) Android application program installation package generation method and device
US9063819B2 (en) Extensible patch management
CN108897547B (en) Software automation deployment method and device
AU2012201749B2 (en) Single development test environment
CN102156643A (en) Software integration method and system thereof
CN109828786B (en) Automated tool based on code-level support sw _64 architecture
CN105159718A (en) Firmware updating method and device
CN106874195A (en) A kind of bug for android applications repairs and continues delivery scheme
CN106775671A (en) A kind of hot patch restorative procedure in the linux environment for communication system
CN104503772A (en) Operating system installation and test environment establishment method and device based on virtual machine
CN111722868A (en) Method for quickly transplanting high-version linux kernel of Shenwei firewall
CN111078265A (en) Jenkins-based web project update patch generation method
CN112379865B (en) Software development framework updating method based on Maven plug-in mechanism
CN107902507B (en) Control software field debugging system and debugging method
CN105549965A (en) Method for integrating driver to different Linux kernel versions
CN111949290B (en) Hot patch management method and device, electronic equipment and storage medium
EP2503450A2 (en) Version numbering in single development and test environment
CN113360156B (en) IOS compiling method and related equipment
CN115168175A (en) Program error solving method, device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant