Skip to content
Snippets Groups Projects
Verified Commit fb1ea737 authored by Karel Koci's avatar Karel Koci :metal:
Browse files

fixup! nsfarm/setup/board: add root password, package install setups

parent e9b1e5bd
Branches
Tags
No related merge requests found
......@@ -13,7 +13,7 @@ class ApkInstall(_Setup):
# Note: there is no need for quotations because package names should not contain any special characters.
self._pkgs = " ".join(args)
def prepare(self, no_revert_needed: bool = False):
def prepare(self, revert_needed: bool = True):
self._sh.run(f"apk --no-progress add {self._pkgs}")
def revert(self):
......
......@@ -22,10 +22,10 @@ class OpkgInstall(_Setup):
self._to_remove: list[str] = []
self._opkg = binary
def prepare(self, no_revert_needed: bool = False):
def prepare(self, revert_needed: bool = True):
self._sh.run(f'[ -n "$(ls /tmp/opkg-lists 2>/dev/null)" ] || {self._opkg} update')
self._sh.run(f"{self._opkg} install {self._pkgs}")
if no_revert_needed:
if not revert_needed:
return
# Note: We are using configuration report here because opkg spits them out in dependency order thus we can
# remove all installed packages in the reverse order to not raise error. The line consist of word "Configuring"
......
......@@ -84,7 +84,7 @@ class RootPassword(_Setup):
self._sh = shell
self.password = password if password else "".join(random.choice(string.ascii_lowercase) for i in range(16))
def prepare(self, no_revert_needed: bool = False):
def prepare(self, revert_needed: bool = True):
# TODO what about previous password
self._sh.run(f"echo 'root:{self.password}' | chpasswd")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment