Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] bootloader steps in Handbook; Genkernel+efibootmgr
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Thu Jul 06, 2017 5:21 am    Post subject: [SOLVED] bootloader steps in Handbook; Genkernel+efibootmgr Reply with quote

Hi legends,

so, I've got other threads at the moment which have largely come to their natural conclusions (thanks to all!) and my feeble brain is not coping with the basics still now that I have to commit to a kernel, try to get the boot sorted and see if it will start...

Here is my current situation.

This is a Dell XPS15 9560 and because the hardware is quite new and my experience compiling kernels goes back to about 2010 I am very unfamiliar with the kinds of config options I'll need and quite simply forgotten lots of stuff that I learned when last working with Gentoo.
Code:
livecd /usr/src/linux # uname -a
Linux livecd 4.5.2-aufs-r1 #1 SMP Sun Jul 3 17:17:11 UTC 2016 x86_64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz GenuineIntel GNU/Linux

Networking is weird because the wifi is something I'll have to sus out separately so I'm using a USB-C ethernet adapter (with vga/hdmi and USB3 on it) - BUT if this adapter is not plugged on Gentoo Live CD startup it is not discovered and if it is pulled after startup it is not seen again. This is apparently something that is fixed in the 2.6 version of the kernel just higher than the live cd:
http://wiki.yobi.be/wiki/Laptop_Dell_XPS_15#DA200

Plus because I am at the chroot stage still, every time I have a failed boot setup I will have to re-chroot via the live cd etc - so I'm trying to be thorough here :)

My fstab looks like this:

Code:
UUID=D833-C435                  /boot      vfat      noauto      0 4
UUID=a11e1caf-d4c3-46a8-9813-ec477b532def      none      swap      sw      0 0
UUID=e2269c52-4a8a-4e0a-875b-2cba25880fbb      /      ext4      noatime,discard   0 1
UUID=fa50e7eb-eed9-4bcf-8ea3-4a66e97c0d3c      /home      ext4      noatime,discard 0 2
UUID=8539ce4c-8106-43ef-a02b-7ab7d151963e      /mnt/mint   ext4      noatime,discard 0 3


/boot is mounting the pre-existing ESP partition - the first on the disk that is shadowed correctly by a protective MBR as confirmed by:
Code:
livecd /usr/src/linux # gdisk -l /dev/nvme0n1
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.
Disk /dev/nvme0n1: 2000409264 sectors, 953.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 756C7429-43D7-4B35-9280-E176570E9F37
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2000409230
Partitions will be aligned on 2048-sector boundaries
Total free space is 207469 sectors (101.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1      1484722176      1485772799   513.0 MiB   EF00 
   2          206848          239615   16.0 MiB    0C01  Microsoft reserved ...
   3          239616      1189881855   567.3 GiB   0700  Basic data partition
   4      1485772800      1544366079   27.9 GiB    8200 
   5      1544366080      2000408575   217.5 GiB   8300 
   6      1189881856      1315710975   60.0 GiB    8300 
   7      1315710976      1484722175   80.6 GiB    8300


and that ESP is currently successfully servicing Linux Mint and MS Windows 10 installations.

So I mount the n1p1 as /boot and I find that it does conform to the standards of an EFI - incorporating an "EFI" folder (in caps) and under that the "vendor" names that are currently working:

Code:
livecd /boot # ls
EFI                                        initramfs-genkernel-x86_64-4.9.34-gentoo
System.map-genkernel-x86_64-4.9.34-gentoo  kernel-genkernel-x86_64-4.9.34-gentoo
Temp


The genkernel has installed to here after I used genkernel all (and also:

Code:
livecd /boot # genkernel --lvm --disklabel --install initramfs
)

Though by now I'm starting to poke around blind.

This is also the case with the steps I've tried to follow around efibootmgr:

Code:
livecd /boot # efibootmgr -c -d /dev/nvme0n1p1 -p 7 -L "Gentoo" -l "\EFI\Boot\bootx64.efi"


which does sort of work as though it might have worked - it shows the other entries and the new Gentoo one but nothing else has happened - ie there is no creation of the Gentoo directory and I noted in the instructions it uses lowercase for the ESP path (maybe irrelevant because its vfat right?) but I don't even know where and how I'm going to get the correct bootx64.efi and why it shouldn't go in \EFI\Gentoo rather than Boot - which I read is the fallback that can be deleted if the vendor specific ones are working ok. (or is that \EFI\ not \EFI\Boot)

Code:

BootCurrent: 0009
Timeout: 2 seconds
BootOrder: 0007,0000,0008,0001,0004,0003,0005,0006,0002,0009
Boot0000* Windows Boot Manager
Boot0001* Linux Mint
Boot0002  Diskette Drive
Boot0003* M.2 PCIe SSD
Boot0004* USB Storage Device
Boot0005  CD/DVD/CD-RW Drive
Boot0006  Onboard NIC
Boot0007* Gentoo
Boot0008  ubuntu
Boot0009* UEFI: Lexar USB Flash Drive 8.07, Partition 1


So it looks like I can make a Gentoo directory that is pointd to by Boot0007...

But how exactly to do that?

Since I'm too simple to try to make a hand-rolled kernel work with all this I've settled on trying to get a bootable environment that I can progress in with the genkernel.

But when I read stuff about installing in the EFI tree on https://wiki.gentoo.org/wiki/EFI_stub_kernel and https://wiki.gentoo.org/wiki/EFI_System_Partition and https://wiki.gentoo.org/wiki/Efibootmgr I end up with a more basic problem...

I don't even know how to ensure I'm building a working kernel:

1) I don't end up with a vmlinuz - I only have the files you see in /boot and vmlinux in the src directory:

Code:
livecd /boot # ls /usr/src/linux
COPYING        Makefile        block     fs       mm               security  vmlinux-gdb.py
CREDITS        Module.symvers  certs     include  modules.builtin  sound     vmlinux.o
Documentation  README          crypto    init     modules.order    tools
Kbuild         REPORTING-BUGS  distro    ipc      net              usr
Kconfig        System.map      drivers   kernel   samples          virt
MAINTAINERS    arch            firmware  lib      scripts          vmlinux


Code:
livecd /boot # ls
EFI                                        initramfs-genkernel-x86_64-4.9.34-gentoo
System.map-genkernel-x86_64-4.9.34-gentoo  kernel-genkernel-x86_64-4.9.34-gentoo
Temp


I have vague memories of understanding the bzipped kernel image etc and where and when it is made/installed but I really need stepping through this guys please...

2) How do I know that the genkernel will provide the ethernet adapter on boot that the live cd does (is it likely to be basically a live cd similar kernel?)

3) What about the initramfs and modules etc?

4) Since the / is on an ext4 do I need to genkernel menuconfig and make changes of various kinds?

Thanks in advance guys,
Will

update

I've done a new genkernel ensuring that the recommendations from https://wiki.gentoo.org/wiki/EFI_stub_kernel are in there - including the built in kernel parameter line root=PARTUUID=92deca30-d916-45ca-bb36-c759fd0a6649
_________________
]8P


Last edited by stardotstar on Mon Jul 10, 2017 12:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Thu Jul 06, 2017 1:24 pm    Post subject: Re: Stuck: bootloader steps in Handbook; Genkernel + efiboot Reply with quote

stardotstar wrote:
Hi legends,

so, I've got other threads at the moment which have largely come to their natural conclusions (thanks to all!) and my feeble brain is not coping with the basics still now that I have to commit to a kernel, try to get the boot sorted and see if it will start...

Here is my current situation.

This is a Dell XPS15 9560 and because the hardware is quite new and my experience compiling kernels goes back to about 2010 I am very unfamiliar with the kinds of config options I'll need and quite simply forgotten lots of stuff that I learned when last working with Gentoo.
Code:
livecd /usr/src/linux # uname -a
Linux livecd 4.5.2-aufs-r1 #1 SMP Sun Jul 3 17:17:11 UTC 2016 x86_64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz GenuineIntel GNU/Linux

Networking is weird because the wifi is something I'll have to sus out separately so I'm using a USB-C ethernet adapter (with vga/hdmi and USB3 on it) - BUT if this adapter is not plugged on Gentoo Live CD startup it is not discovered and if it is pulled after startup it is not seen again. This is apparently something that is fixed in the 2.6 version of the kernel just higher than the live cd:
As a recommendation, use http://sysresccd.org/ instead of Gentoo Live CD.
stardotstar wrote:

http://wiki.yobi.be/wiki/Laptop_Dell_XPS_15#DA200

Plus because I am at the chroot stage still, every time I have a failed boot setup I will have to re-chroot via the live cd etc - so I'm trying to be thorough here :)
What about chrooting from your mint environment?

stardotstar wrote:
My fstab looks like this:

Code:
UUID=D833-C435                  /boot      vfat      noauto      0 4
UUID=a11e1caf-d4c3-46a8-9813-ec477b532def      none      swap      sw      0 0
UUID=e2269c52-4a8a-4e0a-875b-2cba25880fbb      /      ext4      noatime,discard   0 1
UUID=fa50e7eb-eed9-4bcf-8ea3-4a66e97c0d3c      /home      ext4      noatime,discard 0 2
UUID=8539ce4c-8106-43ef-a02b-7ab7d151963e      /mnt/mint   ext4      noatime,discard 0 3
For cleanup see https://forums.gentoo.org/viewtopic-t-1008740-start-2.html
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Thu Jul 06, 2017 1:32 pm    Post subject: Re: Stuck: bootloader steps in Handbook; Genkernel + efiboot Reply with quote

stardotstar wrote:

