Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Commit

Permalink
dbus: Add a Linux post-link for CI systems
Browse files Browse the repository at this point in the history
Travis-CI does not have an `/etc/machine-id` file which dbus
would otherwise use as a UUID. However, before checking that
file it looks for `${PREFIX}/var/lib/dbus/machine-id`.

When necessary we create `${PREFIX}/var/lib/dbus/machine-id`
from `/proc/sys/kernel/random/boot_id` or else `/dev/random`
  • Loading branch information
mingwandroid committed Sep 6, 2016
1 parent b8e4af6 commit e8b4bc1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dbus/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ source:
sha1: e1d3dedd1d2b7305464d6892579fee3ad9639355

build:
number: 1
number: 3
detect_binary_files_with_prefix: true

requirements:
build:
Expand Down
14 changes: 14 additions & 0 deletions dbus/post-link.sh.Linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
if [ ! -f /etc/machine-id ]; then
echo "dbus post-link :: /etc/machine-id not found .." >> ${PREFIX}/.messages.txt
if [ ! -d ${PREFIX}/var/lib/dbus ]; then
mkdir -p ${PREFIX}/var/lib/dbus
fi
if [ -f /proc/sys/kernel/random/boot_id ]; then
echo "dbus post-link :: .. using /proc/sys/kernel/random/boot_id" >> ${PREFIX}/.messages.txt
cat /proc/sys/kernel/random/boot_id | tr -d '-' > ${PREFIX}/var/lib/dbus/machine-id
else
echo "dbus post-link :: .. /proc/sys/kernel/random/boot_id not found either .." >> ${PREFIX}/.messages.txt
echo "dbus post-link :: .. using /dev/random" >> ${PREFIX}/.messages.txt
od -N16 -An -tx1 < /dev/random | tr -d '[:space:]' > ${PREFIX}/var/lib/dbus/machine-id
fi
fi

0 comments on commit e8b4bc1

Please sign in to comment.