From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7003689951757860864 X-Received: by 2002:a2e:b7c8:: with SMTP id p8mr2740532ljo.32.1630673640263; Fri, 03 Sep 2021 05:54:00 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:651c:503:: with SMTP id o3ls1176452ljp.0.gmail; Fri, 03 Sep 2021 05:53:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGjEcvtsjoeFM/voJtUdwXdU0oLF5dC7w0l8dNjvs46G6vD5JHofXK6sT8Ocqy0jBImPnU X-Received: by 2002:a2e:a7c7:: with SMTP id x7mr2793378ljp.406.1630673639199; Fri, 03 Sep 2021 05:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630673639; cv=none; d=google.com; s=arc-20160816; b=HpaWNsQBwWFyxHr/in6x2gCYwO457xJXDEufFuZs+iAC6kUlzDQCrAfbAJnQvpKBJ+ m6v+FTRX6RmxD9raKgckCOPGXiLkrS6gEmVNYmsdn2vzZwtTSGlEp45qQDDONxofEus6 Iz1s2lmyYXzlhzg4SiFQ+YMQpZxp7EFavRS7cupqkZSzWbXDYkrdtQemefvNMAmuZXtr 0rQ81KqcPj92Z1C7EvpUSwq0+LLGDrMj6fjLtpfVPYj3s5z0p06Uv/Ue2HsvdL+1Vtu/ BHhnWglOWyGeJfdbRusnUyA4KbPJrYXp+Cj91WT/B9OjROgVI9HnQiv9boa/s+aD/1O/ kNGw== 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:date:subject:cc:to:from; bh=2qSpF2et5tqaY8GnkZ7Rfch90HIOeGQXbJE9fW7IYio=; b=D76U+Mxl/S4/HjtaKeM+0UvwEOJOYROkHm2Gk+qq0P+Rr3J4sJR90KHhnNU1pjYa1H PRVFUpw+TexiQZT/xkfg2ERGYJ7V3IYm2JuwtRN5evdn1om333wkCiqnBqZSdY+aLOaj 3z1yg/miHzkWEFSrniIxpwYkZCDk/yZ2FO2sSRTY14HzTo34qqoonqH2K2bToSuFubyP rMwT4kKWvlJR0jI/fXdkWXu2upK795AXxtzAiAuN3tj6PP40BzP4gQTdnTXRaPnVvOAS 2NQYa/+Wg1NQPsLx67PSp/h/Hwfqj3PJeOfFV3iB1l4MxTNSzjZBT4w/aye+LFsTnc6I +dHA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 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 thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id z4si265114lfr.2.2021.09.03.05.53.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Sep 2021 05:53:59 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 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 thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 183CrwAs005872 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 3 Sep 2021 14:53:58 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.0.59]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 183CrvB1029234; Fri, 3 Sep 2021 14:53:58 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Florian Bezdeka , Vijai Kumar K , jan.kiszka@siemens.com, Henning Schild Subject: [PATCH v2 3/7] wic: apply the actual fork changes to our pcbios plugin fork Date: Fri, 3 Sep 2021 14:53:51 +0200 Message-Id: <20210903125355.12279-4-henning.schild@siemens.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210903125355.12279-1-henning.schild@siemens.com> References: <20210903125355.12279-1-henning.schild@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: mfW4Pi8Ktr/L 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 | 31 +++++++++++++++++-- 1 file changed, 28 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..f493890fae31 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 @@ -20,14 +20,18 @@ from wic.pluginbase import SourcePlugin from wic.misc import (exec_cmd, exec_native_cmd, get_bitbake_var, BOOTDD_EXTRA_SPACE) +import sys +sys.path[0] = os.path.dirname(os.path.abspath(__file__)) + "/.." +from isarpluginbase import (isar_get_filenames, isar_populate_boot_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 +60,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 +131,18 @@ class BootimgPcbiosPlugin(SourcePlugin): syslinux_conf += "LABEL boot\n" kernel = "/vmlinuz" + + kernel, initrd = isar_get_filenames(get_bitbake_var("IMAGE_ROOTFS")) + 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 + 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 +181,17 @@ class BootimgPcbiosPlugin(SourcePlugin): "install -m 444 %s/syslinux/libutil.c32 %s/libutil.c32" % (bootimg_dir, hdddir)) + install_cmd = isar_populate_boot_cmd(rootfs_dir['ROOTFS_DIR'], hdddir) + exec_cmd(install_cmd) + for install_cmd in cmds: + # skip the kernel install from OE parts, we copy boot from debian + 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.32.0