diff options
| author | Michael Forney <mforney@mforney.org> | 2020-05-25 21:01:32 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-05-25 21:11:21 -0700 |
| commit | f0fb0e517737860133352382ec082e4690be9b3a (patch) | |
| tree | 8a3cfc3b9cc4dc468b2531b8d99d50749b3f053e /pkg/sinit | |
| parent | cdf748ea39cb023b364240569a57ad5bc3e00171 (diff) | |
Start to support configurable prefix
Diffstat (limited to 'pkg/sinit')
| -rw-r--r-- | pkg/sinit/config.h | 6 | ||||
| -rw-r--r-- | pkg/sinit/gen.lua | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pkg/sinit/config.h b/pkg/sinit/config.h index 3d2da6fc..f99a32e5 100644 --- a/pkg/sinit/config.h +++ b/pkg/sinit/config.h @@ -1,5 +1,5 @@ /* See LICENSE file for copyright and license details. */ -static char *const rcinitcmd[] = { "/etc/rc.init", NULL }; -static char *const rcrebootcmd[] = { "/etc/rc.shutdown", "reboot", NULL }; -static char *const rcpoweroffcmd[] = { "/etc/rc.shutdown", "poweroff", NULL }; +static char *const rcinitcmd[] = { PREFIX "/etc/rc.init", NULL }; +static char *const rcrebootcmd[] = { PREFIX "/etc/rc.shutdown", "reboot", NULL }; +static char *const rcpoweroffcmd[] = { PREFIX "/etc/rc.shutdown", "poweroff", NULL }; diff --git a/pkg/sinit/gen.lua b/pkg/sinit/gen.lua index 6fdf25f3..b7299179 100644 --- a/pkg/sinit/gen.lua +++ b/pkg/sinit/gen.lua @@ -1,4 +1,8 @@ -cflags{'-Wall', '-Wextra', '-I $dir'} +cflags{ + '-Wall', '-Wextra', + string.format([[-D 'PREFIX="%s"']], config.prefix), + '-I $dir', +} file('bin/sinit', '755', exe('sinit', {'sinit.c'})) man{'sinit.8'} |
