summaryrefslogtreecommitdiff
path: root/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
AgeCommit message (Collapse)AuthorFilesLines
2020-04-07obmc-phosphor-systemd: Substitute more variablesWilliam A. Kennington III1-0/+6
(From meta-phosphor rev: 174bce334bc5e4fa960aa600399b5cddeb30b841) Change-Id: I03c2c389c7cfedbfbc4c97a8fa4c9fa3fbf937f7 Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2019-04-06update upstream subtreesBrad Bishop1-1/+1
A number of corequisites exist so squashing these all into one patch. meta-ingrasys - refresh master bc513127f4..67bcaf389f meta-hxt - refresh master 86a4df514f..8fe0d38bbb meta-phosphor - refresh master 06c09d7cce..df6ddae3d2 meta-quanta - refresh master 4f126361a1..53f3025271 Change-Id: I3daeef2a0467d8ea4f1fd1c617e526f8b11258af Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2019-03-21obmc-phosphor-systemd: allow systemd unit from repoLei YU1-4/+12
If a recipe inherits obmc-phosphor-systemd, all the systemd units defined in the recipe shall exist in the code tree, otherwise it reports "Did not find unit file" error. This commit changes the behavior, and do not report the error if a unit does not exist in code tree. This allows the system unit to be installed from repo, as long as the repo does install the systemd unit to expected path. Tested: Verify the below case passes the build and the unit is installed correctly in the built image: * Put a systemd unit in repo; * In repo, install the unit into /lib/systemd/system * The repo's recipe defines SYSTEMD_SERVICE_${PN} without putting the unit in openbmc tree And verify if the systemd unit in repo is not installed, the build fails due to missing the unit. (From meta-phosphor rev: 5f56aaf1204a39035da1a493a97e86a73650000f) Change-Id: I9ec9c188357c2995d3e8ddbf2675c60f5e17560e Signed-off-by: Lei YU <mine260309@gmail.com> Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2018-02-01systemd: limit bbclass hooks to class-target scopeBrad Bishop1-3/+5
Allow the phosphor systemd and dbus bbclasses to be inherited by recipes using BBCLASSEXTEND (native, etc). No-op in non-target recipe class context. Tested: Built an image and verified dbus and systemd unit files. Change-Id: Ib2f64233f89d05679c568527a074d9236729201f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2017-12-01obmc-phosphor-systemd: fix string trim of instance nameRobert Lippert1-1/+1
Python rstrip argument is a set of characters to strip and not a substring. This caused a weird build failure when the instance name happened to include some characters from the trailing part of the service name. Change-Id: Ib3263c709c7ca85a8c9f63c33945215b8443b806 Signed-off-by: Robert Lippert <rlippert@google.com>
2017-03-30obmc-phosphor-systemd: use new configparserSaqib Khan1-2/+2
ConfigParser has been renamed to configparser in python3 for PEP 8 compliance. Change-Id: I3d95329ea1adcdeb02b83245e7d13f5bf1d7de58 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
2017-03-17Replace iteritems() with items() in systemdSaqib Khan1-1/+1
Deprecated iteritems() method is not forward-compatible with python3 and is replaced by items() Change-Id: Ic6b57da360149c378118673b966bde189d8e2493 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
2017-01-26Add sysconfdir to default systemd service substitutionsXo Wang1-0/+1
This could be specified as a custom substition by recipes that use it, but like bindir, sbindir, and envfiledir, it seems common enough that it should be a default substitution. Signed-off-by: Xo Wang <xow@google.com> Change-Id: I827aad06ca8401a22554b87499ba7f33470f438d
2016-09-06classes-systemd: Add override variableBrad Bishop1-0/+44
Add SYSTEMD_OVERRIDE variable for easy override file deployment. Change-Id: I5114296254f118fb2b9883615a710c0329921fa7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-09-06classes-systemd: refactor substitutionsBrad Bishop1-16/+17
The exising mechanism for doing substitutions worked but was cumbersome for expressing more than a handful. Rework the interfaces such that expressing many substitutions at once is simpler. Change-Id: I9ffee7a623219a797797cc8f085e7a06eaf74b3c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-09-06classes-systemd: Add link variableBrad Bishop1-0/+30
Add new variable SYSTEMD_LINK for arbitrary link installation in the ${systemd_system_unitdir} namespace. For example, assume a template foo@.target exists and an instance of this template is desired. To describe this: SYSTEMD_LINK_${PN} += "foo@.target:foo@instance.service" Change-Id: I8bb443e71d8eed44d4704c58167e1ff19bdfe2f5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-09-06classes-systemd: Add environment file shortcutsBrad Bishop1-0/+37
To cut down on typing add a new variable SYSTEMD_ENVIRONMENT_FILE_${PN} that simply installs the listed files. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I9b82e99816bc09d264a644f91c45472b59a5d343
2016-09-06classes-systemd: general refactoringBrad Bishop1-29/+36
Factor out some code so it can be used elsewhere. Change-Id: Ifbb2d7553c2c21868b5bc5b515b6f03f2c0882c0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-09-06classes-systemd: Add unit name parserBrad Bishop1-20/+59
Add a method for parsing of unit names, in an attempt to make it a little clearer what the class logic is doing. Change-Id: Idfd3e15a247e1175e001ed8f159ae084017d14a9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-09-06classes-systemd: Enable substitutions on non-unitsBrad Bishop1-10/+11
This will be useful for things like sd config files. Change-Id: I3afbe9446b807aa9cd4bdd20254b8ca2d5c7e6b8 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-09-06Allow package wide user specificiationBrad Bishop1-16/+21
Allow the user to be specified package wide or per unit. Change-Id: I19a56001bd2115462f132c3079690c4b2d0a5ddf Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-07-28classes-systemd: Add userBrad Bishop1-0/+38
Add a SYSTEMD_USER_${PN}_foo.service variable for setting the service user in systemd service files. Change-Id: I9354b19f6cf5563fe33ee71dc5b8b07c4f380847 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-07-28classes-systemd: Add format strings to unit filesBrad Bishop1-0/+42
Add functionality for enabling python str.format()ing of systemd unit files. Add a variable name to SYSTEMD_SUBSTITUTIONS_${unit} and its value will be substituted into any matching python string {format}'s in the unit file during install. Preconfigured variables: base_bindir -> ${base_bindir} bindir -> ${bindir} sbindir -> ${sbindir} DEFAULT_INSTALL_TARGET -> 'obmc-standby.target' Change-Id: Ife5003e1fc6766bf148a80663c35ab50c6002d26 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com
2016-07-28classes-systemd: Add restart policy warningBrad Bishop1-2/+37
Print a warning if a systemd service unit is detected without a restart policy defined. To inhibit: INHIBIT_SYSTEMD_RESTART_POLICY_WARNING += "${UNIT}" Change-Id: I27436276425d028d892c7c98736781e8577ad8eb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-07-28classes-systemd: General refactoringBrad Bishop1-25/+25
Take the more idiomatic approach of iterating on SYSTEMD_PACKAGES to find service files. The OBMC_SYSTEMD_SERVICE variable isn't meant to be used directly by recipes. Rename it to something that seems less public. Change-Id: If031937d4716b9c7e6ac1be506457e41109b69c1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-07-11classes-systemd: Use PN rather than BPNBrad Bishop1-7/+7
This is what all the classes that come with Yocto do. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-07-11classes-systemd: Fix FILES_${PN} path bugBrad Bishop1-3/+2
Missing space and path sep in the generated path. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2016-06-13Support multiple systemd service filesBrad Bishop1-9/+47
Enhance obmc-phosphor-systemd such that an array of service/template socket files in SYSTEMD_SERVICES_${PN} works. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2015-10-16-systemd.bbclass incorrect for nativesdk packagesPatrick Williams1-3/+3
We should use the 'bare' package name BPN instead of PN for finding the service file. Otherwise, a -nativesdk package cannot be created because we get a file-not-found error on the service file.
2015-09-15Add 'meta-phosphor/' from commit '93fb535853a24d4c3c42ec425ac92c9d3de13294'Patrick Williams1-0/+14
git-subtree-dir: meta-phosphor git-subtree-mainline: 21f9b84b4b729fbd7acbd465e7a3f726e4d20f91 git-subtree-split: 93fb535853a24d4c3c42ec425ac92c9d3de13294