Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[FIXED] LILO Not Replaced With Grub2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Fri Nov 11, 2016 9:53 pm    Post subject: [FIXED] LILO Not Replaced With Grub2 Reply with quote

I've been wrestling with installing a plain Gentoo system now for 2 days on a new UEFI Atom-based system. Yes, the BIOS features UEFI. Where I am stuck at now is that I installed grub2, but when I go to reboot, the previous LILO appears and then I get a message (screenshot):
Quote:

GNU/Linux - LIO 24 - Boot Menu
|U | gentoo|

boot:
Loading gentooEBDA is big; kernel setup stack overlaps LILO second stage

That means my grub did not install and/or LILO 24 was not removed.

Here is the full 7800+ log of the command:
Code:
 grub-install --target=x86_64-efi --efi-directory=/boot/efi -v &>/tmp/grub_install.log


And here is the end of the grub log:

Quote:
grub-install: info: Registering with EFI: distributor = `gentoo', path = `\EFI\gentoo\grubx64.efi', ESP at hostdisk//dev/sda,gpt2.
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivars.
efibootmgr: EFI variables are not supported on this system.
grub-install: info: executing efibootmgr -c -d /dev/sda -p 2 -w -L gentoo -l \EFI\gentoo\grubx64.efi.
efibootmgr: EFI variables are not supported on this system.
Installation finished. No error reported.


I made green the messages that suggest grub successfully installed. I made red the messages that suggest something went awry.

Question: what can I do to remove the LILO and assure that Grub is the bootloader?

Background for reference:
I started an install hoping I could accomplish the task of a Xen install in one reboot. When I ran into problems with GPT and UEFI, I resorted to the current high watermark of Debian and succeeded in getting a basic system running. However, when I went to use LVM, I ran into a Debian package problem with LVM not be available because it was labeled "test." I threw my hands up and returned to Gentoo having in mind of simply installing a basic system, then I would rebuild it into a Xen system. Where I am now is I've built the system twice, and a kernel created by genkernel (takes 30 minutes on the Atom 8 processor), but I cannot get the boot loader to have any semblance of being in GRUB. There is a red LILO screen that appears after which loading hangs.


Every indication to me is the GRUB successfully installed. But the actual reboot says otherwise, see above.

I've tried installing LILO and then uninstalling it -- but apparently an "emerge -C sys-boot/lilo" doesn't overwrite or remove what bits have been set.

For the record:
parted, gdisk, & fdisk

Code:

livecd ~ # date;parted
Fri Nov 11 19:15:28 UTC 2016
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: ATA TOSHIBA MG04ACA4 (scsi)
Disk /dev/sda: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name    Flags
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  3146kB  2097kB  ext2            grub    bios_grub
 2      3146kB  137MB   134MB   fat32           boot    boot, esp
 3      137MB   674MB   537MB   linux-swap(v1)  swap
 4      674MB   21.6GB  21.0GB  ext4            rootfs
        21.6GB  4001GB  3979GB  Free Space

(parted) quit
livecd ~ #


Code:

livecd ~ # date; fdisk -t gpt /dev/sda
Fri Nov 11 19:21:57 UTC 2016

Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: CE6D22A6-F033-47E8-A262-D7CC2C54BD71

Device       Start      End  Sectors  Size Type
/dev/sda1     2048     6143     4096    2M BIOS boot
/dev/sda2     6144   268287   262144  128M EFI System
/dev/sda3   268288  1316863  1048576  512M Linux filesystem
/dev/sda4  1316864 42272767 40955904 19.5G Linux filesystem

Command (m for help): q

livecd ~ #



Code:

