#1947 PR merged: Enhance and cleanup 985_fix_broken_links.sh (issue 1638 and pull request 1734)

Labels: enhancement, bug, fixed / solved / done

jsmeix opened issue at 2018-10-31 15:03:

jsmeix commented at 2018-10-31 15:12:

@gdha
this has become a complete rewrite of 985_fix_broken_links.sh

Because there are so many cases how symlinks could behave unexpected
I would very much appreciate it if you could test if it actually makes things
behave better on your test system(s).

In particular have a look at ./etc/localtime which was a broken symlink
on my system before, cf.
https://github.com/rear/rear/pull/1734#issuecomment-434635175
and now its link target is copied into the recovery system, cf.
https://github.com/rear/rear/pull/1734#issuecomment-434724049

jsmeix commented at 2018-10-31 15:24:

FYI
how it looks when there is no link target:

# mv /usr/share/zoneinfo/Europe/Berlin /usr/share/zoneinfo/Europe/Berlin.away

# usr/sbin/rear -D mkrescue
...
Broken symlink './etc/localtime' in recovery system because 'readlink' cannot determine its link target
...

# ROOTFS_DIR=/tmp/rear.cfDhLeh3H5Suz9R/rootfs

# chroot $ROOTFS_DIR find . -xdev -path './proc' -prune -o -path './sys' -prune -o -path './dev' -prune -o -ls | egrep 'mtab|zoneinfo|termcap'
 39723593 0 lrwxrwxrwx 1 root root 33 Sep 13 07:52 ./etc/localtime -> /usr/share/zoneinfo/Europe/Berlin
 39723581 0 lrwxrwxrwx 1 root root 17 Oct 31 15:20 ./etc/mtab -> /proc/self/mounts
 39723588 0 lrwxrwxrwx 1 root root 23 May 12 21:16 ./etc/termcap -> /usr/share/misc/termcap
 41027139 4 -rw-r--r-- 1 root root 442 May 12 21:14 ./usr/share/terminfo/a/ansi-mtabs
 41031676 1068 -rw-r--r-- 1 root root 1092917 May 12 21:16 ./usr/share/misc/termcap

compare with
https://github.com/rear/rear/pull/1734#issuecomment-434724049


[Export of Github issue for rear/rear.]