From 7bf63ca9a9bb4ca4997d049d4d05c7d4a625c678 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Wed, 31 Jul 2019 17:55:05 +0100
Subject: [PATCH] sysroot: Bind-mount /var/lib/apt rw so that we can update

In particular this makes it possible to `apt-get download bubblewrap`
if it isn't already in the container.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 README.md                 | 1 +
 sysroot/run-in-sysroot.py | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 54cc87501..aca7b1f31 100644
--- a/README.md
+++ b/README.md
@@ -161,6 +161,7 @@ tarball at `_build/sysroot.tar.gz` or unpack a sysroot into
 `_build/sysroot`, and prefix those commands with
 `./sysroot/run-in-sysroot.py`:
 
+    ./sysroot/run-in-sysroot.py apt-get update
     ./sysroot/run-in-sysroot.py meson ...
 
 (Or put them in different locations and pass the `--sysroot` and
diff --git a/sysroot/run-in-sysroot.py b/sysroot/run-in-sysroot.py
index 948b1e310..eb875f427 100755
--- a/sysroot/run-in-sysroot.py
+++ b/sysroot/run-in-sysroot.py
@@ -99,6 +99,9 @@ def main():
         [
             'bwrap',
             '--ro-bind', abs_sysroot, '/',
+            '--bind',
+            os.path.join(abs_sysroot, 'var', 'lib', 'apt'),
+            '/var/lib/apt',
             '--dev-bind', '/dev', '/dev',
             '--ro-bind', '/etc/resolv.conf', '/etc/resolv.conf',
             '--proc', '/proc',
-- 
GitLab