livecd ~ # date;gdisk /dev/sda
Fri Nov 11 19:17:52 UTC 2016
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 7814037168 sectors, 3.6 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): CE6D22A6-F033-47E8-A262-D7CC2C54BD71
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 7814037134
Partitions will be aligned on 2048-sector boundaries
Total free space is 7771766381 sectors (3.6 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            6143   2.0 MiB     EF02  grub
   2            6144          268287   128.0 MiB   EF00  boot
   3          268288         1316863   512.0 MiB   8300  swap
   4         1316864        42272767   19.5 GiB    8300  rootfs

Command (? for help): q
livecd ~ #



fstab
Code:
5:03 AM 11/11/2016
livecd ~ # cat /mnt/gentoo/etc/fstab
LABEL=cloudimg-rootfs / ext4 defaults 0 0


/dev/sda2   /boot        vfat    defaults             0 2
/dev/sda3   none         swap    sw                   0 0
/dev/sda4   /            ext4    noatime              0 1

/dev/cdrom  /mnt/cdrom   auto    noauto,user          0 0
livecd ~ #


Listing of /boot

Code:

(chroot) livecd / # ls -la /boot
total 43450
drwxr-xr-x  5 root root     1536 Jan  1  1970 .
drwxr-xr-x 22 root root     4096 Nov 11 05:10 ..
drwxr-xr-x  3 root root      512 Nov 11 20:42 efi
drwxr-xr-x  6 root root      512 Nov 11 20:44 grub
-rwxr-xr-x  1 root root 22130448 Nov 11 05:22 initramfs-genkernel-x86_64-4.4.26-gentoo
-rwxr-xr-x  1 root root  3597668 Nov 11 05:22 initramfs-genkernel-x86_64-4.4.26-gentoo-openstack
-rwxr-xr-x  1 root root  5341328 Nov 11 05:22 kernel-genkernel-x86_64-4.4.26-gentoo
-rwxr-xr-x  1 root root  6037776 Nov 11 05:22 kernel-genkernel-x86_64-4.4.26-gentoo-openstack
drwxr-xr-x  2 root root      512 Nov 11 05:22 lost+found
-rwxr-xr-x  1 root root  3135124 Nov 11 05:22 System.map-genkernel-x86_64-4.4.26-gentoo
-rwxr-xr-x  1 root root  4241153 Nov 11 05:22 System.map-genkernel-x86_64-4.4.26-gentoo-openstack
(chroot) livecd / #



make.conf
Code:
(chroot) livecd init.d # tail /etc/portage/make.conf
# These are the USE and USE_EXPAND flags that were used for
# buidling in addition to what is provided by the profile.
USE="bindist bzip2 idm ipv6 mmx sse sse2 urandom"
CPU_FLAGS_X86="mmx sse sse2"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"

GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo http://gentoo.osuosl.org/ http://mirror.usu.edu/mirrors/gentoo/"
GRUB_PLATFORMS="efi-64"
(chroot) livecd init.d #


/boot/grub/grub.cfg
Code:
(chroot) livecd / # date;cat /boot/grub/grub.cfg
Fri Nov 11 21:49:35 UTC 2016
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  667ba578-dfa7-40c8-bf09-1a63d3e58799
else
  search --no-floppy --fs-uuid --set=root 667ba578-dfa7-40c8-bf09-1a63d3e58799
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-667ba578-dfa7-40c8-bf09-1a63d3e58799' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod fat
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  4CC9-4838
        else
          search --no-floppy --fs-uuid --set=root 4CC9-4838
        fi
        echo    'Loading Linux x86_64-4.4.26-gentoo-openstack ...'
        linux   /kernel-genkernel-x86_64-4.4.26-gentoo-openstack root=UUID=667ba578-dfa7-40c8-bf09-1a63d3e58799 ro
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-4.4.26-gentoo-openstack
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-667ba578-dfa7-40c8-bf09-1a63d3e58799' {
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.4.26-gentoo-openstack' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.4.26-gentoo-openstack-advanced-667ba578-dfa7-40c8-bf09-1a63d3e58799' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod fat
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  4CC9-4838
                else
                  search --no-floppy --fs-uuid --set=root 4CC9-4838
                fi
                echo    'Loading Linux x86_64-4.4.26-gentoo-openstack ...'
                linux   /kernel-genkernel-x86_64-4.4.26-gentoo-openstack root=UUID=667ba578-dfa7-40c8-bf09-1a63d3e58799 ro
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.4.26-gentoo-openstack
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.4.26-gentoo-openstack (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.4.26-gentoo-openstack-recovery-667ba578-dfa7-40c8-bf09-1a63d3e58799' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod fat
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  4CC9-4838
                else
                  search --no-floppy --fs-uuid --set=root 4CC9-4838
                fi
                echo    'Loading Linux x86_64-4.4.26-gentoo-openstack ...'
                linux   /kernel-genkernel-x86_64-4.4.26-gentoo-openstack root=UUID=667ba578-dfa7-40c8-bf09-1a63d3e58799 ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.4.26-gentoo-openstack
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.4.26-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.4.26-gentoo-advanced-667ba578-dfa7-40c8-bf09-1a63d3e58799' {
                load_video
                if [ "x$grub_platform" = xefi ]; then
                        set gfxpayload=keep
                fi
                insmod gzio
                insmod part_gpt
                insmod fat
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  4CC9-4838
                else
                  search --no-floppy --fs-uuid --set=root 4CC9-4838
                fi
                echo    'Loading Linux x86_64-4.4.26-gentoo ...'
                linux   /kernel-genkernel-x86_64-4.4.26-gentoo root=UUID=667ba578-dfa7-40c8-bf09-1a63d3e58799 ro
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.4.26-gentoo
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.4.26-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.4.26-gentoo-recovery-667ba578-dfa7-40c8-bf09-1a63d3e58799' {
                load_video
                if [ "x$grub_platform" = xefi ]; then
                        set gfxpayload=keep
                fi
                insmod gzio
                insmod part_gpt
                insmod fat
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  4CC9-4838
                else
                  search --no-floppy --fs-uuid --set=root 4CC9-4838
                fi
                echo    'Loading Linux x86_64-4.4.26-gentoo ...'
                linux   /kernel-genkernel-x86_64-4.4.26-gentoo root=UUID=667ba578-dfa7-40c8-bf09-1a63d3e58799 ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.4.26-gentoo
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


Last edited by jlpoole on Sat Nov 12, 2016 1:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Fri Nov 11, 2016 11:15 pm    Post subject: Reply with quote

This Howto re: LILO may be helpful: http://www.tldp.org/HOWTO/LILO-2.html#ss2.4
Though, in my case, I do not want to restore what was previously there; I want to remove the LILO insertions permanently.

Also, I copy over everything in /boot to /bootCOPY2 and then exited chroot and made sure that the file system if FAT32, not FAT 12 of FAT16. The Handbook did not address this type of detail, and I'm reading that FAT32 is critical. So to remove any doubt about whether the file system is FAT32 I performed:

Code:
mkfs.fat -F32 /dev/sda2


Then chrooted and copied the files in /bootCOPY2 back to /boot. I tried to reboot, and again ran into the same LILO problem.

Lastly, I had seen the file boot.0800 and guessed it to be from LILO. Thinking it may have been the cause of the LILO to persist, I deleted it. That may have been a mistake, as the URL above teaches that it is the back-up which can be used to restore specific bits as they were prior to LILO.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Sat Nov 12, 2016 12:24 am    Post subject: Reply with quote

I got rid of the LILO by doing the following:
Code:
dd /dev/zero /dev/sda2  bs=4k
dd /dev/zero /dev/sda1  bs=4k

mkfs.fat -F32 /dev/sda2
mkfs.fat -F32 /dev/sda1


I then copied all the files I had backed up in /bootCOPY2 into /boot.

Now when I do not boot up with the Gentoo DVD, I get:
Quote:
L99 99 99 99 99...

So, it appears the LILO was lurking either on /dev/sda1 or /dev/sda2. Now I'll go back and try re-installing and configuring grub2.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Sat Nov 12, 2016 12:51 am    Post subject: Reply with quote

When through a full GRUB 2 installation, but nothing changed, still dumps with "L 99 99 99". So it looks like GRUB really is not installing. Here's the tail of the install log:
Code:
grub-install: info: Registering with EFI: distributor = `gentoo', path = `\EFI\gentoo\grubx64.efi', ESP at hostdisk//dev/sda,gpt2.
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivars.
efibootmgr: EFI variables are not supported on this system.
grub-install: info: executing efibootmgr -c -d /dev/sda -p 2 -w -L gentoo -l \EFI\gentoo\grubx64.efi.
efibootmgr: EFI variables are not supported on this system.
Installation finished. No error reported.


Hmmm.... the EFI variables "not supported" is an indicator of an error, then how can a LiveCD which does not EFI built-in install grub2 on an EFI system. I'm really missing something here, and I'm not getting much notice in the way of fatal errors from the tools, e.g. grub2.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Sat Nov 12, 2016 1:40 am    Post subject: Reply with quote

Guessing you are installing from a Gentoo Minimal Install CD, if so, be advised that it does not support uefi and you need to be booted in UEFI mode before going into the chroot to install grub. Recommend System Rescue CD or USB booted in UEFI mode, then mount the Gentoo root partition at /mnt/gentoo and the Gentoo boot partition at /mnt/gentoo/boot and then entering the chroot. Once there, run
Code:
ls /sys/firmware/efi
to confirm uefi mode, repeat
Code:
emerge grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot/efi -v &>/tmp/grub_install.log
grub-mkconfig /boot/grub/grub.cfg
efibootmgr
efibootmgr should show gentoo as first in bootorder if grub went well
_________________
Defund the FCC.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Sat Nov 12, 2016 2:01 am    Post subject: Reply with quote

Thank you Donahue, I was just starting to formulate the question of what does one do to install a UEFI based system. I think this issue of UEFI needs to be addressed more carefully in the Handbook. I've lost about 20 hours because I was unaware of this cart-before-the-horse problem and I think the Handbook should address the foundation question: Does your system have UEFI? If so, this is the path you need to take.... Yes, I'll bring it up in the Handbook Discussion wiki. Thank you, again.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Sat Nov 12, 2016 2:10 am    Post subject: Reply with quote

I'll also log a bug with Grub -- if UEFI is necessary for a successful installation, then the absence of such needs be more descriptive. My problem was it was not clear grub failed:
Code:
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivars.
efibootmgr: EFI variables are not supported on this system.
grub-install: info: executing efibootmgr -c -d /dev/sda -p 2 -w -L gentoo -l \EFI\gentoo\grubx64.efi.
efibootmgr: EFI variables are not supported on this system.
Installation finished. No error reported.


Add to the summary on the last line: "No error reported" and one would think it was just a warning.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sat Nov 12, 2016 3:08 am    Post subject: Reply with quote

Code:
efibootmgr: EFI variables are not supported on this system.

This is clear indication the box was not booted in EFI mode. Meaning Grub as EFI bootloader cannot be activated. You could still boot from some EFI media and activate Grub, I guess. Without reinstalling anything. OTOH, you installed Grub for EFI, so it did not overwrite MBR where Lilo resides.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Sat Nov 12, 2016 4:08 am    Post subject: Reply with quote

Buffoon wrote:
Code:
efibootmgr: EFI variables are not supported on this system.

This is clear indication the box was not booted in EFI mode. ...


Correct. I just now learned in reviewing the BIOS interface that there were "modes", if you will, for devices such as the CD-ROM and harddrive. In the Boot Order window, each device had an entry for itself, e.g. "ASUS DRW...", and then one prefixed with "UEFI: ASUS DRW". I changed the CD-ROM ASUS to "UEFI: ASUS DRW...." and then was able to successfully load a kernel from the Sysem Rescue CD that had an operative efibootmgr. So a lot of my problem was due to my ignorance of the two modes that are set in the BIOS.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Sat Nov 12, 2016 4:19 am    Post subject: Reply with quote

So here's my progress (have not suceeded... yet):

I loaded the System Rescue CD and found it was not in UEFI mode:

Just for the record, one would think downloading the System Rescue CD and having a kernel load up that supports UEFI would be a simple matter. The fact is that the menu displayed in the System-Rescue-CD has no mention of UEFI. So I punted and tried the "Standard 64bit kernel (rescue54) and once it loaded, I performed two tests to see if EFI was supported:
Code:
#
# no kernel module for EFI
#
root@zeta /root % lsmod |grep -i efi
root@zeta /root % efibootmgr -v
efibootmgr: EFI variables are not supported on this system.
root@zeta /root %


Nonetheless, I followed Donahue's instructions changed root and performed a test:
Code:
(chroot) zeta / # ls /sys/firmware/efi
ls: cannot access /sys/firmware/efi: No such file or directory
(chroot) zeta / #


I then visited the systems BIOS settings and learned for the first time
that there are alternative boot options for a given device. For instance,
there were these two boot options for my ASUS DVD: 1) "UEFI: ASUS..." and 2) "ASUS...", the distinguishing feature being the prefiex "UEFI: ".

