Skip to contentSkip to conversation

openrc: further itegration (branch yem/openrc)

PATCH New Yann E. MORIN 3 participants 12 messages Aug 4, 2019 – Sep 25, 2019

lore
Share & tools
lore
#0 lore raw

v3 cover openrc: further itegration (branch yem/openrc)

Hello All!

This series continues the integration of the OpenRC init system in Buildroot:
- legacy sysv init compatibility
- handle remounting root read/write
- getty support
- netifrc package to replace openrc internal network handling

This series is a respin of patches initially from Micha?, heavily tweaked by me. I'll soon reply to the initial patches that were left behind.

Regards,
Yann E. MORIN.

The following changes since commit 6f79cebe6a7152f2bb83af01a8909c4e33168d45

package/linux-headers: apply all Linux patches when BR2_KERNEL_HEADERS_AS_KERNEL=y (2019-08-04 12:53:03 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 30a72507b462c74206c354feae3887e54b96da09

package/netifrc: add support for BR2_SYSTEM_DHCP (2019-08-04 14:02:27 +0200)

----------------------------------------------------------------
Micha? ?yszczek (5):
package/skeleton-init-openrc: add support for starting sysv scripts package/skeleton-init-openrc: add support to remount rootfs as rw package/openrc: add support for spawning getty package/netifrc: new package
package/netifrc: add support for BR2_SYSTEM_DHCP

 DEVELOPERS                                         |  1 +
 docs/manual/adding-packages-generic.txt            |  5 +-
 package/Config.in                                  |  1 +
 package/netifrc/Config.in                          | 12 +++++
 package/netifrc/netifrc.hash                       |  3 ++
 package/netifrc/netifrc.mk                         | 57 ++++++++++++++++++++++
 package/openrc/getty                               | 24 +++++++++
 package/openrc/openrc.mk                           | 29 +++++++++++
 package/openrc/sysv-rcs                            | 25 ++++++++++
 package/pkg-generic.mk                             |  3 +-
 .../skeleton-init-openrc/skeleton-init-openrc.mk   | 15 ++++++
 .../skeleton/etc/conf.d/.empty                     |  0
 package/skeleton-init-openrc/skeleton/etc/fstab    |  1 +
 .../skeleton/etc/runlevels/default/.empty          |  0
 .../skeleton/etc/runlevels/default/sysv-rcs        |  1 +
 system/Config.in                                   | 16 +++---
 16 files changed, 184 insertions(+), 9 deletions(-)
 create mode 100644 package/netifrc/Config.in
 create mode 100644 package/netifrc/netifrc.hash
 create mode 100644 package/netifrc/netifrc.mk
 create mode 100755 package/openrc/getty
 create mode 100755 package/openrc/sysv-rcs
 create mode 100644 package/skeleton-init-openrc/skeleton/etc/conf.d/.empty
 create mode 100644 package/skeleton-init-openrc/skeleton/etc/runlevels/default/.empty
 create mode 120000 package/skeleton-init-openrc/skeleton/etc/runlevels/default/sysv-rcs
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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v3 1/5 package/skeleton-init-openrc: add support for starting sysv scripts

From: Micha? ?yszczek <[email protected]>

Add an OpenRC service that starts and stops sysv-init scripts. We order that scrpt 'after local' so that it is started after all other native openrc services.

[yann.morin.1998 at free.fr:
- don't propagate the micro optimisation for running .sh scripts
- use spaces, not TABs
- stop services in reverse order
- reword commit log
]

---
 docs/manual/adding-packages-generic.txt       |  5 +++-
 package/openrc/sysv-rcs                       | 25 +++++++++++++++++++
 package/pkg-generic.mk                        |  3 ++-
 .../skeleton/etc/runlevels/default/sysv-rcs   |  1 +
 4 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100755 package/openrc/sysv-rcs
 create mode 120000 package/skeleton-init-openrc/skeleton/etc/runlevels/default/sysv-rcs
docs/manual/adding-packages-generic.txt +4 -1
index 5ac07a81b4..b402767b05 100644
@@ -542,7 +542,10 @@ different steps of the build process.
   sysvinit, etc.), openrc or for the systemd units. These commands
   will be run only when the relevant init system is installed (i.e.
   if systemd is selected as the init system in the configuration,
-  only +LIBFOO_INSTALL_INIT_SYSTEMD+ will be run).
+  only +LIBFOO_INSTALL_INIT_SYSTEMD+ will be run). The only exception
+  is when openrc is chosen as init system and +LIBFOO_INSTALL_INIT_OPENRC+
+  has not been set, in such situation +LIBFOO_INSTALL_INIT_SYSV+ will
+  be called, since openrc supports sysv init scripts.
 
 * +LIBFOO_HELP_CMDS+ lists the actions to print the package help, which
   is included to the main +make help+ output. These commands can print
