Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] copying bzImage into /boot
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
yhtycf
n00b
n00b


Joined: 26 Jun 2020
Posts: 8

PostPosted: Fri Jun 26, 2020 1:33 pm    Post subject: [SOLVED] copying bzImage into /boot Reply with quote

hi, i've been trying to install gentoo (GPT/UEFI on an NVMe drive) for the past 4-5 days on a new pc build and this is my first linux distro. after many retries this time i went all the way, and after lots of trouble with firmware binary blobs and umounting /mnt/gentoo, i finished and then when i rebooted without my usb i get "loading linux 5.4.38-gentoo ..." which i guess means that grub is hanging. so i went back and realized simple framebuffer existed and changed it. then i did make && make modules_install which worked. now im trying to get the bzImage which is presumably in /usr/src/linux/arch/x86/boot/bzImage into the /boot folder. make install says "/boot/vmlinuz-5.4.38-gentoo: No such file or directory" so i'm wondering which file that i replace it with? i don't see any named kernel or gentoo or vmlinuz or anything in /boot. is it the config.gz file? i dont wanna mess this part up

thank you for your time


Last edited by yhtycf on Fri Jun 26, 2020 4:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3541

PostPosted: Fri Jun 26, 2020 2:42 pm    Post subject: Reply with quote

It's really simple: https://wiki.gentoo.org/wiki/EFI_stub_kernel#Installation
Then you need to create the BIOS boot item.
Back to top
View user's profile Send private message
yhtycf
n00b
n00b


Joined: 26 Jun 2020
Posts: 8

PostPosted: Fri Jun 26, 2020 2:53 pm    Post subject: Reply with quote

charles17 wrote:
It's really simple: https://wiki.gentoo.org/wiki/EFI_stub_kernel#Installation
Then you need to create the BIOS boot item.

shouldnt there already be a file in /boot named bzImage then? what's the name of the one that its current using to try to boot? also /boot/efi doesnt seem to be a directory that i have either, or at least ls /boot/efi cant find it. my ESP is mounted on /boot like it says altho i followed the gpt/efi amd64 guide which suggested a bios boot partition and an esp (which i kno isnt necessary but i did it anyway) but i dont think that should be a problem?

thanks for the response


Last edited by yhtycf on Fri Jun 26, 2020 2:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ralphred
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2013
Posts: 117

PostPosted: Fri Jun 26, 2020 2:56 pm    Post subject: Re: copying bzImage into /boot Reply with quote

yhtycf wrote:
presumably in /usr/src/linux/arch/x86/boot/bzImage

That would be the 32bit kernel image, you would normally want ./arch/x86_64/boot/bzImage
Make sure the /boot partition is mounted when you run make install && make modules_install
Config.gz is a gzipped copy of the .config file found in /usr/src/linux-[version]/ directory, it's kinda handy sometimes.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3541

PostPosted: Fri Jun 26, 2020 2:58 pm    Post subject: Reply with quote

yhtycf wrote:
.. i followed the gpt/efi amd64 guide which suggested ...

I am not aware of such guide. Sorry, cannot help then.
Back to top
View user's profile Send private message
yhtycf
n00b
n00b


Joined: 26 Jun 2020
Posts: 8

PostPosted: Fri Jun 26, 2020 3:03 pm    Post subject: Re: copying bzImage into /boot Reply with quote

Ralphred wrote:
yhtycf wrote:
presumably in /usr/src/linux/arch/x86/boot/bzImage

That would be the 32bit kernel image, you would normally want ./arch/x86_64/boot/bzImage
Make sure the /boot partition is mounted when you run make install && make modules_install
Config.gz is a gzipped copy of the .config file found in /usr/src/linux-[version]/ directory, it's kinda handy sometimes.

yap i was worried about that but apparently the x86_64 folder just points to the x86 one (i forgot what thats called)? when i type ls -l /usr/src/linux/arch/x86_64/boot/bzImage it shows me that same directory in lightblue pointing to ../.../x86/boot/bzImage which i think is what that means. also my /boot partition is mounted (at /mnt/gentoo/boot). and ah i see, config.gz isnt wat i was looking for then

thanks for the reposne
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3541

