Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
722 commits
Select commit Hold shift + click to select a range
1ce6166
Merge pull request #278 from Microsoft/go1.11.5
Feb 27, 2019
2d551da
Remove VHDX booting
Mar 4, 2019
6bae68b
Merge pull request #280 from Microsoft/jjh/lcow.vhdx
jterry75 Mar 4, 2019
68357fd
Unix line endings on .c files
Mar 4, 2019
a109671
Merge pull request #281 from Microsoft/jjh/unixlineendings
kevpar Mar 4, 2019
87b5933
Add OCI Privileged container support
jterry75 Mar 2, 2019
eec8f89
Merge pull request #282 from Microsoft/privileged_support
Mar 5, 2019
954d712
Fix comment for privileged container detection
jterry75 Mar 5, 2019
f1b2fa8
Merge pull request #283 from Microsoft/fix_log_message
Mar 5, 2019
4b63268
Fix additional append in host device list
jterry75 Mar 5, 2019
e8850a5
Merge pull request #284 from Microsoft/fix_additional_device_append
jterry75 Mar 5, 2019
b335388
Change HotRemove NIC to warning instead of error
jterry75 Mar 11, 2019
aff0cdb
Merge pull request #286 from Microsoft/v2_hotremove_network
jterry75 Mar 11, 2019
71f3f03
Implement GetProperties pids for V2
jterry75 Mar 11, 2019
ab045a2
Merge pull request #285 from Microsoft/get_properties_v2
jterry75 Mar 12, 2019
003597a
LCOW(v1) Remove kernel/initrd options
Mar 13, 2019
8e8fdcd
Remove Kernel!
Mar 13, 2019
73c53b9
Merge pull request #288 from Microsoft/jjh/kernelstep1
jterry75 Mar 13, 2019
92ea373
Merge pull request #287 from Microsoft/jjh/options
jterry75 Mar 13, 2019
aa70776
Bump go to 1.12.1
Mar 22, 2019
a8a6fa1
Merge pull request #289 from Microsoft/go1.12.1
jterry75 Mar 22, 2019
863e4ec
Exclude lost+found from tar stream
Apr 2, 2019
349ae43
Merge pull request #290 from Microsoft/jjh/lostandfound
jterry75 Apr 2, 2019
216a741
Change to lk4d4/vndr
jterry75 Oct 2, 2018
fb92ea9
Merge pull request #291 from Microsoft/jterry75/revendor
jterry75 Apr 4, 2019
1edcb06
Bump to golang 1.12.2
Apr 8, 2019
b44ca09
Merge pull request #292 from Microsoft/jjh/go1.12
jterry75 Apr 10, 2019
1466302
Move v2 storage calls to golang packages
jterry75 Apr 8, 2019
259620a
Move v2 network calls to golang packages
jterry75 Apr 9, 2019
fb1e764
Move v2 HCS runtime to internal package
jterry75 Apr 9, 2019
a691da4
Move v2 devicemapper to internal package
jterry75 Apr 9, 2019
94ff9eb
Convert all v2 code to LF
jterry75 Apr 9, 2019
de5eaef
Remove v2 runc devices.HostDevices clone to actual runc package
jterry75 Apr 9, 2019
b43e280
Seperate UVM.go into Host/Container/Process
jterry75 Apr 9, 2019
2d6fc97
Retry SCSI mount on source ENOENT
jterry75 Apr 11, 2019
94f619b
Fix issue in storage v1 overlay when readonly==true
jterry75 Apr 11, 2019
74a636c
Merge pull request #293 from Microsoft/move_v2_runtime
jterry75 Apr 15, 2019
7c24cb2
Remove unused error types
jterry75 Apr 16, 2019
a25d497
Return HR ERROR_NOT_FOUND after process exit
jterry75 Apr 16, 2019
0a590cc
Return ERROR_VMCOMPUTE_SYSTEM_NOT_FOUND on runc kill error
jterry75 Apr 16, 2019
9cdd8fa
Return ERROR_VMCOMPUTE_SYSTEM_ALREADY_EXISTS on CreateContainer with …
jterry75 Apr 17, 2019
fefd0ad
Merge pull request #294 from Microsoft/fix_errors
jterry75 Apr 17, 2019
97d5384
gcs: Cleanly shut down stdio sockets to avoid missing data
jstarks Apr 18, 2019
ae778f0
Merge pull request #295 from jstarks/clean_close_sockets
jterry75 Apr 18, 2019
c66c35b
Upgrade to cmd.ProcessState.ExitCode() with golang 1.12
jterry75 Apr 19, 2019
e979295
Merge pull request #296 from Microsoft/exit_status
jterry75 Apr 19, 2019
7009c9e
gcs: Prevent GCS crashing when external process exits
jstarks Apr 21, 2019
92d537f
Merge pull request #297 from jstarks/ctty
jstarks Apr 22, 2019
dfed0c9
Update to golang 1.12.4
jterry75 Apr 29, 2019
1a87c07
Merge pull request #298 from Microsoft/golang_1_12_4
jterry75 Apr 29, 2019
2742a48
vsockexec: Remove dependency on Linux headers
jstarks May 1, 2019
d785569
Merge pull request #300 from jstarks/no_linux_headers
jterry75 May 1, 2019
24abed4
Fix build remove stale test
jterry75 May 1, 2019
9721a20
Fix Wrapf format issue missing container id
jterry75 May 1, 2019
40bf352
Merge pull request #302 from Microsoft/fix_build
jterry75 May 1, 2019
87c71eb
Makefile: append to archive manually
jstarks May 1, 2019
334aff8
Merge pull request #299 from jstarks/makefile2
jstarks May 1, 2019
f9edcb4
hack/catcpio.sh: Pass appropriate flags to cpio -i
jstarks May 4, 2019
6b38ecb
gcs: Include nano seconds in JSON log output
jstarks May 4, 2019
db8d6af
Makefile: Only rebuild Go targets if a dependency has changed
jstarks May 4, 2019
0361543
Merge pull request #305 from jstarks/nano_time
jterry75 May 7, 2019
dcc6ef8
Merge pull request #304 from jstarks/catcpio_fixes
jterry75 May 7, 2019
6218f81
Merge pull request #306 from jstarks/godeps
jstarks May 7, 2019
e872215
Update Travis CI path
jstarks May 7, 2019
a1d9046
Transition to Go modules
kevpar May 8, 2019
dbe1148
Run go mod tidy
kevpar May 8, 2019
add1ce4
Merge pull request #308 from microsoft/modules
kevpar May 8, 2019
67b5c17
Return proper ContainerExit result
jterry75 May 1, 2019
f812e6a
Merge pull request #301 from microsoft/fix_result
jterry75 May 8, 2019
6582bd2
Makefile: Fixes to run in Debian stretch
jstarks May 13, 2019
291ac98
Merge pull request #310 from jstarks/fix_stretch
jstarks May 13, 2019
630b354
Ignore ResizeConsole of closed tty
jterry75 May 13, 2019
97a5777
Merge pull request #311 from jterry75/fix_resize_on_exited
jterry75 May 13, 2019
4d3d9c1
gcs: Fill out ErrorMessage string for HCS external bridge
jstarks May 15, 2019
0a61924
Merge pull request #312 from jstarks/error
jterry75 May 15, 2019
1e2df37
UnknownMessage for v1 requires E_NOTIMPL
jterry75 May 15, 2019
bde2cc1
Merge pull request #313 from microsoft/unknown_message_regression
jterry75 May 15, 2019
a2bc40a
Separate v1 and v2 bridge interfaces
jterry75 May 15, 2019
a613c57
Merge pull request #314 from jterry75/fix_resize_on_exited
jterry75 May 15, 2019
dc5fc6e
Fix regression in external process wait on V2
jterry75 Jun 5, 2019
4d73321
rootfs: Convert from initrd by extracting and archiving
jstarks Jun 5, 2019
7977f11
Merge pull request #316 from jstarks/fix_rootfs_hard_links
jterry75 Jun 5, 2019
517472c
Merge pull request #315 from jterry75/regression_on_stop
jterry75 Jun 5, 2019
379e9f6
Simplify the bridge request/return pattern
jterry75 Jun 5, 2019
f516a03
Merge pull request #317 from jterry75/simplify_request_return
jterry75 Jun 6, 2019
456e8a8
Maps /etc/hosts and /etc/hostname to sandbox/workload containers
jterry75 May 30, 2019
b788199
Merge pull request #319 from jterry75/etc_hosts
jterry75 Jun 19, 2019
afadb50
MessageBase should not be including as ptr type
jterry75 Jun 20, 2019
dfc4697
Merge pull request #320 from jterry75/non_ptr_basetype
jterry75 Jun 20, 2019
d15938c
Add OpenCensus support for all V2 requests/responses
jterry75 May 31, 2019
7b0368e
Merge pull request #318 from jterry75/add_ctx
jterry75 Jun 21, 2019
b75c62c
Export all OC span's with name key
jterry75 Jun 25, 2019
205d179
Merge pull request #321 from jterry75/span_name
jterry75 Jun 25, 2019
a79395d
Force span duration to pretty print
jterry75 Jun 25, 2019
9bf5f37
Merge pull request #322 from jterry75/duration_to_string
jterry75 Jun 25, 2019
95f3e61
Honor userstr override to uid/gid for runc activation
jterry75 Jul 3, 2019
feafeff
Merge pull request #323 from jterry75/runas_user
jterry75 Jul 3, 2019
38167a9
Generate /etc/hosts on sandbox/standalone activation
jterry75 Jul 5, 2019
98047cd
Merge pull request #324 from jterry75/etc_hosts
jterry75 Jul 6, 2019
7defe23
ExitStatus should contain a signaled offset
jterry75 Jul 15, 2019
2e5055d
Merge pull request #325 from jterry75/exit_code_fix
jterry75 Jul 16, 2019
d40aa64
Typo fix
rhdedgar Jul 16, 2019
9dbdb55
Merge pull request #326 from rhdedgar/master
jterry75 Jul 17, 2019
6cb62de
Send SignalProcess to initpid to all pids in ns
jterry75 Jul 25, 2019
9c65c89
Merge pull request #329 from jterry75/signal_init_all
jterry75 Jul 26, 2019
b4d5ba0
Accept OpenCensus SpanContext on requests
jterry75 Jul 30, 2019
4062fc9
Merge pull request #330 from jterry75/parent_ctx
jterry75 Jul 30, 2019
e6ee10b
Break apart hcsv2.Host ModifySettings methods
jterry75 Jul 31, 2019
9d1842e
Merge pull request #333 from jterry75/seperate_uvm_modify
jterry75 Jul 31, 2019
ed3f68b
Cleanup duplicate spans and add context
jterry75 Jul 31, 2019
0ad60ce
Use context wait patterns
jterry75 Jul 31, 2019
f21f430
Merge pull request #332 from jterry75/network_wait_context
jterry75 Jul 31, 2019
84850a6
Merge pull request #331 from jterry75/cleanup_spans
jterry75 Aug 1, 2019
73b7ba6
Add bridge command to retrieve stacks
Aug 14, 2019
2b2cc6b
Merge pull request #335 from microsoft/katiewasnothere/dumpstacks
Aug 16, 2019
8641aef
Update to golang 1.12.9
jterry75 Aug 14, 2019
e08da9b
Merge pull request #334 from jterry75/update_golang
jterry75 Aug 22, 2019
a978dc1
Adding support for 2 ethernet interfaces (ingress/egress on secondary
Aug 26, 2019
5838adb
Merge pull request #336 from dariopb/two_interfaces
jterry75 Aug 26, 2019
a338668
init: Add option to initialize entropy from vsock
jstarks Sep 4, 2019
49026a1
gcs: Improve error message on pmem mount failure
jstarks Sep 4, 2019
26b56e5
Merge pull request #340 from jstarks/pmem_error
jterry75 Sep 4, 2019
53f496f
Merge pull request #339 from jstarks/entropy
jterry75 Sep 4, 2019
39c13e6
init: Add workaround for musl-gcc missing linux/random.h
kevpar Sep 4, 2019
7ab4700
Merge pull request #341 from microsoft/fix-randomh
kevpar Sep 4, 2019
33a7025
init: Close entropy-related fds
jstarks Sep 6, 2019
5cfb937
Merge pull request #342 from jstarks/entropy_fix
kevpar Sep 6, 2019
3c0a9ad
Fix bug in json.Unmarshal on OpenCensus TraceState entries
jterry75 Sep 16, 2019
cd6add3
Merge pull request #345 from microsoft/fix_344
jterry75 Sep 16, 2019
9581e44
Update to containerd 1.3.0 vendor
jterry75 Sep 27, 2019
8cadd9c
Merge pull request #346 from jterry75/update_cd_1_3_0
jterry75 Sep 27, 2019
b2d9d4b
Add sock options and explicitly set payload size for plan 9 mounts
Sep 26, 2019
ee915ce
Merge pull request #347 from microsoft/plan9_mount_perf
jterry75 Oct 2, 2019
3b6b46c
Do not wait for outstanding execs on container exit
jterry75 Oct 4, 2019
2df2116
Support mount propagation for sandbox mounts
Oct 4, 2019
6c7630f
Merge pull request #349 from microsoft/mount_propagation
jterry75 Oct 7, 2019
f2cb33a
Merge pull request #348 from jterry75/stop_waiting_for_exec_exit
jterry75 Oct 7, 2019
01d040a
Create Containers and GCS cgroups on GCS startup
jterry75 Oct 10, 2019
c79cd34
Merge pull request #350 from jterry75/parent_cgroup
jterry75 Oct 10, 2019
58ef35e
update getPropertiesV2 with ability to get container stats for LCOW
Oct 11, 2019
08a7e6d
Fix nil dereference race in Pipe/TtyRelay Wait
jterry75 Oct 17, 2019
ed49d57
Merge pull request #351 from jterry75/fix_panic_in_relay
jterry75 Oct 17, 2019
3685229
Correctly setting the table rule to include only packets from the int…
Oct 18, 2019
0aebdc4
Merge pull request #352 from microsoft/container_stats
Oct 18, 2019
53acb41
Merge pull request #353 from dariopb/rule_fix
jterry75 Oct 18, 2019
212cece
add ability to read runc log for errors in runc commands
Oct 29, 2019
2a2ea96
Fix issue causing SCSI hot add to find no matching device
jterry75 Nov 1, 2019
f4d93b5
Merge pull request #356 from jterry75/fix_scsi_devicelen
jterry75 Nov 4, 2019
9ae3947
Merge pull request #355 from microsoft/runc_log_read
Nov 4, 2019
57a1d0a
move container files under /run writeable storaage
Nov 5, 2019
05314b0
Merge pull request #357 from microsoft/move_container_files
Nov 6, 2019
5bf3e81
Remove v2 dependency on v1 for host processes
jterry75 Nov 6, 2019
675a6c4
Merge pull request #358 from jterry75/run_external_v2
jterry75 Nov 7, 2019
15fb66d
Formally deprecate LCOW v1
jterry75 Nov 7, 2019
15d8e38
Merge pull request #359 from jterry75/lcow_v1_readme
jterry75 Nov 8, 2019
8e258af
add new delete container state bridge call
Nov 8, 2019
34c95b0
update to golang 1.13.4
Nov 12, 2019
bc080b5
Merge pull request #361 from microsoft/golang1.13.4
Nov 13, 2019
19af99e
Increase GCS memory limit to 50MB
kevpar Nov 26, 2019
6bf813c
Merge pull request #362 from kevpar/increase-gcs-mem-limit
jterry75 Nov 26, 2019
b577444
Merge pull request #360 from microsoft/delete_container_state
Dec 2, 2019
7b9296d
Set default reviewers for PR's
jterry75 Dec 10, 2019
7794bd1
Merge pull request #363 from jterry75/owners
jterry75 Dec 10, 2019
63d626e
init: Set RLIMIT_NOFILE hard limit to 1M
Jan 30, 2020
a7ebf62
Merge pull request #368 from microsoft/rlimit
kevpar Feb 4, 2020
372535f
add gpu support for lcow
Jan 13, 2020
dbf8a63
Merge pull request #369 from microsoft/gpu_support
Feb 20, 2020
1abf9db
gcs: Handle infinite wait timeouts
Feb 26, 2020
d5b0dea
Merge pull request #370 from jstarks/no_timeout
jterry75 Feb 26, 2020
e6dd8c6
Terminate all other container processes when the init exits
kevpar Mar 3, 2020
24ef464
Merge pull request #371 from kevpar/init-fork-exit
kevpar Mar 5, 2020
cc00831
Continuously log /dev/kmsg
dcantah Mar 18, 2020
4906aa7
Merge pull request #373 from dcantah/logkmsg
dcantah Apr 2, 2020
7a9e7fa
Improve low memory detection
dcantah Mar 23, 2020
91822c7
Remove opengcs:: prefix from main log statements
dcantah Apr 6, 2020
043c67b
Vendor new version of containerd/cgroups
dcantah Apr 7, 2020
096d842
Merge pull request #372 from dcantah/gcs_cgroup
dcantah Apr 9, 2020
53d8b67
Update readme with information on commit signing
Apr 16, 2020
5e5e32f
Merge pull request #374 from microsoft/readme_with_signing
Apr 16, 2020
a66c6ad
Remove dax mount option to avoid 5.4 kernel hard failure
dcantah Jun 3, 2020
bff689f
Merge pull request #375 from dcantah/remove-dax
dcantah Jun 3, 2020
200301a
Fix pmem build error
dcantah Jun 14, 2020
ac9ffda
Merge pull request #376 from dcantah/pmem-fix
dcantah Jun 14, 2020
146fa3f
Add support for parsing linux devices into workload containers
Jul 16, 2020
60d84e9
Merge pull request #377 from katiewasnothere/sandbox_devices
Jul 31, 2020
ef66283
Touchup OOM/memory limit logging events
dcantah Aug 22, 2020
ed1730c
Merge pull request #378 from dcantah/cgroups-fix
dcantah Aug 31, 2020
9688700
Fix resolv.conf generation
kevpar Sep 3, 2020
3c959b7
Merge pull request #379 from kevpar/fix-resolvconf
kevpar Sep 3, 2020
deb2d17
Add new bridge call to update runc container
Sep 17, 2020
c520427
Write 1 to memory.use_hierarchy to enable hierarchy support
dcantah Oct 3, 2020
eaba4b7
Merge pull request #381 from dcantah/use_hierarchy
dcantah Oct 6, 2020
9787141
Merge pull request #380 from katiewasnothere/update_container
Oct 13, 2020
1a6b13c
Revert previous change that issues a kill all on container stop for LCOW
Oct 15, 2020
db3851c
Merge pull request #382 from katiewasnothere/revert_init_kill_all
Oct 19, 2020
48a6b71
Cleanup process directory after process exits.
ambarve Dec 2, 2020
d84eb8a
Merge pull request #385 from ambarve/cleanup_container_process
ambarve Dec 2, 2020
b9c7fc4
Allow passing any uid for container processes.
ambarve Dec 3, 2020
5ea360e
Merge pull request #386 from ambarve/fix_uid_bug
ambarve Dec 4, 2020
e972b27
Remove the v1 gcs
jterry75 Nov 6, 2019
60b6455
Merge pull request #390 from katiewasnothere/remove_v1_additional
Feb 4, 2021
642f782
Change the update container bridge call to use the modify call instead
Jan 23, 2021
1e3104e
Merge pull request #391 from katiewasnothere/update_to_modify_call
Feb 5, 2021
3a54e77
enable device-mapper for mounting container layers
anmaxvl Jan 20, 2021
80883ee
Remove netnscfg gcstools utility
dcantah Feb 19, 2021
5f390c4
Merge pull request #389 from anmaxvl/maksiman/device-mapper-support
anmaxvl Mar 1, 2021
d32b512
Ignore error if container process dies between queries
Feb 25, 2021
4db65a8
Merge pull request #394 from katiewasnothere/proc_cmdline_logs
Mar 1, 2021
039c267
Merge pull request #393 from dcantah/removenetnscfg
dcantah Mar 4, 2021
2b24f2f
Fixed typo in README
dmitsh Mar 9, 2021
d39f876
Merge pull request #395 from dmitsh/ds-typo
anmaxvl Mar 9, 2021
59148da
go.mod: github.com/containerd/containerd v1.5.0-beta.4
thaJeztah Mar 18, 2021
c0ed290
go.mod: github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3
thaJeztah Mar 18, 2021
b72a022
Merge pull request #396 from thaJeztah/bump_deps
Mar 18, 2021
fd36632
Update to new package location for containerd/sys/reaper
Mar 22, 2021
221178a
Merge pull request #397 from katiewasnothere/fix_containerd_update
Mar 22, 2021
9917392
Add a new generic hook for use in device setup
Jan 6, 2021
6c9e795
Merge pull request #388 from katiewasnothere/generic_hook
Mar 23, 2021
1b5fcfe
add support for dm verity target when mounting VPMem devices
anmaxvl Mar 31, 2021
01a2767
Support passing through arbitrary options and propagation flags for s…
Mar 26, 2021
a72614f
Merge pull request #398 from katiewasnothere/fix_propagation_scsi
Apr 8, 2021
daa2c78
Merge pull request #399 from anmaxvl/maksiman/dm-verity-target
anmaxvl Apr 8, 2021
50edeb3
Update go modules to get missing dependencies
Apr 13, 2021
2ed5866
Merge pull request #400 from katiewasnothere/vendor_missing_deps
Apr 13, 2021
7604c07
Update generichook package to fix broken dependency
Apr 13, 2021
8f1f0a0
Merge pull request #401 from katiewasnothere/fix_generichook_dep
Apr 13, 2021
7913d73
Get rid of service/gcs/core/gcs
dcantah Apr 14, 2021
b1ad9ad
Merge pull request #404 from dcantah/gcs-core-remove
dcantah Apr 14, 2021
02bb73f
minor bugfix in pmem debug message. fix pmem and scsi unit tests
anmaxvl Apr 14, 2021
3bfc2da
Merge pull request #403 from anmaxvl/fix_storage_tests
anmaxvl Apr 14, 2021
9ee477c
Add CI github action
Apr 14, 2021
5eca651
Merge pull request #402 from katiewasnothere/gh_actions
Apr 20, 2021
00dbf04
Remove travis files and related dockerfile
Apr 20, 2021
9c5f6db
Merge pull request #405 from katiewasnothere/remove_travis
Apr 20, 2021
2dcf912
Getting ready for hcsshim merge
dcantah Apr 28, 2021
9d39093
Merge Microsoft/opengcs and Microsoft/hcsshim
dcantah May 17, 2021
ba9332e
Get rid of unnecessary opengcs files
dcantah Apr 28, 2021
86d8b45
Remove vendor dir for opengcs
dcantah Apr 28, 2021
4cdb366
Move all non gcs code to top level
dcantah Apr 28, 2021
2de7397
Remove unneccessary opengcs/log and opengcs/oc packages
dcantah Apr 28, 2021
686fc6e
Move opengcs/internal to /internal
dcantah Apr 28, 2021
4d20492
Build gcs and gcstools binaries out of cmd
dcantah Apr 28, 2021
6eb9d6f
Move opengcs service/gcs and service/libs code to internal/guest
dcantah Apr 28, 2021
5d97cc3
Add opengcs build job to github actions CI
dcantah Apr 28, 2021
9f7d3a8
Fix up imports for opengcs files + build tag for gcs binary
dcantah Apr 28, 2021
ef9e281
Vendor in opengcs dependencies
dcantah May 17, 2021
a9a0562
Fix up Makefile to build gcs binaries from /cmd
dcantah Apr 28, 2021
29eb498
Get rid of need for containerd/sys/reaper
dcantah Apr 28, 2021
f8a46eb
Add build tags to everything so testing at root works
dcantah Apr 28, 2021
0c99156
Fix up opengcs CI issues/remove ginkgo from Makefile
dcantah Apr 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,29 @@ jobs:
uvmboot.exe
zapdir.exe
ncproxy.exe

build_gcs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install go
uses: actions/setup-go@v2
with:
go-version: '^1.15.0'

- name: Pull busybox image
run: docker pull busybox

- name: Run Busybox Container
run: docker run --name base_image_container busybox

- name: Export container to tar file
run: |
docker export base_image_container | gzip > base.tar.gz

- name: Build And Test
run: |
BASE=./base.tar.gz
make all test
39 changes: 37 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# Binaries for programs and plugins
*.exe
.idea
.vscode
*.dll
*.so
*.dylib

# Ignore vscode setting files
.vscode/

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/

# Ignore gcs bin directory
service/bin/
service/pkg/

*.img
*.vhd
*.tar.gz

# Make stuff
.rootfs-done
bin/*
rootfs/*
*.o
/build/

deps/*
out/*

.idea/
.vscode/
87 changes: 87 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
BASE:=base.tar.gz

GO:=go
GO_FLAGS:=-ldflags "-s -w" # strip Go binaries
CGO_ENABLED:=0
GOMODVENDOR:=

CFLAGS:=-O2 -Wall
LDFLAGS:=-static -s # strip C binaries

GO_FLAGS_EXTRA:=
ifeq "$(GOMODVENDOR)" "1"
GO_FLAGS_EXTRA += -mod=vendor
endif
GO_BUILD:=CGO_ENABLED=$(CGO_ENABLED) $(GO) build $(GO_FLAGS) $(GO_FLAGS_EXTRA)

SRCROOT=$(dir $(abspath $(firstword $(MAKEFILE_LIST))))

# The link aliases for gcstools
GCS_TOOLS=\
generichook

.PHONY: all always rootfs test

all: out/initrd.img out/rootfs.tar.gz

clean:
find -name '*.o' -print0 | xargs -0 -r rm
rm -rf bin deps rootfs out

test:
cd $(SRCROOT) && go test ./internal/guest/...

out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools Makefile
@mkdir -p out
rm -rf rootfs
mkdir -p rootfs/bin/
cp bin/init rootfs/
cp bin/vsockexec rootfs/bin/
cp bin/cmd/gcs rootfs/bin/
cp bin/cmd/gcstools rootfs/bin/
for tool in $(GCS_TOOLS); do ln -s gcstools rootfs/bin/$$tool; done
git -C $(SRCROOT) rev-parse HEAD > rootfs/gcs.commit && \
git -C $(SRCROOT) rev-parse --abbrev-ref HEAD > rootfs/gcs.branch
tar -zcf $@ -C rootfs .
rm -rf rootfs

out/rootfs.tar.gz: out/initrd.img
rm -rf rootfs-conv
mkdir rootfs-conv
gunzip -c out/initrd.img | (cd rootfs-conv && cpio -imd)
tar -zcf $@ -C rootfs-conv .
rm -rf rootfs-conv

out/initrd.img: $(BASE) out/delta.tar.gz $(SRCROOT)/hack/catcpio.sh
$(SRCROOT)/hack/catcpio.sh "$(BASE)" out/delta.tar.gz > out/initrd.img.uncompressed
gzip -c out/initrd.img.uncompressed > $@
rm out/initrd.img.uncompressed

-include deps/cmd/gcs.gomake
-include deps/cmd/gcstools.gomake

# Implicit rule for includes that define Go targets.
%.gomake: $(SRCROOT)/Makefile
@mkdir -p $(dir $@)
@/bin/echo $(@:deps/%.gomake=bin/%): $(SRCROOT)/hack/gomakedeps.sh > $@.new
@/bin/echo -e '\t@mkdir -p $$(dir $$@) $(dir $@)' >> $@.new
@/bin/echo -e '\t$$(GO_BUILD) -o $$@.new $$(SRCROOT)/$$(@:bin/%=%)' >> $@.new
@/bin/echo -e '\tGO="$(GO)" $$(SRCROOT)/hack/gomakedeps.sh $$@ $$(SRCROOT)/$$(@:bin/%=%) $$(GO_FLAGS) $$(GO_FLAGS_EXTRA) > $(@:%.gomake=%.godeps).new' >> $@.new
@/bin/echo -e '\tmv $(@:%.gomake=%.godeps).new $(@:%.gomake=%.godeps)' >> $@.new
@/bin/echo -e '\tmv $$@.new $$@' >> $@.new
@/bin/echo -e '-include $(@:%.gomake=%.godeps)' >> $@.new
mv $@.new $@

VPATH=$(SRCROOT)

bin/vsockexec: vsockexec/vsockexec.o vsockexec/vsock.o
@mkdir -p bin
$(CC) $(LDFLAGS) -o $@ $^

bin/init: init/init.o vsockexec/vsock.o
@mkdir -p bin
$(CC) $(LDFLAGS) -o $@ $^

%.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
Loading