Editing
Loop Device
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Building loop-AES == If you plan to use loop-AES you have to apply an additional patch. Since loop-AES replaces the kernels loopback device you have to tell loop-AES about the changes in your vserver kernel. It's a quite simple patch, apply it to your loop-AES source. <pre> diff -ruN loop-AES-v3.1c-orig/loop.c-2.6.patched loop-AES-v3.1c/loop.c-2.6.patched --- loop-AES-v3.1c-orig/loop.c-2.6.patched 2006-01-12 19:22:48.000000000 +0100 +++ loop-AES-v3.1c/loop.c-2.6.patched 2006-03-25 03:09:59.000000000 +0100 @@ -102,6 +102,8 @@ #endif #include <asm/uaccess.h> +#include <linux/vserver/context.h> +#include <linux/vs_context.h> #if !defined(LO_FLAGS_DO_BMAP) # define LO_FLAGS_DO_BMAP 0x20000 @@ -1267,6 +1269,7 @@ struct file *file; struct inode *inode; struct block_device *lo_device = NULL; + struct vx_info_save vxis; int lo_flags = 0; int error; @@ -1412,7 +1415,9 @@ loop_set_softblksz(lo, bdev); + __enter_vx_admin(&vxis); error = kernel_thread(loop_thread, lo, CLONE_KERNEL); + __leave_vx_admin(&vxis); if(error < 0) goto out_mapping; wait_for_completion(&LDE_lo_done); @@ -1527,7 +1532,7 @@ struct loop_func_table *xfer = NULL; if (lo->lo_encrypt_key_size && lo->lo_key_owner != current->uid && - !capable(CAP_SYS_ADMIN)) + !capable(CAP_SYS_ADMIN) && !vx_ccaps(VXC_CRYPTO_LOOP)) return -EPERM; if ((unsigned int) info->lo_encrypt_key_size > LO_KEY_SIZE) return -EINVAL; @@ -1607,7 +1612,8 @@ memcpy(info->lo_file_name, lo->lo_file_name, LO_NAME_SIZE); memcpy(info->lo_crypt_name, lo->lo_crypt_name, LO_NAME_SIZE); info->lo_encrypt_type = lo->lo_encryption ? lo->lo_encryption->number : 0; - if (lo->lo_encrypt_key_size && capable(CAP_SYS_ADMIN)) { + if (lo->lo_encrypt_key_size && + (capable(CAP_SYS_ADMIN) || vx_ccaps(VXC_CRYPTO_LOOP))) { info->lo_encrypt_key_size = lo->lo_encrypt_key_size; memcpy(info->lo_encrypt_key, lo->lo_encrypt_key, lo->lo_encrypt_key_size); </pre> Once done, just (re)compile loop-AES with <tt>make clean && make</tt>. You should now be able to load the loop-AES module. Simply type modprobe loop. If you want to do make tests ensure, you have installed the patched aes utils on your host system.
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information