Skip to content

Commit

Permalink
boot/makebootable: prevent a "." recovery system label
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsosanchezbeato committed Sep 29, 2022
1 parent 111c847 commit 8fd6adc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion boot/makebootable.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ func makeRunnableSystem(model *asserts.Model, bootWith *BootableSet, sealer *Tru
currentTrustedBootAssets = sealer.currentTrustedBootAssetsMap()
currentTrustedRecoveryBootAssets = sealer.currentTrustedRecoveryBootAssetsMap()
}
recoverySystemLabel := filepath.Base(bootWith.RecoverySystemDir)
// filepath.Base("") returns ".", so we need to be a bit careful here
recoverySystemLabel := ""
if bootWith.RecoverySystemDir != "" {
recoverySystemLabel = filepath.Base(bootWith.RecoverySystemDir)
}
// write modeenv on the ubuntu-data partition
modeenv := &Modeenv{
Mode: "run",
Expand Down

0 comments on commit 8fd6adc

Please sign in to comment.