openrc: bump to version 0.42.1
v2 cover openrc: bump to version 0.42.1
From: Carlos Santos <[email protected]>
1. Drop the custom getty service, which has issues with openrc 0.42.1. Use the already existing agetty service, with two small patches.
2. Bump openrc to version 0.42.1. It requires a patch to prevent starting spurions agetty instances for tty[1-6].
3. Add selinux support.
4. Add openrc tests.
Adam Duskett (3):
package/openrc: bump to version 0.42.1
package/openrc: add libselinux support
support/testing: add openrc tests
Carlos Santos (1):
package/openrc: drop custom getty service
.gitlab-ci.yml | 2 + ...ty-replace-sbin-agetty-by-sbin-getty.patch | 33 ++++++++++++ ...getty-start-agetty-after-all-sevices.patch | 29 +++++++++++ ...-add-agetty.tty-1-6-if-MKSYSVINIT-ye.patch | 34 +++++++++++++ package/openrc/getty | 24 --------- package/openrc/openrc.hash | 2 +- package/openrc/openrc.mk | 18 ++++--- support/testing/tests/init/test_openrc.py | 51 +++++++++++++++++++ 8 files changed, 161 insertions(+), 32 deletions(-) create mode 100644 package/openrc/0003-init.d-agetty-replace-sbin-agetty-by-sbin-getty.patch create mode 100644 package/openrc/0004-init.d-agetty-start-agetty-after-all-sevices.patch create mode 100644 package/openrc/0005-runlevels-do-not-add-agetty.tty-1-6-if-MKSYSVINIT-ye.patch delete mode 100755 package/openrc/getty create mode 100644 support/testing/tests/init/test_openrc.py
Signature · 1 line
2.18.2
PATCH v2 1/4 package/openrc: drop custom getty service
From: Carlos Santos <[email protected]>
In Buildroot getty is provided by BusyBox or util-linux (agetty). Both create a /sbin/getty symlink pointing to the actual program, so make the agetty service use that path instead of /sbin/agetty.
Also start agetty after all other services, to prevent mixing startup messages with the getty prompt on devices with a single serial console.
This allows us to drop the custom getty service, which causes an error message from openrc 0.42.1 (in a forthcoming patch):
Error: getty is the name of a real and virtual service.
The patches are required because it's not possible to override the command or startup order by means of a configuration file. Anyway it's still better to patch something maintained upstream than depending on a custom piece that may easily become obsolete.
---
CC: Adam Duskett <[email protected]>
--- ...ty-replace-sbin-agetty-by-sbin-getty.patch | 33 +++++++++++++++++++ ...getty-start-agetty-after-all-sevices.patch | 29 ++++++++++++++++ package/openrc/getty | 24 -------------- package/openrc/openrc.mk | 8 ++--- 4 files changed, 65 insertions(+), 29 deletions(-) create mode 100644 package/openrc/0003-init.d-agetty-replace-sbin-agetty-by-sbin-getty.patch create mode 100644 package/openrc/0004-init.d-agetty-start-agetty-after-all-sevices.patch delete mode 100755 package/openrc/getty
package/openrc/0003-init.d-agetty-replace-sbin-agetty-by-sbin-getty.patch new file +33 -0
@@ -0,0 +1,33 @@ +From b39ab180358ed451eae9df900f49a72ef1eb7442 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +Date: Sun, 1 Mar 2020 09:04:48 -0300 +Subject: [PATCH] init.d/agetty: replace /sbin/agetty by /sbin/getty + +In Buildroot getty is provided by BusyBox or util-linux (agetty). Both +create a /sbin/getty symlink pointing to the actual program, so make the +agetty service use that path instead of /sbin/agetty. + +The patch is required because it's not possible to override the command +by means of a configuration file. + +Signed-off-by: Carlos Santos <[email protected]> +--- + init.d/agetty.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/init.d/agetty.in b/init.d/agetty.in +index e4866f7a..e1864628 100644 +--- a/init.d/agetty.in ++++ b/init.d/agetty.in +@@ -14,7 +14,7 @@ supervisor=supervise-daemon + port="${RC_SVCNAME#*.}" + respawn_period="${respawn_period:-60}" + term_type="${term_type:-linux}" +-command=/sbin/agetty ++command=/sbin/getty + command_args_foreground="${agetty_options} ${port} ${baud} ${term_type}" + pidfile="/run/${RC_SVCNAME}.pid" + +-- +2.18.2 +
package/openrc/0004-init.d-agetty-start-agetty-after-all-sevices.patch new file +29 -0
@@ -0,0 +1,29 @@ +From c2dc04f6b8c6784941b896e0b17c160dd43a566f Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +Date: Sun, 1 Mar 2020 11:14:37 -0300 +Subject: [PATCH] init.d/agetty: start agetty after all services + +This is required for Buildroot, to prevent mixing service initialization +messages with the getty prompt on devices with a single serial console. + +Signed-off-by: Carlos Santos <[email protected]> +--- + init.d/agetty.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/init.d/agetty.in b/init.d/agetty.in +index e1864628..a1ad4e9f 100644 +--- a/init.d/agetty.in ++++ b/init.d/agetty.in +@@ -19,7 +19,7 @@ command_args_foreground="${agetty_options} ${port} ${baud} ${term_type}" + pidfile="/run/${RC_SVCNAME}.pid" + + depend() { +- after local ++ after * + keyword -prefix + provide getty + } +-- +2.18.2 +
package/openrc/getty deleted +0 -24
@@ -1,24 +0,0 @@ -#!/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}" -}
package/openrc/openrc.mk +3 -5
@@ -68,17 +68,15 @@ endef OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_REMOVE_UNNEEDED ifeq ($(BR2_TARGET_GENERIC_GETTY),y) -OPENRC_GETTY_SVCNAME = getty.$(SYSTEM_GETTY_PORT) +OPENRC_GETTY_SVCNAME = agetty.$(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)\""; \ + echo "agetty_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 agetty $(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
Signature · 1 line
2.18.2
Yann E. MORIN
AppliedPATCH v2 1/4 package/openrc: drop custom getty service
Carlos, All,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 12 lines
From: Carlos Santos <[email protected]>
In Buildroot getty is provided by BusyBox or util-linux (agetty). Both create a
/sbin/gettysymlink pointing to the actual program, so make the agetty service use that path instead of/sbin/agetty.Also start agetty after all other services, to prevent mixing startup messages with the getty prompt on devices with a single serial console.
This allows us to drop the custom getty service, which causes an error message from openrc 0.42.1 (in a forthcoming patch):
Quoted 8 lines
Error: getty is the name of a real and virtual service.
The patches are required because it's not possible to override the command or startup order by means of a configuration file. Anyway it's still better to patch something maintained upstream than depending on a custom piece that may easily become obsolete.
Signed-off-by Carlos Santos <[email protected]>
Applied to master, thanks.
It is to be noted, however, that util-linux' agetty is optional (with BR2_PACKAGE_UTIL_LINUX_AGETTY), but the problem was pre-existing, so it's not a problem of your patch.
I wonder anyway if we should not try to fix that somehow?
Regards,
Yann E. MORIN.
Quoted 148 lines
---
CC: Adam Duskett <[email protected]>--- ...ty-replace-sbin-agetty-by-sbin-getty.patch | 33 +++++++++++++++++++ ...getty-start-agetty-after-all-sevices.patch | 29 ++++++++++++++++ package/openrc/getty | 24 -------------- package/openrc/openrc.mk | 8 ++--- 4 files changed, 65 insertions(+), 29 deletions(-) create mode 100644 package/openrc/0003-init.d-agetty-replace-sbin-agetty-by-sbin-getty.patch create mode 100644 package/openrc/0004-init.d-agetty-start-agetty-after-all-sevices.patch delete mode 100755 package/openrc/gettypackage/openrc/0003-init.d-agetty-replace-sbin-agetty-by-sbin-getty.patch new file +33
-0@@ -0,0 +1,33 @@ +From b39ab180358ed451eae9df900f49a72ef1eb7442 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +Date: Sun, 1 Mar 2020 09:04:48 -0300 +Subject: [PATCH] init.d/agetty: replace /sbin/agetty by /sbin/getty + +In Buildroot getty is provided by BusyBox or util-linux (agetty). Both +create a /sbin/getty symlink pointing to the actual program, so make the +agetty service use that path instead of /sbin/agetty. + +The patch is required because it's not possible to override the command +by means of a configuration file. + +Signed-off-by: Carlos Santos <[email protected]> +--- + init.d/agetty.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/init.d/agetty.in b/init.d/agetty.in +index e4866f7a..e1864628 100644 +--- a/init.d/agetty.in ++++ b/init.d/agetty.in +@@ -14,7 +14,7 @@ supervisor=supervise-daemon + port="${RC_SVCNAME#*.}" + respawn_period="${respawn_period:-60}" + term_type="${term_type:-linux}" +-command=/sbin/agetty ++command=/sbin/getty + command_args_foreground="${agetty_options} ${port} ${baud} ${term_type}" + pidfile="/run/${RC_SVCNAME}.pid" + +-- +2.18.2 +package/openrc/0004-init.d-agetty-start-agetty-after-all-sevices.patch new file +29
-0@@ -0,0 +1,29 @@ +From c2dc04f6b8c6784941b896e0b17c160dd43a566f Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +Date: Sun, 1 Mar 2020 11:14:37 -0300 +Subject: [PATCH] init.d/agetty: start agetty after all services + +This is required for Buildroot, to prevent mixing service initialization +messages with the getty prompt on devices with a single serial console. + +Signed-off-by: Carlos Santos <[email protected]> +--- + init.d/agetty.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/init.d/agetty.in b/init.d/agetty.in +index e1864628..a1ad4e9f 100644 +--- a/init.d/agetty.in ++++ b/init.d/agetty.in +@@ -19,7 +19,7 @@ command_args_foreground="${agetty_options} ${port} ${baud} ${term_type}" + pidfile="/run/${RC_SVCNAME}.pid" + + depend() { +- after local ++ after * + keyword -prefix + provide getty + } +-- +2.18.2 +package/openrc/getty deleted +0
-24@@ -1,24 +0,0 @@ -#!/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}" -}package/openrc/openrc.mk +3
-5@@ -68,17 +68,15 @@ endef OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_REMOVE_UNNEEDED ifeq ($(BR2_TARGET_GENERIC_GETTY),y) -OPENRC_GETTY_SVCNAME = getty.$(SYSTEM_GETTY_PORT) +OPENRC_GETTY_SVCNAME = agetty.$(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)\""; \ + echo "agetty_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 agetty $(TARGET_DIR)/etc/init.d/$(OPENRC_GETTY_SVCNAME) ln -sf /etc/init.d/$(OPENRC_GETTY_SVCNAME) \ $(TARGET_DIR)/etc/runlevels/default/$(OPENRC_GETTY_SVCNAME) endefSignature · 6 lines
2.18.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/4 package/openrc: drop custom getty service
Quoted 25 lines · Yann E. MORIN
Carlos, All,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 12 lines
From: Carlos Santos <[email protected]>
In Buildroot getty is provided by BusyBox or util-linux (agetty). Both create a
/sbin/gettysymlink pointing to the actual program, so make the agetty service use that path instead of/sbin/agetty.Also start agetty after all other services, to prevent mixing startup messages with the getty prompt on devices with a single serial console.
This allows us to drop the custom getty service, which causes an error message from openrc 0.42.1 (in a forthcoming patch):
Quoted 8 lines
Error: getty is the name of a real and virtual service.
The patches are required because it's not possible to override the command or startup order by means of a configuration file. Anyway it's still better to patch something maintained upstream than depending on a custom piece that may easily become obsolete.
Signed-off-by Carlos Santos <[email protected]>
Quoted 7 lines
Applied to master, thanks.
It is to be noted, however, that util-linux' agetty is optional (with
BR2_PACKAGE_UTIL_LINUX_AGETTY), but the problem was pre-existing, so it's not a problem of your patch.I wonder anyway if we should not try to fix that somehow?
I think nothing else is required, since /sbin/getty always points to a valid getty program, either provided by busybox or util-linux.
The alternative would be conditionally patching, based on wetter agetty is selected or not.
Signature · 1 line
Carlos Santos <[email protected]>
PATCH v2 2/4 package/openrc: bump to version 0.42.1
In reply to unixmania at gmail.comFrom: Adam Duskett <[email protected]>
Add a patch to prevent starting agetty on tty[1-6]. Buildroot starts a single getty, according to the system configuration. Also tty[1-6] may not even exist (e.g. embedded devices with serial consoles only).
---
Changes v1->v2:
- Fix agetty issue
--- ...-add-agetty.tty-1-6-if-MKSYSVINIT-ye.patch | 34 +++++++++++++++++++ package/openrc/openrc.hash | 2 +- package/openrc/openrc.mk | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 package/openrc/0005-runlevels-do-not-add-agetty.tty-1-6-if-MKSYSVINIT-ye.patch
package/openrc/0005-runlevels-do-not-add-agetty.tty-1-6-if-MKSYSVINIT-ye.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 014dc43447fa553e875984ac4a528e5916cc9e06 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +Date: Sat, 29 Feb 2020 22:41:30 -0300 +Subject: [PATCH] runlevels: do not add agetty.tty[1-6] if MKSYSVINIT=yes + +Buildroot starts a single getty, according to the system configuration. +Also tty[1-6] may not exist (e.g. embedded devices with serial consoles +only). + +Signed-off-by: Carlos Santos <[email protected]> +--- + runlevels/Makefile | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/runlevels/Makefile b/runlevels/Makefile +index 73843d8b..dbfb59ca 100644 +--- a/runlevels/Makefile ++++ b/runlevels/Makefile +@@ -90,12 +90,6 @@ install: + fi; \ + ln -snf ${INITDIR}/"$$x" ${SHUTDOWNDIR}/"$$x" || exit $$?; done \ + fi +- if test "${MKSYSVINIT}" = yes && test "${OS}" = Linux; then \ +- for x in tty1 tty2 tty3 tty4 tty5 tty6; do \ +- ln -snf ${INITDIR}/agetty ${DESTDIR}/${INITDIR}/"agetty.$$x" || exit $$?; \ +- ln -snf ${INITDIR}/agetty.$$x ${DEFAULTDIR}/"agetty.$$x" || exit $$?; \ +- done; \ +- fi + + check test:: + +-- +2.18.2 +
package/openrc/openrc.hash +1 -1
@@ -1,3 +1,3 @@ # Locally calculated -sha256 c99488ca54f2b795328d07bbd456ade49b571136bba7501f7eaaeb1ca9f9ecc4 openrc-0.41.2.tar.gz +sha256 91a01ca6d930a0688fb91338209985de57cac7aa2d37feddacb78fd3d95308e2 openrc-0.42.1.tar.gz sha256 96862463f4e77e2508e4fc2c83773fd24807cb699368b63fd93a5e2b466dd624 LICENSE
package/openrc/openrc.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -OPENRC_VERSION = 0.41.2 +OPENRC_VERSION = 0.42.1 OPENRC_SITE = $(call github,OpenRC,openrc,$(OPENRC_VERSION)) OPENRC_LICENSE = BSD-2-Clause OPENRC_LICENSE_FILES = LICENSE
Signature · 1 line
2.18.2
Yann E. MORIN
AppliedPATCH v2 2/4 package/openrc: bump to version 0.42.1
Carlos, Al,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 5 lines
From: Adam Duskett <[email protected]>
Add a patch to prevent starting agetty on tty[1-6]. Buildroot starts a single getty, according to the system configuration. Also tty[1-6] may not even exist (e.g. embedded devices with serial consoles only).
It would be good if that was made into an upstreamable patch, e.g.:
if test "${MKGETTYS}" != no && test "${OS}" = Linux; then \
[...]
fi(or whatever they'd accept)
Quoted 2 lines
Signed-off-by Adam Duskett <[email protected]>Signed-off-by Carlos Santos <[email protected]>
Applied to master, thanks!
Regards,
Yann E. MORIN.
Quoted 79 lines
---
Changesv1->v2:
- Fix agetty issue--- ...-add-agetty.tty-1-6-if-MKSYSVINIT-ye.patch | 34 +++++++++++++++++++ package/openrc/openrc.hash | 2 +- package/openrc/openrc.mk | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 package/openrc/0005-runlevels-do-not-add-agetty.tty-1-6-if-MKSYSVINIT-ye.patchpackage/openrc/0005-runlevels-do-not-add-agetty.tty-1-6-if-MKSYSVINIT-ye.patch new file +34
-0@@ -0,0 +1,34 @@ +From 014dc43447fa553e875984ac4a528e5916cc9e06 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +Date: Sat, 29 Feb 2020 22:41:30 -0300 +Subject: [PATCH] runlevels: do not add agetty.tty[1-6] if MKSYSVINIT=yes + +Buildroot starts a single getty, according to the system configuration. +Also tty[1-6] may not exist (e.g. embedded devices with serial consoles +only). + +Signed-off-by: Carlos Santos <[email protected]> +--- + runlevels/Makefile | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/runlevels/Makefile b/runlevels/Makefile +index 73843d8b..dbfb59ca 100644 +--- a/runlevels/Makefile ++++ b/runlevels/Makefile +@@ -90,12 +90,6 @@ install: + fi; \ + ln -snf ${INITDIR}/"$$x" ${SHUTDOWNDIR}/"$$x" || exit $$?; done \ + fi +- if test "${MKSYSVINIT}" = yes && test "${OS}" = Linux; then \ +- for x in tty1 tty2 tty3 tty4 tty5 tty6; do \ +- ln -snf ${INITDIR}/agetty ${DESTDIR}/${INITDIR}/"agetty.$$x" || exit $$?; \ +- ln -snf ${INITDIR}/agetty.$$x ${DEFAULTDIR}/"agetty.$$x" || exit $$?; \ +- done; \ +- fi + + check test:: + +-- +2.18.2 +package/openrc/openrc.hash +1
-1@@ -1,3 +1,3 @@ # Locally calculated -sha256 c99488ca54f2b795328d07bbd456ade49b571136bba7501f7eaaeb1ca9f9ecc4 openrc-0.41.2.tar.gz +sha256 91a01ca6d930a0688fb91338209985de57cac7aa2d37feddacb78fd3d95308e2 openrc-0.42.1.tar.gz sha256 96862463f4e77e2508e4fc2c83773fd24807cb699368b63fd93a5e2b466dd624 LICENSEpackage/openrc/openrc.mk +1
-1@@ -4,7 +4,7 @@ # ################################################################################ -OPENRC_VERSION = 0.41.2 +OPENRC_VERSION = 0.42.1 OPENRC_SITE = $(call github,OpenRC,openrc,$(OPENRC_VERSION)) OPENRC_LICENSE = BSD-2-Clause OPENRC_LICENSE_FILES = LICENSESignature · 6 lines
2.18.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 2/4 package/openrc: bump to version 0.42.1
Quoted 10 lines · Yann E. MORIN
Carlos, Al,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 5 lines
From: Adam Duskett <[email protected]>
Add a patch to prevent starting agetty on tty[1-6]. Buildroot starts a single getty, according to the system configuration. Also tty[1-6] may not even exist (e.g. embedded devices with serial consoles only).
Quoted 6 lines
It would be good if that was made into an upstreamable patch, e.g.:
if test "${MKGETTYS}" != no && test "${OS}" = Linux; then \ [...] fi
Done: https://github.com/OpenRC/openrc/pull/355
Signature · 1 line
Carlos Santos <[email protected]>
PATCH v2 3/4 package/openrc: add libselinux support
In reply to unixmania at gmail.comFrom: Adam Duskett <[email protected]>
If the libselinux package is selected, add the package to the dependency list and explicitly set OPENRC_MAKE_OPTS += MKSELINUX=yes
--- package/openrc/openrc.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
package/openrc/openrc.mk +7 -1
@@ -18,7 +18,6 @@ OPENRC_MAKE_OPTS = \ LIBNAME=lib \ LIBEXECDIR=/usr/libexec/rc \ MKPKGCONFIG=no \ - MKSELINUX=no \ MKSYSVINIT=yes \ BRANDING="Buildroot $(BR2_VERSION_FULL)" \ CC=$(TARGET_CC)
@@ -29,6 +28,13 @@ else OPENRC_MAKE_OPTS += MKSTATICLIBS=yes endif +ifeq ($(BR2_PACKAGE_LIBSELINUX),y) +OPENRC_MAKE_OPTS += MKSELINUX=yes +OPENRC_DEPENDENCIES += libselinux +else +OPENRC_MAKE_OPTS += MKSELINUX=no +endif + define OPENRC_BUILD_CMDS $(MAKE) $(OPENRC_MAKE_OPTS) -C $(@D) endef
Signature · 1 line
2.18.2
PATCH v2 3/4 package/openrc: add libselinux support
Carlos, All,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 4 lines
From: Adam Duskett <[email protected]>
If the libselinux package is selected, add the package to the dependency list and explicitly set
OPENRC_MAKE_OPTS+= MKSELINUX=yes
This SELinux stuff has always been a bit boo-I-dont-want-too-touch for me, because it looks overly complex, so just adding the dependency without explanations on how openrc uses/fits with SELinux is a bit too much for me to handle, so I defer to a SELinux-knowledgeable maintainer to look a it...
Regards,
Yann E. MORIN.
Quoted 39 lines
Signed-off-by Adam Duskett <[email protected]>Signed-off-by Carlos Santos <[email protected]>--- package/openrc/openrc.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)package/openrc/openrc.mk +7
-1@@ -18,7 +18,6 @@ OPENRC_MAKE_OPTS = \ LIBNAME=lib \ LIBEXECDIR=/usr/libexec/rc \ MKPKGCONFIG=no \ - MKSELINUX=no \ MKSYSVINIT=yes \ BRANDING="Buildroot $(BR2_VERSION_FULL)" \ CC=$(TARGET_CC)@@ -29,6 +28,13 @@ else OPENRC_MAKE_OPTS += MKSTATICLIBS=yes endif +ifeq ($(BR2_PACKAGE_LIBSELINUX),y) +OPENRC_MAKE_OPTS += MKSELINUX=yes +OPENRC_DEPENDENCIES += libselinux +else +OPENRC_MAKE_OPTS += MKSELINUX=no +endif + define OPENRC_BUILD_CMDS $(MAKE) $(OPENRC_MAKE_OPTS) -C $(@D) endefSignature · 6 lines
2.18.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 3/4 package/openrc: add libselinux support
CArlos, Adam, All,
On 2020-03-11 18:26 +0100, Yann E. MORIN spake thusly:
Quoted 10 lines
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 3 lines
From: Adam Duskett <[email protected]>
If the libselinux package is selected, add the package to the dependency list and explicitly setOPENRC_MAKE_OPTS+= MKSELINUX=yesThis SELinux stuff has always been a bit boo-I-dont-want-too-touch for me, because it looks overly complex, so just adding the dependency without explanations on how openrc uses/fits with SELinux is a bit too much for me to handle, so I defer to a SELinux-knowledgeable maintainer to look a it...
WHAT I forgot to say above the current commit log, is that it is not that helpful: it just repeats in english what the patch does, which is anyway already pretty trivial to see... What a commit log should say, is why the patch exists, and how the patch works.
Totally hypotetical commit log:
package/openrc: add libselinux support
OpenRC has suport for SELinux contexts, but we currently forcibly disable it.
When SELinux is enabled, we know a policy will be installed, so we can enable SELinux support in OpenRC.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 3/4 package/openrc: add libselinux support
Quoted 20 lines · Yann E. MORIN
CArlos, Adam, All,
On 2020-03-11 18:26 +0100, Yann E. MORIN spake thusly:
Quoted 10 lines
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 3 lines
From: Adam Duskett <[email protected]>
If the libselinux package is selected, add the package to the dependency list and explicitly setOPENRC_MAKE_OPTS+= MKSELINUX=yesThis SELinux stuff has always been a bit boo-I-dont-want-too-touch for me, because it looks overly complex, so just adding the dependency without explanations on how openrc uses/fits with SELinux is a bit too much for me to handle, so I defer to a SELinux-knowledgeable maintainer to look a it...
WHAT I forgot to say above the current commit log, is that it is not that helpful: it just repeats in english what the patch does, which is anyway already pretty trivial to see... What a commit log should say, is why the patch exists, and how the patch works.
Quoted 6 lines
Totally hypotetical commit log:
package/openrc: add libselinux support
OpenRC has suport for SELinux contexts, but we currently forcibly disable it.
OK, I will send a new patch with a better commit message and explained how I tested it.
Quoted 2 lines
When SELinux is enabled, we know a policy will be installed, so we can enable SELinux support in OpenRC.
Actually no policy is installed along with OpenRC. Enabling SELinux in OpenRC only adds code to perform the initial policy load and set the enforcing mode. See the security_load_policy(3) man page for additional details.
In order to make the SELinux support useful you also need a complete policy, currently provided by the refpolicy package, as well as the policycoreutils (for restorecon and other utilities). I'm not sure if those packages should be selected along with openrc (they are not selected by systemd, for instance).
As explained in the package help, the refpolicy works for the most part in permissive mode, only.
Signature · 1 line
Carlos Santos <[email protected]>
PATCH v2 3/4 package/openrc: add libselinux support
In reply to Yann E. MORINQuoted 6 lines · Yann E. MORIN
Carlos, All,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 2 lines
From: Adam Duskett <[email protected]>
Quoted 8 lines
Quoted 2 lines
If the libselinux package is selected, add the package to the dependency list and explicitly set
OPENRC_MAKE_OPTS+= MKSELINUX=yesThis SELinux stuff has always been a bit boo-I-dont-want-too-touch for me, because it looks overly complex, so just adding the dependency without explanations on how openrc uses/fits with SELinux is a bit too much for me to handle, so I defer to a SELinux-knowledgeable maintainer to look a it...
I tested it.
Signature · 1 line
Carlos Santos <[email protected]>
PATCH v2 4/4 support/testing: add openrc tests
In reply to unixmania at gmail.comFrom: Adam Duskett <[email protected]>
Two simple tests to ensure that openrc boots without any services crashing with a read only and a read write filing system.
--- .gitlab-ci.yml | 2 + support/testing/tests/init/test_openrc.py | 51 +++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 support/testing/tests/init/test_openrc.py
.gitlab-ci.yml +2 -0
@@ -368,6 +368,8 @@ tests.init.test_busybox.TestInitSystemBusyboxRoNet: { extends: .runtime_test } tests.init.test_busybox.TestInitSystemBusyboxRw: { extends: .runtime_test } tests.init.test_busybox.TestInitSystemBusyboxRwNet: { extends: .runtime_test } tests.init.test_none.TestInitSystemNone: { extends: .runtime_test } +tests.init.test_openrc.TestInitSystemOpenrcRoFull: { extends: .runtime_test } +tests.init.test_openrc.TestInitSystemOpenrcRwFull: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoFull: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoIfupdown: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoNetworkd: { extends: .runtime_test }
support/testing/tests/init/test_openrc.py new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
2.18.2
PATCH v2 4/4 support/testing: add openrc tests
Carlos, Adam, All,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 7 lines
From: Adam Duskett <[email protected]>
Two simple tests to ensure that openrc boots without any services crashing with a read only and a read write filing system.
Signed-off-by Adam Duskett <[email protected]>Signed-off-by Carlos Santos <[email protected]>
Thanks for this new runtime test! :-)
Would it make sense to apply just this test to master? Or does it really need the version bump first?
Regards,
Yann E. MORIN.
Quoted 83 lines
--- .gitlab-ci.yml | 2 + support/testing/tests/init/test_openrc.py | 51 +++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 support/testing/tests/init/test_openrc.py.gitlab-ci.yml +2
-0@@ -368,6 +368,8 @@ tests.init.test_busybox.TestInitSystemBusyboxRoNet: { extends: .runtime_test } tests.init.test_busybox.TestInitSystemBusyboxRw: { extends: .runtime_test } tests.init.test_busybox.TestInitSystemBusyboxRwNet: { extends: .runtime_test } tests.init.test_none.TestInitSystemNone: { extends: .runtime_test } +tests.init.test_openrc.TestInitSystemOpenrcRoFull: { extends: .runtime_test } +tests.init.test_openrc.TestInitSystemOpenrcRwFull: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoFull: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoIfupdown: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoNetworkd: { extends: .runtime_test }support/testing/tests/init/test_openrc.py new file +51
-0@@ -0,0 +1,51 @@ +import infra.basetest +from tests.init.base import InitSystemBase as InitSystemBase + + +class InitSystemOpenrcBase(InitSystemBase): + config = \ + """ + BR2_arm=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_INIT_OPENRC=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.5.7" + BR2_LINUX_KERNEL_DEFCONFIG="vexpress" + BR2_LINUX_KERNEL_DTS_SUPPORT=y + BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca9" + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def check_init(self): + super(InitSystemOpenrcBase, self) + + # Test all services are OK + output, _ = self.emulator.run("rc-status -c") + self.assertEqual(len(output), 0) + + +class TestInitSystemOpenrcRoFull(InitSystemOpenrcBase): + config = InitSystemOpenrcBase.config + \ + """ + BR2_SYSTEM_DHCP="eth0" + # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set + BR2_TARGET_ROOTFS_SQUASHFS=y + """ + + def test_run(self): + self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9") + self.check_init() + + +class TestInitSystemOpenrcRwFull(InitSystemOpenrcBase): + config = InitSystemOpenrcBase.config + \ + """ + BR2_SYSTEM_DHCP="eth0" + BR2_TARGET_ROOTFS_EXT2=y + """ + + def test_run(self): + self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9") + self.check_init()Signature · 6 lines
2.18.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 4/4 support/testing: add openrc tests
Quoted 99 lines · Yann E. MORIN
Carlos, Adam, All,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 7 lines
From: Adam Duskett <[email protected]>
Two simple tests to ensure that openrc boots without any services crashing with a read only and a read write filing system.
Signed-off-by Adam Duskett <[email protected]>Signed-off-by Carlos Santos <[email protected]>Thanks for this new runtime test! :-)
Would it make sense to apply just this test to master? Or does it really need the version bump first?
Regards,
Yann E. MORIN.Quoted 79 lines
--- .gitlab-ci.yml | 2 + support/testing/tests/init/test_openrc.py | 51 +++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 support/testing/tests/init/test_openrc.py.gitlab-ci.yml +2
-0@@ -368,6 +368,8 @@ tests.init.test_busybox.TestInitSystemBusyboxRoNet: { extends: .runtime_test } tests.init.test_busybox.TestInitSystemBusyboxRw: { extends: .runtime_test } tests.init.test_busybox.TestInitSystemBusyboxRwNet: { extends: .runtime_test } tests.init.test_none.TestInitSystemNone: { extends: .runtime_test } +tests.init.test_openrc.TestInitSystemOpenrcRoFull: { extends: .runtime_test } +tests.init.test_openrc.TestInitSystemOpenrcRwFull: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoFull: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoIfupdown: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoNetworkd: { extends: .runtime_test }support/testing/tests/init/test_openrc.py new file +51
-1@@ -0,0 +1,51 @@ +import infra.basetest +from tests.init.base import InitSystemBase as InitSystemBase + + +class InitSystemOpenrcBase(InitSystemBase): + config = \ + """ + BR2_arm=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_INIT_OPENRC=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.5.7" + BR2_LINUX_KERNEL_DEFCONFIG="vexpress" + BR2_LINUX_KERNEL_DTS_SUPPORT=y + BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca9" + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def check_init(self): + super(InitSystemOpenrcBase, self) + + # Test all services are OK + output, _ = self.emulator.run("rc-status -c") + self.assertEqual(len(output), 0) + + +class TestInitSystemOpenrcRoFull(InitSystemOpenrcBase): + config = InitSystemOpenrcBase.config + \ + """ + BR2_SYSTEM_DHCP="eth0" + # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set + BR2_TARGET_ROOTFS_SQUASHFS=y + """ + + def test_run(self): + self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9") + self.check_init() + + +class TestInitSystemOpenrcRwFull(InitSystemOpenrcBase): + config = InitSystemOpenrcBase.config + \ + """ + BR2_SYSTEM_DHCP="eth0" + BR2_TARGET_ROOTFS_EXT2=y + """ + + def test_run(self): + self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9") + self.check_init() --2.18.2
Quoted 4 lines
Quoted 4 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
The test is very simple and does not depend on any new openrc feature. I think it's safe to apply it on master.
Signature · 1 line
Carlos Santos <[email protected]>
Yann E. MORIN
AppliedPATCH v2 4/4 support/testing: add openrc tests
In reply to unixmania at gmail.comCarlos, All,
On 2020-03-01 12:17 -0300, unixmania at gmail.com spake thusly:
Quoted 7 lines
From: Adam Duskett <[email protected]>
Two simple tests to ensure that openrc boots without any services crashing with a read only and a read write filing system.
Signed-off-by Adam Duskett <[email protected]>Signed-off-by Carlos Santos <[email protected]>
Applied to master, but see some comments below...
Quoted 27 lines
--- .gitlab-ci.yml | 2 + support/testing/tests/init/test_openrc.py | 51 +++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 support/testing/tests/init/test_openrc.py.gitlab-ci.yml +2
-0@@ -368,6 +368,8 @@ tests.init.test_busybox.TestInitSystemBusyboxRoNet: { extends: .runtime_test } tests.init.test_busybox.TestInitSystemBusyboxRw: { extends: .runtime_test } tests.init.test_busybox.TestInitSystemBusyboxRwNet: { extends: .runtime_test } tests.init.test_none.TestInitSystemNone: { extends: .runtime_test } +tests.init.test_openrc.TestInitSystemOpenrcRoFull: { extends: .runtime_test } +tests.init.test_openrc.TestInitSystemOpenrcRwFull: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoFull: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoIfupdown: { extends: .runtime_test } tests.init.test_systemd.TestInitSystemSystemdRoNetworkd: { extends: .runtime_test }support/testing/tests/init/test_openrc.py new file +2
-0@@ -0,0 +1,51 @@ +import infra.basetest +from tests.init.base import InitSystemBase as InitSystemBase
support/testing/tests/init/test_openrc.py line 12
Quoted 10 lines
support/testing/tests/init/test_openrc.py new file +10
-0+ + +class InitSystemOpenrcBase(InitSystemBase): + config = \ + """ + BR2_arm=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_INIT_OPENRC=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_LINUX_KERNEL=y
Why can't we use the pre-built kernel?
support/testing/tests/init/test_openrc.py line 22
Quoted 10 lines
support/testing/tests/init/test_openrc.py new file +10
-0+ BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.5.7" + BR2_LINUX_KERNEL_DEFCONFIG="vexpress" + BR2_LINUX_KERNEL_DTS_SUPPORT=y + BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca9" + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def check_init(self): + super(InitSystemOpenrcBase, self)
I'm not sure what this is supposed to achieve... Did you forget to append the actual call to the super's check_init():
super(InitSystemOpenrcBase, self).check_init('/sbin/openrc-init')
I've fixed that and applied, but I'd still like some feedback at least on the kernel question, above.
Regards,
Yann E. MORIN.
Quoted 35 lines
support/testing/tests/init/test_openrc.py new file +28
-0+ # Test all services are OK + output, _ = self.emulator.run("rc-status -c") + self.assertEqual(len(output), 0) + + +class TestInitSystemOpenrcRoFull(InitSystemOpenrcBase): + config = InitSystemOpenrcBase.config + \ + """ + BR2_SYSTEM_DHCP="eth0" + # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set + BR2_TARGET_ROOTFS_SQUASHFS=y + """ + + def test_run(self): + self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9") + self.check_init() + + +class TestInitSystemOpenrcRwFull(InitSystemOpenrcBase): + config = InitSystemOpenrcBase.config + \ + """ + BR2_SYSTEM_DHCP="eth0" + BR2_TARGET_ROOTFS_EXT2=y + """ + + def test_run(self): + self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9") + self.check_init()Signature · 6 lines
2.18.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'