helloSystem / Utilities

Utilities written in PyQt5, meant for use with helloSystem
BSD 2-Clause "Simplified" License
28 stars 29 forks source link

Update.app: Only create boot environment if root device is zfs #91

Closed probonopd closed 3 years ago

probonopd commented 3 years ago

Only create boot environment if the root device actually is zfs.

Currently it stalls on "Creating Boot Environment..." forever on non-zfs systems, such our next-gen live system which is not using zfs.

probonopd commented 3 years ago

On FreeBSD 13 when running from the non-zfs Live system, we now get:

image

So this needs to be fixed!

probonopd commented 3 years ago

Should check, e.g.,

FreeBSD% mount 
zroot/ROOT/updated-default on / (zfs, local, noatime, nfsv4acls)

Only if the string '(/zfs,appears in the mount output line for/` should we attempt to create a Boot Environment.

probonopd commented 3 years ago
import psutil

def is_root_zfs():
    for part in psutil.disk_partitions():
        if part.mountpoint == '/':
            if part.fstype == "zfs":
                return True
            else:
                return False

print(is_root_zfs())
probonopd commented 3 years ago

https://github.com/helloSystem/Utilities/commit/40c4444be691317db220bd5097bb4c11da31f042 closes this