mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-01-13 20:06:38 +00:00
Add tar output format
Add a canonical single tarball output format. This adds kernel and cmdline to `/boot` where LinuxKit output formats will find them. Make the other output formats use that as a base. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
11
vendor/github.com/linuxkit/linuxkit/README.md
generated
vendored
11
vendor/github.com/linuxkit/linuxkit/README.md
generated
vendored
@@ -22,10 +22,8 @@ LinuxKit uses the `moby` tool for image builds, and the `linuxkit` tool for push
|
||||
Simple build instructions: use `make` to build. This will build the tools in `bin/`. Add this
|
||||
to your `PATH` or copy it to somewhere in your `PATH` eg `sudo cp bin/* /usr/local/bin/`. Or you can use `sudo make install`.
|
||||
|
||||
If you already have `go` installed you can use `go get -u github.com/linuxkit/linuxkit/src/cmd/moby` to install
|
||||
If you already have `go` installed you can use `go get -u github.com/moby/tool/cmd/moby` to install
|
||||
the `moby` build tool, and `go get -u github.com/linuxkit/linuxkit/src/cmd/linuxkit` to install the `linuxkit` tool.
|
||||
You can use `go get -u github.com/linuxkit/linuxkit/src/cmd/infrakit-instance-hyperkit`
|
||||
to get the hyperkit infrakit tool.
|
||||
|
||||
Once you have built the tool, use `moby build linuxkit.yml` to build the example configuration,
|
||||
and `linuxkit run linuxkit` to run locally. Use `halt` to terminate on the console.
|
||||
@@ -43,10 +41,11 @@ See `linuxkit run --help`.
|
||||
|
||||
`make test` or `make test-hyperkit` will run the test suite
|
||||
|
||||
There are also docs for booting on [Google Cloud](docs/gcp.md); `linuxkit push gcp <name> && linuxkit run gcp <name>.yml` should
|
||||
work if you specified a GCP image to be built in the config.
|
||||
Additional, platform specific information is available for:
|
||||
- [macOS](docs/mac.md)
|
||||
- [Google Cloud](docs/gcp.md)
|
||||
|
||||
More detailed docs will be available shortly, for running both single hosts and clusters.
|
||||
We'll add more detailed docs for other platforms in the future.
|
||||
|
||||
## Building your own customised image
|
||||
|
||||
|
||||
1
vendor/github.com/linuxkit/linuxkit/projects/README.md
generated
vendored
1
vendor/github.com/linuxkit/linuxkit/projects/README.md
generated
vendored
@@ -20,6 +20,7 @@ If you want to create a project, please submit a pull request to create a new di
|
||||
- [Landlock LSM](landlock/) programmatic access control
|
||||
- [Clear Containers](clear-containers/) Clear Containers image
|
||||
- [Logging](logging/) Experimental logging tools
|
||||
- [etcd cluster](etcd/) etcd cluster demo from DockerCon'17
|
||||
|
||||
## Current projects not yet documented
|
||||
- VMWare support (VMWare)
|
||||
|
||||
63
vendor/github.com/linuxkit/linuxkit/src/initrd/initrd.go
generated
vendored
63
vendor/github.com/linuxkit/linuxkit/src/initrd/initrd.go
generated
vendored
@@ -6,6 +6,7 @@ import (
|
||||
"compress/gzip"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/linuxkit/linuxkit/src/pad4"
|
||||
"github.com/surma/gocpio"
|
||||
@@ -92,6 +93,68 @@ func CopyTar(w *Writer, r *tar.Reader) (written int64, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// CopySplitTar copies a tar stream into an initrd, but splits out kernel and cmdline
|
||||
func CopySplitTar(w *Writer, r *tar.Reader) (kernel []byte, cmdline string, err error) {
|
||||
for {
|
||||
var thdr *tar.Header
|
||||
thdr, err = r.Next()
|
||||
if err == io.EOF {
|
||||
return kernel, cmdline, nil
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
tp := typeconv(thdr)
|
||||
if tp == -1 {
|
||||
return kernel, cmdline, errors.New("cannot convert tar file")
|
||||
}
|
||||
switch thdr.Name {
|
||||
case "boot/kernel":
|
||||
kernel, err = ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
case "boot/cmdline":
|
||||
var buf []byte
|
||||
buf, err = ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
cmdline = string(buf)
|
||||
case "boot":
|
||||
default:
|
||||
size := thdr.Size
|
||||
if tp == cpio.TYPE_SYMLINK {
|
||||
size = int64(len(thdr.Linkname))
|
||||
}
|
||||
chdr := cpio.Header{
|
||||
Mode: thdr.Mode,
|
||||
Uid: thdr.Uid,
|
||||
Gid: thdr.Gid,
|
||||
Mtime: thdr.ModTime.Unix(),
|
||||
Size: size,
|
||||
Devmajor: thdr.Devmajor,
|
||||
Devminor: thdr.Devminor,
|
||||
Type: tp,
|
||||
Name: thdr.Name,
|
||||
}
|
||||
err = w.WriteHeader(&chdr)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if tp == cpio.TYPE_SYMLINK {
|
||||
buffer := bytes.NewBufferString(thdr.Linkname)
|
||||
_, err = io.Copy(w, buffer)
|
||||
} else {
|
||||
_, err = io.Copy(w, r)
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NewWriter creates a writer that will output an initrd stream
|
||||
func NewWriter(w io.Writer) *Writer {
|
||||
initrd := new(Writer)
|
||||
|
||||
19
vendor/github.com/linuxkit/linuxkit/vendor.conf
generated
vendored
19
vendor/github.com/linuxkit/linuxkit/vendor.conf
generated
vendored
@@ -1,24 +1,12 @@
|
||||
github.com/google/google-api-go-client 16ab375f94503bfa0d19db78e96bffbe1a34354f
|
||||
github.com/Masterminds/semver 312afcd0e81e5cf81fdc3cfd0e8504ae031521c8
|
||||
github.com/Masterminds/sprig 01a849f546a584d7b29bfee253e7db0aed44f7ba
|
||||
github.com/Sirupsen/logrus 10f801ebc38b33738c9d17d50860f484a0988ff5
|
||||
github.com/aokoli/goutils 9c37978a95bd5c709a15883b6242714ea6709e64
|
||||
github.com/armon/go-radix 4239b77079c7b5d1243b7b4736304ce8ddb6f0f2
|
||||
github.com/docker/docker 8d96619e5a367798cffcb740cfc41e0a505a5232
|
||||
github.com/docker/distribution 07f32ac1831ed0fc71960b7da5d6bb83cb6881b5
|
||||
github.com/docker/engine-api cf82c64276ebc2501e72b241f9fdc1e21e421743
|
||||
github.com/docker/go-connections e15c02316c12de00874640cd76311849de2aeed5
|
||||
github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3
|
||||
github.com/docker/infrakit cb420e3e50ea60afe58538b1d3cab1cb14059433
|
||||
github.com/ghodss/yaml 0ca9ea5df5451ffdf184b4428c902747c2c11cd7
|
||||
github.com/golang/protobuf c9c7427a2a70d2eb3bafa0ab2dc163e45f143317
|
||||
github.com/googleapis/gax-go 8c5154c0fe5bf18cf649634d4c6df50897a32751
|
||||
github.com/gorilla/context 08b5f424b9271eedf6f9f0ce86cb9396ed337a42
|
||||
github.com/gorilla/mux 599cba5e7b6137d46ddf58fb1765f5d928e69604
|
||||
github.com/gorilla/rpc 22c016f3df3febe0c1f6727598b6389507e03a18
|
||||
github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
|
||||
github.com/jmespath/go-jmespath bd40a432e4c76585ef6b72d3fd96fb9b6dc7b68d
|
||||
github.com/mattn/go-colorable d228849
|
||||
github.com/mitchellh/go-ps 4fdf99ab29366514c69ccccddab5dc58b8d84062
|
||||
github.com/moby/hyperkit 9b5f5fd848f0f5aedccb67a5a8cfa6787b8654f9
|
||||
github.com/opencontainers/runtime-spec d094a5c9c1997ab086197b57e9378fabed394d92
|
||||
@@ -26,11 +14,7 @@ github.com/pkg/errors ff09b135c25aae272398c51a07235b90a75aa4f0
|
||||
github.com/packethost/packngo 91d54000aa56874149d348a884ba083c41d38091
|
||||
github.com/rneugeba/iso9660wrap 4606f848a055435cdef85305960b0e1bb788d506
|
||||
github.com/satori/go.uuid b061729afc07e77a8aa4fad0a2fd840958f1942a
|
||||
github.com/spf13/afero 9be650865eab0c12963d8753212f4f9c66cdcf12
|
||||
github.com/spf13/cobra 7be4beda01ec05d0b93d80b3facd2b6f44080d94
|
||||
github.com/spf13/pflag 9ff6c6923cfffbcd502984b8e0c80539a94968b7
|
||||
github.com/surma/gocpio fcb68777e7dc4ea43ffce871b552c0d073c17495
|
||||
github.com/vaughan0/go-ini a98ad7ee00ec53921f08832bc06ecf7fd600e6a1
|
||||
github.com/xeipuuv/gojsonpointer 6fe8760cad3569743d51ddbb243b26f8456742dc
|
||||
github.com/xeipuuv/gojsonreference e02fc20de94c78484cd5ffb007f8af96be030a45
|
||||
github.com/xeipuuv/gojsonschema 702b404897d4364af44dc8dcabc9815947942325
|
||||
@@ -38,9 +22,6 @@ golang.org/x/crypto 573951cbe80bb6352881271bb276f48749eab6f4
|
||||
golang.org/x/net a6577fac2d73be281a500b310739095313165611
|
||||
golang.org/x/oauth2 1611bb46e67abc64a71ecc5c3ae67f1cbbc2b921
|
||||
golang.org/x/sys 99f16d856c9836c42d24e7ab64ea72916925fa97
|
||||
golang.org/x/text a263ba8
|
||||
google.golang.org/api 1202890e803f07684581b575fda809bf335a533f
|
||||
google.golang.org/grpc 0713829b980f4ddd276689a36235c5fcc82a21bf
|
||||
gopkg.in/inconshreveable/log15.v2 v2.11
|
||||
gopkg.in/tylerb/graceful.v1 4654dfbb6ad53cb5e27f37d99b02e16c1872fbbb
|
||||
gopkg.in/yaml.v2 a3f3340b5840cee44f372bddb5880fcbc419b46a
|
||||
|
||||
Reference in New Issue
Block a user