forked from obel1x/fedora-OEMDRV
configure: use setup_system.inc.sh to get machineid for configuration
This commit is contained in:
@@ -20,14 +20,16 @@ unset _inc_arg
|
||||
#Get the machine_uuid wich is needed by some userspace programs.
|
||||
#As all Parameters that are bound to CPU or Mainboard, are only readable by root, we need to get the values at installtime.
|
||||
#On old installations without the file, we will write it whenever possible
|
||||
if [ -f $( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys ]; then
|
||||
export MACHINEID="$( cat $( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys )"
|
||||
MACHINEID_FILE="$( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys"
|
||||
if [ -f ${MACHINEID_FILE} ]; then
|
||||
export MACHINEID="$( cat ${MACHINEID_FILE} )"
|
||||
elif [ "$EUID" -eq 0 ]; then
|
||||
dmidecode -t system | grep -i 'UUID' \
|
||||
| sed 's/UUID: //' | tr '[:upper:]' '[:lower:]' \
|
||||
| sed 's/[^0-9a-z]*//g' | xargs | tail -c 13 \
|
||||
> "$( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys"
|
||||
export MACHINEID="$( cat $( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys )"
|
||||
> "${MACHINEID_FILE}"
|
||||
export MACHINEID="$( cat ${MACHINEID_FILE} )"
|
||||
echo "Wrote MACHINEID ${MACHINEID} to ${MACHINEID_FILE}"
|
||||
fi
|
||||
|
||||
#Check for configure.conf - used for first setup of system
|
||||
|
||||
Reference in New Issue
Block a user