[pve-devel] [PATCH container 1/4] autodev: create missing paths

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Mar 18 10:11:07 CET 2016


---
 src/lxc-pve-autodev-hook | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lxc-pve-autodev-hook b/src/lxc-pve-autodev-hook
index e2ebd0c..efc82a2 100755
--- a/src/lxc-pve-autodev-hook
+++ b/src/lxc-pve-autodev-hook
@@ -5,6 +5,9 @@ use warnings;
 
 exit 0 if $ENV{LXC_NAME} && $ENV{LXC_NAME} !~ /^\d+$/;
 
+use File::Path;
+use File::Basename;
+
 use PVE::Tools;
 
 my $vmid = $ENV{LXC_NAME};
@@ -44,6 +47,10 @@ while (defined(my $line = <$fd>)) {
 	next;
     }
 
+    my $rel_devpath = "/dev/$dev";
+    my $rel_dir = dirname($rel_devpath);
+    File::Path::mkpath("$root/$rel_dir");
+
     PVE::Tools::run_command(['mknod', '-m', '666', "$root/dev/$dev",
                              $type, $major, $minor]);
 }
-- 
2.1.4





More information about the pve-devel mailing list