2019-05-12 21:55:38 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# openrc
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2023-10-17 13:08:06 +02:00
|
|
|
OPENRC_VERSION = 0.51
|
2019-05-12 21:55:38 +02:00
|
|
|
OPENRC_SITE = $(call github,OpenRC,openrc,$(OPENRC_VERSION))
|
|
|
|
OPENRC_LICENSE = BSD-2-Clause
|
|
|
|
OPENRC_LICENSE_FILES = LICENSE
|
2021-03-05 23:27:44 +01:00
|
|
|
OPENRC_CPE_ID_VENDOR = openrc_project
|
2019-05-12 21:55:38 +02:00
|
|
|
|
|
|
|
OPENRC_DEPENDENCIES = ncurses
|
|
|
|
|
2023-10-17 13:08:06 +02:00
|
|
|
OPENRC_CONF_OPTS = \
|
|
|
|
-Dos=Linux \
|
|
|
|
-Dlibrcdir=/usr/libexec/rc \
|
|
|
|
-Dpkgconfig=false \
|
|
|
|
-Dsysvinit=true \
|
|
|
|
-Drootprefix=/ \
|
|
|
|
-Dbranding="\"Buildroot $(BR2_VERSION_FULL)\""
|
2019-05-12 21:55:38 +02:00
|
|
|
|
2023-10-17 13:08:08 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BASH_COMPLETION),y)
|
|
|
|
OPENRC_CONF_OPTS += -Dbash-completions=true
|
|
|
|
else
|
|
|
|
OPENRC_CONF_OPTS += -Dbash-completions=false
|
|
|
|
endif
|
|
|
|
|
2020-04-16 05:21:37 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
|
2023-10-17 13:08:06 +02:00
|
|
|
OPENRC_CONF_OPTS += -Dselinux=enabled
|
2020-04-16 05:21:37 +02:00
|
|
|
OPENRC_DEPENDENCIES += libselinux
|
|
|
|
else
|
2023-10-17 13:08:06 +02:00
|
|
|
OPENRC_CONF_OPTS += -Dselinux=disabled
|
2020-04-16 05:21:37 +02:00
|
|
|
endif
|
|
|
|
|
2023-10-17 13:08:07 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
|
|
|
|
OPENRC_CONF_OPTS += -Dpam=true
|
|
|
|
OPENRC_DEPENDENCIES += linux-pam
|
|
|
|
else
|
|
|
|
OPENRC_CONF_OPTS += -Dpam=false
|
|
|
|
endif
|
|
|
|
|
2023-10-17 13:08:09 +02:00
|
|
|
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
|
|
|
|
OPENRC_CONF_OPTS += -Dsplit-usr=false
|
|
|
|
else
|
|
|
|
OPENRC_CONF_OPTS += -Dsplit-usr=true
|
|
|
|
endif
|
|
|
|
|
2023-10-17 13:08:06 +02:00
|
|
|
define OPENRC_INSTALL_SYSV_RCS_SCRIPT
|
2019-12-19 20:01:35 +01:00
|
|
|
$(INSTALL) -D -m 0755 $(OPENRC_PKGDIR)/sysv-rcs \
|
|
|
|
$(TARGET_DIR)/etc/init.d/sysv-rcs
|
2019-05-12 21:55:38 +02:00
|
|
|
endef
|
2023-10-17 13:08:06 +02:00
|
|
|
OPENRC_POST_INSTALL_TARGET_HOOKS += OPENRC_INSTALL_SYSV_RCS_SCRIPT
|
2019-05-12 21:55:38 +02:00
|
|
|
|
2020-02-29 19:26:21 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_KBD),)
|
|
|
|
# keymaps and save-keymaps require kbd_mode and dumpkeys, respectively, so
|
|
|
|
# remove them if the kbd package is not selected (e.g. devices with serial
|
|
|
|
# console, only).
|
|
|
|
define OPENRC_NO_KBD
|
|
|
|
$(RM) $(TARGET_DIR)/etc/runlevels/boot/{keymaps,save-keymaps}
|
|
|
|
$(RM) $(TARGET_DIR)/etc/init.d/{keymaps,save-keymaps}
|
|
|
|
$(RM) $(TARGET_DIR)/etc/conf.d/keymaps
|
|
|
|
endef
|
|
|
|
OPENRC_POST_INSTALL_TARGET_HOOKS += OPENRC_NO_KBD
|
|
|
|
endif
|
|
|
|
|
2019-08-04 14:14:18 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_NETIFRC),y)
|
|
|
|
# netifrc replaces network, staticroute and loopback services which are
|
|
|
|
# installed by openrc
|
|
|
|
define OPENRC_NO_NET
|
|
|
|
$(RM) $(TARGET_DIR)/etc/runlevels/boot/{network,staticroute,loopback}
|
|
|
|
$(RM) $(TARGET_DIR)/etc/init.d/{network,staticroute,loopback}
|
|
|
|
$(RM) $(TARGET_DIR)/etc/conf.d/{network,staticroute,loopback}
|
|
|
|
endef
|
2020-02-29 19:18:07 +01:00
|
|
|
OPENRC_POST_INSTALL_TARGET_HOOKS += OPENRC_NO_NET
|
2019-08-04 14:14:18 +02:00
|
|
|
endif
|
|
|
|
|
2019-05-12 21:55:38 +02:00
|
|
|
define OPENRC_REMOVE_UNNEEDED
|
|
|
|
$(RM) -r $(TARGET_DIR)/usr/share/openrc
|
|
|
|
endef
|
|
|
|
OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_REMOVE_UNNEEDED
|
|
|
|
|
package/openrc: add support for spawning getty
We install a template getty service, and we 'instantiate' it in the
default runlevel, using the configured tty.
Ideally, packages that provide a getty program would be responsible
for installing the corresponding service file. However, to keep
consistency with the existing init systems (busybox, systemd, and
sysv), so we do provide it from the openrc package itself.
OpenRC only acts on the files in a runlevel sub-directory, but the
documentation [0] actually suggests that the instance symlink be done
in init.d, and then again symlinked into the actual runlevel
sub-directory. So, we abide by the rules.
Also, to be noted, the getty service file is installed without ensuring
that a getty command is available. This again is not unlike other init
systems, sysvinit and busybox, which behave the same.
[0] https://wiki.gentoo.org/wiki/OpenRC
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[yann.morin.1998@free.fr:
- move getty template to openrc package (Thomas)
- fix namespace of the vaiables (Thomas)
- simplify creation of the defaults file
- rewrite commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-08-04 14:14:17 +02:00
|
|
|
ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
|
2020-03-01 16:17:44 +01:00
|
|
|
OPENRC_GETTY_SVCNAME = agetty.$(SYSTEM_GETTY_PORT)
|
package/openrc: add support for spawning getty
We install a template getty service, and we 'instantiate' it in the
default runlevel, using the configured tty.
Ideally, packages that provide a getty program would be responsible
for installing the corresponding service file. However, to keep
consistency with the existing init systems (busybox, systemd, and
sysv), so we do provide it from the openrc package itself.
OpenRC only acts on the files in a runlevel sub-directory, but the
documentation [0] actually suggests that the instance symlink be done
in init.d, and then again symlinked into the actual runlevel
sub-directory. So, we abide by the rules.
Also, to be noted, the getty service file is installed without ensuring
that a getty command is available. This again is not unlike other init
systems, sysvinit and busybox, which behave the same.
[0] https://wiki.gentoo.org/wiki/OpenRC
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[yann.morin.1998@free.fr:
- move getty template to openrc package (Thomas)
- fix namespace of the vaiables (Thomas)
- simplify creation of the defaults file
- rewrite commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-08-04 14:14:17 +02:00
|
|
|
OPENRC_GETTY_CONF_D = $(TARGET_DIR)/etc/conf.d/$(OPENRC_GETTY_SVCNAME)
|
|
|
|
define OPENRC_SET_GETTY
|
|
|
|
{ \
|
|
|
|
echo "baud=\"$(SYSTEM_GETTY_BAUDRATE)\""; \
|
|
|
|
echo "term_type=\"$(SYSTEM_GETTY_TERM)\"" ; \
|
2020-03-01 16:17:44 +01:00
|
|
|
echo "agetty_options=\"-L $(SYSTEM_GETTY_OPTIONS)\""; \
|
package/openrc: add support for spawning getty
We install a template getty service, and we 'instantiate' it in the
default runlevel, using the configured tty.
Ideally, packages that provide a getty program would be responsible
for installing the corresponding service file. However, to keep
consistency with the existing init systems (busybox, systemd, and
sysv), so we do provide it from the openrc package itself.
OpenRC only acts on the files in a runlevel sub-directory, but the
documentation [0] actually suggests that the instance symlink be done
in init.d, and then again symlinked into the actual runlevel
sub-directory. So, we abide by the rules.
Also, to be noted, the getty service file is installed without ensuring
that a getty command is available. This again is not unlike other init
systems, sysvinit and busybox, which behave the same.
[0] https://wiki.gentoo.org/wiki/OpenRC
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[yann.morin.1998@free.fr:
- move getty template to openrc package (Thomas)
- fix namespace of the vaiables (Thomas)
- simplify creation of the defaults file
- rewrite commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-08-04 14:14:17 +02:00
|
|
|
} > $(OPENRC_GETTY_CONF_D)
|
2020-03-01 16:17:44 +01:00
|
|
|
ln -sf agetty $(TARGET_DIR)/etc/init.d/$(OPENRC_GETTY_SVCNAME)
|
package/openrc: add support for spawning getty
We install a template getty service, and we 'instantiate' it in the
default runlevel, using the configured tty.
Ideally, packages that provide a getty program would be responsible
for installing the corresponding service file. However, to keep
consistency with the existing init systems (busybox, systemd, and
sysv), so we do provide it from the openrc package itself.
OpenRC only acts on the files in a runlevel sub-directory, but the
documentation [0] actually suggests that the instance symlink be done
in init.d, and then again symlinked into the actual runlevel
sub-directory. So, we abide by the rules.
Also, to be noted, the getty service file is installed without ensuring
that a getty command is available. This again is not unlike other init
systems, sysvinit and busybox, which behave the same.
[0] https://wiki.gentoo.org/wiki/OpenRC
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
[yann.morin.1998@free.fr:
- move getty template to openrc package (Thomas)
- fix namespace of the vaiables (Thomas)
- simplify creation of the defaults file
- rewrite commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-08-04 14:14:17 +02:00
|
|
|
ln -sf /etc/init.d/$(OPENRC_GETTY_SVCNAME) \
|
|
|
|
$(TARGET_DIR)/etc/runlevels/default/$(OPENRC_GETTY_SVCNAME)
|
|
|
|
endef
|
|
|
|
OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_SET_GETTY
|
|
|
|
endif # BR2_TARGET_GENERIC_GETTY
|
|
|
|
|
2023-10-17 13:08:06 +02:00
|
|
|
$(eval $(meson-package))
|