summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rwxr-xr-xpackage/openrc/getty24
-rw-r--r--package/openrc/openrc.mk18
-rw-r--r--package/skeleton-init-openrc/skeleton/etc/conf.d/.empty0
-rw-r--r--package/skeleton-init-openrc/skeleton/etc/runlevels/default/.empty0
4 files changed, 42 insertions, 0 deletions
diff --git a/package/openrc/getty b/package/openrc/getty
new file mode 100755
index 0000000000..8fcb071f8a
--- /dev/null
+++ b/package/openrc/getty
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# based on agetty service from OpenRC package
+
+description="start getty on terminal"
+supervisor=supervise-daemon
+port="${RC_SVCNAME#*.}"
+term_type="${term_type:-linux}"
+command=/sbin/getty
+command_args_foreground="${getty_options} ${baud} ${port} ${term_type}"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+ # start getty at the very end of init
+ after *
+ keyword -prefix
+}
+
+start_pre() {
+ export EINFO_QUIET="${quiet:-yes}"
+}
+
+stop_pre() {
+ export EINFO_QUIET="${quiet:-yes}"
+}
diff --git a/package/openrc/openrc.mk b/package/openrc/openrc.mk
index 53f2947dcc..5978b6de5d 100644
--- a/package/openrc/openrc.mk
+++ b/package/openrc/openrc.mk
@@ -42,4 +42,22 @@ define OPENRC_REMOVE_UNNEEDED
endef
OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_REMOVE_UNNEEDED
+ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
+OPENRC_GETTY_SVCNAME = getty.$(SYSTEM_GETTY_PORT)
+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)\"" ; \
+ echo "getty_options=\"-L $(SYSTEM_GETTY_OPTIONS)\""; \
+ } > $(OPENRC_GETTY_CONF_D)
+ $(INSTALL) -D -m 0755 $(OPENRC_PKGDIR)/getty \
+ $(TARGET_DIR)/etc/init.d/getty
+ ln -sf getty $(TARGET_DIR)/etc/init.d/$(OPENRC_GETTY_SVCNAME)
+ 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
+
$(eval $(generic-package))
diff --git a/package/skeleton-init-openrc/skeleton/etc/conf.d/.empty b/package/skeleton-init-openrc/skeleton/etc/conf.d/.empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/package/skeleton-init-openrc/skeleton/etc/conf.d/.empty
diff --git a/package/skeleton-init-openrc/skeleton/etc/runlevels/default/.empty b/package/skeleton-init-openrc/skeleton/etc/runlevels/default/.empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/package/skeleton-init-openrc/skeleton/etc/runlevels/default/.empty