I then selected and saved the option of "UEFI: ASUS..."
I booted into the System Rescue CD

Code:
root@zeta /root % lsmod |grep -i efi
root@zeta /root % dmesg |grep efi
[    0.000000] efi: EFI v2.31 by American Megatrends
[    0.000000] efi:  ACPI=0x7f0cd000  ACPI 2.0=0x7f0cd000  ESRT=0x7f513e98  SMBIOS=0xf0560  MPS=0xfd5e0
[    0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    2.311999] efifb: probing for efifb
[    2.312031] efifb: framebuffer at 0xde000000, mapped to 0xffffc90007000000, using 3072k, total 3072k
[    2.312045] efifb: mode is 1024x768x32, linelength=4096, pages=1
[    2.312052] efifb: scrolling: redraw
[    2.312060] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    3.290374] tsc: Refined TSC clocksource calibration: 2399.998 MHz
root@zeta /root % efibootmgr -v
BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0005,0007,0006,0001,0003,0002
Boot0001* Hard Drive    BBS(HD,,0x0)..GO..NO........o.T.O.S.H.I.B.A. .M.G.0.4.A.C.A.4.0.0.E...................A..........................>..Gd-.;.A..MQ..L. . . . . . . . .6.8.1.K.3.K.F.H.J.F.A.K.......BO
Boot0002  Network Card  BBS(Network,,0x0)..GO..NO........q.I.B.A. .G.E. .S.l.o.t. .0.0.A.0. .v.1.5.4.0........................rN.D+..,.\..........B..Gd-.;.A..MQ..L.I.B.A. .G.E. .S.l.o.t. .0.0.A.0. .v.1.5.4.0.......BO
Boot0003* UEFI: Built-in EFI Shell      VenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BO
Boot0005* UEFI: TOSHIBA MG04ACA400E     PciRoot(0x0)/Pci(0x18,0x0)/Sata(0,65535,0)/HD(2,GPT,cd887f5c-a8d5-46da-9ca9-a469072cdc23,0x1800,0x40000)..BO
Boot0006* USB   BBS(USB,,0x0)..GO..NO........a.A.S.U.S. .D.R.W.-.1.6.0.8.P.2.S. .1...2.2...................A...............................Gd-.;.A..MQ..L.D.E.F.1.0.B.A.2.0.0.7.2.......BO
Boot0007* UEFI: ASUS DRW-1608P2S 1.22   PciRoot(0x0)/Pci(0x16,0x0)/USB(0,0)/USB(1,0)/CDROM(1,0x59,0xb40)/HD(1,MBR,0x0,0x0,0xb40)..BO
root@zeta /root % ls /sys/firmware/efi
config_table  esrt              fw_vendor  runtime-map  vars
efivars       fw_platform_size  runtime    systab
root@zeta /root %


