Skip to contentSkip to conversation

Removing files in devfs

DISCUSSION Oliver Feiler 3 participants 4 messages Jan 19, 2002 – Jan 20, 2002 VFS

lore
Share & tools
lore
#0 lore raw

Hello,

Is this behaviour supposed to be?

9:36 root@kiza /dev# l null
crw-rw-rw- 1 root root 1, 3 Jan 1 1970 null
9:36 root@kiza /dev# rm null
removing `null'
9:36 root@kiza /dev# l null
ls: null: No such file or directory
9:36 root@kiza /dev#

I have kernel 2.4.16 with devfs and on every other system I tried I
only get "rm: cannot unlink `null': Operation not permitted" when trying to delete something in devfs. And I cannot see any differences as far as devfs is concerned on the systems I tried. devfs compiled in, mounted on boot time, same version of devfsd.

Regards,

Oliver

Signature · 3 lines
Oliver Feiler                                               [email protected]
http://www.lionking.org/~kiza/pgpkey              PGP key ID: 0x561D4FD2
http://www.lionking.org/~kiza/
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"oliver" == Oliver Feiler <[email protected]> writes:

oliver> Hello,
oliver> Is this behaviour supposed to be?

oliver> 9:36 root@kiza /dev# l null
oliver> crw-rw-rw- 1 root root 1, 3 Jan 1 1970 null
oliver> 9:36 root@kiza /dev# rm null
oliver> removing `null'
oliver> 9:36 root@kiza /dev# l null
oliver> ls: null: No such file or directory
oliver> 9:36 root@kiza /dev#

oliver> I have kernel 2.4.16 with devfs and on every other system I tried I oliver> only get "rm: cannot unlink `null': Operation not permitted" when trying to oliver> delete something in devfs. And I cannot see any differences as far as devfs is oliver> concerned on the systems I tried. devfs compiled in, mounted on boot time, oliver> same version of devfsd.

oliver> Regards,

oliver> Oliver

Since 2.4.16-preX, you can't remove a {file,symlink} in devfs created by devfs :(

That hit me hardly whith /dev/root. I had to remove the code that generate that link to get my system booting (where system is anything booting with mkinitrd + devfs).

Later, Juan.

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#2 lore raw
In reply to Oliver Feiler
Quoted 12 lines · Oliver Feiler

Hello,

Is this behaviour supposed to be?

9:36 root@kiza /dev# l null
crw-rw-rw- 1 root root 1, 3 Jan 1 1970 null
9:36 root@kiza /dev# rm null
removing `null'
9:36 root@kiza /dev# l null
ls: null: No such file or directory
9:36 root@kiza /dev#

Quoted 6 lines

I have kernel 2.4.16 with devfs and on every other system I
tried I only get "rm: cannot unlink `null': Operation not permitted" when trying to delete something in devfs. And I cannot see any differences as far as devfs is concerned on the systems I tried. devfs compiled in, mounted on boot time, same version of devfsd.

What is "every other system"?

				Regards,

					Richard....
Permanent: [email protected]
Current:   [email protected]
#3 lore raw
In reply to Oliver Feiler
Quoted 3 lines · Richard Gooch

What is "every other system"?

Sorry, the last mail didn't get a followup to the list... that should
explain it:

----forwarded mail----

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"oliver" == Oliver Feiler <[email protected]> writes:

Quoted 3 lines · oliver> Juan Quintela wrote:
Quoted 3 lines

Since 2.4.16-preX, you can't remove a {file,symlink} in devfs created by devfs :(

oliver> Hmm, that'll be it. Since the other systems I tried were both running oliver> 2.4.17 kernels and I'm with .16 at the moment. Thanks for the hint.

this patch should make the trick (it is a workaround, but it is not trivial to do it an easier way without still more incestuous relations, Wating for Richard to do something to the respect.

Later, Juan.

fs/super.c Fri Jan 4 21:09:45 2002 renamed from fs/super.c.orig Fri Jan 4 21:28:24 2002 +2 -2
diff -u linux/fs/super.c.orig linux/fs/super.c
@@ -1056,8 +1056,8 @@
        putname(fs_names);
        if (path_start >= 0) {
                name = path + path_start;
-               devfs_mk_symlink (NULL, "root", DEVFS_FL_DEFAULT,
-                                 name + 5, NULL, NULL);
+//             devfs_mk_symlink (NULL, "root", DEVFS_FL_DEFAULT,
+//                               name + 5, NULL, NULL);
                memcpy (name, "/dev/", 5);
        }
        vfsmnt = alloc_vfsmnt();

----end forward----

Signature · 3 lines
Oliver Feiler                                               [email protected]
http://www.lionking.org/~kiza/pgpkey              PGP key ID: 0x561D4FD2
http://www.lionking.org/~kiza/