mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 06:06:43 +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
|
. /etc/sysconfig
|
||||||
|
|
||||||
# Starting Splash
|
# Starting Splash
|
||||||
[ "$DEBUG" != "yes" -a "$TEXTMODE" != "yes" -a -f /usr/bin/ply-image -a -f $SPLASH ] && \
|
[ "$DEBUG" != "yes" -a "$TEXTMODE" != "yes" -a -f /usr/bin/ply-image -a \
|
||||||
ply-image $SPLASH
|
-f /usr/share/splash/Splash.png ] && \
|
||||||
|
ply-image /usr/share/splash/Splash.png &
|
||||||
|
|
||||||
HOSTNAME="openelec"
|
HOSTNAME="openelec"
|
||||||
|
|
||||||
# mounting needed filesystems
|
# 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
|
# make variable directory structure
|
||||||
install -m 755 -d /var/log
|
progress "make variable directory structure"
|
||||||
install -m 755 -d /var/lock
|
ionice -c 1 -n 0 mkdir -p /var/log /var/lock /var/media /var/run /var/tmp \
|
||||||
install -m 755 -d /var/media
|
/var/run/sepermit
|
||||||
install -m 1777 -d /var/run
|
ionice -c 1 -n 0 chmod 1777 /var/run /var/tmp
|
||||||
install -m 1777 -d /var/tmp
|
|
||||||
install -m 755 -d /var/run/sepermit # for LinuxPAM
|
|
||||||
|
|
||||||
# caching xbmc
|
|
||||||
[ "$XBMC_CACHING" = "yes" ] && cache_xbmc &
|
|
||||||
|
|
||||||
# bring lo up, whether we have network card or not
|
# 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)
|
# create /etc/hosts file, useful for gethostbyname(localhost)
|
||||||
echo -e "127.0.0.1\tlocalhost $HOSTNAME" > /var/run/hosts
|
echo -e "127.0.0.1\tlocalhost $HOSTNAME" > /var/run/hosts
|
||||||
|
|
||||||
# starting Xorg
|
|
||||||
[ ! "$TEXTMODE" = "yes" ] && start_xorg &
|
|
||||||
|
|
||||||
# copying config into storage
|
# copying config into storage
|
||||||
mkdir -p $HOME/.config
|
progress "copying config into storage"
|
||||||
for i in `ls /usr/config`; do
|
mkdir -p $HOME/.config
|
||||||
[ ! -f "$HOME/.config/$i" ] && \
|
for i in `ls /usr/config`; do
|
||||||
cp -PR /usr/config/$i $HOME/.config
|
[ ! -f "$HOME/.config/$i" ] && \
|
||||||
done
|
cp -PR /usr/config/$i $HOME/.config
|
||||||
|
done
|
||||||
|
|
||||||
# setting hostname
|
# loading NVidia driver
|
||||||
echo localhost > /proc/sys/kernel/hostname
|
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
|
# starting debugging shell
|
||||||
if test "$DEBUG" = yes; then
|
if test "$DEBUG" = yes; then
|
||||||
@ -61,17 +91,18 @@ HOSTNAME="openelec"
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# starting init scripts for wanted runlevel
|
# starting init scripts for wanted runlevel
|
||||||
RET=0
|
progress "Starting Init Scripts"
|
||||||
|
RET=0
|
||||||
|
|
||||||
for script in /etc/init.d/*; do
|
for script in /etc/init.d/*; do
|
||||||
if grep -q -e "^# runlevels:.*$RUNLEVEL" $script; then
|
if grep -q -e "^# runlevels:.*$RUNLEVEL" $script; then
|
||||||
. $script
|
. $script
|
||||||
S_RET=$?
|
S_RET=$?
|
||||||
test $S_RET -ge $RET && RET=$S_RET
|
test $S_RET -ge $RET && RET=$S_RET
|
||||||
fi
|
fi
|
||||||
done
|
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 "###################################"
|
||||||
echo "### it seems we have an problem ###"
|
echo "### it seems we have an problem ###"
|
||||||
echo "### starting emergency shell... ###"
|
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