"find -follow -type l" doesn't quite work.
Rob Landley
rob at landley.net
Tue Sep 29 21:18:26 UTC 2009
On Tuesday 29 September 2009 04:01:12 Denys Vlasenko wrote:
> On Fri, Sep 25, 2009 at 11:35 AM, Rob Landley <rob at landley.net> wrote:
> > An easy way to find all dead symlinks under /path is:
> >
> > find -follow -type l /path
> >
> > Using gnu find, that will produce a list of symlinks that, when you've
> > followed them as far as they can, are still symlinks. Using busybox, it
> > finds the same set of files, but instead of listing them to stdout it
> > gives error messages about them. This behavior is less useful.
>
> Please try attached patch.
>
> --
> vda
It's full of unrelated changes that conflict with the last release version:
Applying /home/landley/firmware/firmware/sources/patches/busybox-findl.patch
patching file findutils/find.c
Hunk #1 FAILED at 62.
Hunk #2 succeeded at 94 with fuzz 2 (offset -3 lines).
Hunk #3 succeeded at 369 (offset -7 lines).
Hunk #4 FAILED at 398.
Hunk #5 succeeded at 407 with fuzz 2 (offset -8 lines).
Hunk #6 succeeded at 437 (offset -15 lines).
Hunk #7 FAILED at 598.
Hunk #8 succeeded at 623 (offset -15 lines).
Hunk #9 FAILED at 632.
Hunk #10 succeeded at 840 (offset -15 lines).
Hunk #11 succeeded at 869 (offset -15 lines).
Hunk #12 succeeded at 902 (offset -15 lines).
4 out of 12 hunks FAILED -- saving rejects to file findutils/find.c.rej
patching file include/libbb.h
Hunk #1 succeeded at 275 (offset -11 lines).
patching file libbb/recursive_action.c
Applying to the -git snapshot I have (from last monday):
Applying /home/landley/firmware/firmware/sources/patches/alt-busybox-findl.patch
patching file findutils/find.c
Hunk #1 FAILED at 62.
Hunk #4 FAILED at 405.
Hunk #5 succeeded at 414 with fuzz 2 (offset -1 lines).
Hunk #6 succeeded at 444 (offset -8 lines).
Hunk #7 succeeded at 605 (offset -8 lines).
Hunk #8 succeeded at 630 (offset -8 lines).
Hunk #9 succeeded at 639 (offset -8 lines).
Hunk #10 succeeded at 847 (offset -8 lines).
Hunk #11 succeeded at 876 (offset -8 lines).
Hunk #12 succeeded at 909 (offset -8 lines).
2 out of 12 hunks FAILED -- saving rejects to file findutils/find.c.rej
patching file include/libbb.h
patching file libbb/recursive_action.c
Updating -git to current and applying the patch:
Applying /home/landley/firmware/firmware/sources/patches/alt-busybox-findl.patch
patching file findutils/find.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
12 out of 12 hunks ignored -- saving rejects to file findutils/find.c.rej
patching file include/libbb.h
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file include/libbb.h.rej
patching file libbb/recursive_action.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file libbb/recursive_action.c.rej
Building current -git without applying any patches to it worked, but feeding
that into my build system then went:
*** glibc detected *** cp: munmap_chunk(): invalid pointer: 0x00007fff46870538
***
======= Backtrace: =========
/lib/libc.so.6[0x7f053e0d1cb8]
cp[0x47c966]
cp[0x409261]
cp[0x40928f]
cp[0x409578]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f053e0785a6]
cp[0x408b41]
======= Memory map: ========
00400000-004ea000 r-xp 00000000 08:02 11280388
/home/landley/firmware/firmware/build/host/busybox
006e9000-006ea000 r--p 000e9000 08:02 11280388
/home/landley/firmware/firmware/build/host/busybox
006ea000-006eb000 rw-p 000ea000 08:02 11280388
/home/landley/firmware/firmware/build/host/busybox
006eb000-006ee000 rw-p 006eb000 00:00 0
021a8000-021c9000 rw-p 021a8000 00:00 0
[heap]
7f053de42000-7f053de58000 r-xp 00000000 08:01 904044
/lib/libgcc_s.so.1
7f053de58000-7f053e058000 ---p 00016000 08:01 904044
/lib/libgcc_s.so.1
7f053e058000-7f053e059000 r--p 00016000 08:01 904044
/lib/libgcc_s.so.1
7f053e059000-7f053e05a000 rw-p 00017000 08:01 904044
/lib/libgcc_s.so.1
7f053e05a000-7f053e1c2000 r-xp 00000000 08:01 906149
/lib/libc-2.9.so
7f053e1c2000-7f053e3c2000 ---p 00168000 08:01 906149
/lib/libc-2.9.so
7f053e3c2000-7f053e3c6000 r--p 00168000 08:01 906149
/lib/libc-2.9.so
7f053e3c6000-7f053e3c7000 rw-p 0016c000 08:01 906149
/lib/libc-2.9.so
7f053e3c7000-7f053e3cc000 rw-p 7f053e3c7000 00:00 0
7f053e3cc000-7f053e450000 r-xp 00000000 08:01 906156
/lib/libm-2.9.so
7f053e450000-7f053e64f000 ---p 00084000 08:01 906156
/lib/libm-2.9.so
7f053e64f000-7f053e650000 r--p 00083000 08:01 906156
/lib/libm-2.9.so
7f053e650000-7f053e651000 rw-p 00084000 08:01 906156
/lib/libm-2.9.so
7f053e651000-7f053e671000 r-xp 00000000 08:01 903994
/lib/ld-2.9.so
7f053e852000-7f053e854000 rw-p 7f053e852000 00:00 0
7f053e86d000-7f053e870000 rw-p 7f053e86d000 00:00 0
7f053e870000-7f053e871000 r--p 0001f000 08:01 903994
/lib/ld-2.9.so
7f053e871000-7f053e872000 rw-p 00020000 08:01 903994
/lib/ld-2.9.so
7fff4685c000-7fff46871000 rw-p 7ffffffea000 00:00 0 [stack]
7fff469fe000-7fff469ff000 r-xp 7fff469fe000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
./host-tools.sh: line 231: 30785 Aborted cp e2fsck/e2fsck
"$STAGE_DIR"/fsck.ext2
That said, the "find . -follow -type l" thing does seem to work in current -
git. :)
Rob
--
Latency is more important than throughput. It's that simple. - Linus Torvalds
More information about the busybox
mailing list