File: README.md

package info (click to toggle)
golang-github-checkpoint-restore-go-criu 7.2.0%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 1,796 kB
  • sloc: makefile: 231; ansic: 195; python: 137; sh: 110
file content (24 lines) | stat: -rw-r--r-- 1,658 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
This directory provides scripts used by go-criu. Each script is contained in its own directory, along with the respective Makefile and tests.

## `magic-gen`
CRIU uses a 32-bit integer value to determine the type of image file. These values are called *magics*, and are defined [here](https://github.com/checkpoint-restore/criu/tree/master/criu/include/magic.h). `magicgen.go` processes this header file and generates `magic.go` with a map of magic names and values. If the destination path is not provided, the script uses `../magic/magic.go` by default.

`Usage: magicgen.go /path/to/magic.h /path/to/magic.go`

Makefile targets provided:

- `make` or `make magic-gen`: Generate `../magic/magic.go`
- `make test`: Run unit test and E2E test for `magicgen.go`
- `make clean`: Remove `../magic/magic.go` and `magic.h`

## `proto-gen`
CRIT uses protobuf bindings to serialise and deserialise CRIU image files. The definitions for these bindings are available in [criu/images](https://github.com/checkpoint-restore/criu/tree/master/images). `protogen.py` fetches these definitions and generates the `.pb.go` files used by CRIT. If the source or destination directory is not provided, the script uses `../crit/images` by default.

`Usage: protogen.py /path/to/definitions/dir /path/to/destination/dir`

Makefile targets provided:

- `make` or `make pb-gen`: Generate the `.pb.go` bindings
- `make proto-update`: Update the `.proto` files with the latest copy from the CRIU repo. The GIT_BRANCH variable can be used to specify the branch to fetch the files from.
- `make clean-proto`: Delete all `.proto` bindings
- `make clean-pb`: Delete all `.pb.go` bindings