src/install: resolve device path before comparison in determine_slot_states()
src/install: resolve device path before comparison in determine_slot_states()

Especially in cases where standard device paths (such as /dev/sdb) are
not persistent over reboots, one might need to use symlink pathes
generated by standard or custom udev rules. A good example for this are
the /dev/disk-by-* symlinked device paths.

As RAUC uses the device path to string-compare against the `root=`
kernel command line argument it will not match against a system config
slot entry with a symlink device path such as

  [slot.rootfs.0]
  device=/dev/disk/by-path/pci-0000:00:17.0-ata-1-part1
  ...

This patch resolves this by calling `realpath()` to always get the
canonicalized absolute pathname of the `device` parameter when comparing
against boot slot device name as provided by root= kernel command line.

To not change behavior in existing scenarios, a failed realpath call
(e.g. due to missing path) will result in a message printed and using
the original s->device value instead.

Signed-off-by: Enrico Jorns <a2e5f936c390f36494e46e71bcfbe365bb1e8c49@pengutronix.de>

rauc/rauc,jluebbe/rauc,ejoerns/rauc,jluebbe/rauc,rauc/rauc,rauc/rauc,ejoerns/rauc,ejoerns/rauc,jluebbe/rauc