From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6695999620571463680 X-Received: by 2002:a5d:45c6:: with SMTP id b6mr6848257wrs.229.1559113255248; Wed, 29 May 2019 00:00:55 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:f404:: with SMTP id z4ls332208wma.1.canary-gmail; Wed, 29 May 2019 00:00:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJUsSf4S8KGl9CV6dhrEvNDcnsneG2t8KJH7YEIAQSAn/nSn8AWCbcA06oaMnlAIi9IyM4 X-Received: by 2002:a7b:c7d7:: with SMTP id z23mr1121865wmk.127.1559113254915; Wed, 29 May 2019 00:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559113254; cv=none; d=google.com; s=arc-20160816; b=X2WspB7fA1K82c4ZyHEAQvOkks67IRtG9MubXeOp2BKPwlD3lTAAm2yP3+LiWcDzXl LkVJPhmx9v0g/x+YKTaaVxwJxOK0NsEvbaGOMzJwDvOlTxG3N0cCJoADia1gC+wy3WeK 9FihXpHHPKEvEZ3Cyr1M66PtD6RMJFFUgUcVmlMiZGpjzGJcZuiljEwMRr3VM2hPFk2R t2vZ5nfb9/gFOP99VRWMx7q6qzG71hmjJHJs96BTNG8jLAkZEC7ouL/RhPQ1Lr8B23uX JVd64TMYwmT/q6Qb6LegkZePFSdh0yBHWgTr6NoSWb044T5ok1oJSLyF3zYIb64nLFvD AxDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=FzZaWL90it5YCKAkjUZ3jog14JDjnmMaM5Dltckbuyo=; b=mrt2g2lm29Ko7D+Ljovq3SPWqWvarropvdjjNJMqPg/7k6ZfghqZmO9QxaM2NNypGO dLBmGqq6Ew0s+BGyUEi+zLxhW/fFMWKAsZTsD4BViPcfWRkIA9+eJqB4GlpCAMkdGw0d HByPKZwP8aDqpF/9aunjXuNNtE+ZfGDNVjkY2theAiXgSq4MMS6CbmrsPu5msAY+8kRa frZCkXO6wtMOxw09uSOAEa2DciZOCfbtxYNTFsIsSdTVUx5h+MAEPj9Wgsm3RvDZ/25q uZ4bri0DPzUD5UQ5gp+5fKCC+ZpzPYg9AW59tuzf3/Zhiqa9Voylm5QUkgVwdifKWg3u 2Mmg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id n10si280300wmh.0.2019.05.29.00.00.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 00:00:54 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id x4T70r9i029408 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 May 2019 09:00:53 +0200 Received: from [139.25.69.232] (linux-ses-ext02.ppmd.siemens.net [139.25.69.232]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x4T70qs5009593; Wed, 29 May 2019 09:00:52 +0200 Subject: Re: [PATCH 3/3] image-postproc-extension: add removal of machine-id To: Henning Schild Cc: isar-users@googlegroups.com, Claudius Heine References: <20190528085814.12967-1-claudius.heine.ext@siemens.com> <20190528085814.12967-4-claudius.heine.ext@siemens.com> <20190528194452.46def4c8@md1za8fc.ad001.siemens.net> From: Claudius Heine Message-ID: <10cc6729-ddae-141d-abaa-43081707fd84@siemens.com> Date: Wed, 29 May 2019 09:00:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190528194452.46def4c8@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: TKXY2smsw2IN 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. 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' >> +} > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de