[OE-core] [PATCH] recipes-core: breakout hwclock.sh from busybox

Andre McCurdy armccurdy at gmail.com
Tue Jan 23 20:11:46 UTC 2018


On Tue, Jan 23, 2018 at 8:21 AM, Alex Stewart <alex.stewart at ni.com> wrote:
> * Move the hwclock.sh initscript from busybox into its own package and
>   recipe (hwclock-init). This script is generally useful for distros
>   that get their hwclock implementation from sources other than
>   busybox (like util-linux).
>
> :busybox/*
> * Remove the busybox-hwclock package, as it no longer has a purpose.
> * If busybox is configured to include hwclock, the busybox package will
>   RDEPEND on hwclock-init.
>
> :util-linux/*
> * util-linux-hwclock RDEPENDS on hwclock-init for its initscript.
>
> Signed-off-by: Alex Stewart <alex.stewart at ni.com>
> ---
>  meta/recipes-core/busybox/busybox.inc              | 16 +++--
>  meta/recipes-core/busybox/busybox_1.27.2.bb        |  1 -
>  meta/recipes-core/busybox/files/hwclock.sh         | 83 ----------------------
>  meta/recipes-core/hwclock-init/files/hwclock.sh    | 83 ++++++++++++++++++++++
>  meta/recipes-core/hwclock-init/hwclock-init_1.0.bb | 31 ++++++++
>  meta/recipes-core/util-linux/util-linux.inc        |  1 +
>  6 files changed, 124 insertions(+), 91 deletions(-)
>  delete mode 100644 meta/recipes-core/busybox/files/hwclock.sh
>  create mode 100644 meta/recipes-core/hwclock-init/files/hwclock.sh
>  create mode 100644 meta/recipes-core/hwclock-init/hwclock-init_1.0.bb
>
> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
> index 4012f921c6..bfcc6ba31a 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -377,6 +372,13 @@ python do_package_prepend () {
>      else:
>          set_alternative_vars("${sysconfdir}/busybox.links.nosuid", "${base_bindir}/busybox.nosuid")
>          set_alternative_vars("${sysconfdir}/busybox.links.suid", "${base_bindir}/busybox.suid")
> +
> +    # If busybox is configured to provide a hwclock implementation, add a
> +    # package dependency on hwclock-init for the /etc/init.d/hwclock.sh
> +    # initscript.
> +    with open(d.getVar('B', expand=True) + '/.config', 'r') as fp_conf:

Typical style is to not include expand=True in calls to getVar().

> +        if 'CONFIG_HWCLOCK=y' in fp_conf.read():
> +            d.appendVar('RDEPENDS_busybox', ' hwclock-init ')
>  }
>
>  pkg_postinst_${PN} () {



More information about the Openembedded-core mailing list