Advertisement
Guest User

optware-binwrap.sh

a guest
Jun 13th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.72 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement