public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH 4/9] Revert "wic: Make the bootimg-efi plugin generate usable images"
Date: Wed, 31 Jan 2018 10:41:55 +0100	[thread overview]
Message-ID: <37227b75b4c64456e7a035ac785b9866819990fe.1517390790.git.henning.schild@siemens.com> (raw)
In-Reply-To: <cover.1517390790.git.henning.schild@siemens.com>
In-Reply-To: <cover.1517390790.git.henning.schild@siemens.com>

This reverts commit c8f10e3f541643f6ed6bb3c971bf36267519fba8.
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 62 +++------------------------
 1 file changed, 6 insertions(+), 56 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 45635f3..f631e3f 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -69,20 +69,12 @@ class BootimgEFIPlugin(SourcePlugin):
             grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n"
             grubefi_conf += "default=boot\n"
             grubefi_conf += "timeout=%s\n" % bootloader.timeout
-            grubefi_conf += "set root='hd0,gpt2'\n"
             grubefi_conf += "menuentry 'boot'{\n"
 
-            kernel_image = get_bitbake_var("KERNEL_IMAGE")
-            kernel = "/boot/%s" % kernel_image
-
-            grubefi_conf += "linux %s root=/dev/sda2 rootwait %s\n" \
-                            % (kernel, bootloader.append)
-
-            initrd_image = get_bitbake_var("INITRD_IMAGE")
-            initrd = "/boot/%s" % initrd_image
-
-            grubefi_conf += "initrd %s\n" % initrd
+            kernel = "/bzImage"
 
+            grubefi_conf += "linux %s root=%s rootwait %s\n" \
+                % (kernel, creator.rootdev, bootloader.append)
             grubefi_conf += "}\n"
 
         logger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg",
@@ -91,12 +83,6 @@ class BootimgEFIPlugin(SourcePlugin):
         cfg.write(grubefi_conf)
         cfg.close()
 
