From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6842309179660566528 X-Received: by 2002:a1c:ed17:: with SMTP id l23mr4814653wmh.73.1593105874166; Thu, 25 Jun 2020 10:24:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:82ca:: with SMTP id 68ls1133402wrc.2.gmail; Thu, 25 Jun 2020 10:24:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4f9Mu14f98Z5ooEqkBVk/YLYPZ+jclr3HEUNdEfqzCkRuwZ73L4oi4j/XW+46E/qDrY/a X-Received: by 2002:adf:8024:: with SMTP id 33mr6572047wrk.117.1593105873595; Thu, 25 Jun 2020 10:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593105873; cv=none; d=google.com; s=arc-20160816; b=x9/P+Nyil5ZDI+2H/PUBKaYxdfqPeR56yp+irJ/mYhFTpHWq+817QsIqoN9N6FamcT gcZaatW8yZzFisSu2XxG7S+4qjFAzZ9SCPgxZsJN/FJm6kydARsr2cHuwfem/PMFy+WM a/9E7PrGue5QOIfRKSwPE/xGDy3m1rC1jQAlw2Asc8yuybbRT5+/f640atH7zU00pmYn VbTm/ejBchGbiAoDO4j5n7xRcT2A9g0JN2gciLQtoVbQ7aCHaoDUnI8B9h7kV1SXmjyq aFicRpP+PGIBBStp9gwyLZYjKNzQerZMnFet5tlt+7epMRr1zEyXrWoN3uB1AqGhX5BU rfyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=8YvOy77eYsL+hK6xYJx/g+NF4qPHmscIDAmjV8+PuHE=; b=ruu6RLFO5lnL1CJvQvQBrJLJMBXhVvH0G9uyMN5q/wttOSonZimGa3qHIycUHLAGjs 8CudUabTA5lRf5I/N829ijhHSREE2qNjqcCBH9+VxshxxbPeLVmAgipmk/NiUEds5dpe ll7BvnCCBBsca917+iKxDP0QyLglINy8KjcvM8khpeOcV7U/TAZ3zlhtfscY4vOhTw+K Z/9YpWYISKFq1/z0IUO3ET07JCYqZM5l/j2W5nZB+NRVAazJOL+cvcc5tpuq2NDbf+/1 tIf3CmIi5/RlnhSn/EobEyc75a9//+2HZlZ1nGVeJ4r3GqR4x0zg2f9zmZ5Y8OQjj/V/ 3CyA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id o201si311157wme.1.2020.06.25.10.24.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2020 10:24:33 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) client-ip=212.18.0.9; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49t6MP1VCsz1qs3H; Thu, 25 Jun 2020 19:24:33 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49t6MP14lXz1qr4d; Thu, 25 Jun 2020 19:24:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 7_KJTYz65mFg; Thu, 25 Jun 2020 19:24:30 +0200 (CEST) X-Auth-Info: 0k7e8L74pDp2kDN0xXbS1mKbpvPx1fS4zTiJhYUUIn4= Received: from maia.denx.de (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 25 Jun 2020 19:24:30 +0200 (CEST) Message-ID: <91ce92c15d267e4836ab4d9de2870bc8e6f6dfa1.camel@denx.de> Subject: Re: [PATCH] image: Run copy_boot_files after rootfs postprocessing From: Harald Seiler To: Jan Kiszka , Henning Schild Cc: isar-users@googlegroups.com, Claudius Heine Date: Thu, 25 Jun 2020 19:24:30 +0200 In-Reply-To: References: <20200625153351.3402179-1-hws@denx.de> <20200625184822.236ff069@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUID: B3dsuRnDM1G+ Hello Henning, On Thu, 2020-06-25 at 19:02 +0200, Jan Kiszka wrote: > On 25.06.20 18:48, [ext] Henning Schild wrote: > > Hi Harald, > > > > can you elaborate on those cases? The postprocessing is hacky, if the > > problem is coming from your layer you should probably keep this patch > > in you layer. > > Basically do_generate_image_uuid from > https://lore.kernel.org/cip-dev/20200625141015.31719-4-Quirin.Gylstorff@siemens.com/T/#u, > just modeled as post-processing hook, rather than a task. For reference, this is the exact code: ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_generate_uuid" image_postprocess_generate_uuid() { sudo sed -i '/^IMAGE_UUID=.*/d' '${IMAGE_ROOTFS}/etc/os-release' echo "IMAGE_UUID=\"${IMAGE_UUID}\"" | \ sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' sudo -E chroot '${ROOTFSDIR}' \ update-initramfs -u } > Jan > > > Maybe you can point out an issue in isar itself, or explain how you got > > into this situation? We can then see if your change is generic enough > > for upstream. You could also provide the error-case from your layer as > > an upstream feature, if that is generic enough. I think this patch addresses an issue in isar itself. There is no reason for copy_boot_files() to run before the postprocessing does. I've checked through the git history and the reason this relationship was introduced was a bigger refactor of the task dependency chain. It does not seem to be intentionally this way from what I can tell. The other way around makes more sense, in my opinion. As stated in the commit message, postprocessing might do an update to the initramfs (as seen above) and this change needs to be reflected in the deployed initramfs as well, instead of silently only living in the version that is part of the rootfs. I also checked all existing postprocessing commands and did not see any that assume to be run after the boot files have been deployed. -- Harald > > Henning > > > > Am Thu, 25 Jun 2020 17:33:51 +0200 > > schrieb Harald Seiler : > > > > > In some cases, postprocessing might trigger an update of the initramfs > > > which would not appear in the deployed version. Fix this by running > > > copy_boot_files only after all postprocessing completed. > > > > > > Signed-off-by: Harald Seiler > > > --- > > > meta/classes/image.bbclass | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > > > index 0150f2718573..21d634a8f34f 100644 > > > --- a/meta/classes/image.bbclass > > > +++ b/meta/classes/image.bbclass > > > @@ -153,7 +153,7 @@ do_copy_boot_files() { > > > cp -f "$dtb" "${DEPLOY_DIR_IMAGE}/" > > > done > > > } > > > -addtask copy_boot_files before do_rootfs_postprocess after > > > do_rootfs_install +addtask copy_boot_files before do_rootfs after > > > do_rootfs_postprocess > > > python do_image_tools() { > > > """Virtual task"""