Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR-5720 - Use eatmydata #157

Merged
merged 5 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: apt-update
run: sudo apt update
- name: install-test-dependencies
run: sudo apt install -y snapd germinate mtools debootstrap fdisk gdisk qemu-system-aarch64 qemu-user-static ubuntu-dev-tools
run: sudo apt install -y snapd germinate mtools debootstrap eatmydata fdisk gdisk qemu-system-aarch64 qemu-user-static ubuntu-dev-tools
- name: test
run: sudo go test -timeout 0 -v -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
Expand Down
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ubuntu-image (3.0+23.04ubuntu1) UNRELEASED; urgency=medium
* Make sure the fstab file is cleanly overridden (LP: #2031889)
* Always look for gadget.yaml file in meta directory
* Add a make-dirs manual customization option to create directories in the rootfs
* use eatmydata to speed up debootstrap

[ Alfonso Sanchez-Beato ]
* Update to latest snapd, adapting to changes in layouts code.
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Built-Using: ${misc:Built-Using},
Depends: ${shlibs:Depends},
${misc:Depends},
debootstrap,
eatmydata,
dosfstools,
fdisk,
gdisk,
Expand Down
3 changes: 2 additions & 1 deletion internal/statemachine/classic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3259,6 +3259,8 @@ func TestCreateChroot(t *testing.T) {
err := stateMachine.makeTemporaryDirectories()
asserter.AssertErrNil(err, true)

t.Cleanup(func() { os.RemoveAll(stateMachine.stateMachineFlags.WorkDir) })

err = stateMachine.createChroot()
asserter.AssertErrNil(err, true)

Expand Down Expand Up @@ -3310,7 +3312,6 @@ func TestCreateChroot(t *testing.T) {
t.Errorf("%s is not present in /etc/apt/sources.list", pocket)
}
}
os.RemoveAll(stateMachine.stateMachineFlags.WorkDir)
})
}

Expand Down
7 changes: 5 additions & 2 deletions internal/statemachine/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,9 @@ func generateGerminateCmd(imageDefinition imagedefinition.ImageDefinition) *exec

seedSource := strings.Join(imageDefinition.Rootfs.Seed.SeedURLs, ",")

germinateCmd := execCommand("germinate",
germinateCmd := execCommand(
"eatmydata",
"germinate",
"--mirror", imageDefinition.Rootfs.Mirror,
"--arch", imageDefinition.Architecture,
"--dist", imageDefinition.Series,
Expand Down Expand Up @@ -608,7 +610,8 @@ func cloneGitRepo(imageDefinition imagedefinition.ImageDefinition, workDir strin
// generateDebootstrapCmd generates the debootstrap command used to create a chroot
// environment that will eventually become the rootfs of the resulting image
func generateDebootstrapCmd(imageDefinition imagedefinition.ImageDefinition, targetDir string, includeList []string) *exec.Cmd {
debootstrapCmd := execCommand("debootstrap",
debootstrapCmd := execCommand("eatmydata",
"debootstrap",
"--arch", imageDefinition.Architecture,
"--variant=minbase",
)
Expand Down
1 change: 1 addition & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ parts:
- gdisk
- fakeroot
- debootstrap
- eatmydata
- gpg
- germinate
- mtools
Expand Down