mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
commit
0087475d66
@ -14,14 +14,16 @@ PKG_LONGDESC="LibreELEC-settings: is a settings dialog for LibreELEC"
|
|||||||
PKG_MAKE_OPTS_TARGET="DISTRONAME=$DISTRONAME ROOT_PASSWORD=$ROOT_PASSWORD"
|
PKG_MAKE_OPTS_TARGET="DISTRONAME=$DISTRONAME ROOT_PASSWORD=$ROOT_PASSWORD"
|
||||||
|
|
||||||
if [ "$DISPLAYSERVER" = "x11" ]; then
|
if [ "$DISPLAYSERVER" = "x11" ]; then
|
||||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET setxkbmap"
|
PKG_DEPENDS_TARGET+=" setxkbmap"
|
||||||
else
|
else
|
||||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET bkeymaps"
|
PKG_DEPENDS_TARGET+=" bkeymaps"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
post_makeinstall_target() {
|
post_makeinstall_target() {
|
||||||
mkdir -p $INSTALL/usr/lib/libreelec
|
mkdir -p $INSTALL/usr/lib/libreelec
|
||||||
cp $PKG_DIR/scripts/* $INSTALL/usr/lib/libreelec
|
cp $PKG_DIR/scripts/* $INSTALL/usr/lib/libreelec
|
||||||
|
sed -e "s/@DISTRONAME@/$DISTRONAME/g" \
|
||||||
|
-i $INSTALL/usr/lib/libreelec/backup-restore
|
||||||
|
|
||||||
ADDON_INSTALL_DIR=$INSTALL/usr/share/kodi/addons/service.libreelec.settings
|
ADDON_INSTALL_DIR=$INSTALL/usr/share/kodi/addons/service.libreelec.settings
|
||||||
|
|
||||||
|
@ -2,39 +2,33 @@
|
|||||||
|
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
||||||
|
# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
. /usr/lib/libreelec/functions
|
. /usr/lib/libreelec/functions
|
||||||
|
|
||||||
# Get NAME, which is DISTRONAME, ie. LibreELEC
|
|
||||||
. /etc/os-release
|
|
||||||
|
|
||||||
hidecursor
|
hidecursor
|
||||||
|
|
||||||
BACKUP_FILE=`ls -1 /storage/.restore/??????????????.tar 2>/dev/null | tail -1`
|
BACKUP_FILE=$(find /storage/.restore/ -name "*.tar" -print -quit 2>/dev/null)
|
||||||
|
|
||||||
if [ -f "$BACKUP_FILE" ] ; then
|
|
||||||
echo "RESTORE IN PROGRESS"
|
if [ -f "${BACKUP_FILE}" ]; then
|
||||||
echo ""
|
echo -e "RESTORE IN PROGRESS\n"
|
||||||
echo "Please do not reboot or turn off your ${NAME} device!"
|
echo -e "Please do not reboot or turn off your @DISTRONAME@ device!\n"
|
||||||
echo ""
|
|
||||||
|
|
||||||
StartProgress spinner "Checking backup file... "
|
StartProgress spinner "Checking backup file... "
|
||||||
tar tf $BACKUP_FILE &>/dev/null
|
tar tf "${BACKUP_FILE}" &>/dev/null
|
||||||
ret=$?
|
|
||||||
|
|
||||||
if [ $ret -eq 0 ] ; then
|
if [ $? -eq 0 ]; then
|
||||||
StopProgress "OK"
|
StopProgress "OK"
|
||||||
|
|
||||||
echo
|
echo -e "\nThis may take some time to complete, please be patient.\n"
|
||||||
echo "This may take some time to complete, please be patient."
|
|
||||||
echo
|
|
||||||
|
|
||||||
StartProgress spinner "Restoring... "
|
StartProgress spinner "Restoring... "
|
||||||
rm -rf /storage/.kodi &>/dev/null
|
rm -rf /storage/.kodi \
|
||||||
rm -rf /storage/.cache &>/dev/null
|
/storage/.cache \
|
||||||
rm -rf /storage/.config &>/dev/null
|
/storage/.config &>/dev/null
|
||||||
tar xf $BACKUP_FILE -C / &>/dev/null
|
tar xf "${BACKUP_FILE}" -C / &>/dev/null
|
||||||
rm -f $BACKUP_FILE &>/dev/null
|
rm -f "${BACKUP_FILE}" &>/dev/null
|
||||||
sync
|
sync
|
||||||
StopProgress "done!"
|
StopProgress "done!"
|
||||||
|
|
||||||
@ -43,12 +37,10 @@ if [ -f "$BACKUP_FILE" ] ; then
|
|||||||
else
|
else
|
||||||
StopProgress "FAILED"
|
StopProgress "FAILED"
|
||||||
|
|
||||||
echo
|
echo -e "\nBackup file is not valid, or corrupt.\n"
|
||||||
echo "Backup file is not valid, or corrupt."
|
|
||||||
|
|
||||||
echo
|
|
||||||
StartProgress spinner "Removing file to allow normal restart... "
|
StartProgress spinner "Removing file to allow normal restart... "
|
||||||
rm -f $BACKUP_FILE &>/dev/null
|
rm -f "${BACKUP_FILE}" &>/dev/null
|
||||||
sync
|
sync
|
||||||
StopProgress "done"
|
StopProgress "done"
|
||||||
|
|
||||||
@ -57,5 +49,4 @@ if [ -f "$BACKUP_FILE" ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sync
|
|
||||||
reboot -f
|
reboot -f
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated make config: don't edit
|
||||||
# Busybox version: 1.32.0.git
|
# Busybox version: 1.32.0.git
|
||||||
# Sun Feb 2 19:50:06 2020
|
# Fri Jun 26 21:30:52 2020
|
||||||
#
|
#
|
||||||
CONFIG_HAVE_DOT_CONFIG=y
|
CONFIG_HAVE_DOT_CONFIG=y
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ CONFIG_UNAME_OSNAME="GNU/Linux"
|
|||||||
# CONFIG_BB_ARCH is not set
|
# CONFIG_BB_ARCH is not set
|
||||||
# CONFIG_UNIQ is not set
|
# CONFIG_UNIQ is not set
|
||||||
# CONFIG_UNLINK is not set
|
# CONFIG_UNLINK is not set
|
||||||
CONFIG_USLEEP=y
|
# CONFIG_USLEEP is not set
|
||||||
# CONFIG_UUDECODE is not set
|
# CONFIG_UUDECODE is not set
|
||||||
# CONFIG_BASE64 is not set
|
# CONFIG_BASE64 is not set
|
||||||
# CONFIG_UUENCODE is not set
|
# CONFIG_UUENCODE is not set
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated make config: don't edit
|
||||||
# Busybox version: 1.32.0.git
|
# Busybox version: 1.32.0.git
|
||||||
# Sun Feb 2 19:50:40 2020
|
# Fri Jun 26 19:45:09 2020
|
||||||
#
|
#
|
||||||
CONFIG_HAVE_DOT_CONFIG=y
|
CONFIG_HAVE_DOT_CONFIG=y
|
||||||
|
|
||||||
@ -857,18 +857,18 @@ CONFIG_FTPPUT=y
|
|||||||
CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y
|
CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y
|
||||||
CONFIG_HOSTNAME=y
|
CONFIG_HOSTNAME=y
|
||||||
CONFIG_DNSDOMAINNAME=y
|
CONFIG_DNSDOMAINNAME=y
|
||||||
CONFIG_HTTPD=y
|
# CONFIG_HTTPD is not set
|
||||||
CONFIG_FEATURE_HTTPD_RANGES=y
|
# CONFIG_FEATURE_HTTPD_RANGES is not set
|
||||||
CONFIG_FEATURE_HTTPD_SETUID=y
|
# CONFIG_FEATURE_HTTPD_SETUID is not set
|
||||||
CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
|
# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
|
||||||
CONFIG_FEATURE_HTTPD_AUTH_MD5=y
|
# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
|
||||||
CONFIG_FEATURE_HTTPD_CGI=y
|
# CONFIG_FEATURE_HTTPD_CGI is not set
|
||||||
CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y
|
# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
|
||||||
CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
|
# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
|
||||||
CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
|
# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
|
||||||
CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
|
# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
|
||||||
CONFIG_FEATURE_HTTPD_PROXY=y
|
# CONFIG_FEATURE_HTTPD_PROXY is not set
|
||||||
CONFIG_FEATURE_HTTPD_GZIP=y
|
# CONFIG_FEATURE_HTTPD_GZIP is not set
|
||||||
CONFIG_IFCONFIG=y
|
CONFIG_IFCONFIG=y
|
||||||
CONFIG_FEATURE_IFCONFIG_STATUS=y
|
CONFIG_FEATURE_IFCONFIG_STATUS=y
|
||||||
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
|
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
# httpd.conf has the following format:
|
|
||||||
#
|
|
||||||
# H:/serverroot # define the server root. It will override -h
|
|
||||||
# A:172.20. # Allow address from 172.20.0.0/16
|
|
||||||
# A:10.0.0.0/25 # Allow any address from 10.0.0.0-10.0.0.127
|
|
||||||
# A:10.0.0.0/255.255.255.128 # Allow any address that previous set
|
|
||||||
# A:127.0.0.1 # Allow local loopback connections
|
|
||||||
# D:* # Deny from other IP connections
|
|
||||||
# E404:/path/e404.html # /path/e404.html is the 404 (not found) error page
|
|
||||||
# I:index.html # Show index.html when a directory is requested
|
|
||||||
#
|
|
||||||
# P:/url:[http://]hostname[:port]/new/path
|
|
||||||
# # When /urlXXXXXX is requested, reverse proxy
|
|
||||||
# # it to http://hostname[:port]/new/pathXXXXXX
|
|
||||||
#
|
|
||||||
# /cgi-bin:foo:bar # Require user foo, pwd bar on urls starting with /cgi-bin/
|
|
||||||
# /adm:admin:setup # Require user admin, pwd setup on urls starting with /adm/
|
|
||||||
# /adm:toor:PaSsWd # or user toor, pwd PaSsWd on urls starting with /adm/
|
|
||||||
# .au:audio/basic # additional mime type for audio.au files
|
|
||||||
# *.php:/path/php # run xxx.php through an interpreter
|
|
||||||
#
|
|
||||||
# A/D may be as a/d or allow/deny - only first char matters.
|
|
||||||
# Deny/Allow IP logic:
|
|
||||||
# - Default is to allow all (Allow all (A:*) is a no-op).
|
|
||||||
# - Deny rules take precedence over allow rules.
|
|
||||||
# - "Deny all" rule (D:*) is applied last.
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# 1. Allow only specified addresses
|
|
||||||
# A:172.20 # Allow any address that begins with 172.20.
|
|
||||||
# A:10.10. # Allow any address that begins with 10.10.
|
|
||||||
# A:127.0.0.1 # Allow local loopback connections
|
|
||||||
# D:* # Deny from other IP connections
|
|
||||||
#
|
|
||||||
# 2. Only deny specified addresses
|
|
||||||
# D:1.2.3. # deny from 1.2.3.0 - 1.2.3.255
|
|
||||||
# D:2.3.4. # deny from 2.3.4.0 - 2.3.4.255
|
|
||||||
# A:* # (optional line added for clarity)
|
|
||||||
#
|
|
||||||
|
|
||||||
H:/usr/www # define the server root. It will override -h
|
|
||||||
A:* # Allow address from all ip's
|
|
||||||
E404:/usr/www/error/404.html # /path/e404.html is the 404 (not found) error page
|
|
||||||
I:index.html # Show index.html when a directory is requested
|
|
||||||
|
|
||||||
*.php:/usr/bin/php-cgi
|
|
@ -146,7 +146,6 @@ makeinstall_target() {
|
|||||||
mkdir -p $INSTALL/etc
|
mkdir -p $INSTALL/etc
|
||||||
cp $PKG_DIR/config/profile $INSTALL/etc
|
cp $PKG_DIR/config/profile $INSTALL/etc
|
||||||
cp $PKG_DIR/config/inputrc $INSTALL/etc
|
cp $PKG_DIR/config/inputrc $INSTALL/etc
|
||||||
cp $PKG_DIR/config/httpd.conf $INSTALL/etc
|
|
||||||
cp $PKG_DIR/config/suspend-modules.conf $INSTALL/etc
|
cp $PKG_DIR/config/suspend-modules.conf $INSTALL/etc
|
||||||
|
|
||||||
# /etc/fstab is needed by...
|
# /etc/fstab is needed by...
|
||||||
@ -160,13 +159,6 @@ makeinstall_target() {
|
|||||||
|
|
||||||
# create /etc/hostname
|
# create /etc/hostname
|
||||||
ln -sf /proc/sys/kernel/hostname $INSTALL/etc/hostname
|
ln -sf /proc/sys/kernel/hostname $INSTALL/etc/hostname
|
||||||
|
|
||||||
# add webroot
|
|
||||||
mkdir -p $INSTALL/usr/www
|
|
||||||
echo "It works" > $INSTALL/usr/www/index.html
|
|
||||||
|
|
||||||
mkdir -p $INSTALL/usr/www/error
|
|
||||||
echo "404" > $INSTALL/usr/www/error/404.html
|
|
||||||
}
|
}
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
|
@ -111,7 +111,7 @@ mount_common() {
|
|||||||
mount $MOUNT_OPTIONS $1 $2 >&$SILENT_OUT 2>&1
|
mount $MOUNT_OPTIONS $1 $2 >&$SILENT_OUT 2>&1
|
||||||
[ "$?" -eq "0" ] && ERR_ENV=0 && break
|
[ "$?" -eq "0" ] && ERR_ENV=0 && break
|
||||||
|
|
||||||
usleep 1000000
|
sleep 1
|
||||||
done
|
done
|
||||||
[ "$ERR_ENV" -eq "0" ] && return 0
|
[ "$ERR_ENV" -eq "0" ] && return 0
|
||||||
error "mount_common" "Could not mount $1"
|
error "mount_common" "Could not mount $1"
|
||||||
@ -442,7 +442,7 @@ do_reboot() {
|
|||||||
/usr/bin/busybox umount /storage
|
/usr/bin/busybox umount /storage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
usleep 2000000
|
sleep 2
|
||||||
/usr/bin/busybox reboot
|
/usr/bin/busybox reboot
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,7 +496,7 @@ check_disks() {
|
|||||||
if [ $i -eq 0 ]; then
|
if [ $i -eq 0 ]; then
|
||||||
progress "Device not found, continuing..."
|
progress "Device not found, continuing..."
|
||||||
else
|
else
|
||||||
usleep 500000
|
sleep 1
|
||||||
fi
|
fi
|
||||||
elif [ $(( $FSCK_RET & 4 )) -eq 4 ]; then
|
elif [ $(( $FSCK_RET & 4 )) -eq 4 ]; then
|
||||||
# errors left
|
# errors left
|
||||||
@ -1134,7 +1134,7 @@ if [ "$STORAGE_NETBOOT" = "yes" ]; then
|
|||||||
echo "" > /sysroot/dev/.storage_netboot
|
echo "" > /sysroot/dev/.storage_netboot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BACKUP_FILE=$(ls -1 /sysroot/storage/.restore/??????????????.tar 2>/dev/null | head -n 1)
|
BACKUP_FILE=$(ls -1 /sysroot/storage/.restore/*.tar 2>/dev/null | head -n 1)
|
||||||
|
|
||||||
if [ -f /sysroot/storage/.please_resize_me ]; then
|
if [ -f /sysroot/storage/.please_resize_me ]; then
|
||||||
INIT_UNIT="--unit=fs-resize.target"
|
INIT_UNIT="--unit=fs-resize.target"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user