potential patch to check-cross-arch

Matteo Guglielmi Matteo.Guglielmi at dalco.ch
Wed Oct 9 17:40:02 CEST 2019


This script:



/srv/fai/nfsroot/usr/lib/fai/check-cross-arch



fails (line 36: info=$(file $_ls)) on openSUSE

and Suse Linux Enterprise systems because:



/bin/ls is a symlink to /usr/bin/ls



Here is the section of code that fails:



# where is the ls command
if [ -f $target/bin/ls ]; then
    _ls=$target/bin/ls
elif [ -f $target/usr/bin/ls ]; then
    _ls=$target/usr/bin/ls
else
    echo "Cannot find ls command in $target"
    exit 3
fi

info=$(file $_ls)



because [ -f /i/am/a/symlink ] evaluates to true

causing 'file $_ls' to fail.




This is the simple patch on line 36 I always use:



info=$(file $target$(readlink -m $_ls))



More information about the linux-fai mailing list