guix_mirror_bot pushed a commit to branch master
in repository guix.
commit ed5988f0d2cf14e3cc35a32e6ad91d7cbf535e2f
Author: Ludovic Courtès <[email protected]>
AuthorDate: Wed Jun 4 17:01:23 2025 +0200
linux-container: ‘containerized-operating-system’ provides ‘loopback’
service.
Fixes #420.
Previously, in systems produced by ‘guix system container’, the
‘loopback’ Shepherd service would fail to start with EEXIST, because the
“lo” interface already exists in the container. This commit provides a
fake ‘loopback’ Shepherd service that does nothing.
* gnu/system/linux-container.scm (dummy-networking-service-type): Change
to honor its configuration value.
(containerized-operating-system)[services-to-drop]: Add
‘static-networking-service-type’ in the non-‘shared-network?’ case.
[services-to-add]: Add ‘dummy-networking-service-type’ for loopback in
the non-‘shared-network?’ case.
Reported-by: Antonio Carlos Padoan Junior <[email protected]>
Change-Id: I326b5f3b5e08f67b6613c186497c44b1e887b02e
---
gnu/system/linux-container.scm | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index 8e208d3a70..e9be2c9d8a 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -78,12 +78,13 @@ from OS that are needed on the bare metal and not in a
container."
(define dummy-networking-service-type
(shepherd-service-type
'dummy-networking
- (const (shepherd-service
- (documentation "Provide loopback and networking without actually
+ (lambda (provision)
+ (shepherd-service
+ (documentation "Provide loopback and networking without actually
doing anything.")
- (provision '(loopback networking))
- (start #~(const #t))))
- #f
+ (provision provision)
+ (start #~(const #t))))
+ '(loopback networking)
(description "Provide loopback and networking without actually doing
anything. This service is used by guest systems running in containers, where
networking support is provided by the host.")))
@@ -135,7 +136,7 @@ containerized OS. EXTRA-FILE-SYSTEMS is a list of file
systems to add to OS."
dhcp-client-service-type
network-manager-service-type
connman-service-type)
- (list))))
+ (list static-networking-service-type)))) ;loopback
(define services-to-add
;; Many Guix services depend on a 'networking' shepherd
@@ -143,8 +144,10 @@ containerized OS. EXTRA-FILE-SYSTEMS is a list of file
systems to add to OS."
;; service when we are sure that networking is already set up
;; in the host and can be used. That prevents double setup.
(if shared-network?
- (list (service dummy-networking-service-type))
- '()))
+ (list (service dummy-networking-service-type
+ '(loopback networking)))
+ (list (service dummy-networking-service-type
+ '(loopback)))))
(define os-with-base-essential-services
(operating-system