2

I'm building a Poky-based embedded Linux distribution for a target which doesn't have a real-time clock. System time is only set by ntpd. Therefore I don't really need an init script which calls hwclock --hctosys during boot, and in fact I'm afraid that this might cause the system time which is set by ntpd to be overwritten with an incorrect value.

So how do I get rid of the hwclock init script? It turns out that it comes from the busybox recipe. The default recipe for busybox in Poky contains the following lines:

PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
...
FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
...
INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
...
INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"

I have no idea how to remove all the references to hwclock from within a *.bbappend file. Is there any straightforward solution, or is it not possible from a bbappend and I have to re-write the entire recipe?

Georg P.
  • 2,785
  • 2
  • 27
  • 53

2 Answers2

4

You can disable it from its defconfig file by configuring CONFIG_HWCLOCK=n located at openembedded-core/meta/recipes-core/busybox/busybox/defconfig.

Krupal Tharwala
  • 1,036
  • 9
  • 16
  • 1
    Thanks for your answer! I actually did try this before, but that causes a problem when building the rootfs for the base image. The relevant lines from the error output are `satisfy_dependencies_for: Cannot satisfy the following dependencies for packagegroup-core-boot: busybox-hwclock opkg_install: Cannot install package packagegroup-core-boot.'` Any idea how to solve that? – Georg P. Jan 23 '18 at 05:53
  • Ok, I found the solution! This change together with `MACHINE_FEATURES_BACKFILL_CONSIDERED += "rtc"` in the machine config file did the trick. It is actually explicitly explained in the [Yocto Reference Manual](http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-features-backfill) – Georg P. Jan 23 '18 at 08:06
0

If you want to exclude packages from a build and don't want to resort to manipulating working recipes, just so a PACKAGE_EXCLUDE = "<package_name>" in your local.conf

This is an example of mine: PACKAGE_EXCLUDE = "busybox-syslog busybox-hwclock" But note that some packages may depend on hwclock. You'll get a bitbake dependency error at worst.

Chip Brommer
  • 103
  • 9