PostPosted: Fri Jun 26, 2020 3:03 pm    Post subject: Re: copying bzImage into /boot Reply with quote

Ralphred wrote:
That would be the 32bit kernel image, you would normally want ./arch/x86_64/boot/bzImage

Code:
$ ls -l  arch/x86_64/boot/
total 0
lrwxrwxrwx 1 root root 22 Jun 23 10:43 bzImage -> ../../x86/boot/bzImage
Back to top
View user's profile Send private message
Ralphred
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2013
Posts: 117

PostPosted: Fri Jun 26, 2020 3:06 pm    Post subject: Reply with quote

yhtycf wrote:
shouldnt there already be a file in /boot named bzImage then?

No, the bzImage will be renamed to vmlinuz-[version]-gentoo by the make install command, so you can have multiple kernels (as backups mainly) in /boot without a naming conflict.
Back to top
View user's profile Send private message
yhtycf
n00b
n00b


Joined: 26 Jun 2020
Posts: 8

PostPosted: Fri Jun 26, 2020 3:09 pm    Post subject: Reply with quote

charles17 wrote:
yhtycf wrote:
.. i followed the gpt/efi amd64 guide which suggested ...

I am not aware of such guide. Sorry, cannot help then.

sorry i just meant this (https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Default:_Using_parted_to_partition_the_disk), where im using the example partition layout in the parted suggestion. all the code for that section is designed for that layout so i just went along and used it anyway. and here (https://wiki.gentoo.org/wiki/Gentoo_UEFI#Common_layout_in_Gentoo) it uses the same layout, where under it it just says that i can just mount the ESP as /boot so i decided just to do that even though i know i dont need the bios boot partition.

thanks for the response
Back to top
View user's profile Send private message
yhtycf
n00b
n00b


Joined: 26 Jun 2020
Posts: 8

PostPosted: Fri Jun 26, 2020 3:11 pm    Post subject: Reply with quote

Ralphred wrote:
yhtycf wrote:
shouldnt there already be a file in /boot named bzImage then?

No, the bzImage will be renamed to vmlinuz-[version]-gentoo by the make install command, so you can have multiple kernels (as backups mainly) in /boot without a naming conflict.

ah sweet, is there any reason i can't find a vmlinuz file in my /boot then? even though i already previously used "make install" for the kernel before i found it wouldnt work because grub hangs?

thanks for the response
Back to top
View user's profile Send private message
Ralphred
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2013
Posts: 117

PostPosted: Fri Jun 26, 2020 3:15 pm    Post subject: Reply with quote

So, lets get this straight before we go on, are you trying to directly boot the kernel as an EFI stub, or use grub and boot the kernel from there?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3541

PostPosted: Fri Jun 26, 2020 3:20 pm    Post subject: Reply with quote

yhtycf wrote:
[sorry i just meant this (https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Default:_Using_parted_to_partition_the_disk), where im using the example partition layout in the parted suggestion. all the code for that section is designed for that layout so i just went along and used it anyway. and here (https://wiki.gentoo.org/wiki/Gentoo_UEFI#Common_layout_in_Gentoo) it uses the same layout, where under it it just says that i can just mount the ESP as /boot so i decided just to do that even though i know i dont need the bios boot partition.

That second article got marked for deletion for good reason. I have to admit I didn't read your OP very carefully. Usage of grub stuff is out of my scope.
Sorry.
Back to top
View user's profile Send private message
yhtycf
n00b
n00b


Joined: 26 Jun 2020
Posts: 8

PostPosted: Fri Jun 26, 2020 3:20 pm    Post subject: Reply with quote

Ralphred wrote:
So, lets get this straight before we go on, are you trying to directly boot the kernel as an EFI stub, or use grub and boot the kernel from there?

i dont know what a EFI stub is, im just following the amd64 handbook using grub:2 so i believe thats what im doing

charles17 wrote:
yhtycf wrote:
[sorry i just meant this (https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Default:_Using_parted_to_partition_the_disk), where im using the example partition layout in the parted suggestion. all the code for that section is designed for that layout so i just went along and used it anyway. and here (https://wiki.gentoo.org/wiki/Gentoo_UEFI#Common_layout_in_Gentoo) it uses the same layout, where under it it just says that i can just mount the ESP as /boot so i decided just to do that even though i know i dont need the bios boot partition.

That second article got marked for deletion for good reason. I have to admit I didn't read your OP very carefully. Usage of grub stuff is out of my scope.
Sorry.

i thought it was just marked for redundant info as opposed to faulty info but the sentiment where it says "In other words, after creating and formatting the ESP (...), simply mount it at /boot.[2]" seemed to have helped me get over an error i got on my first install so i stuck with it. oops, hopefully i can recover this cos i spent a million hours on this kernel

thanks for the response
Back to top
View user's profile Send private message
Ralphred
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2013
Posts: 117

PostPosted: Fri Jun 26, 2020 3:29 pm    Post subject: Reply with quote

Cool.
So you ran
Code:
grub-install --target=x86_64-efi --efi-directory=/boot
from your chroot environment?

And fear not mate, you're pretty close, you've just stumbled at a late hurdle.
Back to top
View user's profile Send private message
yhtycf
n00b
n00b


Joined: 26 Jun 2020
Posts: 8

PostPosted: Fri Jun 26, 2020 3:42 pm    Post subject: Reply with quote

Ralphred wrote:
Cool.
So you ran
Code:
grub-install --target=x86_64-efi --efi-directory=/boot
from your chroot environment?

And fear not mate, you're pretty close, you've just stumbled at a late hurdle.

on my first try installing that was the exact command that gave me an error but this time i did that after making sure my ESP was mounted on /boot (in chroot) and it worked fine. my grub seems to be working and in the right spot because when i go to boot it mentions grub and then says something like "loading linux .. .." which i think is from grub. all the guides i see on how to reconfigure kernels say that I should copy the bzImage from my reconfigured kernel into /boot, presumably to overwrite the other bzImage but i can't find it anywhere

thanks for the response
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3541

PostPosted: Fri Jun 26, 2020 3:54 pm    Post subject: Reply with quote

Sorry. Wrong post - deleted.

Last edited by charles17 on Fri Jun 26, 2020 3:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ralphred
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2013
Posts: 117

PostPosted: Fri Jun 26, 2020 3:55 pm    Post subject: Reply with quote

yhtycf wrote:
all the guides i see on how to reconfigure kernels say that I should copy the bzImage from my reconfigured kernel into /boot

This is correct, but running make install from /usr/src/linux with /boot mounted will copy the new kernel over the old one for you (all in your chroot environment).
If you've checked that /boot is mounted, and there is no vmlinuz-* or no EFI directory then that would suggest some earlier command exited with errors, or something wasn't mounted correctly when the commands were issued.

If you want to move this discussion to the #gentoo IRC or some other IM just message me and we can speed up the exchange a bit.
Back to top
View user's profile Send private message
yhtycf
n00b
n00b


Joined: 26 Jun 2020
Posts: 8

PostPosted: Fri Jun 26, 2020 4:09 pm    Post subject: Reply with quote

Ralphred wrote:
yhtycf wrote:
all the guides i see on how to reconfigure kernels say that I should copy the bzImage from my reconfigured kernel into /boot

This is correct, but running make install from /usr/src/linux with /boot mounted will copy the new kernel over the old one for you (all in your chroot environment).
If you've checked that /boot is mounted, and there is no vmlinuz-* or no EFI directory then that would suggest some earlier command exited with errors, or something wasn't mounted correctly when the commands were issued.

If you want to move this discussion to the #gentoo IRC or some other IM just message me and we can speed up the exchange a bit.


THANKS FOR THE HELP! u were right, im a total dumbass and did not have /mnt/gentoo/boot mounted properly. I don't even know what happened with my first "mount /dev/nvme0n1p2 /mnt/gentoo/boot" command tho it went through. Apparently when its mounted properly I'm only supposed to see like 4 things in the /boot folder (rather than 100). I did it again and it worked. I exited and rebooted and my kernel reconfig even worked! Thank you for your time (and soz for wasting it) and the help!
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3541

PostPosted: Fri Jun 26, 2020 4:18 pm    Post subject: Reply with quote

yhtycf wrote:
... and did not have /mnt/gentoo/boot mounted properly. ...

Over the time you will collect some more such "lessons learned". No one else could explain it better.
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