distro/rhel85: sort mounts
Previously, /boot/efi mount was specified before /. This obviously doesn't work because we need to mount / firstly. This commit adds explicit ordering of the mounts. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
c656972f25
commit
57e8ca0e5f
1 changed files with 10 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package rhel85
|
|||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
|
|
@ -427,6 +428,15 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
mounts[i] = *mount
|
||||
}
|
||||
|
||||
// sort the mounts, using < should just work because:
|
||||
// - a parent directory should be always before its children:
|
||||
// / < /boot
|
||||
// - the order of siblings doesn't matter
|
||||
|
||||
sort.Slice(mounts, func(i, j int) bool {
|
||||
return mounts[i].Target < mounts[j].Target
|
||||
})
|
||||
|
||||
stageMounts := osbuild.CopyStageMounts(mounts)
|
||||
stageDevices := osbuild.CopyStageDevices(devices)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue