Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#515 - (x86_64) No support for generic EFI framebuffer #5470

Closed
openwrt-bot opened this issue Feb 14, 2017 · 5 comments
Closed

FS#515 - (x86_64) No support for generic EFI framebuffer #5470

openwrt-bot opened this issue Feb 14, 2017 · 5 comments
Labels

Comments

@openwrt-bot
Copy link

alive4ever:

There is no display on the vga console when booting LEDE x86/64 generic on UEFI - chainloaded via grubx64-standalone.efi - on Qemu with EDK II OVMF.

To reproduce this, manual steps are needed, since LEDE image for x86_64 doesn't support native UEFI boot.

  1. Create a disk image:
    $ qemu-img create -f raw lede-test.img 512M
  2. Setup the disk image as loop device.
    # losetup -f lede-test.img
  3. Create 2 partitions, a 100MB vfat partition to hold efi files and an ext3 partition to hold root filesystem. MBR is assumed. parted/gparted can be used in place of fdisk.
    # fdisk /dev/loop0
    # mkfs.vfat /dev/loop0p1
    # mkfs.ext3 /dev/loop0p2
  4. Mount vfat partition somewhere, for example on /mnt/boot
    # mkdir /mnt/boot && mount /dev/loop0p1 /mnt/boot
  5. Create EFI directory inside /mnt/boot
    # mkdir -p /mnt/boot/EFI/BOOT
  6. Mount ext3 partition somewhere, such as /mnt/rootfs
    # mkdir /mnt/rootfs && mount /dev/loop0p2 /mnt/rootfs
  7. Generate a standalone grub efi image.
    grub2-mkstandalone --modules="part_msdos part_gpt" --format=x86_64-efi --output=/mnt/boot/EFI/BOOT/BOOTX64.EFI
  8. Put LEDE kernel on the boot partition.
    /mnt/boot/lede-x86-64-vmlinuz
  9. Extract LEDE rootfs on the rootfs partition.
    # tar -C /mnt/rootfs -xf lede-x86-64-generic-rootfs.tar.gz
  10. Unmount the directories.
    # umount -v /mnt/rootfs /mnt/boot
  11. Detach the disk image from loop device.
    # losetup -d /dev/loop0
  12. Launch QEMU with UEFI firmware (OVMF_CODE.fd can be extracted from rpm file on https://www.kraxel.org/repos/jenkins/edk2/)
    $ qemu-system-x86_64 -enable-kvm -m 512M -drive file=lede-test.img,format=raw -bios /usr/share/edk2/ovmf/OVMF_CODE.fd -serial stdio
  13. On the grub prompt, type the following
insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod gfxterm terminal_input console terminal_output console gfxterm set gfxpayload=keep

linux (hd0,msdos1)/lede-x86_64-vmlinuz root=/dev/sda2 rootfstype=ext3 rootwait noinitrd console=tty0 console=ttyS0,115200n8

boot

LEDE will boot, but no output shown on the VGA display. The only output is shown on the serial console.

Enabling CONFIG_FB_EFI for x86/64 target is needed to display graphical output on the EFI framebuffer.

@openwrt-bot
Copy link
Author

alive4ever:

LEDE kernel is EFI-stub enabled. So, instead of creating a grub standalone efi image to chainload the kernel, it is possible to load the kernel directly from EFI shell as long as the UEFI and kernel architecture match (x86_64 UEFI to launch x86_64 kernel).
Shell> fs0
fs0:> .\boot\lede-x86_64-vmlinuz root=/dev/sda2 rootfstype=ext3 rootwait noinitrd console=tty0 console=ttyS0,115200n8

@openwrt-bot
Copy link
Author

alive4ever:

I can get LEDE to display text on the EFI framebuffer console by enabling CONFIG_FB_EFI and CONFIG_FB_SIMPLE.

diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default
index 0f23a9df75..b5a2b0a482 100644
--- a/target/linux/x86/64/config-default
+++ b/target/linux/x86/64/config-default
@@ -115,9 +115,10 @@ CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_CMDLINE=y
-# CONFIG_FB_EFI is not set
+CONFIG_FB_EFI=y
CONFIG_FB_HYPERV=y
CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_SIMPLE=y
CONFIG_FB_TILEBLITTING=y

CONFIG_FB_VESA is not set

CONFIG_FONTS is not set

There is no increase in the kernel binary with this change.

@openwrt-bot
Copy link
Author

alive4ever:

Pull request has been submitted: lede-project/source#851

@openwrt-bot
Copy link
Author

alive4ever:

Resubmitted: lede-project/source#860

@openwrt-bot
Copy link
Author

nbd:

Fixed in r3551-2712497442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant