Realtek 8168 install driver Make clean No such file or directory

    • OMV 2.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Dropkick Murphy wrote:

      stackoverflow.com/questions/43…ory-errors-while-cleaning


      Source Code

      1. Use the -f option to rm. That option tells rm to ignore non-existent files and not prompt for confirmation.
      HTH
      The problem occur when I run a script: autorun.sh



      Shell-Script

      1. #!/bin/sh
      2. # invoke insmod with all arguments we got
      3. # and use a pathname, as insmod doesn't look in . by default
      4. TARGET_PATH=$(find /lib/modules/$(uname -r)/kernel/drivers/net/ethernet -name realtek -type d)
      5. if [ "$TARGET_PATH" = "" ]; then
      6. TARGET_PATH=$(find /lib/modules/$(uname -r)/kernel/drivers/net -name realtek -type d)
      7. fi
      8. if [ "$TARGET_PATH" = "" ]; then
      9. TARGET_PATH=/lib/modules/$(uname -r)/kernel/drivers/net
      10. fi
      11. echo
      12. echo "Check old driver and unload it."
      13. check=`lsmod | grep r8169`
      14. if [ "$check" != "" ]; then
      15. echo "rmmod r8169"
      16. /sbin/rmmod r8169
      17. fi
      18. check=`lsmod | grep r8168`
      19. if [ "$check" != "" ]; then
      20. echo "rmmod r8168"
      21. /sbin/rmmod r8168
      22. fi
      23. echo "Build the module and install"
      24. echo "-------------------------------" >> log.txt
      25. date 1>>log.txt
      26. make $@ all 1>>log.txt || exit 1
      27. module=`ls src/*.ko`
      28. module=${module#src/}
      29. module=${module%.ko}
      30. if [ "$module" = "" ]; then
      31. echo "No driver exists!!!"
      32. exit 1
      33. elif [ "$module" != "r8169" ]; then
      34. if test -e $TARGET_PATH/r8169.ko ; then
      35. echo "Backup r8169.ko"
      36. if test -e $TARGET_PATH/r8169.bak ; then
      37. i=0
      38. while test -e $TARGET_PATH/r8169.bak$i
      39. do
      40. i=$(($i+1))
      41. done
      42. echo "rename r8169.ko to r8169.bak$i"
      43. mv $TARGET_PATH/r8169.ko $TARGET_PATH/r8169.bak$i
      44. else
      45. echo "rename r8169.ko to r8169.bak"
      46. mv $TARGET_PATH/r8169.ko $TARGET_PATH/r8169.bak
      47. fi
      48. fi
      49. fi
      50. echo "DEPMOD $(uname -r)"
      51. depmod `uname -r`
      52. echo "load module $module"
      53. modprobe $module
      54. is_update_initramfs=n
      55. distrib_list="ubuntu debian"
      56. if [ -r /etc/debian_version ]; then
      57. is_update_initramfs=y
      58. elif [ -r /etc/lsb-release ]; then
      59. for distrib in $distrib_list
      60. do
      61. /bin/grep -i "$distrib" /etc/lsb-release 2>&1 /dev/null && \
      62. is_update_initramfs=y && break
      63. done
      64. fi
      65. if [ "$is_update_initramfs" = "y" ]; then
      66. if which update-initramfs >/dev/null ; then
      67. echo "Updating initramfs. Please wait."
      68. update-initramfs -u -k $(uname -r)
      69. else
      70. echo "update-initramfs: command not found"
      71. exit 1
      72. fi
      73. fi
      74. echo "Completed."
      75. exit 0
      Display All