package/openrc/sysv-rcs new file +25 -0
new file mode 100755
index 0000000000..606a73d2b4
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+
+description="start or stop sysv rc[S,K] scripts"
+
+depend() {
+    after local
+}
+
+start() {
+    einfo "Starting sysv rc scripts"
+    for i in /etc/init.d/S??*; do
+        # Ignore dangling symlinks (if any).
+        [ -e "$i" ] || continue
+        $i start
+    done
+}
+
+stop() {
+    einfo "Stopping sysv rc scripts"
+    for i in $(ls -r /etc/init.d/S??*); do
+        # Ignore dangling symlinks (if any).
+        [ -e "$i" ] || continue
+        $i stop
+    done
+}
package/pkg-generic.mk +2 -1
index 9620dec524..1f24b52a69 100644
@@ -338,7 +338,8 @@ $(BUILD_DIR)/%/.stamp_target_installed:
 	$(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
 		$($(PKG)_INSTALL_INIT_SYSV))
 	$(if $(BR2_INIT_OPENRC), \
-		$($(PKG)_INSTALL_INIT_OPENRC))
+		$(or $($(PKG)_INSTALL_INIT_OPENRC), \
+			$($(PKG)_INSTALL_INIT_SYSV)))
 	$(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
 	$(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
 		$(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \
package/skeleton-init-openrc/skeleton/etc/runlevels/default/sysv-rcs new file +1 -0
new file mode 120000
index 0000000000..ef5e00823c
@@ -0,0 +1 @@
+/etc/init.d/sysv-rcs
\ No newline at end of file
Signature · 1 line
2.20.1
#2 lore raw

PATCH v3 2/5 package/skeleton-init-openrc: add support to remount rootfs as rw

In reply to Yann E. MORIN

From: Micha? ?yszczek <[email protected]>

Add a pseudo entry for /dev/root in fstab, to tell openrc to prperly remount or not remount / read-write.

For consistency with systemd (which is the only other init system to tweak an fstab basd on / being rw or not), we do this change in the openrc skeleton rahter than in the openrc package.

[yann.morin.1998 at free.fr:
- tweak the sed expressions
- reword commit log
]

---
 .../skeleton-init-openrc/skeleton-init-openrc.mk  | 15 +++++++++++++++
 package/skeleton-init-openrc/skeleton/etc/fstab   |  1 +
 2 files changed, 16 insertions(+)
package/skeleton-init-openrc/skeleton-init-openrc.mk +15 -0
index 5ee2192093..656fc531d7 100644
@@ -15,8 +15,23 @@ SKELETON_INIT_OPENRC_DEPENDENCIES = skeleton-init-common
 
 SKELETON_INIT_OPENRC_PROVIDES = skeleton
 
+ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
+# Comment /dev/root entry in fstab. When openrc does not find fstab entry for
+# "/", it will try to remount "/" as "rw".
+define SKELETON_INIT_OPENRC_ROOT_RO_OR_RW
+	$(SED) '\:^/dev/root :s/^/# /' $(TARGET_DIR)/etc/fstab
+endef
+else
+# Uncomment /dev/root entry in fstab which has "ro" option so openrc notices
+# it and doesn't remount root to rw.
+define SKELETON_INIT_OPENRC_ROOT_RO_OR_RW
+	$(SED) '\:^# /dev/root:s/^# //' $(TARGET_DIR)/etc/fstab
+endef
+endif # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
+
 define SKELETON_INIT_OPENRC_INSTALL_TARGET_CMDS
 	$(call SYSTEM_RSYNC,$(SKELETON_INIT_OPENRC_PKGDIR)/skeleton,$(TARGET_DIR))
+	$(SKELETON_INIT_OPENRC_ROOT_RO_OR_RW)
 endef
 
 $(eval $(generic-package))
package/skeleton-init-openrc/skeleton/etc/fstab +1 -0
index 3ec96cf634..21cf49ba5a 100644
@@ -1,3 +1,4 @@
 # <file system>	<mount pt>	<type>	<options>	<dump>	<pass>
+/dev/root	/		ext2	ro,noauto	0	0
 tmpfs		/tmp		tmpfs	mode=1777	0	0
 tmpfs		/run		tmpfs	mode=0755,nosuid,nodev	0	0
Signature · 1 line
2.20.1
#3 lore raw

PATCH v3 3/5 package/openrc: add support for spawning getty

In reply to Yann E. MORIN

From: Micha? ?yszczek <[email protected]>

We install a template getty service, and we 'instanciate' 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), we do do provide it from the openrc package itself.

OpenrRC 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

[yann.morin.1998 at free.fr:
- move getty template to openrc package (Thomas)
- fix namespace of the vaiables (Thomas)
- simplify creation of the defaults file
- rewrite commit log
]

Cc Thomas Petazzoni <[email protected]>
---
 package/openrc/getty                          | 24 +++++++++++++++++++
 package/openrc/openrc.mk                      | 18 ++++++++++++++
 .../skeleton/etc/conf.d/.empty                |  0
 .../skeleton/etc/runlevels/default/.empty     |  0
 system/Config.in                              |  8 +++----
 5 files changed, 46 insertions(+), 4 deletions(-)
 create mode 100755 package/openrc/getty
 create mode 100644 package/skeleton-init-openrc/skeleton/etc/conf.d/.empty
 create mode 100644 package/skeleton-init-openrc/skeleton/etc/runlevels/default/.empty
package/openrc/getty new file +24 -0
new file mode 100755
index 0000000000..8fcb071f8a
@@ -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}"
+}
package/openrc/openrc.mk +18 -0
index 53f2947dcc..5978b6de5d 100644
@@ -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))
package/skeleton-init-openrc/skeleton/etc/conf.d/.empty new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
package/skeleton-init-openrc/skeleton/etc/runlevels/default/.empty new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
system/Config.in +4 -4
index af7d8566d3..1bfe069b2e 100644
@@ -348,16 +348,16 @@ config BR2_TARGET_GENERIC_GETTY_BAUDRATE
 config BR2_TARGET_GENERIC_GETTY_TERM
 	string "TERM environment variable"
 	default "vt100"
