From da526690c40d668720035dd916f0c982d2d9bd2d Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 13 Jan 2024 02:47:15 +0100 Subject: upgrade: fix sysupgrade_restore Use a temporary file since the execute command seems to allow at most around 200000 bytes. --- scripts/upgrade.py | 7 ++++--- 1 file 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']) -- cgit v1.2.3