Commit Graph

27 Commits

Author SHA1 Message Date
William Hubbs
d6622a1156 add meson build files
Closes #116.
Closes #171.
Closes #172.
Closes #175.
2021-09-04 16:01:29 -05:00
Sven Wegener
63955056ec on_ac_power: support multiple power_supply devices in sysfs
Newer devices have multiple power_supply devices in sysfs:

$ grep ^ /sys/class/power_supply/*/type
/sys/class/power_supply/AC/type:Mains
/sys/class/power_supply/BAT0/type:Battery
/sys/class/power_supply/ucsi-source-psy-USBC000:001/type:USB
/sys/class/power_supply/ucsi-source-psy-USBC000:002/type:USB

There are two "USB" Type-C ports than can supply power and both are
aggregated into the "Mains" power supply by the firmware. The "Battery"
also counts as a power supply, but is missing the online attribute.

The -f check with a wildcard pattern results in an error, when multiple
devices are present:

/lib/rc/bin/on_ac_power: line 21: [: too many arguments

When the power_supply class is registered, check for a "Mains" device.

Fixes #427.
2021-08-13 13:38:07 -05:00
William Hubbs
38aaba28ee scripts/shutdown.in: fix sysvinit compatible shutdown
X-Gentoo-Bug: https://bugs.gentoo.org/755422
2020-11-20 14:57:04 -06:00
artoo
a15b532a02 scripts: fix halt, poweroff and reboot wrappers
These are designed to emulate the sysvinit equivalents, so pass "now" as
the time argument if no arguments are given.

This fixes #268.
2018-12-27 13:52:16 -06:00
William Hubbs
5427783fdf standardize the default shell
I do not know of a need to have the default shell be a build-time
configurable setting. All *nix systems I am aware of have /bin/sh as a
default posix compatible shell.
If some systems running OpenRC do not make that assumption about
/bin/sh, I will consider bringing this back, so feel free to open an
issue.
2018-12-08 12:06:26 -06:00
William Hubbs
e7807b3136 fix sysvinit compatibility for shutdown wrapper 2017-07-11 14:41:29 -05:00
William Hubbs
03a461ac0e fix sysvinit compatibility for reboot wrapper 2017-07-11 11:53:23 -05:00
William Hubbs
7e0f76e0ad fix sysvinit compatibility for poweroff wrapper 2017-07-11 11:10:46 -05:00
William Hubbs
9812ce5b8d fix halt wrapper so it is sysvinit compatible
This makes the halt wrapper sysvinit compatible. It ignores several
command line switches which are not currently implemented; however,
those can be implemented if we need to do so.

This fixes https://github.com/openrc/openrc/issues/146.
2017-07-10 18:36:24 -05:00
William Hubbs
1e837d596e fix argument parsing for the sysvinit shutdown wrapper
This fixes #140.
2017-06-12 17:58:18 -05:00
William Hubbs
dcc686e42b scripts/shutdown: fix arguments to be sysvinit shutdown compatible
This fixes #140.
2017-06-12 12:24:18 -05:00
William Hubbs
2f81c100af Fix link to shutdown for MKSYSVINIT=yes 2017-06-12 12:12:50 -05:00
udeved
199a210d2f scripts/Makefile: make symlinks absolute instead of relative
This closes #142.
2017-06-12 10:39:44 -05:00
udeved
5b7667af32 scripts/Makefile: respect SBINDIR with MKSYSVINIT
This is for #142.
2017-06-12 10:38:47 -05:00
William Hubbs
84d140a1f6 scripts/shutdown: pass --single to openrc-shutdown
Sysvinit shutdown has a default of single user mode, but openrc-shutdown
makes you choose a default action. Because of this, the shutdown wrapper
needs to pass --single to openrc-shutdown.
2017-06-07 10:59:42 -05:00
William Hubbs
1564e155b7 openrc-init: add optional sysvinit compatibility 2017-05-31 18:07:02 -05:00
William Hubbs
f6ea16159e scripts: make sure the rc-sstat symlink is always replaced 2017-02-22 14:25:02 -06:00
William Hubbs
b693af9055 Revert "scripts: do not substitute for @SHELL@ in rc-sstat"
This reverts commit e2e652e469.
2017-01-26 15:39:19 -06:00
William Hubbs
e2e652e469 scripts: do not substitute for @SHELL@ in rc-sstat 2017-01-08 20:42:26 -06:00
William Hubbs
e277ae57ef fix tests
X-Gentoo-Bug: 572602
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=572602
2016-01-22 12:07:13 -06:00
William Hubbs
000503fad7 Convert OpenRC to a centralized copyright/license structure
In the past, OpenRC was a hybrid of a centralized and file-scope
license/copyright structure.

I followed the instructions from the Software Freedom Law Center [1] to
convert to a Centralized structure where possible, for easier future
maintenance.

[1] https://softwarefreedom.org/resources/2012/ManagingCopyrightInformation.html
2015-12-21 12:16:06 -06:00
William Hubbs
d2ce07e227 Add rc-sstat script
The rc-sstat script is written to display status of s6 services and
run rc-status to display all services status.

This currently only works on Linux.
2015-06-10 18:45:29 -05:00
William Hubbs
60d288a877 remove type command
The posix equivalent of the type command is "command -v", so now we use
that. Thanks to Jonathan Callen <jcallen@gentoo.org> for informing me
wrt the fix.
2013-12-02 02:08:40 -06:00
Alessio Ababilov
260b61e9d8 on_ac_power: Fix AC adapter presence recognition
On several machines, a file corresponding to AC adapter can be named
ADP1. The on_ac_power script  checked for AC*, which does not match
ADP1, so the script always considered the adapter to be off.

X-Gentoo-Bug: 380933
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=380933
2011-11-17 11:55:44 -06:00
Jory A. Pratt
761fe99fe2 on_ac_power needs to exit not return bug #322037 2010-07-12 22:19:56 -05:00
Michal Gorny
20b4076b12 Support sysfs.
Fixes #214
2010-03-27 08:53:04 +00:00
Roy Marples
1d174cc60c Move on_ac_power to a shell script.
Fixes #204
2009-12-10 22:30:56 +00:00