Re: [OE-core] [PATCH] recipes-core: breakout hwclock.sh from busybox
On 1/23/18 8:21 AM, Alex Stewart 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> --- > 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 > @@ -20,19 +20,17 @@ export EXTRA_LDFLAGS = "${LDFLAGS}" > > EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} > CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}' > HOSTCPP='${BUILD_CPP}'" > > -PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev > ${PN}-hwclock" > +PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev" > > FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" > FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* > ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* > ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog" > FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf > ${sysconfdir}/mdev/*" > FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" > FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc" > -FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh" > > -INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev > ${PN}-hwclock" > +INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev" > > INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd" > -INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh" > INITSCRIPT_NAME_${PN}-mdev = "mdev" > INITSCRIPT_PARAMS_${PN}-mdev = "start 04 S ." > INITSCRIPT_NAME_${PN}-syslog = "syslog" > @@ -276,9 +274,6 @@ do_install () { > if grep "CONFIG_UDHCPD=y" ${B}/.config; then > install -m 0755 ${WORKDIR}/busybox-udhcpd > ${D}${sysconfdir}/init.d/ > fi > - if grep "CONFIG_HWCLOCK=y" ${B}/.config; then > - install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ > - fi > if grep "CONFIG_UDHCPC=y" ${B}/.config; then > install -d ${D}${sysconfdir}/udhcpc.d > install -d ${D}${datadir}/udhcpc > @@ -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: > +if 'CONFIG_HWCLOCK=y' in fp_conf.read(): > +d.appendVar('RDEPENDS_busybox', ' hwclock-init ') I wonder if it has some implications when rebuilding from shared state since .config might not be there -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] recipes-core: breakout hwclock.sh from busybox
On Tue, Jan 23, 2018 at 8:21 AM, Alex Stewartwrote: > * 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 > --- > 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} () { -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] recipes-core: breakout hwclock.sh from busybox
On Tue, Jan 23, 2018 at 2:21 PM, Alex Stewartwrote: > * 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 Acked-by: Otavio Salvador Sorry for being picky about it but I think it was worth it. Thanks for your patience :-) -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] recipes-core: breakout hwclock.sh from busybox
* 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--- 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 @@ -20,19 +20,17 @@ export EXTRA_LDFLAGS = "${LDFLAGS}" EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}' HOSTCPP='${BUILD_CPP}'" -PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock" +PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev" FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog" FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/mdev/*" FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc" -FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh" -INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock" +INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev" INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd" -INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh" INITSCRIPT_NAME_${PN}-mdev = "mdev" INITSCRIPT_PARAMS_${PN}-mdev = "start 04 S ." INITSCRIPT_NAME_${PN}-syslog = "syslog" @@ -276,9 +274,6 @@ do_install () { if grep "CONFIG_UDHCPD=y" ${B}/.config; then install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ fi - if grep "CONFIG_HWCLOCK=y" ${B}/.config; then - install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ - fi if grep "CONFIG_UDHCPC=y" ${B}/.config; then install -d ${D}${sysconfdir}/udhcpc.d install -d ${D}${datadir}/udhcpc @@ -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: +if 'CONFIG_HWCLOCK=y' in fp_conf.read(): +d.appendVar('RDEPENDS_busybox', ' hwclock-init ') } pkg_postinst_${PN} () { diff --git a/meta/recipes-core/busybox/busybox_1.27.2.bb b/meta/recipes-core/busybox/busybox_1.27.2.bb index 6c1f4888cf..af2abadc5e 100644 --- a/meta/recipes-core/busybox/busybox_1.27.2.bb +++ b/meta/recipes-core/busybox/busybox_1.27.2.bb @@ -8,7 +8,6 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://busybox-udhcpd \ file://default.script \ file://simple.script \ - file://hwclock.sh \ file://mount.busybox \ file://syslog \ file://syslog-startup.conf \ diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh deleted file mode 100644 index be5f94d86c..00 --- a/meta/recipes-core/busybox/files/hwclock.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: hwclock -# Required-Start: -# Required-Stop: $local_fs -# Default-Start: S -# Default-Stop: 0 6 -# Short-Description: Set system clock -# Description: Set system clock to hardware clock, according to the UTC -#