Skip to contentSkip to conversation

Don't have hwclock init scripts for machines without rtc

PATCH Applied Andrei Gherzan 3 participants 10 messages Aug 16, 2012 – Sep 3, 2012

lore
Share & tools
lore
#0 lore raw

v2 cover Don't have hwclock init scripts for machines without rtc

V2:
Remove: 3f88694 subversion: Add gettext to DEPENDS as msgfmt is needed at compile time Sent as (it should be) a different pull request.

I dropped the idea of maching Busybox HW dependent. A bad idea indeed. Now, hwclock init script is packaged separately and pulled into image only if MACHINE_FEATURES contains rtc value. The inclusion of rtc is done in a BACKFILL way.

The following changes since commit af847d36375aa53f0c1ee2a00c97ba9f38837d1b:

bitbake: bitbake: build.py: Add stampdir argument to cached_mtime_noerror (2012-08-16 12:27:41 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ag/backfill-busybox
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/backfill-busybox

Andrei Gherzan (6):
utils.py: Modify and rename distro_features_backfill python function bitbake.conf: Use the new form of features_backfill function bitbake.conf: Add MACHINE_FEATURES_BACKFILL and append to
MACHINE_FEATURES
bitbake.conf: Add rtc to MACHINE_FEATURES_BACKFILL
task-core-boot: Add busybox-hwclock if MACHINE_FEATURES contains rtc
busybox: Package hwclock.sh initscript separately

 meta/conf/bitbake.conf                    |    5 ++++-
 meta/lib/oe/utils.py                      |    9 ++++++---
 meta/recipes-core/busybox/busybox.inc     |    5 +++--
 meta/recipes-core/tasks/task-core-boot.bb |    1 +
 4 files changed, 14 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/6 utils.py: Modify and rename distro_features_backfill python function

This function was written to be used with DISTRO_FEATURES. This behavior is usefull with MACHINE_FEATURES as well.

---
 meta/lib/oe/utils.py |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta/lib/oe/utils.py +6 -3
index e14743f..8d3efe4 100644
@@ -87,15 +87,18 @@ def inherits(d, *classes):
     """Return True if the metadata inherits any of the specified classes"""
     return any(bb.data.inherits_class(cls, d) for cls in classes)
 
-def distro_features_backfill(d):
+def features_backfill(var,d):
+    # This construct allows the addition of new features to variable specified
+    # as var
+    # Example for var = "DISTRO_FEATURES"
     # This construct allows the addition of new features to DISTRO_FEATURES
     # that if not present would disable existing functionality, without
     # disturbing distributions that have already set DISTRO_FEATURES.
     # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should
     # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED
 
-    backfill = (d.getVar("DISTRO_FEATURES_BACKFILL", True) or "").split()
-    considered = (d.getVar("DISTRO_FEATURES_BACKFILL_CONSIDERED", True) or "").split()
+    backfill = (d.getVar(var+"_BACKFILL", True) or "").split()
+    considered = (d.getVar(var+"_BACKFILL_CONSIDERED", True) or "").split()
 
     addfeatures = []
     for feature in backfill:
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 2/6 bitbake.conf: Use the new form of features_backfill function

This function was modified in order to be used with other variables then DISTRO_FEATURES. Use this new function name and add the parameter needed.

---
 meta/conf/bitbake.conf |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index 8074684..296ebc1 100644
@@ -722,7 +722,7 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
 IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
 
 DISTRO_FEATURES_BACKFILL = "pulseaudio"
-DISTRO_FEATURES_append = "${@oe.utils.distro_features_backfill(d)}"
+DISTRO_FEATURES_append = "${@oe.utils.features_backfill("DISTRO_FEATURES",d)}"
 
 COMBINED_FEATURES = "\
     ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "alsa", d)} \
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 3/6 bitbake.conf: Add MACHINE_FEATURES_BACKFILL and append to MACHINE_FEATURES

In reply to Andrei Gherzan

This is works the way DISTRO_FEATURES_BACKFILL does.

---
 meta/conf/bitbake.conf |    3 +++
 1 file changed, 3 insertions(+)
meta/conf/bitbake.conf +3 -0
index 296ebc1..4773d50 100644
@@ -724,6 +724,9 @@ IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
 DISTRO_FEATURES_BACKFILL = "pulseaudio"
 DISTRO_FEATURES_append = "${@oe.utils.features_backfill("DISTRO_FEATURES",d)}"
 
+MACHINE_FEATURES_BACKFILL = ""
+MACHINE_FEATURES_append = "${@oe.utils.features_backfill("MACHINE_FEATURES",d)}"
+
 COMBINED_FEATURES = "\
     ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "alsa", d)} \
     ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "bluetooth", d)} \
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v2 4/6 bitbake.conf: Add rtc to MACHINE_FEATURES_BACKFILL

In reply to Andrei Gherzan

This was done this way so that the current machine configuration would remain unaffected.
The rtc MACHINE_FEATURE will specify if a real time clock is avalaible.

---
 meta/conf/bitbake.conf |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index 4773d50..bc2d47d 100644
@@ -724,7 +724,7 @@ IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
 DISTRO_FEATURES_BACKFILL = "pulseaudio"
 DISTRO_FEATURES_append = "${@oe.utils.features_backfill("DISTRO_FEATURES",d)}"
 
-MACHINE_FEATURES_BACKFILL = ""
+MACHINE_FEATURES_BACKFILL = "rtc"
 MACHINE_FEATURES_append = "${@oe.utils.features_backfill("MACHINE_FEATURES",d)}"
 
 COMBINED_FEATURES = "\
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v2 5/6 task-core-boot: Add busybox-hwclock if MACHINE_FEATURES contains rtc

In reply to Andrei Gherzan

For machines with no hardware clock it makes no sense to have this init stript. Moreover, we avoid a boot error in this way.

---
 meta/recipes-core/tasks/task-core-boot.bb |    1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/tasks/task-core-boot.bb +1 -0
index 6487436..2947509 100644
@@ -34,6 +34,7 @@ RDEPENDS_task-core-boot = "\
     base-files \
     base-passwd \
     busybox \
+    ${@base_contains("MACHINE_FEATURES", "rtc", "busybox-hwclock", "", d)} \
     ${VIRTUAL-RUNTIME_initscripts} \
     ${@base_contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
     modutils-initscripts \
Signature · 1 line
1.7.9.5
#6 lore raw

Re: [V2 PATCH 5/6] task-core-boot: Add busybox-hwclock if MACHINE_FEATURES contains rtc

Quoted 13 lines · On Friday 17 August 2012 01:28:51 Andrei Gherzan wrote:

For machines with no hardware clock it makes no sense to have this init stript. Moreover, we avoid a boot error in this way.

---
 meta/recipes-core/tasks/task-core-boot.bb |    1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/meta/recipes-core/tasks/task-core-boot.bb index 6487436..2947509 100644

meta/recipes-core/tasks/task-core-boot.bb RDEPENDS_task-core-boot = "\ · line 40

Quoted 7 lines
meta/recipes-core/tasks/task-core-boot.bb +1 -0
@@ -34,6 +34,7 @@ RDEPENDS_task-core-boot = "\
     base-files \
     base-passwd \
     busybox \
+    ${@base_contains("MACHINE_FEATURES", "rtc", "busybox-hwclock", "", d)}
 \ ${VIRTUAL-RUNTIME_initscripts} \
     ${@base_contains("MACHINE_FEATURES", "keyboard",
 "${VIRTUAL-RUNTIME_keymaps}", "", d)} \ modutils-initscripts \

Why did this get added to task-core-boot? This is meant only to contain items that are essential for booting; I'm not sure that support for the rtc qualifies.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#7 lore raw

Re: [V2 PATCH 5/6] task-core-boot: Add busybox-hwclock if MACHINE_FEATURES contains rtc

Quoted 12 lines · Paul Eggleton
Quoted 10 lines · On Friday 17 August 2012 01:28:51 Andrei Gherzan wrote:

For machines with no hardware clock it makes no sense to have this init stript. Moreover, we avoid a boot error in this way.

---
 meta/recipes-core/tasks/task-core-boot.bb |    1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/meta/recipes-core/tasks/task-core-boot.bb index 6487436..2947509

100644

Quoted 7 lines

meta/recipes-core/tasks/task-core-boot.bb RDEPENDS_task-core-boot = "\ · line 36

Quoted 6 lines
meta/recipes-core/tasks/task-core-boot.bb +0 -0
@@ -34,6 +34,7 @@ RDEPENDS_task-core-boot = "\
     base-files \
     base-passwd \
     busybox \

busybox-hwclock contains the hwclock init script. Before this change that script was included in busybox main package which was added to this task. I didn't want to move this package as this change would have been a different commit - to move stuff from stuff - and because i didn't want to break anything around.

ag

Quoted 19 lines

meta/recipes-core/tasks/task-core-boot.bb RDEPENDS_task-core-boot = "\ · line 37

Quoted 1 line
meta/recipes-core/tasks/task-core-boot.bb +1 -0
+    ${@base_contains("MACHINE_FEATURES", "rtc", "busybox-hwclock", "",

d)}

meta/recipes-core/tasks/task-core-boot.bb RDEPENDS_task-core-boot = "\ · line 40

Quoted 3 lines
meta/recipes-core/tasks/task-core-boot.bb +0 -0
 \ ${VIRTUAL-RUNTIME_initscripts} \
     ${@base_contains("MACHINE_FEATURES", "keyboard",
 "${VIRTUAL-RUNTIME_keymaps}", "", d)} \ modutils-initscripts \

Why did this get added to task-core-boot? This is meant only to contain items
that are essential for booting; I'm not sure that support for the rtc qualifies.

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre

#8 lore raw

PATCH v2 6/6 busybox: Package hwclock.sh initscript separately

In reply to Andrei Gherzan

We package this separately to be able to pull this in only if this makes sense for the MACHINE.

---
 meta/recipes-core/busybox/busybox.inc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-core/busybox/busybox.inc +3 -2
index 78239a2..5a5b383 100644
@@ -14,15 +14,16 @@ SECTION = "base"
 export EXTRA_CFLAGS = "${CFLAGS}"
 export EXTRA_LDFLAGS = "${LDFLAGS}"
 
-PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev"
+PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
 
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
 FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf*"
 FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf"
 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"
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock""
 
 INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
 INITSCRIPT_NAME_${PN}-syslog = "syslog"
Signature · 1 line
1.7.9.5
Applied
#9 lore raw
In reply to Andrei Gherzan
Quoted 27 lines · Andrei Gherzan

V2:
Remove: 3f88694 subversion: Add gettext to DEPENDS as msgfmt is needed at compile time Sent as (it should be) a different pull request.

I dropped the idea of maching Busybox HW dependent. A bad idea indeed. Now, hwclock init script is packaged separately and pulled into image only if MACHINE_FEATURES contains rtc value. The inclusion of rtc is done in a BACKFILL way.

The following changes since commit af847d36375aa53f0c1ee2a00c97ba9f38837d1b:

   bitbake: bitbake: build.py: Add stampdir argument to cached_mtime_noerror (2012-08-16 12:27:41 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ag/backfill-busybox
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/backfill-busybox

Andrei Gherzan (6):
utils.py: Modify and rename distro_features_backfill python function bitbake.conf: Use the new form of features_backfill function bitbake.conf: Add MACHINE_FEATURES_BACKFILL and append to
MACHINE_FEATURES
bitbake.conf: Add rtc to MACHINE_FEATURES_BACKFILL
task-core-boot: Add busybox-hwclock if MACHINE_FEATURES contains rtc
busybox: Package hwclock.sh initscript separately

Quoted 6 lines
  meta/conf/bitbake.conf                    |    5 ++++-
  meta/lib/oe/utils.py                      |    9 ++++++---
  meta/recipes-core/busybox/busybox.inc     |    5 +++--
  meta/recipes-core/tasks/task-core-boot.bb |    1 +
  4 files changed, 14 insertions(+), 6 deletions(-)

Merged into OE-Core

Thanks
Sau!