Merge remote-tracking branch 'origin/master'

This commit is contained in:
ericbsd
2025-12-09 19:45:37 -04:00
2 changed files with 16 additions and 23 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
Install Station Install Station
=== ===
It is a strip down version of install-station and it is the new installer for GhostBSD. Install Station is the streamlined installer for GhostBSD.
Install Station only edit disk, partition and will install GhostBSD. Users and system setup will be done with at the first boot after installation with Setup Station. Install Station handles disk editing, partitioning, and OS installation. User configuration and system setup are performed at first boot after installation with Setup Station.
## Managing Translations ## Managing Translations
To create a translation file. To create a translation file.
+14 -21
View File
@@ -27,13 +27,13 @@ class Configuration:
list_of_errors: List of error messages describing validation failures list_of_errors: List of error messages describing validation failures
""" """
errors = [] errors = []
# Check basic installation data # Check basic installation data
if not hasattr(InstallationData, 'boot') or not InstallationData.boot: if not hasattr(InstallationData, 'boot') or not InstallationData.boot:
errors.append("Boot manager not specified") errors.append("Boot manager not specified")
elif InstallationData.boot not in ['refind', 'grub', 'none']: elif InstallationData.boot not in ['refind', 'grub', 'none']:
errors.append(f"Invalid boot manager: {InstallationData.boot}") errors.append(f"Invalid boot manager: {InstallationData.boot}")
# Check ZFS configuration path # Check ZFS configuration path
if InstallationData.zfs_config_data: if InstallationData.zfs_config_data:
if not isinstance(InstallationData.zfs_config_data, list): if not isinstance(InstallationData.zfs_config_data, list):
@@ -43,7 +43,7 @@ class Configuration:
has_partscheme = any('partscheme' in str(line) for line in InstallationData.zfs_config_data) has_partscheme = any('partscheme' in str(line) for line in InstallationData.zfs_config_data)
if not has_partscheme: if not has_partscheme:
errors.append("ZFS config missing partition scheme") errors.append("ZFS config missing partition scheme")
has_disk = any('disk0=' in str(line) for line in InstallationData.zfs_config_data) has_disk = any('disk0=' in str(line) for line in InstallationData.zfs_config_data)
if not has_disk: if not has_disk:
errors.append("ZFS config missing disk specification") errors.append("ZFS config missing disk specification")
@@ -51,25 +51,25 @@ class Configuration:
# Check custom partition configuration path # Check custom partition configuration path
if not hasattr(InstallationData, 'disk') or not InstallationData.disk: if not hasattr(InstallationData, 'disk') or not InstallationData.disk:
errors.append("Disk not specified for custom partitioning") errors.append("Disk not specified for custom partitioning")
if not hasattr(InstallationData, 'slice') or not InstallationData.slice: if not hasattr(InstallationData, 'slice') or not InstallationData.slice:
errors.append("Partition slice not specified") errors.append("Partition slice not specified")
if not hasattr(InstallationData, 'scheme') or not InstallationData.scheme: if not hasattr(InstallationData, 'scheme') or not InstallationData.scheme:
errors.append("Partition scheme not specified") errors.append("Partition scheme not specified")
elif InstallationData.scheme not in ['partscheme=GPT', 'partscheme=MBR']: elif InstallationData.scheme not in ['partscheme=GPT', 'partscheme=MBR']:
errors.append(f"Invalid partition scheme: {InstallationData.scheme}") errors.append(f"Invalid partition scheme: {InstallationData.scheme}")
if not hasattr(InstallationData, 'new_partition') or not InstallationData.new_partition: if not hasattr(InstallationData, 'new_partition') or not InstallationData.new_partition:
errors.append("No partitions defined for custom partitioning") errors.append("No partitions defined for custom partitioning")
elif not isinstance(InstallationData.new_partition, list): elif not isinstance(InstallationData.new_partition, list):
errors.append("Partition data is not a list") errors.append("Partition data is not a list")
# Check installation config file path # Check installation config file path
if not installation_config: if not installation_config:
errors.append("Installation config file path not defined") errors.append("Installation config file path not defined")
return len(errors) == 0, errors return not errors, errors
@classmethod @classmethod
def create_cfg(cls): def create_cfg(cls):
@@ -96,7 +96,7 @@ class Configuration:
if not is_valid: if not is_valid:
error_msg = "Configuration validation failed:\n" + "\n".join(f"- {error}" for error in errors) error_msg = "Configuration validation failed:\n" + "\n".join(f"- {error}" for error in errors)
raise ValueError(error_msg) raise ValueError(error_msg)
try: try:
with open(installation_config, 'w') as f: with open(installation_config, 'w') as f:
# Installation Mode # Installation Mode
@@ -106,7 +106,7 @@ class Configuration:
f.write('installType=GhostBSD\n') f.write('installType=GhostBSD\n')
f.write('installMedium=livezfs\n') f.write('installMedium=livezfs\n')
f.write('packageType=livezfs\n') f.write('packageType=livezfs\n')
if InstallationData.zfs_config_data: if InstallationData.zfs_config_data:
# ZFS Configuration Path # ZFS Configuration Path
for line in InstallationData.zfs_config_data: for line in InstallationData.zfs_config_data:
@@ -142,26 +142,19 @@ class Configuration:
# Partition Setup # Partition Setup
f.write('\n# Partition Setup\n') f.write('\n# Partition Setup\n')
for line in InstallationData.new_partition: for line in InstallationData.new_partition:
if 'BOOT' in line or 'BIOS' in line or 'UEFI' in line: if 'BOOT' not in line and 'BIOS' not in line and 'UEFI' not in line:
pass
else:
f.write(f'disk0-part={line.strip()}\n') f.write(f'disk0-part={line.strip()}\n')
f.write('commitDiskLabel\n') f.write('commitDiskLabel\n')
# Network Configuration # Network Configuration
f.write('\n# Network Configuration\n') f.write('\n# Network Configuration\n')
f.write('hostname=installed\n') f.write('hostname=installed\n')
# First Boot Preparation Commands # First Boot Preparation Commands
f.write('\n# command to prepare first boot\n') f.write('\n# command to prepare first boot\n')
f.write("runCommand=sysrc hostname='installed'\n") f.write("runCommand=sysrc hostname='installed'\n")
f.write("runCommand=pw userdel -n ghostbsd -r\n") f.write("runCommand=pw userdel -n ghostbsd -r\n")
f.write("runCommand=sed -i '' 's/ghostbsd/root/g' /etc/gettytab\n") f.write("runCommand=sed -i '' 's/ghostbsd/root/g' /etc/gettytab\n")
f.write("runCommand=sed -i '' 's/ghostbsd/root/g' /etc/ttys\n") f.write("runCommand=sed -i '' 's/ghostbsd/root/g' /etc/ttys\n")
f.write("runCommand=mv /usr/local/etc/devd/automount_devd"
".conf.skip /usr/local/etc/devd/automount_devd.conf\n")
f.write("runCommand=mv /usr/local/etc/devd/automount_devd"
"_localdisks.conf.skip /usr/local/etc/devd/"
"automount_devd_localdisks.conf\n")
except IOError as e: except IOError as e:
raise IOError(f"Failed to write configuration file: {e}") raise IOError(f"Failed to write configuration file: {e}") from e