From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Florian Bezdeka <florian.bezdeka@siemens.com>,
Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>,
jan.kiszka@siemens.com,
Henning Schild <henning.schild@siemens.com>
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 [thread overview]
Message-ID: <20210903125355.12279-4-henning.schild@siemens.com> (raw)
In-Reply-To: <20210903125355.12279-1-henning.schild@siemens.com>
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 <henning.schild@siemens.com>
---
.../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 <tom.zanussi (at] linux.intel.com>
@@ -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
next prev parent reply other threads:[~2021-09-03 12:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-03 12:53 [PATCH v2 0/7] re-fork wic pcbios and efi plugins Henning Schild
2021-09-03 12:53 ` [PATCH v2 1/7] wic: reset our plugin forks to OE upstream for re-forking Henning Schild
2021-09-03 12:53 ` [PATCH v2 2/7] wic: add utility library for common bits of isar plugins Henning Schild
2021-09-03 12:53 ` Henning Schild [this message]
2021-09-03 12:53 ` [PATCH v2 4/7] wic: clean up wic class in terms of isar variables Henning Schild
2021-09-03 12:53 ` [PATCH v2 5/7] wic: apply the actual fork changes to our efi plugin fork Henning Schild
2021-09-03 12:53 ` [PATCH v2 6/7] wic: mount /boot and exlude it from root for efi Henning Schild
2021-09-03 16:06 ` Henning Schild
2021-09-03 12:53 ` [PATCH v2 7/7] meta-isar: use "systemd-boot" for one test target Henning Schild
2021-09-06 5:05 ` [PATCH v2 0/7] re-fork wic pcbios and efi plugins Jan Kiszka
2021-09-06 8:59 ` Henning Schild
2021-09-06 9:48 ` Anton Mikanovich
2021-09-06 10:51 ` Henning Schild
2021-09-07 7:15 ` Bezdeka, Florian
2021-09-07 8:00 ` Henning Schild
2021-09-13 13:05 ` Anton Mikanovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210903125355.12279-4-henning.schild@siemens.com \
--to=henning.schild@siemens.com \
--cc=Vijaikumar_Kanagarajan@mentor.com \
--cc=florian.bezdeka@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox