1 pkg_postinst_${PN} () {
5 # It would be nice to run the code below while building an image,
6 # but currently the calls to cynara-db-chsgen (a binary) in
7 # cynara-db-migration (a script) prevent that. Rely instead
8 # on OE's support for running failed postinst scripts at first boot.
9 if [ x"$D" != "x" ]; then
13 mkdir -p $D${sysconfdir}/cynara
14 ${CHSMACK} -a System $D${sysconfdir}/cynara
16 # Strip git patch level information, the version comparison code
17 # in cynara-db-migration only expect major.minor.patch version numbers.
18 VERSION=${@d.getVar('PV',d,1).split('+git')[0]}
19 if [ -d $D${localstatedir}/cynara ] ; then
21 echo "NOTE: updating cynara DB to version $VERSION"
22 $D${sbindir}/cynara-db-migration upgrade -f 0.0.0 -t $VERSION
25 echo "NOTE: creating cynara DB for version $VERSION"
26 mkdir -p $D${localstatedir}/cynara
27 ${CHSMACK} -a System $D${localstatedir}/cynara
28 $D${sbindir}/cynara-db-migration install -t $VERSION
31 # Workaround for systemd.bbclass issue: it would call
32 # "systemctl start" without "--no-block", but because
33 # the service is not ready to run at the time when
34 # this scripts gets executed by run-postinsts.service,
36 echo "NOTE: enabling and starting cynara service"
37 systemctl enable cynara
38 systemctl start --no-block cynara