mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-05-12 10:24:23 +00:00
Do not show devices that cant be used (#212)
during interactive install all devices will appear but some of those are not desirable as they cannot be used to install. Skip those in the list Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
parent
5014587a3c
commit
8696eb16d2
@ -149,6 +149,10 @@ func InteractiveInstall(debug, spawnShell bool, sourceImgURL string) error {
|
||||
block, err := ghw.Block()
|
||||
if err == nil {
|
||||
for _, disk := range block.Disks {
|
||||
// skip useless devices (/dev/ram, /dev/loop, /dev/sr, /dev/zram)
|
||||
if strings.HasPrefix(disk.Name, "loop") || strings.HasPrefix(disk.Name, "ram") || strings.HasPrefix(disk.Name, "sr") || strings.HasPrefix(disk.Name, "zram") {
|
||||
continue
|
||||
}
|
||||
size := float64(disk.SizeBytes) / float64(GiB)
|
||||
if size > maxSize {
|
||||
maxSize = size
|
||||
|
Loading…
Reference in New Issue
Block a user