Skip to content

Commit

Permalink
TEST: allow install improvements on all systems
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Kubik <[email protected]>
  • Loading branch information
kubiko committed Jan 6, 2024
1 parent f4d3bb2 commit 54c9436
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions cmd/snap-bootstrap/cmd_initramfs_mounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,37 +221,7 @@ func generateInitramfsMounts() (err error) {
}

func canInstallAndRunAtOnce(mst *initramfsMountsState) (bool, error) {
currentSeed, err := mst.LoadSeed(mst.recoverySystem)
if err != nil {
return false, err
}
preseedSeed, ok := currentSeed.(seed.PreseedCapable)
if !ok {
return false, nil
}

// TODO: relax this condition when "install and run" well tested
if !preseedSeed.HasArtifact("preseed.tgz") {
return false, nil
}

// If kernel has fde-setup hook, then we should also have fde-setup in initramfs
kernelPath := filepath.Join(boot.InitramfsRunMntDir, "kernel")
kernelHasFdeSetup := osutil.FileExists(filepath.Join(kernelPath, "meta", "hooks", "fde-setup"))
_, fdeSetupErr := exec.LookPath("fde-setup")
if kernelHasFdeSetup && fdeSetupErr != nil {
return false, nil
}

gadgetPath := filepath.Join(boot.InitramfsRunMntDir, "gadget")
if osutil.FileExists(filepath.Join(gadgetPath, "meta", "hooks", "install-device")) {
return false, nil
}

// TODO: when install in initrd is finished and it is tested
// without fde hook, turn the return into...
// return true, nil
return kernelHasFdeSetup, nil
return true, nil
}

func readSnapInfo(sysSnaps map[snap.Type]*seed.Snap, snapType snap.Type) (*snap.Info, error) {
Expand Down

0 comments on commit 54c9436

Please sign in to comment.