(Note: I had previously installed app-portage/eix, it was not part of the
standard install, but I am addicted to it.)
Code:

(chroot) zeta / # eix grub -I
[I] sys-boot/grub
     Available versions:
     (0)    0.97-r16 ~0.97-r17
     (2)    2.02_beta2-r9(2/2.02_beta2-r9)^t 2.02_beta3-r1(2/2.02_beta3-r1)^t **9999(2/9999)^st
       {custom-cflags debug device-mapper doc efiemu +fonts libzfs mount multislot ncurses netboot nls sdl static test +themes truetype GRUB_PLATFORMS="coreboot efi-32 efi-64 emu ieee1275 loongson multiboot pc qemu qemu-mips uboot xen xen-32"}
     Installed versions:  2.02_beta3-r1(2)^t(03:27:43 AM 11/11/2016)(fonts nls themes -debug -device-mapper -doc -efiemu -libzfs -mount -multislot -sdl -static -test -truetype GRUB_PLATFORMS="efi-64 pc -coreboot -efi-32 -emu -ieee1275 -loongson -multiboot -qemu -qemu-mips -uboot -xen -xen-32")
     Homepage:            https://www.gnu.org/software/grub/
     Description:         GNU GRUB boot loader

(chroot) zeta / # eix -I efibootmgr
[I] sys-boot/efibootmgr
     Available versions:  ~0.5.4 0.5.4-r1 ~0.6.0 0.11.0 0.12 ~13 ~14
     Installed versions:  0.12(03:23:10 AM 11/11/2016)
     Homepage:            https://github.com/rhinstaller/efibootmgr
     Description:         User-space application to modify the EFI boot manager

