From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7088339307047419904 X-Received: by 2002:a05:600c:34c7:b0:392:8d86:b148 with SMTP id d7-20020a05600c34c700b003928d86b148mr2334776wmq.117.1650439719539; Wed, 20 Apr 2022 00:28:39 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6000:1d8c:b0:207:aa22:e989 with SMTP id bk12-20020a0560001d8c00b00207aa22e989ls748380wrb.1.gmail; Wed, 20 Apr 2022 00:28:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5P5mcYwbjWBuZPOb0xRJc/gZau9gqfTikwcbynw8MuLHrNEtp1/7M8ahPK2DuafMvizPO X-Received: by 2002:a05:6000:71c:b0:207:a807:e297 with SMTP id bs28-20020a056000071c00b00207a807e297mr14192416wrb.596.1650439718571; Wed, 20 Apr 2022 00:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650439718; cv=none; d=google.com; s=arc-20160816; b=0QPuYr7Gd/yC0b08gi5yVeI+izKXLw5T/+tDb9/1tGkVyTaFiIu7hx6McC/L+kXcCH JP3zvDotnl9b44PTTCxKWac2eP8k3g1OSdU4EiYuRSDbr9yRUphFr3j5XTUJTJ3EwFhP ON5wkJTVhL/7Q+dtAwktck0ku5bxall3AaPNhMXHnfF6TnxJyJnztd/sD4PHRDbx25bM SvsPjcNtkd2yKDoyEo/ZMW74HUCJGqA5AbXeWDcE3iRGavs+9FVmBqBIZndt1BoMcCLc nYXE36IoRUJAIIPRESpSAEmloMXTrUjNgAsbOqqTld2QsG5iJJL9DwgDVqumaN8YmfOd UDsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:to:from:dkim-signature; bh=iwUnCn1R4zPr4J9lgeVuj2Ds4oIK2OlJRFEG6ZbriK8=; b=BtTUhdWcc0te4TLxp+9MKMQrmsReuHWEMJzhb1/p3gf8cER3WV/YxVN8I2dnBKa5T+ SVmTs68ic+fQHn/AqZvuaLDTTYsmA6MBxArX36N57qJTkpdn+SBBKqvOZBvO7hD4VYsl 0FzwuqhDDhdRXueSje0EG44+BILfW0vWP48u3yhaXfoPYGaRv60/8dFeDr5IUTuKdJ45 8Kc/PtjHCAULRPQ3jr74wGkfM3pkAN8X6emHqOU3khE+0mmi/S0FUgHH1BzuNkrlU5uG OpvwJronFXBMJcdskIKRvjAWaVRhuEr9tLwJwSXWajSX6UJfbUOkhk+ZHb6Ua2OQ6NkN fjRw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=BlnZod8u; spf=pass (google.com: domain of fm-51332-20220420072837d656410bbed8caf4c9-tkq3hn@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-51332-20220420072837d656410bbed8caf4c9-tKQ3HN@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-227.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id x20-20020a05600c21d400b0038c73e87e1asi297748wmj.0.2022.04.20.00.28.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2022 00:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-51332-20220420072837d656410bbed8caf4c9-tkq3hn@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=BlnZod8u; spf=pass (google.com: domain of fm-51332-20220420072837d656410bbed8caf4c9-tkq3hn@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-51332-20220420072837d656410bbed8caf4c9-tKQ3HN@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: by mta-64-227.flowmailer.net with ESMTPSA id 20220420072837d656410bbed8caf4c9 for ; Wed, 20 Apr 2022 09:28:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=iwUnCn1R4zPr4J9lgeVuj2Ds4oIK2OlJRFEG6ZbriK8=; b=BlnZod8u6NqYdLHCI97XuqVt4VrSaOQIKNvipy8EFuM8LvdCs8bfmrGkZy2i5PkF/Qz2R8 khYPTitarI/YSX/kBoJehUeLzyjFeHTsq9MKsXYLTjz79+Hu0t0J10lAJtl2desP9Ff8pKXT 639F2bno/O4jSl96m2bedIjdWsNbs=; From: Quirin Gylstorff To: jan.kiszka@siemens.com, isar-users@googlegroups.com Subject: [PATCH v2] classes/image-postproc-extension: Remove /etc/machine-id Date: Wed, 20 Apr 2022 09:28:36 +0200 Message-Id: <20220420072836.324028-1-Quirin.Gylstorff@siemens.com> In-Reply-To: <20220419153640.222797-1-Quirin.Gylstorff@siemens.com> References: <20220419153640.222797-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer X-TUID: 6k9n/EiEiYBY From: kas In a read-only system the machine id should be deleted or set to `unitialized\n`[1]. Systemd will generate a new machine-id during the first boot. In the case of a read-only root file system Systemd generates a mount point with the machine id. If an overlay for /etc is used this creates a mount conflict. To avoid the conflict between the overlay filesystem and systemd /etc/machine-id mount point deleted the file /etc/machine-id. This partly reverts 98d6a72d3064. The man page[2] was updated for Debian Bullseye to allow a missing machine id. For Debian Bullseye it reads: ``` For operating system images which are created once and used on multiple machines, for example for containers or in the cloud, /etc/machine-id should be either missing or an empty file in the generic file system image ``` [1]: https://systemd.io/BUILDING_IMAGES/ [2]: https://manpages.debian.org/bullseye/systemd/machine-id.5.en.html Signed-off-by: Quirin Gylstorff --- Changes V2: - add information about revert of 98d6a72d3064 meta/classes/image-postproc-extension.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass index ca520273..0c412c0d 100644 --- a/meta/classes/image-postproc-extension.bbclass +++ b/meta/classes/image-postproc-extension.bbclass @@ -57,7 +57,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id" image_postprocess_machine_id() { # systemd(1) takes care of recreating the machine-id on first boot sudo rm -f '${IMAGE_ROOTFS}/var/lib/dbus/machine-id' - sudo install -m 644 '/dev/null' '${IMAGE_ROOTFS}/etc/machine-id' + sudo rm -f '${IMAGE_ROOTFS}/etc/machine-id' } ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_sshd_key_regen" -- 2.35.1