-        cfg = open("%s/hdd/boot/EFI/BOOT/grub-mkimage.cfg" % cr_workdir, "w")
-        mkimage_conf = "set root='hd0,gpt1'\n"
-        mkimage_conf += "set prefix=($root)/EFI/BOOT\n"
-        cfg.write(mkimage_conf)
-        cfg.close()
-
     @classmethod
     def do_configure_systemdboot(cls, hdddir, creator, cr_workdir, source_params):
         """
@@ -148,8 +134,7 @@ class BootimgEFIPlugin(SourcePlugin):
 
         if not custom_cfg:
             # Create systemd-boot configuration using parameters from wks file
-            kernel_name = get_bitbake_var("KERNEL_IMAGE")
-            kernel = "/%s" % kernel_name
+            kernel = "/bzImage"
 
             boot_conf = ""
             boot_conf += "title boot\n"
@@ -206,9 +191,8 @@ class BootimgEFIPlugin(SourcePlugin):
 
         hdddir = "%s/hdd/boot" % cr_workdir
 
-        kernel_name = get_bitbake_var("KERNEL_IMAGE")
-        install_cmd = "install -m 0644 %s/%s %s/%s" % \
-                      (staging_kernel_dir, kernel_name, hdddir, kernel_name)
+        install_cmd = "install -m 0644 %s/bzImage %s/bzImage" % \
+            (staging_kernel_dir, hdddir)
         exec_cmd(install_cmd)
 
 
@@ -216,45 +200,11 @@ class BootimgEFIPlugin(SourcePlugin):
             if source_params['loader'] == 'grub-efi':
                 shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir,
                                 "%s/grub.cfg" % cr_workdir)
-                shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub-mkimage.cfg" % cr_workdir,
-                                "%s/grub-mkimage.cfg" % cr_workdir)
                 for mod in [x for x in os.listdir(kernel_dir) if x.startswith("grub-efi-")]:
                     cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[9:])
                     exec_cmd(cp_cmd, True)
                 shutil.move("%s/grub.cfg" % cr_workdir,
                             "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir)
-
-                distro_arch = get_bitbake_var("DISTRO_ARCH")
-                if not distro_arch:
-                    raise WicError("Couldn't find target architecture")
-
-                if distro_arch == "amd64":
-                    grub_target = 'x86_64-efi'
-                    grub_image = "bootx64.efi"
-                elif distro_arch == "i386":
-                    grub_target = 'i386-efi'
-                    grub_image = "bootia32.efi"
-                else:
-                    raise WicError("grub-efi is incompatible with target %s" %
-                                   distro_arch)
-
-                bootimg_dir = "%s/hdd/boot" % cr_workdir
-                if not os.path.isfile("%s/EFI/BOOT/%s" \
-                                      % (bootimg_dir, grub_image)):
-
-                    # TODO: check that grub-mkimage is available
-                    grub_cmd = "grub-mkimage -p /EFI/BOOT "
-                    grub_cmd += "-c %s/grub-mkimage.cfg " % cr_workdir
-                    grub_cmd += "-O %s -o %s/EFI/BOOT/%s " \
-                                % (grub_target, bootimg_dir, grub_image)
-                    grub_cmd += "part_gpt part_msdos ntfs ntfscomp fat ext2 "
-                    grub_cmd += "normal chain boot configfile linux multiboot "
-                    grub_cmd += "search efi_gop efi_uga font gfxterm gfxmenu "
-                    grub_cmd += "terminal minicmd test iorw loadenv echo help "
-                    grub_cmd += "reboot serial terminfo iso9660 loopback tar "
-                    grub_cmd += "memdisk ls search_fs_uuid udf btrfs xfs lvm "
-                    grub_cmd += "reiserfs ata "
-                    exec_cmd(grub_cmd)
             elif source_params['loader'] == 'systemd-boot':
                 for mod in [x for x in os.listdir(kernel_dir) if x.startswith("systemd-")]:
                     cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:])
-- 
2.13.6


  parent reply	other threads:[~2018-01-31  9:42 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31  9:41 [PATCH 0/9] first wic integration Henning Schild
2018-01-31  9:41 ` [PATCH 1/9] classes: image: introduce size measuring function, for before do_*_image Henning Schild
2018-01-31  9:41 ` [PATCH 2/9] images: new class wic-img for wic intregration Henning Schild
2018-02-13 14:44   ` Alexander Smirnov
2018-02-13 16:06     ` Henning Schild
2018-01-31  9:41 ` [PATCH 3/9] wic: add a bootimg-efi-isar plugin outside the wic tree Henning Schild
2018-02-12 17:48   ` Jan Kiszka
2018-01-31  9:41 ` Henning Schild [this message]
2018-01-31  9:41 ` [PATCH 5/9] Revert "wic: Introduce the `WicExecError` exception class" Henning Schild
2018-01-31  9:41 ` [PATCH 6/9] Revert "wic: Work around mcopy error" Henning Schild
2018-01-31  9:41 ` [PATCH 7/9] Revert "wic: Use sudo instead of pseudo" Henning Schild
2018-01-31  9:41 ` [PATCH 8/9] Revert "wic: Remove sysroot support" Henning Schild
2018-01-31  9:42 ` [PATCH 9/9] wic: now truly go for the wic version we claim to have Henning Schild
2018-01-31 10:11   ` Alexander Smirnov
2018-01-31 10:55     ` Jan Kiszka
2018-01-31 11:11       ` Alexander Smirnov
2018-01-31 11:43         ` Jan Kiszka
2018-01-31 11:53           ` Baurzhan Ismagulov
2018-01-31 12:01             ` Jan Kiszka
2018-01-31 12:28               ` Baurzhan Ismagulov
2018-01-31 13:53                 ` Henning Schild
2018-01-31 14:01                   ` Baurzhan Ismagulov
2018-01-31 14:21                     ` Henning Schild
2018-01-31 10:02 ` [PATCH 0/9] first wic integration Alexander Smirnov
2018-01-31 10:12   ` Henning Schild
2018-01-31 11:24     ` Baurzhan Ismagulov
2018-01-31 11:47       ` Jan Kiszka
2018-01-31 12:02         ` Baurzhan Ismagulov
2018-01-31 12:15           ` Jan Kiszka
2018-01-31 13:30             ` Jan Kiszka
2018-01-31 13:41               ` Baurzhan Ismagulov
2018-01-31 14:01                 ` Jan Kiszka
2018-01-31 15:21                   ` Baurzhan Ismagulov
2018-01-31 15:46                     ` Henning Schild
2018-01-31 16:13                     ` Jan Kiszka
2018-01-31 13:35             ` Baurzhan Ismagulov
2018-01-31 13:47               ` Henning Schild
2018-01-31 14:00                 ` Baurzhan Ismagulov
2018-01-31 13:46             ` Henning Schild
2018-01-31 13:36           ` Henning Schild
2018-01-31 13:40             ` Baurzhan Ismagulov
2018-01-31 13:05       ` Henning Schild
2018-02-01 12:41 ` [PATCH] images: wic: limit use of sudo and enable manual call again Henning Schild
2018-02-01 12:44   ` Henning Schild
2018-02-01 16:09     ` Baurzhan Ismagulov
2018-02-01 18:10       ` Henning Schild
2018-02-01 18:55         ` Henning Schild
2018-02-12 19:07   ` Henning Schild
2018-02-12 17:27 ` [PATCH 0/9] first wic integration Henning Schild
2018-02-12 18:21   ` Alexander Smirnov
2018-02-12 18:30     ` Henning Schild

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=37227b75b4c64456e7a035ac785b9866819990fe.1517390790.git.henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.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