Skip to content

Commit

Permalink
Merge pull request #8 from hnez/first-boot-timeout
Browse files Browse the repository at this point in the history
strategy: use a longer login timeout on the first boot
  • Loading branch information
SmithChart authored Nov 19, 2024
2 parents f70059e + 629d482 commit 51d9128
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lxatacstrategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class LXATACStrategy(Strategy):

status = attr.ib(default=Status.unknown)
mmc_bootstrapped = attr.ib(default=False)
first_boot = attr.ib(default=True)

@property
def target_hostname(self):
Expand Down Expand Up @@ -88,6 +89,7 @@ def bootstrap(self):
self.dfu_mode.set(False)

self.mmc_bootstrapped = True
self.first_boot = True

def wait_online(self):
self.shell.poll_until_success("ping -c1 _gateway", timeout=60.0)
Expand Down Expand Up @@ -158,10 +160,18 @@ def transition(self, status, *, step):
self.barebox.boot("")
self.barebox.await_boot()

# The first boot takes quite some time because the eMMC is
# re-partitioned, filesystems are created and then the TAC reboots.
# Subsequent boots are faster and do not need the long timeout.
self.shell.login_timeout = 300 if self.first_boot else 60

self.target.activate(self.shell)
self.wait_system_ready()
self.wait_online()

# Use shorter boot timeout for subsequent boots.
self.first_boot = False

else:
raise StrategyError(f"no transition found from {self.status} to {status}")

Expand Down

0 comments on commit 51d9128

Please sign in to comment.