meta-nicole: phosphor-ipmi-config: Set device id

This adds a dev_id.json with Nicole specific values and a systemd unit
which changes at the boot time the device ID in the dev_id.json to the
actual BMC position.

Tested: `ipmitool mc info` now shows the actual BMC position in the
        Device ID field.

(From meta-yadro rev: 8dcdb1ef8661b2f5624d75787bd4bcc4da8301d7)

Change-Id: Ia819ef4154ffe368ca9684662c248295060e0597
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config-set-device-id.sh b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config-set-device-id.sh
new file mode 100755
index 0000000..6600ced
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config-set-device-id.sh
@@ -0,0 +1,5 @@
+#!/bin/sh -eu
+
+BMCPOS=$(awk -v RS=" " '/^bmcposition=/{print substr($0,13)}' /proc/cmdline)
+sed -r "s/\"id\"\s*:\s*[0-9]+\s*,/\"id\": ${BMCPOS:-0},/" -i \
+    /usr/share/ipmi-providers/dev_id.json