The genkernel has installed to here after I used genkernel all (and also:

Code:
livecd /boot # genkernel --lvm --disklabel --install initramfs
)
Why at all are you putting --lvm and initramfs? In your fstab I cannot see any lv.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Thu Jul 06, 2017 1:41 pm    Post subject: Re: Stuck: bootloader steps in Handbook; Genkernel + efiboot Reply with quote

stardotstar wrote:
...which does sort of work as though it might have worked - it shows the other entries and the new Gentoo one but nothing else has happened - ie there is no creation of the Gentoo directory and I noted in the instructions it uses lowercase for the ESP path (maybe irrelevant because its vfat right?) but I don't even know where and how I'm going to get the correct bootx64.efi and why it shouldn't go in \EFI\Gentoo rather than Boot - which I read is the fallback that can be deleted if the vendor specific ones are working ok. (or is that \EFI\ not \EFI\Boot)

Code:

BootCurrent: 0009
Timeout: 2 seconds
BootOrder: 0007,0000,0008,0001,0004,0003,0005,0006,0002,0009
Boot0000* Windows Boot Manager
Boot0001* Linux Mint
Boot0002  Diskette Drive
Boot0003* M.2 PCIe SSD
Boot0004* USB Storage Device
Boot0005  CD/DVD/CD-RW Drive
Boot0006  Onboard NIC
Boot0007* Gentoo
Boot0008  ubuntu
Boot0009* UEFI: Lexar USB Flash Drive 8.07, Partition 1


So it looks like I can make a Gentoo directory that is pointd to by Boot0007...

All those entries shown by efibootmgr are only for direct booting from EFI (F8, F12, without grub or refind). If an entry does not, it can/should be removed.

For the kernel, you should start with
Code:
cd /usr/src/linux-4.9.34-gentoo/
make menuconfig
and use / to search for what you need.

Your hardware components should be listed somewhere like http://www.dell.com/support/home/en/us/debsdt1/product-support/servicetag/CYRTRY1/configuration.

And links like https://www.startpage.com/do/search?query=%2280861e3a%22+site%3Acateee.net whre you replace "80861e3a" with identifiers from your lspci -nn output should also help.

Regarding the bootloader, as you are having mint on the same ssd, why not start with using mint's bootloader and adding Gentoo's kernel to it?

Please also notice that sysresccd has an option for booting an installed (your newly installed Gentoo) Linux system. You just need to point it to the right root partition.
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Fri Jul 07, 2017 1:48 am    Post subject: Reply with quote

Charles, these are outstanding, logical and helpful suggestions, all.

I'll dig through them and report back.

Leveraging mint and rescuecd as you suggest are brilliant elegant solutions.

There is much in my approach that show my ignorance of much of the tacit wisdom and assumed knowledge to self-support with Gentoo so I appreciate the patience and generosity implicit in your replies.
_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Fri Jul 07, 2017 4:40 am    Post subject: Reply with quote

Very nice formatting, thanks to Charles and khayyam

Code:
livecd etc # awk '!/(^#|^$)/ && gsub(/[ |\t]+/," ")1' /mnt/gentoo/etc/fstab | column -t

UUID=D833-C435                             /boot      vfat  noauto           0  4
UUID=a11e1caf-d4c3-46a8-9813-ec477b532def  none       swap  sw               0  0
UUID=e2269c52-4a8a-4e0a-875b-2cba25880fbb  /          ext4  noatime,discard  0  1
UUID=fa50e7eb-eed9-4bcf-8ea3-4a66e97c0d3c  /home      ext4  noatime,discard  0  2
UUID=8539ce4c-8106-43ef-a02b-7ab7d151963e  /mnt/mint  ext4  noatime,discard  0  3

_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Fri Jul 07, 2017 4:46 am    Post subject: Reply with quote

I have used my Mint system as the chroot base and cleaned up the EFI boot table:

Code:
(chroot) will-XPS-15-9560 / # efibootmgr -b 3 -B

BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001,0004
Boot0000* Windows Boot Manager
Boot0001* Linux Mint
Boot0004* USB Storage Device

(chroot) will-XPS-15-9560 / # efibootmgr -v

BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001,0004
Boot0000* Windows Boot Manager   HD(1,GPT,92deca30-d916-45ca-bb36-c759fd0a6649,0x587f1000,0x100800)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................

Boot0001* Linux Mint   PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,AC-E4-2E-71-80-00-21-E4)/HD(1,GPT,92deca30-d916-45ca-bb36-c759fd0a6649,0x587f1000,0x100800)/File(\EFI\ubuntu\grubx64.efi)

Boot0004* USB Storage Device   BBS(USB,USB Storage Device,0x0)..BO

(chroot) will-XPS-15-9560 / #


and so I see in this the syntax for creating a valid Gentoo one - including the cases and structure I suspected in /File(\EFI\ubuntu\grubx64.efi)