(chroot) zeta / # efibootmgr -v
BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0005,0007,0006,0001,0003,0002
Boot0001* Hard Drive    BBS(HD,,0x0)..GO..NO........o.T.O.S.H.I.B.A. .M.G.0.4.A.C.A.4.0.0.E...................A..........................>..Gd-.;.A..MQ..L. . . . . . . . .6.8.1.K.3.K.F.H.J.F.A.K.......BO
Boot0002  Network Card  BBS(Network,,0x0)..GO..NO........q.I.B.A. .G.E. .S.l.o.t. .0.0.A.0. .v.1.5.4.0........................rN.D+..,.\..........B..Gd-.;.A..MQ..L.I.B.A. .G.E. .S.l.o.t. .0.0.A.0. .v.1.5.4.0.......BO
Boot0003* UEFI: Built-in EFI Shell      VenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BO
Boot0005* UEFI: TOSHIBA MG04ACA400E     PciRoot(0x0)/Pci(0x18,0x0)/Sata(0,65535,0)/HD(2,GPT,cd887f5c-a8d5-46da-9ca9-a469072cdc23,0x1800,0x40000)..BO
Boot0006* USB   BBS(USB,,0x0)..GO..NO........a.A.S.U.S. .D.R.W.-.1.6.0.8.P.2.S. .1...2.2...................A...............................Gd-.;.A..MQ..L.D.E.F.1.0.B.A.2.0.0.7.2.......BO
Boot0007* UEFI: ASUS DRW-1608P2S 1.22   PciRoot(0x0)/Pci(0x16,0x0)/USB(0,0)/USB(1,0)/CDROM(1,0x59,0xb40)/HD(1,MBR,0x0,0x0,0xb40)..BO
(chroot) zeta / #


