Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-10-22 21:54:16 +0200
committerAnton Hvornum <anton@hvornum.se>2021-10-22 21:54:16 +0200
commit7149b76f3bd3163938fe7413546e5f678f98851f (patch)
tree7c6768ea65799387a9b1b2dc5a2c0b7212e9e785 /archinstall/lib
parent8b96080ec81939f3a69c28585c21c43e496d087b (diff)
Forgot some imports that didn't show up on a static run without going through a few of the menu's
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/disk/__init__.py2
-rw-r--r--archinstall/lib/disk/blockdevice.py3
-rw-r--r--archinstall/lib/disk/filesystem.py6
-rw-r--r--archinstall/lib/disk/helpers.py2
-rw-r--r--archinstall/lib/disk/partition.py4
-rw-r--r--archinstall/lib/disk/user_guides.py4
6 files changed, 17 insertions, 4 deletions
diff --git a/archinstall/lib/disk/__init__.py b/archinstall/lib/disk/__init__.py
index 8237f774..352d04b9 100644
--- a/archinstall/lib/disk/__init__.py
+++ b/archinstall/lib/disk/__init__.py
@@ -1,7 +1,7 @@
from .btrfs import *
from .helpers import *
from .blockdevice import BlockDevice
-from .filesystem import Filesystem
+from .filesystem import Filesystem, MBR, GPT
from .partition import *
from .user_guides import *
from .validators import * \ No newline at end of file
diff --git a/archinstall/lib/disk/blockdevice.py b/archinstall/lib/disk/blockdevice.py
index daa65323..57cbcfa6 100644
--- a/archinstall/lib/disk/blockdevice.py
+++ b/archinstall/lib/disk/blockdevice.py
@@ -1,3 +1,4 @@
+import os
import json
import logging
from ..output import log
@@ -94,6 +95,7 @@ class BlockDevice:
@property
def partitions(self):
+ from .filesystem import Partition
SysCommand(['partprobe', self.path])
result = SysCommand(['/usr/bin/lsblk', '-J', self.path])
@@ -123,6 +125,7 @@ class BlockDevice:
@property
def partition_table_type(self):
+ from .filesystem import GPT
return GPT
@property
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
index b53d8451..28846764 100644
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -1,7 +1,11 @@
import time
+import logging
+import json
from .partition import Partition
from .blockdevice import BlockDevice
+from ..general import SysCommand
from ..output import log
+from ..storage import storage
GPT = 0b00000001
MBR = 0b00000010
@@ -58,7 +62,7 @@ class Filesystem:
return index
def load_layout(self, layout :dict):
- from .luks import luks2
+ from ..luks import luks2
# If the layout tells us to wipe the drive, we do so
if layout.get('wipe', False):
diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py
index 8b372f73..65abdea2 100644
--- a/archinstall/lib/disk/helpers.py
+++ b/archinstall/lib/disk/helpers.py
@@ -132,6 +132,8 @@ def get_mount_info(path) -> dict:
def get_partitions_in_use(mountpoint) -> list:
+ from .partition import Partition
+
try:
output = SysCommand(f"/usr/bin/findmnt --json -R {mountpoint}").decode('UTF-8')
except SysCallError:
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py
index 30151583..3bb2982b 100644
--- a/archinstall/lib/disk/partition.py
+++ b/archinstall/lib/disk/partition.py
@@ -2,9 +2,13 @@ import glob
import pathlib
import time
import logging
+import json
+import os
from typing import Optional
from .blockdevice import BlockDevice
+from .helpers import get_mount_info, get_filesystem_type
from ..output import log
+from ..general import SysCommand
class Partition:
def __init__(self, path: str, block_device: BlockDevice, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False, autodetect_filesystem=True):
diff --git a/archinstall/lib/disk/user_guides.py b/archinstall/lib/disk/user_guides.py
index 0a975149..79b9d48f 100644
--- a/archinstall/lib/disk/user_guides.py
+++ b/archinstall/lib/disk/user_guides.py
@@ -3,7 +3,7 @@ from ..output import log
def suggest_single_disk_layout(block_device, default_filesystem=None):
if not default_filesystem:
- from .user_interaction import ask_for_main_filesystem_format
+ from ..user_interaction import ask_for_main_filesystem_format
default_filesystem = ask_for_main_filesystem_format()
MIN_SIZE_TO_ALLOW_HOME_PART = 40 # Gb
@@ -76,7 +76,7 @@ def suggest_single_disk_layout(block_device, default_filesystem=None):
def suggest_multi_disk_layout(block_devices, default_filesystem=None):
if not default_filesystem:
- from .user_interaction import ask_for_main_filesystem_format
+ from ..user_interaction import ask_for_main_filesystem_format
default_filesystem = ask_for_main_filesystem_format()
# Not really a rock solid foundation of information to stand on, but it's a start: