In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install lxc,lxd on tinycorelinux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Preparation and compilation of golang
Add a swapfile=hda1 to Grub. Compile go1.12.6 with at least 1g of memory. To prepare git,git, we use 4.x, need expat2.tcz and openssl-1.0.0.tcz, both use 3.x, press "install sandstorm davros on tinycolinux" to compile openssl1.0.1 to cover 1.0.0-prefix=/usr/local,make install,sudo ldconfig, and then compile curl 7.30.0-with-ssl=/usr/local,make install,sudo ldconfig, without compiling git, to prevent unable to get local issuer certificate git, run git config-global http.sslVerify false
Install bash.tcz, download and extract go1.4-bootstrap-20171003.tar.gz,Go 1.4 was the last distribution in which the toolchain was written in CjingCD go,sudo. / make.bash, without export GOROOT_BOOTSTRAP=/mnt/hda1/tmp/go, this is useless, you still need mv / mnt/hda1/tmp/go / home/tc/go1.4 Download go1.12.6.tar.gz,cd go-go1.12.6/src,sudo. / make.bash does not have the previous swap settings here, in order for go to take effect. Export PATH=$PATH:/mnt/hda1/tmp/go-go1.12.6/bin
Lxd source code processing
Install libcap.tcz,acl-dev.tcz, download and extract lxd-3.0.4.tar.gz,cd lxd-lxd-3.04, and process lxd src:
The first problem, the same problem, is that the gcc443 we use is not gnu11,go default call gnu11, there will be Unknown command line-std=gnu11 in lxd src, find / / # cgo with-std=gnu11 to remove it, for comments, there are about 16 files, and then, in / home/tc/go/src, create a new github.com- > lxc folder, cd lxc, directly mv modified lxd to here. Make sure the name is in lxd/ lxd/shared/idmap/shift_linux.go, / lxd/shared/netutils/netns_addrs.c
Then there is makefile:
At the top of Sudo vi Makefile, add the judgment of removing deps from shell=/bin/bash,default. Change the ifeq in ifeq ($(TAG_SQLITE3),) to ifneq, and further analyze the logic of the default make deps in makefile:
It takes home/ current user / go/ as GOPATH, maintains such a structure (GOPATH) / deps/, so we mkdir-p ~ / go/src,cd ~ / go/src,mv / mnt/hda1/tmp/lxd-lxd-3.04 ~ / go/src
Continue to analyze makefile, there are 5 deps:sqlite,uv,raft,co,dqlite, there are 4 addresses in the file, there is no libuv, which will be dealt with later, but because these five deps may make compilation errors, as soon as make deps is executed, it will always be forced to pull from 0 (sqlite unconditional pull, the other four judgment pull), so it is impossible to modify the relevant files of deps sqlite locally and debug the influence of make deps to make it pass finally. We can only customize the sqlite repository and replace its address in makefile:
Sqlite: sqlite: https://github.com/CanonicalLtd/sqlite/3c5e6afb3d8330485563387bc9b9492b4fd3d88d, around 2019.4.19 you must fork its github repository, make the following modifications, and change the GitHub repo call address parameter in makefile to skip this in src/sqlite3.h.in: delete the sentence typedef struct sqlite3_wal_replication sqlite3_wal_replication; and then typdef struct sqlite3_wal_replication {... The sqlite3_wal_replication of} is preceded by a struct, and there are five lines in order to avoid the possibility that the typedef redefinition of c11 is not supported until after redefinition of typedef 'sqlite3 wal replication',gcc 4.7 is compiled in make deps-Wtypedef-redefinition,gcc 443 is not supported.
The other four deps can be modified from git to / mnt/hda1/tmp respectively. Try make install.
Libuv: https://github.com/libuv/libuv/commit/1a06462cd33fb94720d639f40db3522313945adf Sudo. / autogen.sh,./configure,make install around Git clone 2019.6.28
Raft: around Git clone 2019.6.26, error implicit declaration of function aligned_alloc will appear in https://github.com/CanonicalLtd/raft/commit/ee097affa3dfff53f0c5af096a55d8b7dacecdc3, because the function aligned_alloc () added in C11 can be released in configure.ac 161line, so it is a warning instead of error. / configure-disable-example, otherwise there will be TIME_UTC isa macro in C11 timekeeping UTC is macro in glibc 2.16
Libco: https://github.com/freeekanayaka/libco, is currently v18, no make install copy lib.pc to / usr/lib/pkconfig/ manual copy install / usr/ for prefix and then ldconfig
Of course, you can also put the new warehouse addresses of the revised 4 deps into makefile like sqlite, try Sudo make deps, and if you can't find libuv, go to that deps under make install and sudo ldconfig to re-make deps, which is more convenient and unified.
The above src processing of lxd src and dep, because go or makefile will continue to download files to go path, when debugging, if there are any new errors, remember to empty the corresponding folder in / deps/ or src/github.com/ and let makefile or go get reapply the new logic.
Compile deps and lxd
Make dep, finally succeed! After that, you need to set up several export. After compilation, you will be prompted: Export CGO_CFLAGS= "- I/home/tc/go/deps/sqlite/-I/home/tc/go/deps/dqlite/include/" Export CGO_LDFLAGS= "- L/home/tc/go/deps/sqlite/.libs/-L/home/tc/go/deps/dqlite/.libs/" Export LD_LIBRARY_PATH= "/ home/tc/go/deps/sqlite/libs/:/home/tc/go/deps/dqlite/.libs/" if it is generated manually The corresponding address will be / mnt/hda1/tmp/xxx
Finally, before the overall make (default), you need to deal with:
There will be many pitfalls and challenges here, mainly because the package download of golang needs to use an external network line and go does not have a standard way to change mirror. To save trouble, we will manually complete: create a new golang.org folder in src-> x folder, cd x, and still git clone github.com/golang/sys/,github.com/golang/net/, github.com/golang/crypto/, this is because all golang.org packages are walled, and there are some large packages that are not walled, such as mgo v2 downloaded to gopkg.in. Cd gppkg.in,git clone https://github.com/go-mgo/mgo/,mv mgo mgo.v2,cd mgo.v2,git checkout v2 is one of its branch.
Sudo make . Other packages will be downloaded automatically, and the unwalled gopkg.in will still be downloaded to / home/tc/go/src/gopkg.in. Then automatically start compiling, if you can't find the deps here, the export is often not set up after the make deps, it doesn't matter, here you can further export overlay completion.
Finally, the lxd is compiled. Finish it!
Thank you for reading! This is the end of the article on "how to install lxc,lxd on tinycorelinux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 222
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.