Skip to content

Commit

Permalink
gpsd: Fix gpsd Yocto pyro build for read only rootfs
Browse files Browse the repository at this point in the history
Attempting to include gpsd on Yocto pyro with IMAGE_FEATURES including
read-only-rootfs results in an error:
"The following packages could not be configured offline and rootfs is
read-only"

This stems from a failure during the do_rootfs steps where the /etc/init.d/gpsd
file is missing during the call to update-rc.d.

This happens because the /etc/init.d/gpsd file is installed during
package install for gpsd-conf instead of gpsd, and the default value for
INITSCRIPT_PACKAGES is PN.  To resolve, specify INITSCRIPT_PACKAGES as
gpsd-conf instead.

Also, as suggested on the Yocto mailing list, refactor to inherit
update-alternatives and use this to replace the postinst and postrm
steps.

Signed-off-by: Dan Walkes <[email protected]>
Signed-off-by: Martin Jansa <[email protected]>
  • Loading branch information
dwalkes authored and shr-project committed Oct 15, 2017
1 parent 8ceeb8b commit 0b62032
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions meta-oe/recipes-navigation/gpsd/gpsd_3.16.bb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
SRC_URI[md5sum] = "68691b5de4c94f82ec4062b042b5eb63"
SRC_URI[sha256sum] = "03579af13a4d3fe0c5b79fa44b5f75c9f3cac6749357f1d99ce5d38c09bc2029"

inherit scons update-rc.d python-dir pythonnative systemd bluetooth
inherit scons update-rc.d python-dir pythonnative systemd bluetooth update-alternatives

INITSCRIPT_PACKAGES = "gpsd-conf"
INITSCRIPT_NAME = "gpsd"
INITSCRIPT_PARAMS = "defaults 35"

Expand Down Expand Up @@ -86,14 +87,6 @@ do_install_append() {
install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
}

pkg_postinst_${PN}-conf() {
update-alternatives --install ${sysconfdir}/default/gpsd gpsd-defaults ${sysconfdir}/default/gpsd.default 10
}

pkg_postrm_${PN}-conf() {
update-alternatives --remove gpsd-defaults ${sysconfdir}/default/gpsd.default
}

PACKAGES =+ "libgps libgpsd python-pygps-dbg python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"

FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
Expand Down Expand Up @@ -133,3 +126,9 @@ RPROVIDES_${PN} += "${PN}-systemd"
RREPLACES_${PN} += "${PN}-systemd"
RCONFLICTS_${PN} += "${PN}-systemd"
SYSTEMD_SERVICE_${PN} = "${PN}.socket"


ALTERNATIVE_${PN} = "gpsd-defaults"
ALTERNATIVE_PATH = "${sysconfdir}/default/gpsd.default"
ALTERNATIVE_LINK = "${sysconfdir}/default/gpsd"
ALTERNATIVE_TARGET = "${sysconfdir}/default/gpsd.default"

0 comments on commit 0b62032

Please sign in to comment.