summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2024-01-13 02:47:15 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2024-01-13 02:47:15 +0100
commitda526690c40d668720035dd916f0c982d2d9bd2d (patch)
tree2d098205e38cccfe8879f5fe6999c0aefd64f850
parent48afca2576f6f6ba54c1076a2d07e956e9caddaf (diff)
upgrade: fix sysupgrade_restore
Use a temporary file since the execute command seems to allow at most around 200000 bytes.
-rw-r--r--scripts/upgrade.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/upgrade.py b/scripts/upgrade.py
index ac71ee2..088647c 100644
--- a/scripts/upgrade.py
+++ b/scripts/upgrade.py
@@ -90,11 +90,12 @@ class Container:
def sysupgrade_backup(self, ):
return self.execute_with_output(['sysupgrade', '-b', '-'],
- decode=False)
+ encoding='raw', decode=False)
def sysupgrade_restore(self, data):
- self.execute(['sysupgrade', '-r', '-'],
- stdin_payload=data, decode=False)
+ backup_file = '/tmp/lxd-upgrade.tar.gz'
+ self.files.put(backup_file, data)
+ self.execute(['sysupgrade', '-r', backup_file])
def opkg_list_installed(self, ):
return self.execute_with_output(['opkg', 'list-installed'])