-	# currently observed only by busybox and sysvinit
-	depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV
+	# currently observed by all but systemd
+	depends on !BR2_INIT_SYSTEMD
 	help
 	  Specify a TERM type.
 
 config BR2_TARGET_GENERIC_GETTY_OPTIONS
 	string "other options to pass to getty"
 	default ""
-	# currently observed only by busybox and sysvinit
-	depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV
+	# currently observed by all but systemd
+	depends on !BR2_INIT_SYSTEMD
 	help
 	  Any other flags you want to pass to getty,
 	  Refer to getty --help for details.
Signature · 1 line
2.20.1
#4 lore raw

PATCH v3 4/5 package/netifrc: new package

In reply to Yann E. MORIN

From: Micha? ?yszczek <[email protected]>

netifrc entirely replaces openrc's basic network management. As such, it conflicts with the network services installed by openrc, so we remove them from openrc when netifrc is enabled.

Currently, we only catter tfor the loopback interface, but we prepare for also handling the DHCP interface, to come in a latter patch.

[yann.morin.1998 at free.fr:
- remove openrc files within the openrc package itself
- as it's a generic-package, no need to use post-install hooks
- use description from the homepage in the help text
- check-package fixes
- rename package
]

---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/netifrc/Config.in    | 12 ++++++++++
 package/netifrc/netifrc.hash |  3 +++
 package/netifrc/netifrc.mk   | 45 ++++++++++++++++++++++++++++++++++++
 package/openrc/openrc.mk     | 11 +++++++++
 6 files changed, 73 insertions(+)
 create mode 100644 package/netifrc/Config.in
 create mode 100644 package/netifrc/netifrc.hash
 create mode 100644 package/netifrc/netifrc.mk
