help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Working grub.cfg for UEFI boot FreeBSD using GRUB on x86


From: HSR Hackspace
Subject: Working grub.cfg for UEFI boot FreeBSD using GRUB on x86
Date: Mon, 3 Apr 2017 17:37:13 +0530

Hi folks;

I have a x86 machine with UEFI (secure boot disabled) running Freebsd
10.1.  I am trying to make it dual boot with Linux as second operating
system. For that I'm trying to install freebsd port of grub ( from
FreeBSD). Installation seems going fine with only problem being
missing grub.cfg. I tried creating  post installation but I got empty
file.

-> grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
/usr/local/etc/grub.d/00_header: cut: not found

Above command generated file grub.cfg.new
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /usr/local/etc/grub.d and settings from /usr/local/etc/default/grub
#

### BEGIN /usr/local/etc/grub.d/00_header ###

For  work around I  manually created grb.cfg with below entry :

menuentry "FreeBSD" {
    insmod ufs2
insmod bsd
insmod gzio
insmod efi_gop
    insmod gfxterm
    insmod font
    insmod videotest
    insmod videoinfo
    set gfxmode=auto
    set kernvt="vt"
    set root=(hd0,3)
    kfreebsd /boot/loader.efi
}

This end with error: invalid a.out header.

I think this may be due to file format mismatch between kfreebsd (
a.out) and loader (efi). So I replaced loader.efi with simple loader
file . But this time I got a blank screen (with white blurr on top of
screen) . Not sure this is video issue or something else. Finally I
replaced last line with chainloader /boot/loader.efi. This time result
are more encouraging but booting got stuck with 'signature did not
matched not booting'. Since we have disabled secure booting I am not
expecting signature matching.

My queries:

a) How would a working grub.cfg for freebsd will look like. Is my
chain loader approach worth pursuing?
b) Is this signature mismatch error make any sense. Anything I can do about it?


My setup details : Freebsd is in '/' which is partition three on disk
and have UFS file system.

gpart show -l:

=>        6  146239733  da0  GPT  (558G)
          6         10       - free -  (40K)
         16        128    1  (null)  (512K)
        144     262144    2  efi  (1.0G) -----------> ESP
     262288    1048576    3  rootfs  (4.0G)
    1310864    2097152    4  swap  (8.0G)
    3408016    1048576    5  nextroot  (4.0G)
    4456592     102400    6  var  (400M)
    4558992   13107200    7  raw  (50G)
   17666192     524288    8  godspeed  (2.0G)
   18190480  128049248    9  data  (488G)
  146239728         11       - free -  (44K)

df -T :

Filesystem         Type      1K-blocks     Used     Avail Capacity  Mounted on
/dev/gpt/rootfs    ufs         1048412   983276    -18736   102%    /
devfs              devfs             1        1         0   100%    /dev
/dev/gpt/efi       msdosfs     1046516       64   1046452     0%    /efi
/dev/gpt/var       ufs          395896    26712    337520     7%    /var
/dev/gpt/godspeed  ufs         2031132      128   1868516     0%
/var/db/godspeed
/dev/gpt/data      ufs       504159728 30075728 433751232     6%    /data
procfs             procfs            4        4         0   100%    /proc
linprocfs          linprocfs         4        4         0   100%
/compat/linux/proc
linsysfs           linsysfs          4        4         0   100%
/compat/linux/sys



grub installation command : grub-install --target=x86_64-efi
--efi-directory=/efi/ --bootloader-id=grub --boot-directory=/boot/
--modules="part_gpt part_msdos"

Appreciate some help in debugging this issue.

Thanks in advance.

_SP



reply via email to

[Prev in Thread] Current Thread [Next in Thread]