partition: deal with grub{,2}-editenv in tests #3001

Merged
merged 3 commits into from Mar 9, 2017

Conversation

Projects
None yet
3 participants
Collaborator

mvo5 commented Mar 8, 2017

Some distros ship grub-editenv as grub2-editenv. Add a tiny bit of code to deal with both names.

zyga approved these changes Mar 8, 2017

LGTM

partition/grub_test.go
@@ -31,23 +31,35 @@ import (
"github.com/snapcore/snapd/osutil"
)
+// grubEditenvCmd finds the right grub{,2}-editenv command
+func grubEditenvCmd() string {
+ for _, exe := range []string{"grub-editenv", "grub2-editenv"} {
@zyga

zyga Mar 8, 2017

Contributor

❤️

CC @Conan-Kudo

Contributor

Conan-Kudo commented Mar 8, 2017

Does this check for unversioned name first? I ask because some people are still shipping/using GRUB Legacy, and this could get confused because of it. That's why I suggest testing for versioned names first, because if they exist, they should be used.

@mvo5 mvo5 merged commit e423d85 into snapcore:master Mar 9, 2017

6 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment