parser = argparse.ArgumentParser(
description=_("IPFire Installation Tool CLI"),
)
+ parser.add_argument("--first-install", action="store_true",
+ help=_("Runs the \"first install\" setup process"))
parser.add_argument("--arch", nargs="?", default=self.native_arch,
help=_("Select the target architecture"))
parser.add_argument("--debug", action="store_true",
"""
Bricklayer's base class
"""
- def __init__(self, arch, debug=False, unattended=False, disks=[]):
+ def __init__(self, arch, first_install=False, debug=False, unattended=False, disks=[]):
self.arch = arch
+ self.first_install = first_install
self.unattended = unattended
# Enable debug logging
# Initialize the step
step = stepcls(self, tui=self.tui)
+ # Skip this step if it isn't enabled in first install mode
+ if self.first_install and not step.first_install:
+ return
+
# Skip this step if it isn't enabled
if not step.enabled:
return
# This enables or disables this step
enabled = True
+ # Should this be run in first-install mode?
+ first_install = False
+
def __init__(self, bricklayer, tui):
self.bricklayer = bricklayer
self.tui = tui
"""
Shows a very warm welcome message to the user
"""
+ first_install = True
+
def run(self):
name = self.bricklayer.os.get("NAME")
current_language = self.bricklayer.settings.get("language")
"""
Shows a message that the installation is complete
"""
+ first_install = True
+
def run(self):
self.tui.message(
_("Congratulations"),
width=50,
)
+
class UnattendedWarning(Step):
@property
def enabled(self):
class RootPassword(InteractiveStep):
+ first_install = True
+
def run(self):
password = self.tui.passwd(
_("Root Password"),
log = logging.getLogger("bricklayer.timezones")
class SelectTimezone(step.InteractiveStep):
+ first_install = True
+
def run(self):
# Get a list of all available timezones
timezones = {