CN108376074A - A kind of RancherOS ros nucleus module transplantation methods based on embedded system - Google Patents
A kind of RancherOS ros nucleus module transplantation methods based on embedded system Download PDFInfo
- Publication number
- CN108376074A CN108376074A CN201611069177.2A CN201611069177A CN108376074A CN 108376074 A CN108376074 A CN 108376074A CN 201611069177 A CN201611069177 A CN 201611069177A CN 108376074 A CN108376074 A CN 108376074A
- Authority
- CN
- China
- Prior art keywords
- ros
- rancheros
- embedded system
- files
- parameter
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000002054 transplantation Methods 0.000 title claims abstract description 14
- 230000002452 interceptive effect Effects 0.000 claims abstract description 8
- 238000012986 modification Methods 0.000 claims description 13
- 230000004048 modification Effects 0.000 claims description 13
- 230000003068 static effect Effects 0.000 claims description 9
- 238000009434 installation Methods 0.000 claims description 7
- 230000006870 function Effects 0.000 claims description 6
- 230000008859 change Effects 0.000 claims description 4
- 230000008569 process Effects 0.000 claims description 2
- 230000008901 benefit Effects 0.000 abstract description 2
- 238000005516 engineering process Methods 0.000 description 4
- 230000007613 environmental effect Effects 0.000 description 3
- 241000700605 Viruses Species 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a kind of RancherOS ros nucleus module transplantation methods based on embedded system, the method includes:Step 1) creates the interactive container of the specified parameter based on ros build mirror images;Step 2) is arranged system environment variable and installs the go orders that version number is 1.5;Step 3) adds compilation tool;Step 4) changes main Naming Problems and adds the dependence library of cutil.go files;Step 5) cross compile obtains executable file.The method of the present invention can solve RancherOS ros nucleus modules and embedded system mismatch problem;With advantage easy to operate, highly practical.
Description
Technical field
The present invention relates to embedded container handling system fields, and in particular to a kind of Rancher based on embedded system
OS ros nucleus module transplantation methods.
Background technology
Existing embedded system increasingly tends to be intelligent with internet, communication and the development of computer, man-machine friendship
Mutually also more frequently, therefore, requirement of the people to embedded system is higher and higher, it is desirable to which embedded system is more than one using can
The environment of operation.However current embedded system is not perfect enough, since the application of operation increases, the entrance being exposed is just more
More, this makes wooden horse, Malware and virus be easy for invading in system;Resource utilization:Although the property of smart machine
It can be improved, but whens in face of high-resolution video or complex figure processing etc., need more efficient resource management
Technology.
Container virtualization technology is trend of the times, is pacified wherein becoming application as the container technique of new generation of representative using Docker
The hot spot studied entirely.Docker virtualization technologies can provide security domain for application, and isolated island environment is effectively isolated between application
It accesses, protects privacy of user data.Due to the rise of Docker, the Linux release versions of many new special operation containers
Occur.Container encapsulate application program it is required all, in addition to shared operating system nucleus, ring when it encapsulates operation
Border, frame and library, code, configuration and relevant dependence.Container reduce significantly operating system as one all can platform held
The role of load.At this moment operating system under container only needs to undertake the role of a unusual lightweight:Startup and control container.
But existing container handling system is only applicable to server end, can not be adapted to embedded system.
Embedded OS based on Linux usually carries out Linux according to the characteristics of embedded system with application
Part is cut, and is differed with the linux system of server end.
Invention content
It is an object of the invention in order to solve RancherOS and embedded Linux system mismatch problem, need to embedding
Embedded system configures and RancherOS codes are modified, and thus proposes a kind of RancherOS based on embedded system
Ros nucleus module transplantation methods, this method aims to solve the problem that the problem of RancherOS cannot run on embedded system, by only
System environments is arranged in vertical cross compile RancherOS nucleus modules, and modification Naming Problems, addition rely on library and cross compile obtains
To executable file.
To achieve the goals above, the present invention provides a kind of RancherOS ros core moulds based on embedded system
Block transplantation method, the method includes:
Step 1) creates the interactive container of the specified parameter based on ros-build mirror images;
Step 2) is arranged system environment variable and installs the go orders that version number is 1.5;
Step 3) adds compilation tool;
Step 4) changes main Naming Problems and adds the dependence library of cutil.go files;
Step 5) cross compile obtains executable file.
In above-mentioned technical proposal, specified parameter includes in the step 1):Parameter-i ,-t set container to interactive mould
Formula;Parameter-v, according to specified path carry shared volume;Parameter -- device allows container to access the equipment under specified path.
In above-mentioned technical proposal, the step 2) specifically includes:
Step 2-1) setting current path BUILD_DIR;
Step 2-2) the target architecture GOARCH for the program that Go compilers export is set;
Step 2-3) the destination OS GOOS that the program for compiling out is run is set;
Step 2-4) the command line parameter GOGCCFLAGS of gcc compilings when compiling cgo is set;
Step 2-5) setting GOPATH:The catalogue that will be scanned for when GO orders is executed, main storage includes G O source codes
With the catalogue of binary file;
Step 2-6) the installation directory GOROOT of Go language is set;
Step 2-7) setting GOTOOLDIR:The tools chain program of Go is under this catalogue;
Step 2-8) judge whether to use cgo;
Step 2-9) installation respective version number go orders.
In above-mentioned technical proposal, the compilation tool of the step 3) is arm-histvb300-linux compilers.
In above-mentioned technical proposal, the step 4) specifically includes:
Step 4-1) modification docker-from-scratch files under Main files main.go files, modification
Main functions are main functions, and it is package Main to change package main;
Step 4-2) modification util files under cutil.go files cgo parameter sections, add cgo CFLAGS parameters
Specified bank file path, modification cgo LDFLAGS parameters specify path and the static link library filename of static link library;
The library file includes blkid.h, libmount.h header file, libblkid.a, libmount.a and li
Buuid.a static linkage library files.
In above-mentioned technical proposal, in the compilation process of the step 5), it is based on the original compiling ros core moulds of RancherOS
On the basis of block command, GOARCH, CGO_ENABLED and CC parameter need to be added.
Advantage of the invention is that:
1, the method for the invention RancherOS ros nucleus modules that can solve to have determined are mismatched with embedded system and are asked
Topic;
2, method of the invention is easy to operate, highly practical.
Description of the drawings
Fig. 1 is the flow chart of the RancherOS ros nucleus module transplantation methods based on embedded system of the present invention.
Specific implementation mode
The present invention will be described in detail in the following with reference to the drawings and specific embodiments.
As shown in Figure 1, a kind of RancherOS ros nucleus module transplantation methods based on embedded system, pass through independence
Cross compile RancherOS ros nucleus modules, are arranged system environments, and modification Naming Problems, addition rely on library and cross compile
Obtain executable file;The method specifically includes:
Step 1) creates the interactive container of the specified parameter based on ros-build mirror images;
The specified parameter includes:Parameter-i ,-t set container to interactive mode;Parameter-v, hangs according to specified path
Carry shared volume;Parameter -- device allows container to access the equipment under specified path.
Step 2) is arranged system environment variable and installs the go orders that version number is 1.5;It specifically includes:
Step 2-1) setting current path BUILD_DIR;
Step 2-2) the target architecture GOARCH for the program that Go compilers export is set;
Step 2-3) the destination OS GOOS that the program for compiling out is run is set;
Step 2-4) the command line parameter GOGCCFLAGS of gcc compilings when compiling cgo is set;
Step 2-5) setting GOPATH:The catalogue that will be scanned for when GO orders is executed, main storage includes G O source codes
With the catalogue of binary file;
Step 2-6) the installation directory GOROOT of Go language is set;
Step 2-7) setting GOTOOLDIR:The tools chain program of Go is under this catalogue;
Step 2-8) judge whether to use cgo;
Step 2-9) installation respective version number go orders.
Step 3) adds compilation tool;
The compilation tool is arm-histvb300-linux compilers.
Step 4) changes main Naming Problems and adds the dependence library of cutil.go files;
Step 4-1) modification docker-from-scratch files under Main files main.go files, modification
Main functions are main functions, and it is package Main to change package main;
Step 4-2) modification util files under cutil.go files cgo parameter sections, add cgo CFLAGS parameters
Specified bank file path, modification cgo LDFLAGS parameters specify path and the static link library filename of static link library.
The library file include blkid.h, libmount.h header file, libblkid.a, libmount.a and
Libuuid.a static linkage library files.
Step 5) cross compile obtains executable file.
Wherein, cross compile obtains executable file, the base based on the original compiling ros nucleus module orders of RancherOS
On plinth, GOARCH, CGO_ENABLED and CC parameter need to be added.
The present invention a specific embodiment be:
Step 1) creates the interactive container of the specified parameter based on ros-build mirror images, and order is:Docker
run–t-i–v/var/run/docker.sock:/ var/run/docker.sock--device=/dev/kvm:/dev/
Kvm--name=ros-build ros-build
System environment variable is arranged in step 2), and the order that sets is:
Export BUILD_DIR=$ PWD
Export GOARCH=" arm "
Export GOOS=" linux "
Export GOGCCFLAGS="-fPIC-marm-fmessage-length=0-I/include "
Export GOPATH=/go
Export GOROOT="/usr/local/go "
Export GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64 "
Export CGO_ENABLED=" 1 "
Step 3) installs the go orders that version number is 1.5.
Step 3-1) deletion/usr/local/go files;
Step 3-2) GO_VERSION environmental variances are set, order is:Export GO_VERSION=1.5.1
Step 3-3) using curl orders be downloaded version number be 1.5 go orders, order be:
curl-sSL"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-
amd64.t ar.gz"|tar-v-C/usr/local-xz
Step 3-4) PATH environmental variances are set, order is:
Export PATH=$ PATH:/go/bin:/usr/local/go/bin:$PATH
Step 4) adds arm-histvb300-linux compilers.
Step 4-1) download arm-histvb300-linux compilers installation kit and decompress after;
Step 4-2) execute the go Installing of Command that order ./cross.install progress version number is 1.5;
Step 4-3) setting PATH environmental variances, it orders and is:
Export PATH=$ PATH:/opt/hisi-linux/x86-arm/arm-histbv300-linux/bin
Step 5) changes the main.go file designations in the Main files under docker-from-scratch files
Problem, changing later partial code is:
Step 6) adds the dependence library of the cutil.go files under util files.
Step 6-1) util/cutil.go files are changed, modified partial code is:
Step 6-2) container/path under create include files;
Step 6-3) blkid files are created under/paths include/, and add under blkid.h to this document folder
Step 6-4) libmount files are created under/paths include/, and libmount.h is added to this document folder
Under
Step 6-5) container/path under create libs files;
Step 6-6) it adds under libblkid.a, libmount.a, libuuid.a static link library to libs files.
Step 7) cross compile obtains executable file, the base based on the original compiling ros nucleus module orders of RancherOS
On plinth, GOARCH, CGO_ENABLED and CC parameter need to be added, order is:
GOARCH=arm CGO_ENABLED=1CC=" arm-histbv300-linux-gcc " godep go bui
ld-tags netgo-installsuffix netgo-ldflags"-X github.com/rancher/os/
Config.VERSION v0.4.1-dev-linkmode external-extldflags-extld=arm-histbv300-
linux-gcc"-o ros
The foregoing is merely the specific implementation modes of the present invention, are not intended to limit the scope of the present invention, this field
It will be appreciated by the skilled person that under the premise of not departing from inventive principle, modify or wait to technical scheme of the present invention
With replacing, without departure from the spirit and scope of technical solution of the present invention, should all cover in protection scope of the present invention.
Claims (6)
1. a kind of RancherOS ros nucleus module transplantation methods based on embedded system, the method includes:
Step 1) creates the interactive container of the specified parameter based on ros-build mirror images;
Step 2) is arranged system environment variable and installs the go orders that version number is 1.5;
Step 3) adds compilation tool;
Step 4) changes main Naming Problems and adds the dependence library of cutil.go files;
Step 5) cross compile obtains executable file.
2. the RancherOS ros nucleus module transplantation methods according to claim 1 based on embedded system, feature
It is, specified parameter includes in the step 1):Parameter-i ,-t set container to interactive mode;Parameter-v, according to specified
Path carry shared volume;Parameter -- device allows container to access the equipment under specified path.
3. the RancherOS ros nucleus module transplantation methods according to claim 1 based on embedded system, feature
It is, the step 2) specifically includes:
Step 2-1) setting current path BUILD_DIR;
Step 2-2) the target architecture GOARCH for the program that Go compilers export is set;
Step 2-3) the destination OS GOOS that the program for compiling out is run is set;
Step 2-4) the command line parameter GOGCCFLAGS of gcc compilings when compiling cgo is set;
Step 2-5) setting GOPATH:The catalogue that will be scanned for when GO orders is executed, main storage includes G O source codes and two
The catalogue of binary file;
Step 2-6) the installation directory GOROOT of Go language is set;
Step 2-7) setting GOTOOLDIR:The tools chain program of Go is under this catalogue;
Step 2-8) judge whether to use cgo;
Step 2-9) installation respective version number go orders.
4. the RancherOS ros nucleus module transplantation methods according to claim 1 based on embedded system, feature
It is, the compilation tool of the step 3) is arm-histvb300-linux compilers.
5. the RancherOS ros nucleus module transplantation methods according to claim 1 based on embedded system, feature
It is, the step 4) specifically includes:
Step 4-1) modification docker-from-scratch files under Main files main.go files, change Main
Function is main functions, and it is package Main to change package main;
Step 4-2) cutil.go files under modification util files cgo parameter sections, addition cgo CFLAGS parameters are specified
Library file path, modification cgo LDFLAGS parameters specify path and the static link library filename of static link library;
The library file is quiet comprising blkid.h, libmount.h header file, libblkid.a, libmount.a and libuuid.a
State links library file.
6. the RancherOS ros nucleus module transplantation methods according to claim 1 based on embedded system, feature
It is, in the compilation process of the step 5), based on the basis of the original compiling ros nucleus module orders of RancherOS, need to adds
Add GOARCH, CGO_ENABLED and CC parameter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611069177.2A CN108376074B (en) | 2016-11-28 | 2016-11-28 | RancherOS ros core module transplanting method based on embedded system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611069177.2A CN108376074B (en) | 2016-11-28 | 2016-11-28 | RancherOS ros core module transplanting method based on embedded system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108376074A true CN108376074A (en) | 2018-08-07 |
CN108376074B CN108376074B (en) | 2020-10-23 |
Family
ID=63015378
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611069177.2A Expired - Fee Related CN108376074B (en) | 2016-11-28 | 2016-11-28 | RancherOS ros core module transplanting method based on embedded system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108376074B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111190687A (en) * | 2019-11-28 | 2020-05-22 | 安超云软件有限公司 | Container mirror image construction method, device, equipment and storage medium |
CN111866084A (en) * | 2020-06-24 | 2020-10-30 | 北京智芯微电子科技有限公司 | Container-based edge internet of things agent device |
CN117112144A (en) * | 2023-09-22 | 2023-11-24 | 上海卓悠网络科技有限公司 | Method and system for deploying k3s on android system and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100633241B1 (en) * | 2004-05-21 | 2006-10-12 | 오정훈 | Integrated development environment system for embedded linux education |
CN101790174A (en) * | 2010-01-19 | 2010-07-28 | 西安交通大学 | Ad Hoc network Construction method based on OMAP 3530Mini development board |
CN102137101A (en) * | 2011-03-04 | 2011-07-27 | 中山中珩数字科技有限公司 | Embedded Linux system data transmission method based on SCTP (Stream Control Transmission Protocol) and system thereof |
CN105204913A (en) * | 2015-10-20 | 2015-12-30 | 福建升腾资讯有限公司 | Method and system for running Linux application on Android operating system and system |
-
2016
- 2016-11-28 CN CN201611069177.2A patent/CN108376074B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100633241B1 (en) * | 2004-05-21 | 2006-10-12 | 오정훈 | Integrated development environment system for embedded linux education |
CN101790174A (en) * | 2010-01-19 | 2010-07-28 | 西安交通大学 | Ad Hoc network Construction method based on OMAP 3530Mini development board |
CN102137101A (en) * | 2011-03-04 | 2011-07-27 | 中山中珩数字科技有限公司 | Embedded Linux system data transmission method based on SCTP (Stream Control Transmission Protocol) and system thereof |
CN105204913A (en) * | 2015-10-20 | 2015-12-30 | 福建升腾资讯有限公司 | Method and system for running Linux application on Android operating system and system |
Non-Patent Citations (7)
Title |
---|
CYEAAA: "Docker与Golang的巧妙结合", 《DOCKERONE》 * |
HEMMINGWAY: "hi3531交叉编译环境arm-hisiv100nptl-linux搭建过程", 《CSDN》 * |
HYPRIOT: "Install Docker 1.12 on the $9 C.H.I.P. computer", 《HYPRIOT》 * |
SANKAR: "Docker + Golang = <3", 《FEEDBACK》 * |
WXWD1: "嵌入式Linux所需要做的交叉编译库文件", 《LINUX公社》 * |
XDOUJIANG: "安装go语言环境", 《51CTO博客》 * |
高礼: "基于ARM和ZigBee技术的智能家居系统的设计与研究", 《CNKI》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111190687A (en) * | 2019-11-28 | 2020-05-22 | 安超云软件有限公司 | Container mirror image construction method, device, equipment and storage medium |
CN111190687B (en) * | 2019-11-28 | 2023-06-30 | 安超云软件有限公司 | Method, device, equipment and storage medium for constructing container mirror image |
CN111866084A (en) * | 2020-06-24 | 2020-10-30 | 北京智芯微电子科技有限公司 | Container-based edge internet of things agent device |
CN117112144A (en) * | 2023-09-22 | 2023-11-24 | 上海卓悠网络科技有限公司 | Method and system for deploying k3s on android system and storage medium |
CN117112144B (en) * | 2023-09-22 | 2024-03-12 | 上海卓悠网络科技有限公司 | Method and system for deploying k3s on android system and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108376074B (en) | 2020-10-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210141625A1 (en) | Container image building using shared resources | |
EP3336690B1 (en) | Extensible data transformation authoring and validation system | |
CN103001947B (en) | A kind of program processing method and system | |
KR101774975B1 (en) | Extension point declarative registration for virtualization | |
CN103970563B (en) | The method of dynamic load Android class | |
JP6412276B2 (en) | Virtual machine creation method and apparatus | |
CN102999720B (en) | Program identification method and system | |
US11121932B2 (en) | Method and apparatus for model mapping and dynamically enabling external model on the network device | |
CN104714828A (en) | Methods and devices for installing and operating application | |
CN101452402A (en) | Software operation system and software operation method | |
CN102323879A (en) | Complete network middleware operation support platform and integration method of heterogeneous middleware | |
CN103064738A (en) | Method and system for embedding local application program window into browser in Linux | |
CN108376074A (en) | A kind of RancherOS ros nucleus module transplantation methods based on embedded system | |
WO2020063252A1 (en) | Method and device for isolating multiple version dependency | |
CN105468427A (en) | Implementation method and system of automatic compilation and release | |
CN102930190A (en) | Method for preventing user from acquiring super user permission in Android system | |
CN104317573A (en) | Android installation package transformation method and device as well as method and device for operating application | |
CN103514395A (en) | Plug-in right control method and system | |
CN111984245A (en) | Block chain intelligent contract online integrated development environment system and implementation method | |
CN112835568A (en) | Project construction method and device | |
CN102999721B (en) | A kind of program processing method and system | |
CN103885784A (en) | Method for establishing Android platform with security module and plugging function | |
CN108694048B (en) | Method for realizing batch publishing service | |
CN109857374B (en) | Development method and device of mobile application | |
CN104539585A (en) | Browser anti-injection method, browser client side and device |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20201023 |