diff options
author | Pascal Terjan <pterjan@mageia.org> | 2012-09-19 21:02:35 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2012-09-19 21:02:35 +0000 |
commit | 0b0fbb54a3b89112f3be4aad0f983f8752ee3ff8 (patch) | |
tree | c49e9cc428c531fb8bc882942e9e4aebbb482522 | |
parent | c50bf7b4a8dbdf530673472d50b3f1f3c0ccedb9 (diff) | |
download | iurt-0b0fbb54a3b89112f3be4aad0f983f8752ee3ff8.tar iurt-0b0fbb54a3b89112f3be4aad0f983f8752ee3ff8.tar.gz iurt-0b0fbb54a3b89112f3be4aad0f983f8752ee3ff8.tar.bz2 iurt-0b0fbb54a3b89112f3be4aad0f983f8752ee3ff8.tar.xz iurt-0b0fbb54a3b89112f3be4aad0f983f8752ee3ff8.zip |
Mount /dev/shm as tmpfs
-rwxr-xr-x | iurt_root_command | 10 | ||||
-rw-r--r-- | lib/Iurt/Chroot.pm | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/iurt_root_command b/iurt_root_command index 90abf38..1843269 100755 --- a/iurt_root_command +++ b/iurt_root_command @@ -143,6 +143,10 @@ $run{todo} = []; "bind mount source on dest", \&bindmount, "Bind mounting" ], + [ "", "tmpfs", 1, "<directory>", + "mount a tmpfs on the given directory", + \&tmpfs, "Mount tmpfs" ], + [ "", "umount", 1, "<directory>", "umount the given directory", \&umount, "Unmounting" ], @@ -421,6 +425,12 @@ sub bindmount { return 1; } +sub tmpfs { + my ($_run, $dir) = @_; + check_path_authorized($dir) or return; + return !system("mount", "none", "-t", "tmpfs", $dir); +} + sub umount { my ($_run, $dir) = @_; check_path_authorized($dir) or return; diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 0f196e0..1e19860 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -88,7 +88,7 @@ sub clean_and_build_chroot { sudo($config, "--umount", "$chroot/proc"); return; } - if (!sudo($config, '--bindmount', "/dev/shm", "$chroot/dev/shm")) { + if (!sudo($config, '--tmpfs', "$chroot/dev/shm")) { plog('WARNING', "Failed to mount /dev/shm"); } if ($run->{icecream}) { |