DEVELOPERS +1 -0
index d43a9f2c74..9483a5056a 100644
@@ -1646,6 +1646,7 @@ F:	board/altera/socrates_cyclone5/
 F:	board/pine64/rock64
 F:	configs/rock64_defconfig
 F:	configs/socrates_cyclone5_defconfig
+F:	package/netifrc/
 F:	package/openrc/
 F:	package/skeleton-init-openrc/
 
package/Config.in +1 -0
index cb0f89ad99..7d271117e3 100644
@@ -2220,6 +2220,7 @@ menu "System tools"
 	source "package/mender-grubenv/Config.in"
 	source "package/monit/Config.in"
 	source "package/ncdu/Config.in"
+	source "package/netifrc/Config.in"
 	source "package/numactl/Config.in"
 	source "package/nut/Config.in"
 	source "package/openrc/Config.in"
package/netifrc/Config.in new file +12 -0
new file mode 100644
index 0000000000..9347033d67
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_NETIFRC
+	bool "netifrc"
+	depends on BR2_PACKAGE_OPENRC
+	help
+	  netifrc is a collection of modules created to configure and
+	  manage network interfaces via individual, per-interface
+	  scripts.
+
+	  https://wiki.gentoo.org/wiki/Netifrc
+
+comment "netifrc needs openrc as init system"
+	depends on !BR2_PACKAGE_OPENRC
package/netifrc/netifrc.hash new file +3 -0
new file mode 100644
index 0000000000..d811acc4a2
@@ -0,0 +1,3 @@
+# Calculated manually
+sha256	004907e0c3db2d106d6a51d604d79f971f1013fa7642054ad7efe5076e52f7b3	netifrc-0.6.1.tar.gz
+sha256	da376c9e2244f2a7220767ea4dd88cf423ff5b548e7c2f96b0f3b9dac727748a	LICENSE
package/netifrc/netifrc.mk new file +45 -0

45 lines not on this page · raw message

package/openrc/openrc.mk +11 -0
index 5978b6de5d..387962d4d5 100644
@@ -37,6 +37,17 @@ define OPENRC_INSTALL_TARGET_CMDS
 	$(MAKE) $(OPENRC_MAKE_OPTS) DESTDIR=$(TARGET_DIR) -C $(@D) install
 endef
 
+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
+OPENRC_POST_TARGET_INSTALL_HOOKS += OPENRC_NO_NET
+endif
+
 define OPENRC_REMOVE_UNNEEDED
 	$(RM) -r $(TARGET_DIR)/usr/share/openrc
 endef
Signature · 1 line
2.20.1
#5 lore raw

PATCH v3 4/5 package/netifrc: new package

Quoted 14 lines · On Sun, 4 Aug 2019 14:14:18 +0200 "Yann E. MORIN" <[email protected]>…
package/netifrc/netifrc.mk new file +14 -0
+NETIFRC_VERSION = 0.6.1
+NETIFRC_SITE = $(call github,gentoo,netifrc,$(NETIFRC_VERSION))
+NETIFRC_LICENSE = BSD-2-Clause
+NETIFRC_LICENSE_FILES = LICENSE
+
+NETIFRC_DEPENDENCIES = openrc
+
+# set LIBNAME so netifrc puts files in proper directories and sets proper
+# paths in installed files. Since in buildroot /lib64 and /lib32 always
+# points to /lib, it's safe to hardcode it to "lib"
+NETIFRC_MAKE_OPTS = \
+	LIBNAME=lib \
+	LIBEXECDIR=/usr/libexec/netifrc
+

package/netifrc/netifrc.mk line 30

Quoted 10 lines
package/netifrc/netifrc.mk new file +10 -0
+define NETIFRC_BUILD_CMDS
+	$(MAKE) $(NETIFRC_MAKE_OPTS) -C $(@D)
+endef
+
+ifeq ($(BR2_PACKAGE_HAS_UDEV),)
+define NETIFRC_REMOVE_UDEV
+	$(RM) $(TARGET_DIR)/lib/udev/net.sh
+	$(RM) $(TARGET_DIR)/lib/udev/rules.d/90-network.rules
+	rmdir --ignore-fail-on-non-empty  $(TARGET_DIR)/lib/udev/rules.d
+	rmdir --ignore-fail-on-non-empty  $(TARGET_DIR)/lib/udev