also the way that it wants to have the correct media device described - though this is something that I suspect efibootmgr will do when passed the correct pointers.

Now, in following Charles' logic I could work out how to create a grub kernel entry in Mint to choose the Gentoo environment and kernel after selecting the Mint option in the EFI boot menu.

To do this I will need to make Mint show the Grub menu other than to hold shift after selecting...
_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Fri Jul 07, 2017 5:25 am    Post subject: Reply with quote

Diving into the Grub setup for MInt which is the default that EFI launches now I see that grub-setup on the Mint install has detected entries for both Windows and the Gentoo kernels (they don;'t work but it has at least seen a Gentoo kernel somehow)

The grub.conf in the /boot/EFI tree is like this:

Code:
will-XPS-15-9560 mnt # cd /mnt/gentoo/boot
will-XPS-15-9560 boot # ls
EFI                                       kernel-genkernel-x86_64-4.9.34-gentoo      Temp
initramfs-genkernel-x86_64-4.9.34-gentoo  System.map-genkernel-x86_64-4.9.34-gentoo

will-XPS-15-9560 boot # cd EFI

will-XPS-15-9560 EFI # ls

Dell  Gentoo  Microsoft  tools  ubuntu

will-XPS-15-9560 EFI # cd ubuntu

will-XPS-15-9560 ubuntu # ls

fw  fwupx64.efi  grub.cfg  grubx64.efi  mmx64.efi  shimx64.efi

will-XPS-15-9560 ubuntu # cat grub.cfg

search.fs_uuid 8539ce4c-8106-43ef-a02b-7ab7d151963e root
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg



So it is looking for root instances on the Mint partition (8539ce4c-8106-43ef-a02b-7ab7d151963e) and then creating a sort of redirection using the config file constructed from instances of 'root' on partition 5 followed by /boot/grub/grub.cfg

So in theory I should be able to put 2 and 2 together and somehow have a root hint for a Gentoo kernel on n1p5 that points through to a grub.cfg that provisions a Gentoo Kernel and loading of the n1p6 root filesystem.

I just have to get my head around how all that makes sense :)
W
_________________
]8P
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Fri Jul 07, 2017 6:28 am    Post subject: Reply with quote

stardotstar wrote:
Code:
will-XPS-15-9560 mnt # cd /mnt/gentoo/boot
will-XPS-15-9560 boot # ls
EFI                                       kernel-genkernel-x86_64-4.9.34-gentoo      Temp
initramfs-genkernel-x86_64-4.9.34-gentoo  System.map-genkernel-x86_64-4.9.34-gentoo

will-XPS-15-9560 boot # cd EFI

will-XPS-15-9560 EFI # ls

Dell  Gentoo  Microsoft  tools  ubuntu

will-XPS-15-9560 EFI # cd ubuntu

will-XPS-15-9560 ubuntu # ls

fw  fwupx64.efi  grub.cfg  grubx64.efi  mmx64.efi  shimx64.efi

will-XPS-15-9560 ubuntu # cat grub.cfg

search.fs_uuid 8539ce4c-8106-43ef-a02b-7ab7d151963e root
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg



So it is looking for root instances on the Mint partition (8539ce4c-8106-43ef-a02b-7ab7d151963e) and then creating a sort of redirection using the config file constructed from instances of 'root' on partition 5 followed by /boot/grub/grub.cfg

That's confusing. I cannot see /boot/grub/ in your listing above. And nothing about mint. Instead, there is ubuntu. Have you been mixing ubuntu with mint?

For an explanation of grub, the /boot partition and directory structure, see https://wiki.gentoo.org/wiki/Handbook_Talk:AMD64/Full/Installation#improve_suggested_partitions_and_use_of_grub-install.
And could you please show output in list form ls -al or as tree tree -L 3 /boot? Then it would be easier to read.
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 6:13 am    Post subject: Reply with quote

Hi Charles, thanks for following along with me!

The Mint install apparently is constrained to install as ubuntu - something I discovered poking around in the EFI tree; witness:

Code:

will-XPS-15-9560 grub.d # cat 50_linuxmint.cfg
#! /bin/sh
set -e

# Set distributor to "Ubuntu"
#
# In Mint 16:
# shim and grub come with hardcoded ubuntu strings upstream, without this EFI installation is broken
# https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1242417
#
# In Mint 17:
# Despite the bug report being marked as fixed, the situation is the same. Grub was patched by Ubuntu
# to assign the "ubuntu" distributor ID when it was given "Kubuntu". That results in Kubuntu finally
# getting EFI to work out of the box but still using "ubuntu" as far as grub-install is concerned.
# So we'll stick to "Ubuntu" for this iteration.
#
# The remaining issues are almost the same:
#
#  - Branding issue in Linux Mint (our EFI name is "Ubuntu" because anything else won't work)
#  - Conflict between Linux Mint and Ubuntu (in multi-boot situations
#      they use the same EFI name so EFI implementations can't list them both).
#      That should also be a problem with derivatives, and also a problem with
#      multiple installations of the same operating system (for instance in the case of Mint editions).
#

