From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6693487099162656768 X-Received: by 2002:a2e:5c1:: with SMTP id 184mr40852029ljf.94.1558615618182; Thu, 23 May 2019 05:46:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:a416:: with SMTP id q22ls559797lfc.2.gmail; Thu, 23 May 2019 05:46:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEpzn1EQ+Jl5Lu3uC7y86OYGVOkpt6ZeHC9VQGmZyKZRjYwQ2ws/fvbPPhvKeLcdkiPZvt X-Received: by 2002:ac2:424b:: with SMTP id m11mr177481lfl.163.1558615617720; Thu, 23 May 2019 05:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558615617; cv=none; d=google.com; s=arc-20160816; b=s9Yc9S/JwjRhHCbH9lAmkyLds11gNoAOCWWjmCO4lST99rDzYgGWabG7uO2eh1d9G8 LuwLH0Xx8bhxHLaWupuAEv4ipKdx0nhxs9v0lvKLvsrapCywGCGr8E114aNZnT88oZjS Jfz/8MgenovKcrm2ma1GOM1dup4pNHI1spB3zhxh1iW+K3SKmL6mEdtdIFP9oGJi/nTn AM1TlKgxzbd/39B+SFK2uYzbeO7A70FOrLrnc5pV/5h8zPyg8SnRPCcHUonyhZw6i9p5 4VyBkR8auFBWABfby7X3wmUW4j/YUXvt7zQDq/aGmLNt5jJuo0qau5SoS1IROvT/K4eB KpjA== 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=rxFbqKNE9+f/4ojAJOl20i4qdJz/xnzgMVecdgSxXjU=; b=k8HB4F6WDg9D7PoRm1rPB2TNz0lmZDTBmKR9z45j2kTd+Fd3alRznHvvpS12kuP5jS gECJibIvikobseHR3PYD7KKxma9HsQz/HfY4YhUBs3NWBn6tXBTuDgQOJMroLZDOjGRH +z11Pjus6acMMjOgvWiBHetd9PWL6dDT73hDCEAr8yXVue7kD18TN80E8FlyfuE1CPdq MkefPEghmBFsBXzkiCVd2r1a+NPfGjgL2F4XkoRM3mEFbPjFISDao0NzOkpcTdliN2Rm NM3+vIbDIZmpW9DxOJOJVcieoF32JP1CWOZ1k2sTMLLxNGN4cRpmWWVTL+WkF/li6jjc BSBw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 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 lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id s187si2103402lfe.4.2019.05.23.05.46.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 05:46:57 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 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 lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id x4NCku0G001018 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 May 2019 14:46:56 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.69.101]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x4NCkucH032272; Thu, 23 May 2019 14:46:56 +0200 Date: Thu, 23 May 2019 14:46:54 +0200 From: Henning Schild To: "[ext] claudius.heine.ext@siemens.com" Cc: , Claudius Heine Subject: Re: [PATCH] image.bbclass: remove 'get_image_name' function Message-ID: <20190523144654.70b5450d@md1za8fc.ad001.siemens.net> In-Reply-To: <20190521142818.25505-1-claudius.heine.ext@siemens.com> References: <20190521142818.25505-1-claudius.heine.ext@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: swGvkz9pl8C0 Am Tue, 21 May 2019 16:28:18 +0200 schrieb "[ext] claudius.heine.ext@siemens.com" : > From: Claudius Heine > > This function is only used in 'do_copy_boot_files' where a simple > shell function fits better. > > Signed-off-by: Claudius Heine > --- > meta/classes/image.bbclass | 33 ++++++--------------------------- > 1 file changed, 6 insertions(+), 27 deletions(-) > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index 3eb261f..45ed8ba 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -64,29 +64,6 @@ inherit image-postproc-extension > # Extra space for rootfs in MB > ROOTFS_EXTRA ?= "64" > > -def get_image_name(d, name_link): > - S = d.getVar("IMAGE_ROOTFS", True) > - path_link = os.path.join(S, name_link) > - > - # If path_link does not exist, it might be a symlink > - # in the target rootfs. This block attempts to resolve > - # it relative to the rootfs location. > - if not os.path.exists(path_link): > - path_link = os.path.join( > - S, > - os.path.relpath( > - os.path.realpath(path_link), > - "/", > - ), > - ) > - > - if os.path.exists(path_link): > - base = os.path.basename(os.path.realpath(path_link)) > - full = d.getVar("IMAGE_FULLNAME", True) + "." + base > - return [base, full] > - > - return ["", ""] > - > def get_rootfs_size(d): > import subprocess > rootfs_extra = int(d.getVar("ROOTFS_EXTRA", True)) > @@ -149,12 +126,14 @@ addtask rootfs_install before do_build after > do_unpack > do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}" > do_copy_boot_files() { > - if [ -n "${KERNEL_IMAGE}" ]; then > - cp -f ${IMAGE_ROOTFS}/boot/${@get_image_name(d, > 'vmlinuz')[0]} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE} > + kernel="$(realpath -q '${IMAGE_ROOTFS}/vmlinuz')" Will this work if ${IMAGE_ROOTFS}/vmlinuz is a symlink to "/boot/vmlinuz-foo-bar"? The funny thing with the kernel and the initrd is that we should probably stop deploying them anyways. As far as i know there are probably 2 users of them. The first is the qemu test script, which should be fixed to use IMAGE_RFS/vmlinuz and deal with possible symlinks. The second one is the legacy bios wic. This one is also just broken because it creates a boot partition with copies of kernel and initrd, that debian does not even know about. So you will also never be able to update the kernel with apt ... If any other imager needs the deployed KERNEL and INITRD ... that other imager probably has the same issue. So in the long run we should just drop that and fix those imagers to turn the real /boot into the boot partition and fix up /etc/fstab. Henning > + if [ -n "$kernel" ]; then > + cp -f "$kernel" '${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}' > fi > > - if [ -n "${INITRD_IMAGE}" ]; then > - sudo cp -f ${IMAGE_ROOTFS}/boot/${@get_image_name(d, > 'initrd.img')[0]} ${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE} > + initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img')" > + if [ -n "$initrd" ]; then > + cp -f "$initrd" '${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}' > fi > > # Check DTB_FILE via inline python to handle unset case: