mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 21:26:49 +00:00
busybox:
- move dbus start to /sbin/init - move connman start to /sbin/init - move udev start to /sbin/init - move xorg start to its own init script - show splash from /usr/share/splash dir - various cleanups and cosmetic - use some ionice for speedup - force loading nvidia driver
This commit is contained in:
parent
c7408d0e21
commit
04c4ba7626
@ -1,13 +0,0 @@
|
||||
# start D-BUS daemon
|
||||
#
|
||||
# runlevels: openelec, text, debug
|
||||
|
||||
(
|
||||
progress "Starting D-BUS"
|
||||
|
||||
install -m 755 -d /var/lib/dbus
|
||||
install -m 755 -d /var/run/dbus
|
||||
|
||||
dbus-daemon --system
|
||||
dbus-uuidgen --ensure
|
||||
)&
|
@ -1,13 +0,0 @@
|
||||
# start Connection Manager
|
||||
#
|
||||
# runlevels: openelec, text, debug
|
||||
|
||||
(
|
||||
progress "Starting Connection Manager"
|
||||
|
||||
mkdir -p /var/run
|
||||
touch /var/run/resolv.conf
|
||||
|
||||
connmand
|
||||
|
||||
)&
|
@ -4,43 +4,73 @@
|
||||
. /etc/sysconfig
|
||||
|
||||
# Starting Splash
|
||||
[ "$DEBUG" != "yes" -a "$TEXTMODE" != "yes" -a -f /usr/bin/ply-image -a -f $SPLASH ] && \
|
||||
ply-image $SPLASH
|
||||
[ "$DEBUG" != "yes" -a "$TEXTMODE" != "yes" -a -f /usr/bin/ply-image -a \
|
||||
-f /usr/share/splash/Splash.png ] && \
|
||||
ply-image /usr/share/splash/Splash.png &
|
||||
|
||||
HOSTNAME="openelec"
|
||||
HOSTNAME="openelec"
|
||||
|
||||
# mounting needed filesystems
|
||||
/bin/mount -n -t ramfs none /var
|
||||
progress "mounting needed filesystems"
|
||||
ionice -c 1 -n 0 mount -n -t ramfs none /var
|
||||
|
||||
# make variable directory structure
|
||||
install -m 755 -d /var/log
|
||||
install -m 755 -d /var/lock
|
||||
install -m 755 -d /var/media
|
||||
install -m 1777 -d /var/run
|
||||
install -m 1777 -d /var/tmp
|
||||
install -m 755 -d /var/run/sepermit # for LinuxPAM
|
||||
|
||||
# caching xbmc
|
||||
[ "$XBMC_CACHING" = "yes" ] && cache_xbmc &
|
||||
progress "make variable directory structure"
|
||||
ionice -c 1 -n 0 mkdir -p /var/log /var/lock /var/media /var/run /var/tmp \
|
||||
/var/run/sepermit
|
||||
ionice -c 1 -n 0 chmod 1777 /var/run /var/tmp
|
||||
|
||||
# bring lo up, whether we have network card or not
|
||||
ifconfig lo 127.0.0.1 up
|
||||
progress "starting Loopback Network interface"
|
||||
ifconfig lo 127.0.0.1 up
|
||||
|
||||
# setup hostname
|
||||
progress "Setup hostname"
|
||||
echo $HOSTNAME > /proc/sys/kernel/hostname
|
||||
|
||||
# create /etc/hosts file, useful for gethostbyname(localhost)
|
||||
echo -e "127.0.0.1\tlocalhost $HOSTNAME" > /var/run/hosts
|
||||
|
||||
# starting Xorg
|
||||
[ ! "$TEXTMODE" = "yes" ] && start_xorg &
|
||||
|
||||
# copying config into storage
|
||||
mkdir -p $HOME/.config
|
||||
for i in `ls /usr/config`; do
|
||||
[ ! -f "$HOME/.config/$i" ] && \
|
||||
cp -PR /usr/config/$i $HOME/.config
|
||||
done
|
||||
progress "copying config into storage"
|
||||
mkdir -p $HOME/.config
|
||||
for i in `ls /usr/config`; do
|
||||
[ ! -f "$HOME/.config/$i" ] && \
|
||||
cp -PR /usr/config/$i $HOME/.config
|
||||
done
|
||||
|
||||
# setting hostname
|
||||
echo localhost > /proc/sys/kernel/hostname
|
||||
# loading NVidia driver
|
||||
if lspci -n | grep 0300 | grep -q 10de; then
|
||||
progress "loading NVidia driver"
|
||||
ionice -c 1 -n 0 modprobe nvidia
|
||||
fi
|
||||
|
||||
# caching xbmc
|
||||
[ "$XBMC_CACHING" = "yes" ] && cache_xbmc
|
||||
|
||||
# starting Udev
|
||||
progress "starting Udev"
|
||||
echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
|
||||
nice -n 20 udevd --daemon
|
||||
nice -n 20 udevadm monitor 2>&1 >/var/log/udev.log &
|
||||
nice -n 20 udevadm control --env STARTUP=1
|
||||
(
|
||||
nice -n 20 udevadm trigger
|
||||
nice -n 20 udevadm settle --timeout=5
|
||||
nice -n 20 udevadm control --env STARTUP=
|
||||
)&
|
||||
|
||||
# starting dbus
|
||||
progress "Starting D-BUS"
|
||||
mkdir -p /var/lib/dbus /var/run/dbus
|
||||
dbus-daemon --system
|
||||
dbus-uuidgen --ensure
|
||||
|
||||
# starting Connman
|
||||
progress "Starting Connection Manager"
|
||||
mkdir -p /var/run
|
||||
touch /var/run/resolv.conf
|
||||
connmand
|
||||
|
||||
# starting debugging shell
|
||||
if test "$DEBUG" = yes; then
|
||||
@ -61,17 +91,18 @@ HOSTNAME="openelec"
|
||||
fi
|
||||
|
||||
# starting init scripts for wanted runlevel
|
||||
RET=0
|
||||
progress "Starting Init Scripts"
|
||||
RET=0
|
||||
|
||||
for script in /etc/init.d/*; do
|
||||
if grep -q -e "^# runlevels:.*$RUNLEVEL" $script; then
|
||||
. $script
|
||||
S_RET=$?
|
||||
test $S_RET -ge $RET && RET=$S_RET
|
||||
fi
|
||||
done
|
||||
for script in /etc/init.d/*; do
|
||||
if grep -q -e "^# runlevels:.*$RUNLEVEL" $script; then
|
||||
. $script
|
||||
S_RET=$?
|
||||
test $S_RET -ge $RET && RET=$S_RET
|
||||
fi
|
||||
done
|
||||
|
||||
# when we have an problem we must look where is this problem
|
||||
# if we have an problem we must look where is this problem
|
||||
echo "###################################"
|
||||
echo "### it seems we have an problem ###"
|
||||
echo "### starting emergency shell... ###"
|
||||
|
@ -1,15 +0,0 @@
|
||||
# start udev daemon
|
||||
#
|
||||
# runlevels: openelec, text, debug
|
||||
|
||||
(
|
||||
progress "starting Udev"
|
||||
|
||||
echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
|
||||
|
||||
udevd --daemon
|
||||
udevadm control --env STARTUP=1
|
||||
udevadm trigger
|
||||
udevadm settle --timeout=15
|
||||
udevadm control --env STARTUP=
|
||||
)&
|
41
packages/x11/xserver/xorg-server/init.d/60_xorg
Normal file
41
packages/x11/xserver/xorg-server/init.d/60_xorg
Normal file
@ -0,0 +1,41 @@
|
||||
# configure X.Org video settings
|
||||
#
|
||||
# runlevels: openelec
|
||||
|
||||
DISPLAY=':0.0'
|
||||
XORG_NVIDIA_CONF="/etc/X11/xorg-nvidia.conf"
|
||||
XORG_ARGS="-s 0 -nr -noreset -allowMouseOpenFail -nocursor -nolisten tcp"
|
||||
|
||||
export DISPLAY
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# do not change anything below
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
[ "$DEBUG" = yes ] && XORG_ARGS="$XORG_ARGS -logverbose 6 -verbose 6"
|
||||
|
||||
if lspci -n | grep 0300 | grep -q 10de; then
|
||||
|
||||
XORG_ARGS="$XORG_ARGS -ignoreABI"
|
||||
[ -f $XORG_NVIDIA_CONF ] && XORG_ARGS="$XORG_ARGS -config $XORG_NVIDIA_CONF"
|
||||
|
||||
progress "Found nVidia card, enabling binary driver as requested"
|
||||
ionice -c 1 -n 0 mkdir -p /var/lib
|
||||
ionice -c 1 -n 0 ln -sf /usr/lib/libGL_nvidia.so.1 /var/lib/libGL.so
|
||||
ionice -c 1 -n 0 ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so
|
||||
|
||||
else
|
||||
|
||||
progress "Not found nVidia card, enabling OSS driver as requested"
|
||||
ionice -c 1 -n 0 mkdir -p /var/lib
|
||||
ionice -c 1 -n 0 ln -sf /usr/lib/libGL_mesa.so.1 /var/lib/libGL.so
|
||||
ionice -c 1 -n 0 ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so
|
||||
fi
|
||||
|
||||
ionice -c 1 -n 0 mkdir -p /var/cache/xkb
|
||||
|
||||
# Make ICE directory
|
||||
ionice -c 1 -n 0 mkdir -m 1777 -p /tmp/.ICE-unix >/dev/null 2>&1
|
||||
ionice -c 1 -n 0 chown root:root /tmp/.ICE-unix
|
||||
|
||||
ionice -c 1 -n 0 /usr/bin/Xorg $DISPLAY vt01 $XORG_ARGS > /dev/null 2>&1 &
|
Loading…
x
Reference in New Issue
Block a user