From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7000822935908777984 X-Received: by 2002:a2e:98d3:: with SMTP id s19mr6847595ljj.179.1630056744176; Fri, 27 Aug 2021 02:32:24 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:c13:: with SMTP id z19ls2061440lfu.0.gmail; Fri, 27 Aug 2021 02:32:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJOAZ3bSgrHHrKvh9XI+A2XVBR35KpecZKM8QC4Heg0fNtqJHjgM4B0VrL3c491m5k4aO2 X-Received: by 2002:ac2:5d65:: with SMTP id h5mr6508905lft.477.1630056743141; Fri, 27 Aug 2021 02:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630056743; cv=none; d=google.com; s=arc-20160816; b=m1FK39heRFgpKMqKMJNkCkhEQYTFzT8jWsyFpyrN1ELY+qMitsiIk4bZ7LEKptt6MR vvUuDyBQ9zmK1RLwRhNfZzsOZWRJe9pBefaX/wU6ohFP1ZLVkEcqd7lvwyDL00T9ex+z IxTVJ6beSMVCByNOpddLHILR7nM93xpHVYuy4ow8IiEqQQNV45Cvv0jbSk7B0AcvoPxb KuVim3gK8bCUTXusNgBA6V0aZXX94x6ElY9olmRRPJAVrhmCbXNaYAa665+OTYvpQFr1 P6naouBXtbKUeg/9PgafC2toZUzhBKUTCwBZqAOpkhrrgPxnOyqNZjUgWM3Nv7Aqmy/7 V9Nw== 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=uv9WU5Wl/FSldKNcNgfgmAEX0645QeoSRQyU5J2f8f8=; b=XETdruuT6q20sX4xdmHsNtEz7lUzAyjoUraUYetz4zt1c525B538KQebQVozMylr0A W+jF4Wl4yS4z4NZ3aj1V3jQqmZr+sJNu9Uh4yc8mJpug/HjKWNB0H0mR7ccAodgsG89S eiiLRFrzqqHKUWT6EFpdOk2wHS/fe2OdC5xzUbqrKWjlJWt45EQx1uAdyqhYfToJ6n9M Bo2stzMMchHlAxHcSPTqPzF3zDCeqnqVQ6rKtcjWNahFvt3GEqAu6Isqnoj8MNxFY21M m0PIS8P6JQ1VJUcTHWghXtjpcv70QnOZR5E23ry57nj5rmA8un06K6BDzl2UbmwO9Kgj HZAw== 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 h11si365270lfc.4.2021.08.27.02.32.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Aug 2021 02:32:23 -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 17R9WMad023611 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Aug 2021 11:32:22 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.0.59]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 17R9WM5K007447; Fri, 27 Aug 2021 11:32:22 +0200 Date: Fri, 27 Aug 2021 11:32:20 +0200 From: Henning Schild To: "Bezdeka, Florian (T RDA IOT SES-DE)" Cc: "isar-users@googlegroups.com" , Vijai Kumar K Subject: Re: [PATCH 2/3] wic: apply the actual fork changes to our pcbios plugin fork Message-ID: <20210827113220.7e8a6d43@md1za8fc.ad001.siemens.net> In-Reply-To: <10f3c8a58d43bd36f35c33755ea8c73b539f17c7.camel@siemens.com> References: <20210826192827.2653-1-henning.schild@siemens.com> <20210826192827.2653-3-henning.schild@siemens.com> <10f3c8a58d43bd36f35c33755ea8c73b539f17c7.camel@siemens.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: qMrqOCvYX5Zp Am Fri, 27 Aug 2021 09:35:24 +0200 schrieb "Bezdeka, Florian (T RDA IOT SES-DE)" : > On Thu, 2021-08-26 at 21:28 +0200, Henning Schild wrote: > > This aims to be a rather minimal one-commit fork to do isar specific > > changes to the forked class. It does things in a way that results in > > somehow strange code but pretty clean patching that aims to be easy > > to read and mostly about adding lines to get things done. The hope > > is that it will make maintaining the fork easier than before. > > > > Signed-off-by: Henning Schild > > --- > > .../wic/plugins/source/bootimg-pcbios-isar.py | 36 > > +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) > > > > diff --git > > a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py > > b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py index > > f2639e700493..3a3a6f09392f 100644 --- > > a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py +++ > > b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py @@ > > -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-2.0-only # > > # DESCRIPTION > > -# This implements the 'bootimg-pcbios' source plugin class for > > 'wic' +# This implements the 'bootimg-pcbios-isar' source plugin > > class for 'wic' # > > # AUTHORS > > # Tom Zanussi > > @@ -22,12 +22,12 @@ from wic.misc import (exec_cmd, exec_native_cmd, > > > > logger = logging.getLogger('wic') > > > > -class BootimgPcbiosPlugin(SourcePlugin): > > +class BootimgPcbiosIsarPlugin(SourcePlugin): > > """ > > Create MBR boot partition and install syslinux on it. > > """ > > > > - name = 'bootimg-pcbios' > > + name = 'bootimg-pcbios-isar' > > > > @classmethod > > def _get_bootimg_dir(cls, bootimg_dir, dirname): > > @@ -56,6 +56,10 @@ class BootimgPcbiosPlugin(SourcePlugin): > > """ > > bootimg_dir = cls._get_bootimg_dir(bootimg_dir, 'syslinux') > > mbrfile = "%s/syslinux/" % bootimg_dir > > + > > + # files have different prefix in debian > > + mbrfile += "mbr/" > > + > > if creator.ptable_format == 'msdos': > > mbrfile += "mbr.bin" > > elif creator.ptable_format == 'gpt': > > @@ -123,11 +127,27 @@ class BootimgPcbiosPlugin(SourcePlugin): > > syslinux_conf += "LABEL boot\n" > > > > kernel = "/vmlinuz" > > + > > + # figure out the real filename in /boot/ by following > > debian symlinks > > + kernel_file = get_bitbake_var("KERNEL_FILE") > > + rootfs_dir = get_bitbake_var("IMAGE_ROOTFS") > > + kernel = > > os.path.basename(os.path.realpath(os.path.join(rootfs_dir, > > kernel_file))) + syslinux_conf += "KERNEL " + kernel + "\n" > > > > syslinux_conf += "APPEND label=boot root=%s %s\n" % \ > > (creator.rootdev, bootloader.append) > > > > + # we are using an initrd, smuggle it in > > + initrd = "initrd.img" > > + kernel_parts = kernel.split("-") > > + kernel_suffix = "-".join(kernel_parts[1:]) > > + if kernel_suffix: > > + initrd += "-%s" % kernel_suffix > > I guess I was the last one modifying this file... Just had a look at > upstream commit d3f1af4e2318a4420f4c7f23edd093f66891ca8b, which seems > partially reverted now. > > I'm missing the part in do_prepare_partition, where the kernel_suffix > should be optional as well. Maybe I'm just missing / overlooking > something? There used to be two places where the actual filename of the kernel was found following the symlink in /. The suffix was extracted to figure out the name of the initrd. The places have been "copy" and "configure". In addition "copy" dealt with config and System.map. I changed "copy" to be "cp -a" simply copying everything from /boot into the boot partition which will later be mounted at /boot. Meaning no need to know the filename follow symlinks, derive initrd and other filenames via "guessing". So that "cp -a" does take care of the bits that i "reverted". It also deals with the additional files (config, System.map) introduces by 328dc021ec3d8a1eaff72324b3e9646a0fd5e128 from Vijai. > > + > > + syslinux_conf = syslinux_conf.replace(" root=%s " % > > (creator.rootdev), > > + " root=%s > > initrd=%s " % (creator.rootdev, initrd)) + > > logger.debug("Writing syslinux config > > %s/hdd/boot/syslinux.cfg", cr_workdir) > > cfg = open("%s/hdd/boot/syslinux.cfg" % cr_workdir, "w") > > @@ -166,7 +186,17 @@ class BootimgPcbiosPlugin(SourcePlugin): > > "install -m 444 %s/syslinux/libutil.c32 > > %s/libutil.c32" % (bootimg_dir, hdddir)) > > > > + # install /boot from our debian rootfs completely > > + cmds = cmds + ("cp -a %s/%s %s/.." % > > (rootfs_dir['ROOTFS_DIR'], "boot", hdddir),) + This is the "magic" line. Copying all files from debian so the plugin does not need to know there names and name them all. Henning > > for install_cmd in cmds: > > + # skip the kernel install from OE parts, "cp -a" will > > bring our kernel > > + if install_cmd == cmds[0]: > > + continue > > + # one file has a different suffix in debian > > + install_cmd = install_cmd.replace("ldlinux.sys", > > "ldlinux.c32") > > + # files have different prefix in debian > > + install_cmd = install_cmd.replace("/syslinux/", > > "/syslinux/modules/bios/") exec_cmd(install_cmd) > > > > du_cmd = "du -bks %s" % hdddir > > -- > > 2.31.1 > > >