mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 14:16:40 +00:00
busybox: port machine-id script setup to systemd
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
05029fcaf7
commit
85c9783459
@ -98,6 +98,11 @@ pre_make_target() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
post_makeinstall_target() {
|
post_makeinstall_target() {
|
||||||
|
# replace systemd-machine-id-setup with ours
|
||||||
|
mkdir -p $INSTALL/bin
|
||||||
|
rm -rf $INSTALL/bin/systemd-machine-id-setup
|
||||||
|
cp $PKG_DIR/scripts/systemd-machine-id-setup $INSTALL/bin
|
||||||
|
|
||||||
# provide 'halt', 'shutdown', 'reboot' & co.
|
# provide 'halt', 'shutdown', 'reboot' & co.
|
||||||
mkdir -p $INSTALL/sbin
|
mkdir -p $INSTALL/sbin
|
||||||
ln -sf /bin/systemctl $INSTALL/sbin/halt
|
ln -sf /bin/systemctl $INSTALL/sbin/halt
|
||||||
@ -148,4 +153,6 @@ post_install() {
|
|||||||
add_group tty 5
|
add_group tty 5
|
||||||
add_group video 39
|
add_group video 39
|
||||||
add_group utmp 22
|
add_group utmp 22
|
||||||
|
|
||||||
|
enable_service machine-id.service
|
||||||
}
|
}
|
||||||
|
9
packages/sysutils/busybox/init.d/03_systemid → packages/sysutils/systemd/scripts/systemd-machine-id-setup
Normal file → Executable file
9
packages/sysutils/busybox/init.d/03_systemid → packages/sysutils/systemd/scripts/systemd-machine-id-setup
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
################################################################################
|
################################################################################
|
||||||
# This file is part of OpenELEC - http://www.openelec.tv
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
@ -22,8 +23,10 @@
|
|||||||
# MACHINEID SHOULD be the same between upgrades/reinstalls
|
# MACHINEID SHOULD be the same between upgrades/reinstalls
|
||||||
# MAC is hashed so that it cant be reversed making it anonymous
|
# 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
|
# Used to help with global usage statistics, also used for dbus and systemd
|
||||||
#
|
|
||||||
# runlevels: openelec, installer, textmode
|
# creating machine-id, systemd otherwise does this automatically if not present.
|
||||||
|
# this we want to avoid to have the same machine-id over reboot, fallback
|
||||||
|
# to systemd's solution if this dont work here
|
||||||
|
|
||||||
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`
|
||||||
@ -33,8 +36,6 @@ fi
|
|||||||
|
|
||||||
if [ -n "$MAC_ADRESS" ]; then
|
if [ -n "$MAC_ADRESS" ]; then
|
||||||
MACHINEID=`echo $MAC_ADRESS | md5sum | cut -f1 -d" "`
|
MACHINEID=`echo $MAC_ADRESS | md5sum | cut -f1 -d" "`
|
||||||
else
|
|
||||||
MACHINEID="00000000000000000000000000000000"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$MACHINEID" > /run/machine-id
|
echo "$MACHINEID" > /run/machine-id
|
12
packages/sysutils/systemd/system.d/machine-id.service
Normal file
12
packages/sysutils/systemd/system.d/machine-id.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Setup machine-id
|
||||||
|
DefaultDependencies=no
|
||||||
|
After=local-fs.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/systemd-machine-id-setup
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sysinit.target
|
Loading…
x
Reference in New Issue
Block a user