Code:

(chroot) zeta / # grub-install --target=x86_64-efi --efi-directory=/boot/efi -v &>/tmp/grub_install_efi.log
(chroot) zeta / # tail /tmp/grub_install_efi.log
Timeout: 1 seconds
BootOrder: 0000,0005,0007,0006,0001,0003,0002
Boot0001* Hard Drive
Boot0002  Network Card
Boot0003* UEFI: Built-in EFI Shell
Boot0005* UEFI: TOSHIBA MG04ACA400E
Boot0006* USB
Boot0007* UEFI: ASUS DRW-1608P2S 1.22
Boot0000* gentoo
Installation finished. No error reported.
(chroot) zeta / #  grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/kernel-genkernel-x86_64-4.4.26-gentoo-openstack
Found initrd image: /boot/initramfs-genkernel-x86_64-4.4.26-gentoo-openstack
Found linux image: /boot/kernel-genkernel-x86_64-4.4.26-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.4.26-gentoo
done
(chroot) zeta / #  curl -d private=1 -d name="zeta in UEFI boot mode" --data-urlencode text@/tmp/grub_install_efi.log http://napadata.net/paste/api/create
http://napadata.net/paste/view/364883a6

Here is the tail of the log file:
Code:
grub-install: info: copying `/boot/grub/x86_64-efi/core.efi' -> `/boot/efi/EFI/gentoo/grubx64.efi'.
grub-install: info: Registering with EFI: distributor = `gentoo', path = `\EFI\gentoo\grubx64.efi', ESP at hostdisk//dev/sda,gpt2.
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivars.
grub-install: info: executing efibootmgr -c -d /dev/sda -p 2 -w -L gentoo -l \EFI\gentoo\grubx64.efi.
BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0000,0005,0007,0006,0001,0003,0002
Boot0001* Hard Drive
Boot0002  Network Card
Boot0003* UEFI: Built-in EFI Shell
Boot0005* UEFI: TOSHIBA MG04ACA400E
Boot0006* USB
Boot0007* UEFI: ASUS DRW-1608P2S 1.22
Boot0000* gentoo
Installation finished. No error reported.

And then moved back to main root:
Code:

(chroot) zeta / # exit
exit
root@zeta /root % cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount /mnt/gentoo{/boot/efi,/boot,/sys,/proc,}
reboot


I then rebooted, but ended up in the Sytem Rescue CD grub. Then I removed the System Rescue CD from my player and the "L 99 99 999" showed up. I'm guessing now, the boot order of grub is the issue that I need to fix.

Progress... in baby steps.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sat Nov 12, 2016 4:41 am    Post subject: Reply with quote

