mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0031-appliance-Create-dev-loop-control-and-similar-device.patch

022f11
From f30de70c1cb828a4fe20d46946bf8779a7707dc3 Mon Sep 17 00:00:00 2001
022f11
From: "Richard W.M. Jones" <rjones@redhat.com>
022f11
Date: Thu, 26 Sep 2013 10:47:17 +0100
022f11
Subject: [PATCH] appliance: Create /dev/loop-control and similar devices.
022f11
022f11
When 'mount -o loop' and similar commands are used, the loop module is
022f11
loaded automatically by the kernel when /dev/loop-control is accessed.
022f11
022f11
/dev/loop-control is created semi-statically by an unholy and
022f11
overcomplex combination of kmod static-nodes and systemd-tmpfiles
022f11
(instead of using, say, just udev or even just a simple series of
022f11
mknod commands).
022f11
022f11
(cherry picked from commit e2895b19bb2be67c01172cdd0634553c21923605)
022f11
---
022f11
 appliance/init | 7 +++++++
022f11
 1 file changed, 7 insertions(+)
022f11
022f11
diff --git a/appliance/init b/appliance/init
022f11
index 79083a4..bd383c3 100755
022f11
--- a/appliance/init
022f11
+++ b/appliance/init
022f11
@@ -83,6 +83,13 @@ if grep -sq selinux=1 /proc/cmdline; then
022f11
   mount -t selinuxfs none /sys/fs/selinux
022f11
 fi
022f11
 
022f11
+# Set up kmod static-nodes (RHBZ#1011907).
022f11
+mkdir -p /run/tmpfiles.d
022f11
+kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
022f11
+
022f11
+# Set up tmpfiles (must run after kmod.conf is created above).
022f11
+systemd-tmpfiles --prefix=/dev --create
022f11
+
022f11
 # Disk optimizations.
022f11
 # Increase the SCSI timeout so we can read remote images.
022f11
 for f in /sys/block/sd*/device/timeout; do echo 300 > $f; done
022f11
-- 
022f11
1.8.3.1
022f11