From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6695999620571463680 X-Received: by 2002:a1c:a807:: with SMTP id r7mr4235797wme.137.1559128007745; Wed, 29 May 2019 04:06:47 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:544d:: with SMTP id w13ls417408wrv.16.gmail; Wed, 29 May 2019 04:06:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzr6dGWtUAQbLSFhtVpNzN9okcSTJ4E9E9p2Gykw9Kteu/a0YMoIEy4lML3kjWZ0faAiBFb X-Received: by 2002:adf:f542:: with SMTP id j2mr4821719wrp.16.1559128007309; Wed, 29 May 2019 04:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559128007; cv=none; d=google.com; s=arc-20160816; b=gkNmemqLHaX1gFVeYmf03WeUzkjQo6vYLUea6dITgL/RKs86zZrIHUfLtJXiXfnsJN 6Gekbko9imZWgLLzUHQYl6qSuD4Nj3cWnDWsAiU9Iy7v52RetztqmT1+OkjAExCeZdKl 31b6jgRdOBGyKxIp3krUHhP5oFVHk0UxupRO563XM78mLt3HZB8pNb6gHn3Ha+/DFN4l sLglT6wFP9AdyCfHVWWpe5R6Xc+L38GA15Gf+g5+gIPleKwLGHGIzdWThpvK2trh2cBC FJPX0btawjYxcJQ12M1Ytt0eOLdqiN47KxujmIkROQQ4j8j5R5fMyJp/wAxB1rkHoan8 s9yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=rjvOOn4SbNrwgjYmFwmw7by2PhX4JrhDkSevG0hOo2Y=; b=KuvWBPleBhGJjWd4oB0YzvEzF0XLN+d+4xk1J2afvI1lA0DYKZoAnYXzSMaQdJKMUD DusxCmH2DsqBzVObHiUqSn4WY3Bcw41S4BADJOr1Em6Km8ObjILZiBcK1LPK5XbJqi8Y 4NBxjRvF341FZX8RxRAkC24cakI2gHRnlqdeLzWNAkNFB4WFIoMLHG8V8e07hpFYfPGT TIxinDTnfPbH1kNNxCW7dtuTZFNSo9wCT31XYx3w2o2zBIWeftDQs9H4TW7Bf2ovo4vZ vYihd1svdbdFwm7SJzj8IMafVHFLWIN1wjIangZk6/IC25CxMqeUJ9xnCVS3PkRvAKFX W2cA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id x3si80193wmh.4.2019.05.29.04.06.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 04:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id x4TB6koC000728 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 May 2019 13:06:46 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.69.101]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x4TB6kiM017445; Wed, 29 May 2019 13:06:46 +0200 Date: Wed, 29 May 2019 13:06:44 +0200 From: Henning Schild To: Claudius Heine Cc: , Claudius Heine Subject: Re: [PATCH 3/3] image-postproc-extension: add removal of machine-id Message-ID: <20190529130644.3fa8be7c@md1za8fc.ad001.siemens.net> In-Reply-To: <10cc6729-ddae-141d-abaa-43081707fd84@siemens.com> References: <20190528085814.12967-1-claudius.heine.ext@siemens.com> <20190528085814.12967-4-claudius.heine.ext@siemens.com> <20190528194452.46def4c8@md1za8fc.ad001.siemens.net> <10cc6729-ddae-141d-abaa-43081707fd84@siemens.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: ynj8jnmTM2cC Am Wed, 29 May 2019 09:00:52 +0200 schrieb Claudius Heine : > Hi Henning, > > On 28/05/2019 19.44, Henning Schild wrote: > > Am Tue, 28 May 2019 10:58:14 +0200 > > schrieb "[ext] claudius.heine.ext@siemens.com" > > : > > > >> From: Claudius Heine > >> > >> The machine-id(5) should contain a unique id of the machine, but > >> since this file is created by the systemd postinst script, every > >> machine using the same image would have the same id. > >> > >> The file is removed in a postprocessing step and will be > >> regenerated by systemd on the first boot. > > > > Systemd is not the only officially supported init system on Debian. > > And i disagree with anyone claiming that it is OK to assume that in > > Isar ;). > > > > I just did a little test and the outcome means we need more > > research. > > > > In stretch with sysvinit-core in IMAGE_PREINSTALL there will be no > > machine-id. So it is OK to rm -f, where the f is important. > > > > In buster there is one, no clue where it comes from ... But that is > > not magically recreated at first boot. Meaning we might have > > deleted an important file without a plan to bring it back. > > > > Question is, is it important at all for !systemd. If not at all, who > > created and and why? Btw ... my gentoo laptop also has one, and i > > would never install systemd. Maybe udev ... > > From machine-id(5): > The machine ID is usually generated from a random source > during system > installation or first boot and stays constant for all > subsequent boots. > Optionally, for stateless systems, it is generated during > runtime during early > boot if necessary. > > As I understand it, it is ok to remove that file if the system has > technically not booted yet. Systemd also couples its 'first boot > detection' on the existence of the `/etc/machine-id` file: > > From systemd.unit(5): > ConditionFirstBoot= takes a boolean argument. This > condition may be used to > conditionalize units on whether the system is booting up > with an unpopulated > /etc directory (specifically: an /etc with no > /etc/machine-id). This may be > used to populate /etc on the first boot after factory > reset, or when a new > system instance boots up for the first time. > > So any system that depends on the existence of a machine-id should > also depend on systemd (or something else) recreating that on the > first boot if it does not exist. Agreed. Sounds like it is safe to remove it in any case! Henning > Claudius > > > > > Henning > > > >> Signed-off-by: Claudius Heine > >> --- > >> meta/classes/image-postproc-extension.bbclass | 11 +++++++++-- > >> 1 file changed, 9 insertions(+), 2 deletions(-) > >> > >> diff --git a/meta/classes/image-postproc-extension.bbclass > >> b/meta/classes/image-postproc-extension.bbclass index > >> 625ba7d..495eae6 100644 --- > >> a/meta/classes/image-postproc-extension.bbclass +++ > >> b/meta/classes/image-postproc-extension.bbclass @@ -26,8 +26,7 @@ > >> update_etc_os_release() { fi > >> } > >> > >> -ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure > >> image_postprocess_mark" - > >> +ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure" > >> image_postprocess_configure() { > >> # Configure root filesystem > >> if [ -n "${DISTRO_CONFIG_SCRIPT}" ]; then > >> @@ -39,8 +38,16 @@ image_postprocess_configure() { > >> fi > >> } > >> > >> +ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_mark" > >> + > >> image_postprocess_mark() { > >> BUILD_ID=$(get_build_id) > >> update_etc_os_release \ > >> --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" > >> } > >> + > >> +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}/etc/machine-id' > >> +} > > >