L 99 ... comes from MBR, you are booting in CSM mode, figure out how to boot in EFI mode.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Sat Nov 12, 2016 6:02 am    Post subject: Reply with quote

Buffoon wrote:
L 99 ... comes from MBR, you are booting in CSM mode, figure out how to boot in EFI mode.


Yes, my BIOS had Compatibility Support Module (CSM) activated. But before I could deactivate that, I had to change a video setting and reboot; the BIOS would not let me alter the CSM mode until the video mode had been altered.

Then I ended up in the EFI Shell. After trying a variety of maneuvars, I finally got into the grub I created and could select the kernel I compiled. There is the "openstack" kernel that must have shipped with linux-sources? The openstack kernel would not launch, but the one I compiled did... however, it is in read-only mode. My grub file has a "ro" in the line which I just copied from some credible source; I tried to change "ro" to "rw" in grub's editor, but the resulting shell was still on a read-only file system. This is progress, I'm almost there. I need to 1) get a direct boot, and 2) get read-write ability.

Also, looks like the DVD writer, an ASUS which probably is 5 years old, isn't being offered as an option. I wonder if turning off the Compatability Support Module causes the device to be inoperative? Any opinions on that? Have we entered an age where components are obsolete because they do not conform to EUFI standards?

I would say this has been the most difficult matter to troubleshoot in any of my computing experience. I've cross-compiled to ARMs and the like, but there was always good documentation and Vapier helped at times. But the UEFI -- my Graciousness, what a whole new level of complexity it presents and I wonder if the Gentoo Handbook will be able to help people through it. There are just so many variables and concepts that it is enough to intimidate most people, I suppose.

Thank you for your on-going assistance. I've been verbose here because people need to see what it is I've gone through and hopefully it will provide them some help when they are faced with a similar issue. I'll report further as I progress.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 344
Location: Salem, OR

PostPosted: Sat Nov 12, 2016 1:04 pm    Post subject: Reply with quote

I have a suitable working system now.

I had to get-around a problem with my system mounting as read-only. To accomplish this I used:
Code:
 mount -n -o remount -t ext4 /dev/sda4 /

then modified my /etc/fstab to:
Code:
jlpoole@zeta ~ $ date;cat /etc/fstab
Sat Nov 12 12:50:29 UTC 2016
#LABEL=cloudimg-rootfs / ext4 defaults 0 0


/dev/sda2   /boot        vfat    defaults             0 2
/dev/sda3   none         swap    sw                   0 0
/dev/sda4   /            ext4    noatime,rw           0 1

/dev/cdrom  /mnt/cdrom   auto    noauto,user          0 0
jlpoole@zeta ~ $


Also, I set in my /etc/default/grub :
Code:
GRUB_DISTRIBUTOR="Gentoo"

# Default menu entry
#GRUB_DEFAULT=0
#
#11/11/2016 jlpoole:
#
GRUB_DEFAULT=saved

which, I am guessing, had caused me to dump into the UEFI shell. Once I got my /etc/fstab in working order, the boot sequence proceeds normally.

Thank you Donahue & Buffoon for your time and help. This has been the worst experience I have had in computing: the complexity of the UEFI is a real bear-trap and does not bode well for enthusiasts. I do wonder if I would have been able to work through this in any other distribution. Of course, other distributions probably take into account the problems presented by this extra layer of complexity and keep it hidden under the seams from the user or side-step it. For example my Debian install of the current high watermark, "Jessie", had no problem, it was that once I had a working system, I learned that it was too "new" that it did not include LVM and working outside of their package system seemed a daunting task. The "Gentoo Way" certainly woke me up as to how advancements have been made in architecture that could create even more formidable barriers to entry.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3095
Location: Illinois, USA

PostPosted: Sat Nov 12, 2016 3:02 pm    Post subject: Reply with quote

Thank YOU, jlpoole! For an eye-opening experience. Asus is noted for having many configurable features and it is usually considered a plus. My Gigabyte board, GA-F2A88X-D3HP autodetects the boot media (How? Magic?) and boots UEFI or BIOS accordingly. I've read that sometimes this doesn't work, but worked fine for me. My main problem was scouring the net for instructions on how to install grub legacy.

I've bookmarked this thread for the next time I install a new mobo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum