From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7065986084596875264 X-Received: by 2002:a5d:6b06:0:b0:1e3:3e52:8a6 with SMTP id v6-20020a5d6b06000000b001e33e5208a6mr5455341wrw.148.1645785555477; Fri, 25 Feb 2022 02:39:15 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:a702:0:b0:381:3b7e:ef50 with SMTP id q2-20020a1ca702000000b003813b7eef50ls316125wme.2.gmail; Fri, 25 Feb 2022 02:39:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxI5I6Bt6p0b0NDpdH34/EPvemZ06oQ1OoNGbBy8Lja/2C34FVmWTZwxMhoSIWEi/bpasj1 X-Received: by 2002:a1c:5459:0:b0:381:40b0:1ee8 with SMTP id p25-20020a1c5459000000b0038140b01ee8mr114409wmi.66.1645785554476; Fri, 25 Feb 2022 02:39:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645785554; cv=none; d=google.com; s=arc-20160816; b=KoTZycVft6SkpO8CF/Ub73Co/iZup92I93NSfrOGSw6KzBJuDC81OzH5khq2QYT1Ti OP790lAbUc+xraNoi5A8+7BYtIfXdchqkp09aFxX6T7wqRmI649N8ie34lftZreXB8VK Bm9F9vBljRlSazhId4rBWztlH1dPRoAQZhFunPbXI4M4IYzVFCUAVom/f7281RAXApb2 Ubf25Y/Q3wCrucQg8r/vhaenjemgO9RVhMq2TxkPdwYnI+ZjHaEpu7ZFAmX+RTzlGBGL f3h6Iqge0htSd8aXlOgCtwZQKoiiV4rArTSeALQcv9jFibKrg+vhi2UH8BjvDXINO7yY D/Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=UOt/Hf/UQnJZtgq98tuWkwYbuaUeHd+DDcUmZizjKmc=; b=wdc4J9oi+vnI+AhN93wRKO49BPRc7JCV9NRMtMFeseEDNovJ/7WR9pDf1TUM+OE2Do KlMIgX+4je9Gxz4M3VQP9mJY+z779kjOKgQIrAbS6j53xycwcQe2A3lpJv81Y+uRnBUH uT+Cb9b1ECMvqUQMUPY6XF0mGAjn20ocdzDlAbXT+ELh4P7vlUPTbI5v1L9cTrpffXRU JB5MNu3ZneXJGInktaDasd6ilBjEdt2X+LTrv3sP1GHDlHqlfht5VKoBTQVbDLYp/VNx KcTn9sLFFlFurjWMWtaIUSnB++JGhwoyHdDfRBfbP2W3VcNf41fe6hIya84LWe54vKsw EcLg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=luFE8qOy; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::433 as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com. [2a00:1450:4864:20::433]) by gmr-mx.google.com with ESMTPS id 8-20020a1c0208000000b0037bc4b90d17si518762wmc.3.2022.02.25.02.39.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Feb 2022 02:39:14 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::433 as permitted sender) client-ip=2a00:1450:4864:20::433; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=luFE8qOy; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::433 as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-wr1-x433.google.com with SMTP id d28so3796826wra.4 for ; Fri, 25 Feb 2022 02:39:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UOt/Hf/UQnJZtgq98tuWkwYbuaUeHd+DDcUmZizjKmc=; b=luFE8qOyYpCzdtwXoDpuo+fs/aHMEcnnEAItw8ZFmWeLaxBKRg9EEiYxC/9IfrZtfm ptC+aZRPpUof+qze42KFgvxLIzkHC2HNv8b+twI7uXmk8nwOe1tU4+takpmz9DkcHMtk lx/qWf42pambqHvA8kTvSltkN6fjZRJi3mTiEHvx2tOEJV/5Mld3VdsoD3MRpNVdi9eM KgXFc7WR3mouE7E0Nqfkr+KIZNvLLsYB1+fH+uqkwZ7LHYpLNt6w8BENNMMwjH71rsrM VHRIhhUYg2IOeX0H5O8wBN1OURDjFsIUu6+tWpv5S8NqcK+v+qg2KzffRZcvxxOjXdmI ituw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UOt/Hf/UQnJZtgq98tuWkwYbuaUeHd+DDcUmZizjKmc=; b=PVNz8yAFaHivmR1Dwl6kQefbBTuRTXxD8XjkjugUybrW8m6pIxYUpaGb1fD8mWsDHS lLpYS8WB4waywsHZjjb61NBhLSmF5pXCjq5T7/IMRpuS0Wb7rCyR5Q0gg9HuEkc8ptzK O7jsRiemP9zojTVr+vkT7Zyp9ebmWwpbWW8B/XIlGfHhPD/AgriHzwf85BpB6bXgc9oO BOkJDOU1DdlgKxZZkeA/cgJo8fS3WA3llDQzPdIecqQXWA1e4Qaz8R8eYuaEly8hlVSp uqyPAQzOE8RvEi44dYyacCjwyyvjxd+pWrjgtMiqIthZAXFXRMuZGsvyX0woOrcomGUx keNQ== X-Gm-Message-State: AOAM5324P3+rYX+MQGHz+LYWzT+nBoKowH64fMhi2HdrqWjnmvgSXdtG 8M2Y+lrsuKGLF2GMIBc8f1q37vhzjHcxmZiEjFY= X-Received: by 2002:a5d:4d06:0:b0:1ef:5745:3a6a with SMTP id z6-20020a5d4d06000000b001ef57453a6amr3540440wrt.20.1645785553720; Fri, 25 Feb 2022 02:39:13 -0800 (PST) MIME-Version: 1.0 References: <20220218095428.1767282-1-Vijaikumar_Kanagarajan@mentor.com> <20220225093137.54487e31@md1za8fc.ad001.siemens.net> In-Reply-To: <20220225093137.54487e31@md1za8fc.ad001.siemens.net> From: vijai kumar Date: Fri, 25 Feb 2022 16:09:02 +0530 Message-ID: Subject: Re: [RFC PATCH] image: Reorder do_copy_boot_files task To: Henning Schild Cc: Vijai Kumar K , isar-users , Jan Kiszka Content-Type: text/plain; charset="UTF-8" X-TUID: /GaEXh2rOU/T Hi Henning, On Fri, Feb 25, 2022 at 2:01 PM Henning Schild wrote: > > Am Fri, 18 Feb 2022 15:24:28 +0530 > schrieb Vijai Kumar K : > > > There might be cases where in there are some initramfs changes in > > postprocess. For example, via the distro config script. > > Postprocessing is a hack reserved for very few special cases, most of > which should read and not write. > > That smells like you are abusing postprocess, and whatever you do there > might also break kernel updates with "apt-get". > > Please give us the example, i bet it can be moved out of postprocess > into a much more sustainable place (like a package). > > With no good example, NACK from me. Thank you for the quick review comments. Let me try to provide more information. Postprocess abuse has always been a concern, we have ways to inject stuff and we also have undocumented rules on what should or should not be done as part of certain tasks. We could capture it. Happy to do that. The end user accidentally steps over this and something breaks. The original issue was that plymouth theme was changed at a later stage. The issue was fixed by having it not done as part of postprocess. We have an option to pass a custom distro configuration script. It is run as part of postprocess[1]. At best the user could run plymouth-set-default-theme[2] as part of this script that changes the initramfs during postprocess. We could not completely rule out modifications in postprocess. And the rootfs is not complete till rootfs_finalize where we remove the ability to chroot. Changes could even then be injected, but that does not happen that often and the user needs to create a task or append one to do that. Not as simple as a variable append. We should take the images from a finalized rootfs, and then deploy it, so that the images in both deploy and rootfs are the same no matter whether we use it or not. Despite the fact that what should or should not be done in rootfs postprocess, It only makes sense to copy the files to deploy directory after finalizing the rootfs. [1]https://github.com/ilbers/isar/blob/ffdd1b0ce026d21c8b62c06c926d205aad3078b6/meta/classes/image-postproc-extension.bbclass#L36 [2]https://manpages.debian.org/buster/plymouth/plymouth-set-default-theme.1 > > > In such a scenario we would have an outdated initramfs file in deploy > > directory. Certain downstream Wic plugins directly consume the image > > from deploy directory. It then uses the outdated initramfs for > > creating the wic image. > > Maybe those downstream wic plugins deserve fixing as well, take the > initrd and kernel out of root/boot. > > For image type wic there should in fact be no reason to copy the boot > files to deploy. That is something for ext4 and others going to "qemu > --kernel ..." Maybe, but ideally deploy should have the final kernel and initrd shipped, no matter whether its a wic image or ext4img. We could have a scenario where we build multiple image types, both ends up with different initramfs because we used the file from different places(IMAGE_ROOTFS/DEPLOY_DIR) I hope this gives some justification to the patch? Thanks, Vijai Kumar K > While those files are there for any image i would not suggest using > them. We have lava setups where we convert a wic into > kernel+initrd+nfsrootfs+cmdline, all taken only out of that wic. No > side channels. I guess one could also look into ".wic.img.p1" but the > boot files have no place as output for wic images, let alone as input > for wic. > > regards, > Henning > > > Copy boot files after rootfs postprocess but before finalizing the > > rootfs. > > > > Signed-off-by: Vijai Kumar K > > --- > > RECIPE-API-CHANGELOG.md | 7 ++++++- > > meta/classes/image.bbclass | 2 +- > > 2 files changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md > > index cad15a8..ef53b1a 100644 > > --- a/RECIPE-API-CHANGELOG.md > > +++ b/RECIPE-API-CHANGELOG.md > > @@ -342,4 +342,9 @@ The bitbake variable defines the respective > > environment variable which is availa When cross compiling, `cross` is > > added to the `DEB_BUILD_PROFILES` environment variable. Please note, > > that manually exported versions of the variables are overwritten. > > -For a list of well-known Debian build profiles and common practices, > > we refer to Debian's BuildProfileSpec. \ No newline at end of file > > +For a list of well-known Debian build profiles and common practices, > > we refer to Debian's BuildProfileSpec. + > > +### Move do_copy_boot_files task after do_rootfs_postprocess > > + > > +The boot-files(kernel, initrd, dtbs) are now shipped to > > tmp/deploy/images after +do_rootfs_postprocess task and before > > do_rootfs_finalize task. diff --git a/meta/classes/image.bbclass > > b/meta/classes/image.bbclass index 6d77243..d70a93b 100644 > > --- a/meta/classes/image.bbclass > > +++ b/meta/classes/image.bbclass > > @@ -170,7 +170,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_finalize > > after do_rootfs_postprocess > > python do_image_tools() { > > """Virtual task""" > > -- > You received this message because you are subscribed to the Google Groups "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20220225093137.54487e31%40md1za8fc.ad001.siemens.net.