Skip to content

Commit

Permalink
Merge pull request #157 from canonical/eatmydata
Browse files Browse the repository at this point in the history
FR-5720 - Use eatmydata for germinate and debootstrap
  • Loading branch information
sil2100 authored Oct 30, 2023
2 parents ffca56b + 8004b5a commit ffc4b13
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
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

0 comments on commit ffc4b13

Please sign in to comment.