Preparing to split up ./lib/disk.py
And added some sane(?) defaults, which I'll massage into code some how.
This commit is contained in:
parent
6a125d5bd2
commit
68212dd32c
|
|
@ -7,6 +7,7 @@ from typing import Optional
|
||||||
from .general import *
|
from .general import *
|
||||||
from .hardware import has_uefi
|
from .hardware import has_uefi
|
||||||
from .output import log
|
from .output import log
|
||||||
|
from .disk2 import btrfs # TODO: rename disk2 to disk, once we migrate all the code here into a structure
|
||||||
|
|
||||||
ROOT_DIR_PATTERN = re.compile('^.*?/devices')
|
ROOT_DIR_PATTERN = re.compile('^.*?/devices')
|
||||||
GPT = 0b00000001
|
GPT = 0b00000001
|
||||||
|
|
@ -121,7 +122,7 @@ def disk_layout_filesystem_checks(layout):
|
||||||
options['btrfs-subvolumes'] = input('Would you like to use BTRFS subvolumes? (Y/n)').strip().lower() in ('', 'y', 'yes')
|
options['btrfs-subvolumes'] = input('Would you like to use BTRFS subvolumes? (Y/n)').strip().lower() in ('', 'y', 'yes')
|
||||||
|
|
||||||
if options['btrfs-subvolumes']:
|
if options['btrfs-subvolumes']:
|
||||||
partition['filesystem']['subvolume'] = '@' # Detect /home etc, and set up sane defaults?
|
btrfs.create_subvolume(partition)
|
||||||
|
|
||||||
def suggest_single_disk_layout(block_device, default_filesystem=None):
|
def suggest_single_disk_layout(block_device, default_filesystem=None):
|
||||||
if not default_filesystem:
|
if not default_filesystem:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
def create_subvolume(partition):
|
||||||
|
if partition['mountpoint'] == '/':
|
||||||
|
partition['filesystem']['subvolume'] = '@'
|
||||||
|
elif partition['mountpoint'] == '/home':
|
||||||
|
partition['filesystem']['subvolume'] = '@home'
|
||||||
|
|
||||||
|
# @.snapshots /.snapshots
|
||||||
|
# @log /var/log
|
||||||
|
# @pkg /var/cache/pacman/pkg
|
||||||
Loading…
Reference in New Issue