diff --git a/NOTICE b/NOTICE index 4e9c1a6..c6c4e38 100644 --- a/NOTICE +++ b/NOTICE @@ -5,9 +5,13 @@ This project includes software derived from the following project: Project: e2b infra Repository: https://github.com/e2b-dev/infra -Original directory: packages/envd -The envd/ directory and proto/envd/*.proto files in this repository contains code derived from the above project and is licensed under the Apache License Version 2.0. +The following files and directories in this repository contain code derived from the above project and are licensed under the Apache License Version 2.0: + +- envd/ +- proto/envd/*.proto +- internal/snapshot/ +- internal/uffd/ Modifications to this code were made by M/S Omukk. diff --git a/internal/snapshot/header.go b/internal/snapshot/header.go index 3083af7..e679529 100644 --- a/internal/snapshot/header.go +++ b/internal/snapshot/header.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Modifications by M/S Omukk + // Package snapshot implements snapshot storage, header-based memory mapping, // and memory file processing for Firecracker VM snapshots. // @@ -6,8 +9,6 @@ // previous generation. A Header contains a sorted list of BuildMap entries // that together cover the entire memory address space, with each entry // pointing to a specific generation's diff file. -// -// Inspired by e2b's snapshot system (Apache 2.0, modified by Omukk). package snapshot import ( diff --git a/internal/snapshot/mapping.go b/internal/snapshot/mapping.go index f39a175..8451518 100644 --- a/internal/snapshot/mapping.go +++ b/internal/snapshot/mapping.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Modifications by M/S Omukk + package snapshot import "github.com/google/uuid" @@ -6,8 +9,6 @@ import "github.com/google/uuid" // a sorted list of BuildMap entries. Consecutive dirty blocks are merged into // a single entry. BuildStorageOffset tracks the sequential position in the // compact diff file. -// -// Inspired by e2b's snapshot system (Apache 2.0, modified by Omukk). func CreateMapping(buildID uuid.UUID, dirty []bool, blockSize int64) []*BuildMap { var mappings []*BuildMap var runStart int64 = -1 diff --git a/internal/snapshot/memfile.go b/internal/snapshot/memfile.go index 5ef052f..a0bbc95 100644 --- a/internal/snapshot/memfile.go +++ b/internal/snapshot/memfile.go @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// Modifications by M/S Omukk + package snapshot import ( diff --git a/internal/uffd/fd.go b/internal/uffd/fd.go index 1094930..492a520 100644 --- a/internal/uffd/fd.go +++ b/internal/uffd/fd.go @@ -1,9 +1,10 @@ +// SPDX-License-Identifier: Apache-2.0 +// Modifications by M/S Omukk + // Package uffd implements a userfaultfd-based memory server for Firecracker // snapshot restore. When a VM is restored from a snapshot, instead of loading // the entire memory file upfront, the UFFD handler intercepts page faults // and serves memory pages on demand from the snapshot's compact diff file. -// -// Inspired by e2b's UFFD implementation (Apache 2.0, modified by Omukk). package uffd /* diff --git a/internal/uffd/region.go b/internal/uffd/region.go index afe7f14..20b3921 100644 --- a/internal/uffd/region.go +++ b/internal/uffd/region.go @@ -1,3 +1,9 @@ +// SPDX-License-Identifier: Apache-2.0 +// Modifications by M/S Omukk +// +// Modifications by Omukk (Wrenn Sandbox): merged Region and Mapping into +// single file, inlined shiftedOffset helper. + package uffd import "fmt" diff --git a/internal/uffd/server.go b/internal/uffd/server.go index 31d8479..7b2e68b 100644 --- a/internal/uffd/server.go +++ b/internal/uffd/server.go @@ -1,3 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 +// Modifications by M/S Omukk +// +// Modifications by Omukk (Wrenn Sandbox): replaced errgroup with WaitGroup +// + semaphore, replaced fdexit abstraction with pipe, integrated with +// snapshot.Header-based DiffFileSource instead of block.ReadonlyDevice, +// fixed EAGAIN handling in poll loop. + package uffd /*