Merge ~cjwatson/launchpad-buildd:lxd-more-loop-devices into launchpad-buildd:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 65a86ac9aba2db561fbc0e7d28f47bb0a2c5c2bd
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad-buildd:lxd-more-loop-devices
Merge into: launchpad-buildd:master
Diff against target: 38 lines (+3/-2)
3 files modified
debian/changelog (+1/-0)
lpbuildd/target/lxd.py (+1/-1)
lpbuildd/target/tests/test_lxd.py (+1/-1)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+416589@code.launchpad.net

Commit message

Make more loop device nodes available in LXD containers

Description of the change

According to https://discuss.linuxcontainers.org/t/udev-inside-privileged-container/13314, the lack of namespacing for block devices means that the best we can do to make loop devices available is to just pre-create as many as we're likely to need.

(This apparently used to work differently when builders were running bionic, but we were using the old LXD .deb then so quite a lot of things have changed.)

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 50c9cb0..8235c76 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -2,6 +2,7 @@ launchpad-buildd (210) UNRELEASED; urgency=medium
6
7 * Stop building with dpkg-deb -Zgzip; we no longer need to install on
8 lucid.
9+ * Make more loop device nodes available in LXD containers (LP: #1963706).
10
11 -- Colin Watson <cjwatson@ubuntu.com> Mon, 28 Feb 2022 11:27:20 +0000
12
13diff --git a/lpbuildd/target/lxd.py b/lpbuildd/target/lxd.py
14index 24e48fe..08c40c9 100644
15--- a/lpbuildd/target/lxd.py
16+++ b/lpbuildd/target/lxd.py
17@@ -470,7 +470,7 @@ class LXD(Backend):
18 # filesystems.
19 self.run(
20 ["mknod", "-m", "0660", "/dev/loop-control", "c", "10", "237"])
21- for minor in range(8):
22+ for minor in range(256):
23 self.run(
24 ["mknod", "-m", "0660", "/dev/loop%d" % minor,
25 "b", "7", str(minor)])
26diff --git a/lpbuildd/target/tests/test_lxd.py b/lpbuildd/target/tests/test_lxd.py
27index e94657b..07e77cb 100644
28--- a/lpbuildd/target/tests/test_lxd.py
29+++ b/lpbuildd/target/tests/test_lxd.py
30@@ -458,7 +458,7 @@ class TestLXD(TestCase):
31 ["mknod", "-m", "0660", "/dev/loop-control",
32 "c", "10", "237"]),
33 ]
34- for minor in range(8):
35+ for minor in range(256):
36 expected_args.append(
37 Equals(
38 lxc +

Subscribers

People subscribed via source and target branches