From 9715ae0aa5734d04ad3f4a573850fafe304b0066 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Fri, 12 Jul 2013 23:44:12 +0200 Subject: [PATCH] busybox: create /etc/machine-id (symlink from /run/machine-id), used by systemd, dbus and replaces '$SYSTEMID' Signed-off-by: Stephan Raue --- .../02-systemid.conf => init.d/03_systemid} | 18 ++++++++++-------- packages/sysutils/busybox/install | 3 +++ 2 files changed, 13 insertions(+), 8 deletions(-) rename packages/sysutils/busybox/{profile.d/02-systemid.conf => init.d/03_systemid} (77%) diff --git a/packages/sysutils/busybox/profile.d/02-systemid.conf b/packages/sysutils/busybox/init.d/03_systemid similarity index 77% rename from packages/sysutils/busybox/profile.d/02-systemid.conf rename to packages/sysutils/busybox/init.d/03_systemid index 0e72138c15..9a9b680f0d 100644 --- a/packages/sysutils/busybox/profile.d/02-systemid.conf +++ b/packages/sysutils/busybox/init.d/03_systemid @@ -17,13 +17,13 @@ # the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. # 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 MAC_ADRESS=`cat /sys/class/net/eth0/address` @@ -32,7 +32,9 @@ elif [ -e "/sys/class/net/wlan0/address" ]; then fi 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 -export SYSTEMID +echo "$MACHINEID" > /run/machine-id diff --git a/packages/sysutils/busybox/install b/packages/sysutils/busybox/install index df3e60754f..85f22b8a2b 100755 --- a/packages/sysutils/busybox/install +++ b/packages/sysutils/busybox/install @@ -59,6 +59,9 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $USER_PASSWORD`" # /etc/fstab is needed by... 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 ln -sf /var/cache/hosts $INSTALL/etc/hosts