/packages/sysutils/busybox/install

http://github.com/OpenELEC/OpenELEC.tv · Shell · 75 lines · 32 code · 17 blank · 26 comment · 0 complexity · 4013812ab2b3dfccfe34d6b4039f449a MD5 · raw file

  1. #!/bin/sh
  2. ################################################################################
  3. # This file is part of OpenELEC - http://www.openelec.tv
  4. # Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
  5. #
  6. # This Program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10. #
  11. # This Program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with OpenELEC.tv; see the file COPYING. If not, write to
  18. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19. # http://www.gnu.org/copyleft/gpl.html
  20. ################################################################################
  21. . config/options $1
  22. ROOT_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $ROOT_PASSWORD`"
  23. USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $USER_PASSWORD`"
  24. add_user root "$ROOT_PWD" 0 0 "Root User" "/storage" "/bin/sh"
  25. add_group root 0
  26. add_group users 100
  27. add_user $USER_NAME "$USER_PWD" 1000 1000 "User" "/storage" "/bin/sh"
  28. add_group $USER_GROUP 1000
  29. cp -PR $BUILD/busybox*/_install-system/* $INSTALL
  30. echo "chmod 4755 $INSTALL/bin/busybox" >> $FAKEROOT_SCRIPT
  31. mkdir -p $INSTALL/usr/bin
  32. cp $PKG_DIR/scripts/createlog $INSTALL/usr/bin/
  33. cp $PKG_DIR/scripts/lsb_release $INSTALL/usr/bin/
  34. ln -sf /bin/busybox $INSTALL/usr/bin/env #/usr/bin/env is needed for most python scripts
  35. mkdir -p $INSTALL/sbin
  36. cp $PKG_DIR/scripts/init $INSTALL/sbin/
  37. mkdir -p $INSTALL/etc
  38. cp $PKG_DIR/config/profile $INSTALL/etc
  39. cp $PKG_DIR/config/syslog.conf $INSTALL/etc
  40. cp $PKG_DIR/config/httpd.conf $INSTALL/etc
  41. echo "chmod 000 $INSTALL/etc/shadow" >> $FAKEROOT_SCRIPT
  42. # /etc/fstab is needed by...
  43. touch $INSTALL/etc/fstab
  44. # /etc/hosts must be writeable
  45. ln -sf /var/cache/hosts $INSTALL/etc/hosts
  46. # /etc/mtab is needed by udisks etc...
  47. ln -sf /proc/self/mounts $INSTALL/etc/mtab
  48. # create /etc/hostname
  49. echo $HOSTNAME > $INSTALL/etc/hostname
  50. mkdir -p $INSTALL/etc/modprobe.d
  51. cp $PKG_DIR/modprobe.d/* $INSTALL/etc/modprobe.d
  52. # add user modprobe.d dir
  53. mkdir -p $INSTALL/usr/config/modprobe.d
  54. # add webroot
  55. mkdir -p $INSTALL/usr/www
  56. echo "It works" > $INSTALL/usr/www/index.html
  57. mkdir -p $INSTALL/usr/www/error
  58. echo "404" > $INSTALL/usr/www/error/404.html