GRUB_DISTRIBUTOR="Ubuntu"


Now, this is all new stuff to me but I can say for sure that I have Mint working admirably well at the moment and I never installed Ubuntu (pure?) but I did play with some Debian and Kali instances before I settled on what I have here. Neither of those appear to have left any trace :)

So with that explained I now need to work out how the OS parser (or whatever it's called) has detected and configured grub for my Gentoo system - clearly it can probe the partitions and has found the root tree identifiable as Gentoo but now I need to build my kernel and put the necessary files in the right place for it to be bootable.

Currently the Genkernel has built and installed to the /boot partition (mounted in Mint at /mnt/gentoo/boot

Code:
will-XPS-15-9560 grub.d # cd /mnt/gentoo/boot
will-XPS-15-9560 boot # ls
EFI  initramfs-genkernel-x86_64-4.9.34-gentoo  kernel-genkernel-x86_64-4.9.34-gentoo  System.map-genkernel-x86_64-4.9.34-gentoo  Temp
will-XPS-15-9560 boot # cd EFI
will-XPS-15-9560 EFI # ls
Dell  Gentoo  Microsoft  tools  ubuntu
will-XPS-15-9560 EFI # cd Gentoo/
will-XPS-15-9560 Gentoo # ls


and there is nothing in the Gentoo EFI directory, which there need not be if I'm going to leverage the Mint Grub.

In fact, I'm figuring that I don't even need to mount the EFI system partition (n1p1) to Gentoo's boot as Gentoo's boot needs only the Kernel to boot with when the Mint Grub config points to it?

Here is the listing you requested:

Code:

will-XPS-15-9560 boot # tree -L 3 ./
./
├── EFI
│   ├── Dell
│   │   ├── Bios
│   │   └── logs
│   ├── Gentoo
│   ├── Microsoft
│   │   ├── Boot
│   │   └── Recovery
│   ├── tools
│   └── ubuntu
│       ├── fw
│       ├── fwupx64.efi
│       ├── grub.cfg
│       ├── grubx64.efi
│       ├── mmx64.efi
│       └── shimx64.efi
├── initramfs-genkernel-x86_64-4.9.34-gentoo
├── kernel-genkernel-x86_64-4.9.34-gentoo
├── System.map-genkernel-x86_64-4.9.34-gentoo
└── Temp
    ├── bcdinfo.txt
    ├── bootfailure.txt
    ├── disklayout.txt
    ├── SrtTrail.log
    └── SrtTrail.txt

12 directories, 13 files




I'll play more now but would appreciate any insights if you have any as I go :)
WIll
_________________
]8P
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon Jul 10, 2017 7:33 am    Post subject: Reply with quote

stardotstar wrote:
Currently the Genkernel has built and installed to the /boot partition (mounted in Mint at /mnt/gentoo/boot

Code:
will-XPS-15-9560 grub.d # cd /mnt/gentoo/boot
will-XPS-15-9560 boot # ls
EFI  initramfs-genkernel-x86_64-4.9.34-gentoo  kernel-genkernel-x86_64-4.9.34-gentoo  System.map-genkernel-x86_64-4.9.34-gentoo  Temp
will-XPS-15-9560 boot # cd EFI
will-XPS-15-9560 EFI # ls
Dell  Gentoo  Microsoft  tools  ubuntu
will-XPS-15-9560 EFI # cd Gentoo/
will-XPS-15-9560 Gentoo # ls


and there is nothing in the Gentoo EFI directory, which there need not be if I'm going to leverage the Mint Grub.

Files could be moved and/or copied, see https://wiki.gentoo.org/wiki/EFI_stub_kernel#Installation. But I am not sure about whre grub2 expects them.


stardotstar wrote:
In fact, I'm figuring that I don't even need to mount the EFI system partition (n1p1) to Gentoo's boot as Gentoo's boot needs only the Kernel to boot with when the Mint Grub config points to it?

That's true. Per each computer it needs only one instance of grub. And the /boot partition and/or EFI system partition needs not be mounted for booting. You would only mount it if you need to do manipulations to its content. Even its fstab entry .. (didn't I mention before?) ...
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 8:36 am    Post subject: Reply with quote

Yes, I recall you did mention not needing the mount.

So I have compiled a kernel with an emphasis on base bootability, building most evrything I figure I need as a minimum rather than juggling modules.

My first task will be to see if I can get the grub config that works to init this kernel.

So I have now in the ESP partition (n1p1) mounted as /boot on the chrooted Gentoo environment in Mint:
Code:
(chroot) will-XPS-15-9560 /boot # ls -la
total 55352
drwx------  4 root root     4096 Jul 10 18:22 .
drwxr-xr-x 21 root root     4096 Jun 22 14:52 ..
drwx------  7 root root     4096 Jul  6 14:20 EFI
-rwx------  1 root root  4890052 Jul 10 18:22 System.map-4.9.34-gentoo
-rwx------  1 root root  3165831 Jul  6 16:06 System.map-genkernel-x86_64-4.9.34-gentoo
drwx------  2 root root     4096 May 30 19:13 Temp
-rwx------  1 root root   134133 Jul 10 18:22 config-4.9.34-gentoo
-rwx------  1 root root 34152956 Jul  6 16:16 initramfs-genkernel-x86_64-4.9.34-gentoo
-rwx------  1 root root  5325392 Jul  6 16:06 kernel-genkernel-x86_64-4.9.34-gentoo
-rwx------  1 root root  8983120 Jul 10 18:22 vmlinuz-4.9.34-gentoo


Am I right in thinking that the vmlinuz image is what would need to be copied to the Gentoo directory for native EFI boot accessability? But that it would need to be named as an EFI Stub kernel?
Forgive me if I'm still not "getting" some of the distinctions here.

...nothing currently in Gentoo
(chroot) will-XPS-15-9560 /boot # cd EFI
(chroot) will-XPS-15-9560 /boot/EFI # ls
Dell Gentoo Microsoft tools ubuntu
(chroot) will-XPS-15-9560 /boot/EFI # cd Gentoo/
(chroot) will-XPS-15-9560 /boot/EFI/Gentoo # ls
[/code]

and ubuntu have the (increasingly familiar to me) .efi kernel images???
Code:

(chroot) will-XPS-15-9560 /boot/EFI/Gentoo # cd ..
(chroot) will-XPS-15-9560 /boot/EFI # cd ubuntu/
(chroot) will-XPS-15-9560 /boot/EFI/ubuntu # ls -l
total 3456
drwx------ 2 root root    4096 May 25 18:34 fw
-rwx------ 1 root root   62436 May 25 18:34 fwupx64.efi
-rwx------ 1 root root     117 Jun 18 12:33 grub.cfg
-rwx------ 1 root root 1121144 Jun 18 12:33 grubx64.efi
-rwx------ 1 root root 1168464 Jun 18 12:33 mmx64.efi
-rwx------ 1 root root 1169992 Jun 18 12:33 shimx64.efi


I am going to copy vmlinuz to /boot/EFI/Gentoo/grubx64.efi and cross my fingers :D
_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 8:52 am    Post subject: Reply with quote

OK, I'm getting somewhere.

I was able to go into UEFI setup add a boot option, point to the grub64.efi I had put in the Gentoo directory and then it started the kernel.

It fell over a screen of console text later but I am definitely starting to understand how these pieces fit together and what they require (among other things a working init= LOL)

I also figure that if I don't mount that system part but put vmlinuz in the /boot folder on the root system that Mint sees then the grub auto detect will in all probability launch that one too. That's the next test I'm going to do as well as look at how to fix my broken kernel for both the native EFI and the Grub contexts.
_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 9:06 am    Post subject: Reply with quote

OK, the kernel pointed to from Grub boots to login, but I'm missing networking so I'll go back to the handbook and also relook at my kernel config.

The EFI setup is actually dead simple as far as pointing to a kernel goes, the Dell lets you simply choose the vmlinuz from anywhere on the ESP partition and name it. My problem here is that although I specified the root= in the built in kernel parameter I have failed to pass init= so it panics.

Good progress.
W
_________________
]8P
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon Jul 10, 2017 9:32 am    Post subject: Reply with quote

