Skip to contentSkip to conversation

systemtap: Fix issues from 4.0 upgrade

PATCH In review Richard Purdie 2 participants 3 messages Oct 16, 2018 – Oct 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemtap: Fix issues from 4.0 upgrade

4.0 adds systemd support but installs the unit files in the wrong location. Fix this in do_install and inherit systemd to package them correctly.

Also fix ownership of files manually copied in to root:root to avoid QA warnings.

---
 meta/recipes-kernel/systemtap/systemtap_git.bb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
meta/recipes-kernel/systemtap/systemtap_git.bb +9 -1
index 0b7833e901b..3c45bfa9374 100644
@@ -25,7 +25,7 @@ PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3"
 PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c"
 PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native"
 
-inherit autotools gettext pkgconfig distutils3-base
+inherit autotools gettext pkgconfig distutils3-base systemd
 
 do_configure_prepend () {
     # Improve reproducibility for c++ object files
@@ -39,6 +39,14 @@ do_install_append () {
       rm -rf ${D}${datadir}/${PN}
       rm ${D}${libexecdir}/${PN}/stap-env
    fi
+
+   # Fix makefile hardcoded path assumptions for systemd (assumes $prefix)
+   install -d `dirname ${D}${systemd_unitdir}`
+   mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}`
+   rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty
+
+   # Ensure correct ownership for files copied in
+   chown root.root ${D}${sysconfdir}/stap-exporter/* -R
 }
 
 BBCLASSEXTEND = "nativesdk"
Signature · 1 line
2.17.1
#1 lore raw

Hi Richard,

Quoted 25 lines · Richard Purdie

4.0 adds systemd support but installs the unit files in the wrong location. Fix this in do_install and inherit systemd to package them correctly.

Also fix ownership of files manually copied in to root:root to avoid QA warnings.

---
  meta/recipes-kernel/systemtap/systemtap_git.bb | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
meta/recipes-kernel/systemtap/systemtap_git.bb +1 -1
index 0b7833e901b..3c45bfa9374 100644
@@ -25,7 +25,7 @@ PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3"
  PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c"
  PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native"
 
-inherit autotools gettext pkgconfig distutils3-base
+inherit autotools gettext pkgconfig distutils3-base systemd
 
  do_configure_prepend () {
      # Improve reproducibility for c++ object files
@@ -39,6 +39,14 @@ do_install_append () {
        rm -rf ${D}${datadir}/${PN}

meta/recipes-kernel/systemtap/systemtap_git.bb do_install_append () { · line 49

Quoted 10 lines
meta/recipes-kernel/systemtap/systemtap_git.bb +8 -0
        rm ${D}${libexecdir}/${PN}/stap-env
     fi
+
+   # Fix makefile hardcoded path assumptions for systemd (assumes $prefix)
+   install -d `dirname ${D}${systemd_unitdir}`
+   mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}`
+   rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty
+
+   # Ensure correct ownership for files copied in
+   chown root.root ${D}${sysconfdir}/stap-exporter/* -R

root:root ?

Quoted 4 lines
meta/recipes-kernel/systemtap/systemtap_git.bb +0 -0
  }
 
  BBCLASSEXTEND = "nativesdk"
Signature · 10 lines
Kind regards,
Martin Hundebøll
Embedded Linux Consultant

+45 61 65 54 61
[email protected]

Geanix IVS
https://geanix.com
DK39600706
#2 lore raw
Quoted 12 lines · Martin Hundebøll

meta/recipes-kernel/systemtap/systemtap_git.bb do_install_append () { · line 49

Quoted 9 lines · Richard Purdie
(quoted diff) +2 -0
+
+   # Fix makefile hardcoded path assumptions for systemd (assumes

$prefix)

meta/recipes-kernel/systemtap/systemtap_git.bb +6 -0
+   install -d `dirname ${D}${systemd_unitdir}`
+   mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}`
+   rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty
+
+   # Ensure correct ownership for files copied in
+   chown root.root ${D}${sysconfdir}/stap-exporter/* -R

root:root ?

Well spotted, thanks!

Cheers,

Richard