Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit 6222957

Browse files
authored
mount tmpfs to /var/cache/apt/archives/ to prevent install failure (#18)
* fix issue with "You don't have enough free space in /var/cache/apt/archives/" Also, don't afraid users with error messages when fail to mount / ro again
1 parent b421300 commit 6222957

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ubports-qa

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,22 @@ class WritableRootFS:
5050
LOG.debug("Attempting to mount rootfs read-write.")
5151
ensure_root()
5252
subprocess.run(["mount", "-o", "rw,remount", "/"])
53+
LOG.debug("Making sure we have enough free space for archives.")
54+
subprocess.run(["mount", "-t", "tmpfs", "tmpfs", "/var/cache/apt/archives"])
5355

5456
@classmethod
5557
def attempt_unmount(cls):
58+
LOG.debug("Unmounting tmpfs")
59+
ensure_root()
60+
subprocess.run(["umount", "/var/cache/apt/archives"])
5661
LOG.debug("Attempting to mount rootfs read-only.")
5762
if not os.path.exists("/userdata/.writable_image"):
58-
ensure_root()
5963
os.sync()
6064
try:
6165
subprocess.run(["mount", "-o", "ro,remount", "/"], check=True)
6266
except subprocess.CalledProcessError:
63-
LOG.error("Failed to remount root filesystem read-only.")
64-
LOG.error("Please consider rebooting your device.")
67+
LOG.warning("Failed to remount root filesystem read-only.")
68+
LOG.warning("Please consider rebooting your device.")
6569

6670

6771
def ensure_root():

0 commit comments

Comments
 (0)