stardotstar wrote:
I am going to copy vmlinuz to /boot/EFI/Gentoo/grubx64.efi and cross my fingers :D

Renaming a gentoo-generated kernel "grub..." looks very strange to me.
"grubx64.efi" should be for an EFI application (to bring up the boot entries in grub's boot menu) generated by grub.

And if you are comfortable with using the Dell F8, F12 entries for booting directly, you don't need grub ...
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon Jul 10, 2017 9:41 am    Post subject: Reply with quote

stardotstar wrote:
My problem here is that although I specified the root= in the built in kernel parameter I have failed to pass init= so it panics

So what do you have in Gentoo's kernel's CONFIG_CMDLINE?
And why at all init?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon Jul 10, 2017 9:53 am    Post subject: Reply with quote

stardotstar wrote:
OK, the kernel pointed to from Grub boots to login, but I'm missing networking so I'll go back to the handbook and also relook at my kernel config.

What's your output of lspci -nnkv | sed -n -e '/Network/,/^$/p' ?
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 10:06 am    Post subject: Reply with quote

No doubt good questions!

let's see - attached image shows the panic.

I'm finding the command line now :)

[img]https://sourcepoint.com.au/outlinks/Kernel_Panic.JPG[/img]


W
_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 10:08 am    Post subject: Reply with quote

Here is the output of my networking:

Code:
will-XPS-15-9560 linux # lspci -nnkv | sed -n -e '/Network/,/^$/p'
02:00.0 Network controller [0280]: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter [168c:003e] (rev 32)
   Subsystem: Bigfoot Networks, Inc. QCA6174 802.11ac Wireless Network Adapter [1a56:1535]
   Flags: bus master, fast devsel, latency 0, IRQ 141
   Memory at ed200000 (64-bit, non-prefetchable) [size=2M]
   Capabilities: [40] Power Management version 3
   Capabilities: [50] MSI: Enable+ Count=8/8 Maskable+ 64bit-
   Capabilities: [70] Express Endpoint, MSI 00
   Capabilities: [100] Advanced Error Reporting
   Capabilities: [148] Virtual Channel
   Capabilities: [168] Device Serial Number 00-00-00-00-00-00-00-00
   Capabilities: [178] Latency Tolerance Reporting
   Capabilities: [180] L1 PM Substates
   Kernel driver in use: ath10k_pci
   Kernel modules: ath10k_pci


I don't know if you recall my mentioning of the D200 USB-C Dell hub that has ethernet and VGA/HDMI etc on it - it would only be seen by the system if it was plugged from boot. In Mint it appears - here it is in ifconfig

Code:
will-XPS-15-9560 linux # ifconfig
enxd481d738330c Link encap:Ethernet  HWaddr d4:81:d7:38:33:0c 
          inet addr:192.168.0.24  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::d681:d7ff:fe38:330c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2075 (2.0 KB)  TX bytes:6215 (6.2 KB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:114068 errors:0 dropped:0 overruns:0 frame:0
          TX packets:114068 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:44070041 (44.0 MB)  TX bytes:44070041 (44.0 MB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:10.30.1.14  P-t-P:10.30.1.13  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:37484 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30203 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:36710604 (36.7 MB)  TX bytes:5025728 (5.0 MB)

wlp2s0    Link encap:Ethernet  HWaddr 9c:b6:d0:de:75:a3 
          inet addr:192.168.0.27  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::2b6d:d5d2:c8ef:ef44/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:49588 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28353 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:43190187 (43.1 MB)  TX bytes:9207095 (9.2 MB)



a guess with your sed from above using lsusb yields:

Code:
will-XPS-15-9560 linux # lsusb -v | sed -n -e '/Network/,/^$/p'
      bInterfaceSubClass      6 Ethernet Networking
      bInterfaceProtocol      0
      iInterface              5 CDC Communications Control
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      CDC Ethernet:
        iMacAddress                      3 00249B1DD441
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               8
        bMaxBurst               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              4 Ethernet Data
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x02
      Latency Tolerance Messages (LTM) Supported
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   2
      Lowest fully-functional device speed is High Speed (480Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
Device Status:     0x0010
  (Bus Powered)
  Latency Tolerance Messaging (LTM) Enabled

FIXME: alloc bigger buffer for device capability descriptors

_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 10:14 am    Post subject: Reply with quote

Here is my CMDLINE .config

Code:
will-XPS-15-9560 linux # cat .config | grep CMDLINE
# CONFIG_BLK_CMDLINE_PARSER is not set
# CONFIG_CMDLINE_PARTITION is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="root=PARTUUID=92deca30-d916-45ca-bb36-c759fd0a6649"
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_FB_CMDLINE=y
will-XPS-15-9560 linux #

_________________
]8P
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon Jul 10, 2017 10:21 am    Post subject: Reply with quote

stardotstar wrote:
Code:
CONFIG_CMDLINE="root=PARTUUID=92deca30-d916-45ca-bb36-c759fd0a6649"

And blkid grep 92deca30-d916-45ca-bb36-c759fd0a6649 points to your Gentoo root ( / ) partition??

Edit:
Keep in mind, the CONFIG_CMDLINE (EFI stub kernel) is not needed when booting the grubx64.efi bootmanager.

Your bootmanager is grubx64.efi,
stardotstar wrote:
Code:
Boot0001* Linux Mint   PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,AC-E4-2E-71-80-00-21-E4)/HD(1,GPT,92deca30-d916-45ca-bb36-c759fd0a6649,0x587f1000,0x100800)/File(\EFI\ubuntu\grubx64.efi)

stardotstar wrote:
and ubuntu have the (increasingly familiar to me) .efi kernel images???
Code:

(chroot) will-XPS-15-9560 /boot/EFI/Gentoo # cd ..
(chroot) will-XPS-15-9560 /boot/EFI # cd ubuntu/
(chroot) will-XPS-15-9560 /boot/EFI/ubuntu # ls -l
total 3456
drwx------ 2 root root    4096 May 25 18:34 fw
-rwx------ 1 root root   62436 May 25 18:34 fwupx64.efi
-rwx------ 1 root root     117 Jun 18 12:33 grub.cfg
-rwx------ 1 root root 1121144 Jun 18 12:33 grubx64.efi
-rwx------ 1 root root 1168464 Jun 18 12:33 mmx64.efi
-rwx------ 1 root root 1169992 Jun 18 12:33 shimx64.efi

and so you should register your Gentoo-made kernel in grub to get a Gentoo boot entry in grub, see https://wiki.gentoo.org/wiki/Kernel/Rebuild#Using_GRUB2


Last edited by charles17 on Mon Jul 10, 2017 12:01 pm; edited 2 times in total
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon Jul 10, 2017 10:51 am    Post subject: Reply with quote

stardotstar wrote:
Here is the output of my networking:

Code:
will-XPS-15-9560 linux # lspci -nnkv | sed -n -e '/Network/,/^$/p'
02:00.0 Network controller [0280]: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter [168c:003e] (rev 32)

For [168c:003e] (you remember https://www.startpage.com/do/search?query=%22168c003e%22+site%3Acateee.net?), see https://wiki.gentoo.org/wiki/Dell_XPS_13_9360#Wireless.
Wireless should work ...


Last edited by charles17 on Mon Jul 10, 2017 10:59 am; edited 1 time in total
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 10:59 am    Post subject: Reply with quote

charles17 wrote:
stardotstar wrote:
Code:
CONFIG_CMDLINE="root=PARTUUID=92deca30-d916-45ca-bb36-c759fd0a6649"

And blkid grep 92deca30-d916-45ca-bb36-c759fd0a6649 points to your Gentoo root ( / ) partition??


Well that is certainly what I intended... But now I check it is most certainly not; I chose the ESP....

I was careful to identify the PARTID not just the UUID so I don't know why I mistook it for the ESP not the root fs since I do know what the root fs is vs the boot loader, never the less, I'll change that PARTID and see what happens then:

Code:
will-XPS-15-9560 linux # blkid grep 92deca30-d916-45ca-bb36-c759fd0a6649
will-XPS-15-9560 linux # blkid
/dev/nvme0n1p1: UUID="D833-C435" TYPE="vfat" PARTUUID="92deca30-d916-45ca-bb36-c759fd0a6649"
/dev/nvme0n1p3: UUID="90DEC301DEC2DF1A" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="d6a24b0d-844b-4bac-8718-f2457bb9f39f"
/dev/nvme0n1p4: UUID="a11e1caf-d4c3-46a8-9813-ec477b532def" TYPE="swap" PARTUUID="fc7abe7a-e59b-461c-812b-2bfd6f61f253"
/dev/nvme0n1p5: UUID="8539ce4c-8106-43ef-a02b-7ab7d151963e" TYPE="ext4" PARTUUID="67af9314-defb-45d4-bce1-55ef7b725ce7"
/dev/nvme0n1p6: UUID="e2269c52-4a8a-4e0a-875b-2cba25880fbb" TYPE="ext4" PARTUUID="77d93d41-4384-4c12-b22a-74f0dbb417f5"
/dev/nvme0n1p7: UUID="fa50e7eb-eed9-4bcf-8ea3-4a66e97c0d3c" TYPE="ext4" PARTUUID="7ed06c8a-1a80-43bc-8bf5-8c22913b6740"
/dev/nvme0n1: PTUUID="756c7429-43d7-4b35-9280-e176570e9f37" PTTYPE="gpt"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="5883c880-99c1-4c0f-996e-cc15d9ed500e"


I will recompile after grokking the wifi hints you posted.
_________________
]8P
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 887
Location: 2074/SYD/NSW/AU

PostPosted: Mon Jul 10, 2017 11:32 am    Post subject: Reply with quote

So, I'm looking at the ethernet drivers needed for the USB-C one - I did a diff between lsusb with and without it plugged and found that the ethernet is a Realtek r8152
Code:
< Bus 004 Device 003: ID 0bda:8153 Realtek Semiconductor Corp.

but in the make menuconfig I can't find an ethernet driver support for it
there is

Code:
 [*]   Realtek devices                                                                    │ │ 
  │ │                  < >     RealTek RTL-8139 C+ PCI Fast Ethernet Adapter support                            │ │ 
  │ │                  < >     RealTek RTL-8129/8130/8139 PCI Fast Ethernet Adapter support                     │ │ 
  │ │                  < >     Realtek 8169 gigabit ethernet support   


I'm sorry I seem to be making a real meal of this but do I need to look somewhere else as it's a usb ethernet adapter?

ediit - yes, soorrry I have found it...
_________________
]8P
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon Jul 10, 2017 11:40 am    Post subject: Reply with quote

http://cateee.net/lkddb/web-lkddb/USB_RTL8152.html?
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
Goto page 1, 2  Next
Page 1 of 2

 
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