This was failing, because netifrc installed its udev stuff in /usr/lib/udev, because here it queried pkg-config (the host one) of udevdir. So I've forced that to be /lib/udev by passing UDEVDIR=/lib/udev in NETIFRC_MAKE_OPTS.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

PATCH v3 5/5 package/netifrc: add support for BR2_SYSTEM_DHCP

In reply to Yann E. MORIN

From: Micha? ?yszczek <[email protected]>

This patch makes openrc-netifrc package aware of BR2_SYSTEM_DHCP config, and if set, will start dhcp daemon on configured interface.

[yann.morin.1998 at free.fr:
- simplify condition for BR2_SYSTEM_DHCP
- reword commit log
]

---
 package/netifrc/netifrc.mk | 12 ++++++++++++
 system/Config.in           |  8 +++++---
 2 files changed, 17 insertions(+), 3 deletions(-)
package/netifrc/netifrc.mk +12 -0
index 4b9a0a8d39..15719ee8b4 100644
@@ -31,8 +31,19 @@ define NETIFRC_REMOVE_UDEV
 endef
 endif # BR2_PACKAGE_HAS_UDEV
 
+NETIFRC_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
+ifneq ($(NETIFRC_DHCP_IFACE),)
+NETIFRC_DHCP_CFG = config_$(NETIFRC_DHCP_IFACE)="dhcp"
+define NETIFRC_DHCP_SERVICE
+	ln -sf net.lo $(TARGET_DIR)/etc/init.d/net.$(NETIFRC_DHCP_IFACE)
+	ln -sf /etc/init.d/net.$(NETIFRC_DHCP_IFACE) \
+		$(TARGET_DIR)/etc/runlevels/default/net.$(NETIFRC_DHCP_IFACE)
+endef
+endif # BR2_SYSTEM_DHCP != ""
+
 define NETIFRC_NET_CFG
 	config_lo="127.0.0.1/8"
+	$(NETIFRC_DHCP_CFG)
 endef
 
 define NETIFRC_INSTALL_TARGET_CMDS
@@ -40,6 +51,7 @@ define NETIFRC_INSTALL_TARGET_CMDS
 	$(NETIFRC_REMOVE_UDEV)
 	$(call PRINTF,$(NETIFRC_NET_CFG)) > $(TARGET_DIR)/etc/conf.d/net
 	ln -sf /etc/init.d/net.lo $(TARGET_DIR)/etc/runlevels/default/net.lo
+	$(NETIFRC_DHCP_SERVICE)
 endef
 
 $(eval $(generic-package))
system/Config.in +5 -3
index 1bfe069b2e..c87266f431 100644
@@ -377,7 +377,8 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
 config BR2_SYSTEM_DHCP
 	string "Network interface to configure through DHCP"
 	default ""
-	depends on BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || BR2_PACKAGE_SYSTEMD_NETWORKD
+	depends on BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || \
+		BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_NETIFRC
 	help
 	  Enter here the name of the network interface (E.G. eth0) to
 	  automatically configure through DHCP at bootup.
@@ -388,8 +389,9 @@ config BR2_SYSTEM_DHCP
 	  overwrite /etc/network/interfaces or add a networkd
 	  configuration file.
 
-comment "automatic network configuration via DHCP needs ifupdown or busybox or networkd"
-	depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || BR2_PACKAGE_SYSTEMD_NETWORKD)
+comment "automatic network configuration via DHCP needs ifupdown or busybox or networkd or netifrc"
+	depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || \
+		BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_NETIFRC)
 
 endif # BR2_ROOTFS_SKELETON_DEFAULT
 
Signature · 1 line
2.20.1
#7 lore raw

v3 cover openrc: further itegration (branch yem/openrc)

In reply to Yann E. MORIN

Hello,

Quoted 6 lines · On Sun, 4 Aug 2019 14:14:15 +0200 "Yann E. MORIN" <[email protected]>…

Micha? ?yszczek (5):
package/skeleton-init-openrc: add support for starting sysv scripts package/skeleton-init-openrc: add support to remount rootfs as rw package/openrc: add support for spawning getty package/netifrc: new package
package/netifrc: add support for BR2_SYSTEM_DHCP

