I need help with grub

166 views
Skip to first unread message

Eddie Davis

unread,
Feb 11, 2018, 8:01:26 PM2/11/18
to Android-x86
I installed Android-x86 7.1 R1 64 on my Lenovo Yoga 710 laptop
and it works good except the screen resolution is to high. I can
adjust it to my liking in settings but I would like to edit the grub menu to a lower resolution and show a background image. So
far I have had not luck with it.
Here are the items I have added to android.cfg in the efi folder.

insmod efi_gop
insmod png
insmod jpeg
GRUB_GFXMODE=1280x1024x32
GRUB_BACKGROUND="$kdir/ironman.png"

This has no effect on the grub menu.
I've aslo tried insmod all_video. I know efi_gop should work because it works with Manjaro Linux and shows the supported screen resolutions with that mod.
What am I doing wrong? Is it even possible to change the resolution and display a background image in this version of grub.

Chih-Wei Huang

unread,
Feb 11, 2018, 9:42:37 PM2/11/18
to Android-x86
2018-02-12 9:01 GMT+08:00 Eddie Davis <ejda...@gmail.com>:
> I installed Android-x86 7.1 R1 64 on my Lenovo Yoga 710 laptop
> and it works good except the screen resolution is to high. I can
> adjust it to my liking in settings but I would like to edit the grub menu to a lower resolution and show a background image. So
> far I have had not luck with it.
> Here are the items I have added to android.cfg in the efi folder.
>
> insmod efi_gop
> insmod png
> insmod jpeg

Note we didn't install any grub modules.
You need to add these modules to ESP
yourself to make them work.

> GRUB_GFXMODE=1280x1024x32
> GRUB_BACKGROUND="$kdir/ironman.png"
>
> This has no effect on the grub menu.

I either don't think just adding these variables will work.
They are only used by grub-install of a normal linux distro
to generate grub.cfg. But we don't use grub-install.
You need to write the grub command directly like:

background_image -m stretch $GRUB_BACKGROUND


> I've aslo tried insmod all_video. I know efi_gop should work because it works with Manjaro Linux and shows the supported screen resolutions with that mod.
> What am I doing wrong? Is it even possible to change the resolution and display a background image in this version of grub.



--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Eddie Davis

unread,
Feb 12, 2018, 3:57:39 PM2/12/18
to Android-x86
Thanks for responding, so I got it to work with a bunch of edits to android.cfg.
This is what I added:

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod video_bochs
    insmod video_cirrus
  fi
}
#if [ x$feature_default_font_path = xy ] ; then
#font=unicode
#else
##Scrapped if-then-else above required? - NO?
insmod part_msdos
search --no-floppy --set=root --label SYS/DRV
    font=/boot/grub/fonts/unicode.pf2
fi
if loadfont $font ; then
  set gfxmode=1280x1024x32
  load_video
  insmod gfxterm
  set locale_dir=/boot/grub/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
search --set=root --label SYS/DRV
### Begin Background setup ###
insmod png
set menu_color_normal=red/black
set menu_color_highlight=black/light-gray
if background_image /boot/grub/splash.png; then
  true
else
  set menu_color_normal=red/black
  set menu_color_highlight=black/light-gray
fi
### END Background setup ###

### BEGIN setup graphics ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
### End setup graphics ###
I also had to add the mods,font,and locales -whew!
And everything looks like I like it.
By the way I think it would be great if you included a grub theme with Android-x86,
it would definitely look more complete.

Thanks for making this great project, Cheers! 
Reply all
Reply to author
Forward
0 new messages