PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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