Thanks a lot, I've applied the series. There was an issue on PATCH 4/5 though, so I'll reply to that.

When I test this series, with Busybox, there are a few errors at boot time related to loadkeys, dumpkeys and kbd_mode being missing:
http://code.bulix.org/39k5v9-881711?raw. Can we do something about this? This was on a machine with no screen/keyboard, i.e console over serial port.

Also, would it be possible to add a test case for OpenRC in support/testing/tests/init/ ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw

v3 cover openrc: further itegration (branch yem/openrc)

Quoted 12 lines · Thomas Petazzoni

Hello,

Quoted 6 lines · On Sun, 4 Aug 2019 14:14:15 +0200 "Yann E. MORIN" <[email protected]>…

Micha? ?yszczek (5):
package/skeleton-init-openrc: add support for starting sysv scripts package/skeleton-init-openrc: add support to remount rootfs as rw package/openrc: add support for spawning getty package/netifrc: new package
package/netifrc: add support for BR2_SYSTEM_DHCP

Quoted 8 lines

Thanks a lot, I've applied the series. There was an issue on PATCH 4/5 though, so I'll reply to that.

When I test this series, with Busybox, there are a few errors at boot time related to loadkeys, dumpkeys and kbd_mode being missing:
http://code.bulix.org/39k5v9-881711?raw. Can we do something about this? This was on a machine with no screen/keyboard, i.e console over serial port.

This looks like some keyboard related programs were not installed, and in this case those keyboard scripts should not be installed I reckon, as it seems pointless to set keyboard mapping if system does not have keyboard installed.

I suspect bug in Kconfig, missing deps, I will look at it today.

Quoted 2 lines

Also, would it be possible to add a test case for OpenRC in support/testing/tests/init/ ?

Sure, once openrc is fully merged (as in there is no more changes during
review) I will write those tests.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190924/5ac2093f/attachment.asc>

#9 lore raw

v3 cover openrc: further itegration (branch yem/openrc)

Hi Thomas

Quoted 27 lines · michal.lyszczek at bofc.pl
Quoted 12 lines · Thomas Petazzoni

Hello,

Quoted 6 lines · On Sun, 4 Aug 2019 14:14:15 +0200 "Yann E. MORIN" <[email protected]>…

Micha? ?yszczek (5):
package/skeleton-init-openrc: add support for starting sysv scripts package/skeleton-init-openrc: add support to remount rootfs as rw package/openrc: add support for spawning getty package/netifrc: new package
package/netifrc: add support for BR2_SYSTEM_DHCP

Quoted 8 lines

Thanks a lot, I've applied the series. There was an issue on PATCH 4/5 though, so I'll reply to that.

When I test this series, with Busybox, there are a few errors at boot time related to loadkeys, dumpkeys and kbd_mode being missing:
http://code.bulix.org/39k5v9-881711?raw. Can we do something about this? This was on a machine with no screen/keyboard, i.e console over serial port.

This looks like some keyboard related programs were not installed, and in this case those keyboard scripts should not be installed I reckon, as it seems pointless to set keyboard mapping if system does not have keyboard installed.

Quoted 7 lines

I suspect bug in Kconfig, missing deps, I will look at it today.

Quoted 2 lines

Also, would it be possible to add a test case for OpenRC in support/testing/tests/init/ ?

Sure, once openrc is fully merged (as in there is no more changes during review) I will write those tests.

It looks like openrc is starting `keymaps' service, which means BR2_TARGET_GENERIC_TERM_KEYMAP is enabled, but this config depends on BR2_INIT_OPENRC && BR2_PACKAGE_KBD, (related snipet):

Quoted 7 lines

config BR2_TARGET_GENERIC_TERM_KEYMAP
????string "Set terminal keymap"
????default "us"
????depends on BR2_INIT_OPENRC && BR2_PACKAGE_KBD

comment "Setting terminal keymap requires OpenRC and kdb package" ????depends on !(BR2_INIT_OPENRC && BR2_PACKAGE_KBD)

keymaps service is disabled in package/openrc/openrc.mk

Quoted 9 lines

OPENRC_TERM_KEYMAP = $(call qstrip,$(BR2_TARGET_GENERIC_TERM_KEYMAP)) ifneq ($(OPENRC_TERM_KEYMAP),)
(...)
else
define OPENRC_SET_TERM_KEYMAP
????$(RM) $(TARGET_DIR)/etc/runlevels/boot/{keymaps,save-keymaps} ????$(RM) $(TARGET_DIR)/etc/conf.d/keymaps
endef
endif # OPENRC_TERM_KEYMAP

so it would seem that BR2_PACKAGE_KBD is set in the same time as BR2_TARGET_GENERIC_TERM_KEYMAP, which is strange as `depends' looks legit and this should not happen (and I am sure I've tested it and it worked fine).

