Want more features on Pastebin? Sign Up, it's FREE!
Guest

optware-binwrap.sh

By: a guest on Jun 13th, 2011  |  syntax: Bash  |  size: 0.72 KB  |  views: 82  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2.  
  3. # OptWare for WDLXTV bin wrapper script
  4. # (C) 2010 Denis Roio <jaromil@dyne.org>
  5. # GNU GPL v3
  6.  
  7. # this scrips scans for all binaries present in /bin and /usr/bin
  8. # and generates execution wrappers in /apps/wdlxtv_optware/bin
  9. # so that the correct libraries are linked to them
  10.  
  11.  
  12. . /tmp/optware.env
  13.  
  14. rm -rf $USBROOT/opt/wrappers
  15. mkdir $USBROOT/opt/wrappers
  16.  
  17. wrap_bins() {
  18.     echo -n "building binary wrappers for $1 "
  19.     for x in `ls $1 | grep -v '\.sh$'`; do
  20.         cat <<EOF > $USBROOT/opt/wrappers/$x
  21. #!/bin/sh
  22. LD_LIBRARY_PATH=/lib:/usr/lib
  23. exec $1/$x "\$@"
  24. EOF
  25.         chmod +x $USBROOT/opt/wrappers/$x
  26.         echo -n .
  27.     done
  28.     echo
  29. }
  30.  
  31. wrap_bins /bin
  32. wrap_bins /sbin
  33. wrap_bins /usr/bin
  34. wrap_bins /usr/sbin
clone this paste RAW Paste Data