mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
busybox: create /etc/machine-id (symlink from /run/machine-id), used by systemd, dbus and replaces '$SYSTEMID'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
8523c8f9da
commit
9715ae0aa5
@ -17,13 +17,13 @@
|
|||||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
# Attempts to generate a unique system ID based on one local MAC address
|
|
||||||
# SystemID SHOULD be the same between upgrades/reinstalls
|
|
||||||
# MAC is hashed so that it cant be reversed making it anonymous
|
|
||||||
# Used to help with global usage statistics
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
SYSTEMID="00000000000000000000000000000000"
|
# Attempts to generate a unique machine ID based on one local MAC address
|
||||||
|
# MACHINEID SHOULD be the same between upgrades/reinstalls
|
||||||
|
# MAC is hashed so that it cant be reversed making it anonymous
|
||||||
|
# Used to help with global usage statistics, also used for dbus and systemd
|
||||||
|
#
|
||||||
|
# runlevels: openelec, installer, textmode
|
||||||
|
|
||||||
if [ -e "/sys/class/net/eth0/address" ]; then
|
if [ -e "/sys/class/net/eth0/address" ]; then
|
||||||
MAC_ADRESS=`cat /sys/class/net/eth0/address`
|
MAC_ADRESS=`cat /sys/class/net/eth0/address`
|
||||||
@ -32,7 +32,9 @@ elif [ -e "/sys/class/net/wlan0/address" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$MAC_ADRESS" ]; then
|
if [ -n "$MAC_ADRESS" ]; then
|
||||||
SYSTEMID=`echo $MAC_ADRESS | md5sum | cut -f1 -d" "`
|
MACHINEID=`echo $MAC_ADRESS | md5sum | cut -f1 -d" "`
|
||||||
|
else
|
||||||
|
MACHINEID="00000000000000000000000000000000"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SYSTEMID
|
echo "$MACHINEID" > /run/machine-id
|
@ -59,6 +59,9 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $USER_PASSWORD`"
|
|||||||
# /etc/fstab is needed by...
|
# /etc/fstab is needed by...
|
||||||
touch $INSTALL/etc/fstab
|
touch $INSTALL/etc/fstab
|
||||||
|
|
||||||
|
# /etc/machine-id, needed by systemd and dbus
|
||||||
|
ln -sf /run/machine-id $INSTALL/etc/machine-id
|
||||||
|
|
||||||
# /etc/hosts must be writeable
|
# /etc/hosts must be writeable
|
||||||
ln -sf /var/cache/hosts $INSTALL/etc/hosts
|
ln -sf /var/cache/hosts $INSTALL/etc/hosts
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user