So, can you please share your .config or name of defconfig you used, as
I cannot seem to reproduce this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190924/1bb309f6/attachment.asc>

#10 lore raw

v3 cover openrc: further itegration (branch yem/openrc)

Hello Michal,

Quoted 3 lines · On Tue, 24 Sep 2019 23:50:56 +0200 michal.lyszczek at bofc.pl wrote:

It looks like openrc is starting `keymaps' service, which means BR2_TARGET_GENERIC_TERM_KEYMAP is enabled, but this config depends on BR2_INIT_OPENRC && BR2_PACKAGE_KBD, (related snipet):

I'm not sure which version of Buildroot you're looking at, but there is no option named BR2_TARGET_GENERIC_TERM_KEYMAP in current Buildroot master.

Quoted 1 line

keymaps service is disabled in package/openrc/openrc.mk

And there's no such code in openrc.mk in Buildroot master.

Perhaps you're looking at some local branch you have, with some patches that are not in upstream Buildroot at this point ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#11 lore raw

v3 cover openrc: further itegration (branch yem/openrc)

Hello Thomas,

Quoted 13 lines · Thomas Petazzoni

Hello Michal,

Quoted 3 lines · On Tue, 24 Sep 2019 23:50:56 +0200 michal.lyszczek at bofc.pl wrote:

It looks like openrc is starting `keymaps' service, which means BR2_TARGET_GENERIC_TERM_KEYMAP is enabled, but this config depends on BR2_INIT_OPENRC && BR2_PACKAGE_KBD, (related snipet):

I'm not sure which version of Buildroot you're looking at, but there is no option named BR2_TARGET_GENERIC_TERM_KEYMAP in current Buildroot master.

Quoted 6 lines
Quoted 1 line

keymaps service is disabled in package/openrc/openrc.mk

And there's no such code in openrc.mk in Buildroot master.

Perhaps you're looking at some local branch you have, with some patches that are not in upstream Buildroot at this point ?

Right, so it would seem you are missing these 2 patches

https://patchwork.ozlabs.org/patch/1098589/
https://patchwork.ozlabs.org/patch/1098588/

I remember Yann saying it would be nice to have this in every init system, not only openrc. This is probably the reason why these 2 were not merged. But honestly I don't really know what changes to make to make these patches generic to all init systems. The only common parts are:

Quoted 8 lines

config BR2_TARGET_GENERIC_TERM_KEYMAP
string "Set terminal keymap"
default "us"
depends on BR2_INIT_OPENRC && BR2_PACKAGE_KBD
help
Configures all virtual terminals (on /dev/tty[1-12]) to use specified keymap. List of keymaps are installed in /usr/share/keymaps. Set to empty, to keep default keymap.

and

Quoted 9 lines

choice
prompt "Terminal encoding"
default BR2_TARGET_GENERIC_TERMENCODING_KEEP
depends on BR2_INIT_OPENRC
help
Set terminal encoding. This makes sense only when you are going to use virtual terminals with external monitor (or qemu) that uses /dev/tty[1-12].

Quoted 7 lines

config BR2_TARGET_GENERIC_TERMENCODING_KEEP
bool "keep default"
config BR2_TARGET_GENERIC_TERMENCODING_ASCII
bool "ascii"
config BR2_TARGET_GENERIC_TERMENCODING_UTF8

	bool "utf-8"

endchoice

Which for me look generic enough to be used in other init systems, we just
have to remove `depends on BR2_INIT_OPENRC' (or add deps on another init)
once it is implemented in others inits. Other changes regarding these
features are done in package/openrc/openrc.mk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190925/d99fe2c6/attachment.asc>