[arch-projects] [PATCH] [devtools] Add /dev/loop-control support.
In order to take advantage of linux-3.1+ and mount/losetup of util-linux-2.21+, thats allows dynamic allocation of loopback devices. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- mkarchroot.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/mkarchroot.in b/mkarchroot.in index cda761c..9d7631e 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -99,6 +99,7 @@ chroot_mount() { mknod -m 666 "${working_dir}/dev/tty" c 5 0 mknod -m 666 "${working_dir}/dev/tty0" c 4 0 mknod -m 666 "${working_dir}/dev/full" c 1 7 + mknod -m 600 "${working_dir}/dev/loop-control" b 7 237 ln -s /proc/kcore "${working_dir}/dev/core" ln -s /proc/self/fd "${working_dir}/dev/fd" ln -s /proc/self/fd/0 "${working_dir}/dev/stdin" -- 1.7.8.1
On Tue, Jan 10, 2012 at 10:37 AM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
In order to take advantage of linux-3.1+ and mount/losetup of util-linux-2.21+, thats allows dynamic allocation of loopback devices.
Why do we mount /dev as tmpfs? If we use devtmpfs instead we don't need any of these symlinks/nodes. Am I missing something? -t
On 01/10/2012 07:47 AM, Tom Gundersen wrote:
On Tue, Jan 10, 2012 at 10:37 AM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
In order to take advantage of linux-3.1+ and mount/losetup of util-linux-2.21+, thats allows dynamic allocation of loopback devices. Why do we mount /dev as tmpfs?
If we use devtmpfs instead we don't need any of these symlinks/nodes. Am I missing something?
-t
I do not know. Ask to Pierre [#1]. [#1] http://projects.archlinux.org/devtools.git/commit/?id=d6792db31cca80acde27af... -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 01/10/2012 07:37 AM, Gerardo Exequiel Pozzi wrote:
In order to take advantage of linux-3.1+ and mount/losetup of util-linux-2.21+, thats allows dynamic allocation of loopback devices.
Signed-off-by: Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> --- mkarchroot.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/mkarchroot.in b/mkarchroot.in index cda761c..9d7631e 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -99,6 +99,7 @@ chroot_mount() { mknod -m 666 "${working_dir}/dev/tty" c 5 0 mknod -m 666 "${working_dir}/dev/tty0" c 4 0 mknod -m 666 "${working_dir}/dev/full" c 1 7 + mknod -m 600 "${working_dir}/dev/loop-control" b 7 237 ln -s /proc/kcore "${working_dir}/dev/core" ln -s /proc/self/fd "${working_dir}/dev/fd" ln -s /proc/self/fd/0 "${working_dir}/dev/stdin" brb, please ignore this at all. This is wrong.
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
In order to take advantage of linux-3.1+ and mount/losetup of util-linux-2.21+, thats allows dynamic allocation of loopback devices. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- mkarchroot.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/mkarchroot.in b/mkarchroot.in index cda761c..4b92a35 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -99,6 +99,7 @@ chroot_mount() { mknod -m 666 "${working_dir}/dev/tty" c 5 0 mknod -m 666 "${working_dir}/dev/tty0" c 4 0 mknod -m 666 "${working_dir}/dev/full" c 1 7 + mknod -m 600 "${working_dir}/dev/loop-control" c 10 237 ln -s /proc/kcore "${working_dir}/dev/core" ln -s /proc/self/fd "${working_dir}/dev/fd" ln -s /proc/self/fd/0 "${working_dir}/dev/stdin" -- 1.7.8.1
Am 11.01.2012 08:43, schrieb Gerardo Exequiel Pozzi:
In order to take advantage of linux-3.1+ and mount/losetup of util-linux-2.21+, thats allows dynamic allocation of loopback devices.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- mkarchroot.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/mkarchroot.in b/mkarchroot.in index cda761c..4b92a35 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -99,6 +99,7 @@ chroot_mount() { mknod -m 666 "${working_dir}/dev/tty" c 5 0 mknod -m 666 "${working_dir}/dev/tty0" c 4 0 mknod -m 666 "${working_dir}/dev/full" c 1 7 + mknod -m 600 "${working_dir}/dev/loop-control" c 10 237 ln -s /proc/kcore "${working_dir}/dev/core" ln -s /proc/self/fd "${working_dir}/dev/fd" ln -s /proc/self/fd/0 "${working_dir}/dev/stdin"
This still won't create the loopN file when you request one using loop-control (unless losetup does it) - this is only tmpfs, and no udev instance is looking after the chroot.
On 01/11/2012 06:49 AM, Thomas Bächler wrote:
Am 11.01.2012 08:43, schrieb Gerardo Exequiel Pozzi:
In order to take advantage of linux-3.1+ and mount/losetup of util-linux-2.21+, thats allows dynamic allocation of loopback devices.
Signed-off-by: Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> --- mkarchroot.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/mkarchroot.in b/mkarchroot.in index cda761c..4b92a35 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -99,6 +99,7 @@ chroot_mount() { mknod -m 666 "${working_dir}/dev/tty" c 5 0 mknod -m 666 "${working_dir}/dev/tty0" c 4 0 mknod -m 666 "${working_dir}/dev/full" c 1 7 + mknod -m 600 "${working_dir}/dev/loop-control" c 10 237 ln -s /proc/kcore "${working_dir}/dev/core" ln -s /proc/self/fd "${working_dir}/dev/fd" ln -s /proc/self/fd/0 "${working_dir}/dev/stdin" This still won't create the loopN file when you request one using loop-control (unless losetup does it) - this is only tmpfs, and no udev instance is looking after the chroot.
Ouch, partially true ( partially because udev does not create devices anymore http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=220893b3cbdbf... and such device will be outside the chroot in devtmpfs. So (chroot)/dev should be devtmpfs here... -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 11.01.2012 12:40, schrieb Gerardo Exequiel Pozzi:
Ouch, partially true ( partially because udev does not create devices anymore http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=220893b3cbdbf... and such device will be outside the chroot in devtmpfs.
So (chroot)/dev should be devtmpfs here...
There were reasons against that, I'm afraid. I have no good solution for this problem right now, let's first find out why we build a tmpfs instead of bind-mounting the host /dev.
On 01/11/2012 03:02 PM, Thomas Bächler wrote:
Am 11.01.2012 12:40, schrieb Gerardo Exequiel Pozzi:
Ouch, partially true ( partially because udev does not create devices anymore http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=220893b3cbdbf... and such device will be outside the chroot in devtmpfs.
So (chroot)/dev should be devtmpfs here...
There were reasons against that, I'm afraid. I have no good solution for this problem right now, let's first find out why we build a tmpfs instead of bind-mounting the host /dev.
We used to lose /dev entries on host when somebody started a second compilation on the same chroot when rsync is used to clean the build directory. No idea if we have this bug anymore since now we have proper locking. -- Ionuț
On 01/11/2012 10:36 AM, Ionut Biru wrote:
On 01/11/2012 03:02 PM, Thomas Bächler wrote:
Am 11.01.2012 12:40, schrieb Gerardo Exequiel Pozzi:
Ouch, partially true ( partially because udev does not create devices anymore http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=220893b3cbdbf... and such device will be outside the chroot in devtmpfs.
So (chroot)/dev should be devtmpfs here...
There were reasons against that, I'm afraid. I have no good solution for this problem right now, let's first find out why we build a tmpfs instead of bind-mounting the host /dev.
We used to lose /dev entries on host when somebody started a second compilation on the same chroot when rsync is used to clean the build directory.
No idea if we have this bug anymore since now we have proper locking.
mmmm I guess that is related to /dev/pts, that is now mounted with -o newinstance PS: In that case (keeping devtools like now), is the time to do something that I have pending since long time in mkarchiso: make it independent from mkarchroot. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (4)
-
Gerardo Exequiel Pozzi
-
Ionut Biru
-
Thomas Bächler
-
Tom Gundersen