Clean create_cfg.py updated readme

- Trim unnecessary trailing whitespaces
- Simplify logic in error and disk partition checks
- Replace ambiguous return with a more Pythonic `not errors`
- Enhance IOError handling for clarity
- Update `README.md` for clearer installer purpose and flow
This commit is contained in:
ericbsd
2025-11-29 15:44:14 -04:00
parent f8afc8002a
commit 579f90474c
2 changed files with 16 additions and 23 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
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
To create a translation file.
+3 -10
View File
@@ -69,7 +69,7 @@ class Configuration:
if not installation_config:
errors.append("Installation config file path not defined")
return len(errors) == 0, errors
return not errors, errors
@classmethod
def create_cfg(cls):
@@ -142,9 +142,7 @@ class Configuration:
# Partition Setup
f.write('\n# Partition Setup\n')
for line in InstallationData.new_partition:
if 'BOOT' in line or 'BIOS' in line or 'UEFI' in line:
pass
else:
if 'BOOT' not in line and 'BIOS' not in line and 'UEFI' not in line:
f.write(f'disk0-part={line.strip()}\n')
f.write('commitDiskLabel\n')
@@ -158,10 +156,5 @@ class Configuration:
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/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:
raise IOError(f"Failed to write configuration file: {e}")
raise IOError(f"Failed to write configuration file: {e}") from e