Skip to contentSkip to conversation

stress-ng: create a symlink for /usr/bin/stress

PATCH Superseded Dan Callaghan 2 participants 5 messages Jul 23, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stress-ng: create a symlink for /usr/bin/stress

In commit 72641004, stress-ng was made to provide the stress package, because it's backwards compatible with the old stress command. But it doesn't actually provide /usr/bin/stress which is what other recipes depending on stress will expect.

Symlink /usr/bin/stress to stress-ng so that it actually becomes a drop-in replacement for stress.

---
 meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb +1 -0
index 8ea0476db5..dcded1120d 100644
@@ -22,5 +22,6 @@ inherit bash-completion
 
 do_install() {
     oe_runmake DESTDIR=${D} install
+    ln -s stress-ng ${D}/usr/bin/stress
 }
 
Signature · 1 line
2.25.4
#1 lore raw

Hi Dan

Quoted 18 lines · Dan Callaghan

In commit 72641004, stress-ng was made to provide the stress package, because it's backwards compatible with the old stress command. But it doesn't actually provide /usr/bin/stress which is what other recipes depending on stress will expect.

Symlink /usr/bin/stress to stress-ng so that it actually becomes a drop-in replacement for stress.

---
 meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb +0 -0
index 8ea0476db5..dcded1120d 100644

meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb inherit bash-completion · line 25

Quoted 4 lines
meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb +1 -0
@@ -22,5 +22,6 @@ inherit bash-completion
 
 do_install() {
     oe_runmake DESTDIR=${D} install
+    ln -s stress-ng ${D}/usr/bin/stress

there is stress recipe in some layers which could provide stress utility as well, therefore it should be using update-alternatives mechanism so it fills in when stress is not provided by say stress recipe.

secondly please use ${D}${bindir}/stress instead of hardcoding the path

Quoted 6 lines
meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb +0 -0
 }
 
#2 lore raw

Excerpts from Khem Raj's message of 2020-07-22 23:09:23 -07:00:

Quoted 4 lines

there is stress recipe in some layers which could provide stress utility as well, therefore it should be using update-alternatives mechanism so it fills in when stress is not provided by say stress recipe.

Hmm... The stress-ng recipe already RPROVIDES stress though. Doesn't that make it incompatible with any other existing stress recipe and update-alternatives?

Personally I think alternatives is overkill here, and stress-ng should not RPROVIDES stress at all (that is, revert commit 72641004). In that case, we would have noticed that the stress recipe had been removed from oe-core and we could have just updated our image accordingly to depend on stress-ng instead.

Quoted 1 line

secondly please use ${D}${bindir}/stress instead of hardcoding the path

Oops, yes of course.

Signature · 3 lines
Dan Callaghan <[email protected]>
Software Engineer
Opengear <https://opengear.com/>
#3 lore raw
Quoted 11 lines · Dan Callaghan

Excerpts from Khem Raj's message of 2020-07-22 23:09:23 -07:00:

Quoted 4 lines

there is stress recipe in some layers which could provide stress utility as well, therefore it should be using update-alternatives mechanism so it fills in when stress is not provided by say stress recipe.

Hmm... The stress-ng recipe already RPROVIDES stress though. Doesn't that make it incompatible with any other existing stress recipe and update-alternatives?

Quoted 6 lines

Personally I think alternatives is overkill here, and stress-ng should not RPROVIDES stress at all (that is, revert commit 72641004). In that case, we would have noticed that the stress recipe had been removed from oe-core and we could have just updated our image accordingly to depend on stress-ng instead.

yeah I think its a fair point, we already are providing it in that case we can live with unconditional
symlink and let older stress recipe deal with conflicts if someone needs it

Quoted 9 lines
Quoted 1 line

secondly please use ${D}${bindir}/stress instead of hardcoding the path

Oops, yes of course.

--
Dan Callaghan <[email protected]>
Software Engineer
Opengear <https://opengear.com/>

#4 lore raw

PATCH v2 1/1 stress-ng: create a symlink for /usr/bin/stress

In reply to Dan Callaghan

In commit 72641004, stress-ng was made to provide the stress package, because it's backwards compatible with the old stress command. But it doesn't actually provide /usr/bin/stress which is what other recipes depending on stress will expect.

Symlink /usr/bin/stress to stress-ng so that it actually becomes a drop-in replacement for stress.

---
 meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb +1 -0
index 8ea0476db5..28bf9884cf 100644
@@ -22,5 +22,6 @@ inherit bash-completion
 
 do_install() {
     oe_runmake DESTDIR=${D} install
+    ln -s stress-ng ${D}${bindir}/stress
 }
 
Signature · 1 line
2.25.4