Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] missing initramfs.linux.img when dual booting
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
enrico68
Apprentice
Apprentice


Joined: 21 Oct 2016
Posts: 198

PostPosted: Thu Aug 29, 2024 1:14 pm    Post subject: Reply with quote

Weezer wrote:


It looks like you are trying to edit your grub.cfg in Arch. You don't need to do anything to Arch's grub.cfg.


That is exactly what I did, I added to the Arch's grub.cfg, that's how I undestood your instructions, my bad...

Quote:
Simply create a file named custom.cfg and put this in there:

menuentry 'Gentoo' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f2c0bfeb-9ea5-4261-93b4-5715bb9fded7 {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,3),msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f2c0bfeb-9ea5-4261-93b4-5715bb9fded7
else
search --no-floppy --fs-uuid --set=root f2c0bfeb-9ea5-4261-93b4-5715bb9fded7
fi
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=f2c0bfeb-9ea5-4261-93b4-5715bb9fded7 rw loglevel=3 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/intel-ucode.img /boot/initramfs-linux.img

}

All right, I will make this cgf. file and not touch Arch's grub.cfg, clear.

Quote:
Nothing more, nothing less. Arch will see the custom.cfg without doing anything further. You should then be able to boot into Gentoo.

I will give it a try and see if it works.

Quote:
Also, I mentioned that you should not run "grub-install" from Gentoo, not grub-mkconfig. Running grub-mkconfig is perfectly fine as that is how you get your menu entries to use in the custom.cfg file.

This part is not clear...how do I run grub-mkconfig if I do not run first grub-install?? Unless you mean to run grub-mkconfig in Arch, then it makes sense...am I right on this? Please confirm I got thi part right, as it is very important.

Quote:
At this point, I would suggest removing all symlinks in your Gentoo /boot directory (if you made any).

I did, and they will all be removed.

Quote:
Re-run grub-mkconfig -o /boot/grub/grub.cfg and then copy the menu entries into custom.cfg which will be in Arch's /boot/grub/ directory.

I re-run grub-mkconfig in Arch, not Gentoo, correct?

Quote:
Let me iterate that custom.cfg should be only the menu entries. Nothing preceding the entries and nothing after.

Got it!

Quote:
Andrew is not wrong about what hes is saying either, about versioning, etc. I simply use symlinks in the custom.cfg file so I don't have to manually edit at every kernel upgrade. The custom.cfg file NEVER changes once it is set up. I could call my symlinks franks-linux and franks-fallback-linux (dumb examples). They are just a pointer to the actual kernel entries.

It could be a solution to try later, once I get settled with my dual-boot.[/quote]

Quote:
In your Arch /boot/grub/ directory, you will have both:
grub.cfg
custom.cfg
Completely independent of each other.

Ok.

Quote:
You don't need os-prober because Arch will handle the Arch side of things and you will handle the custom.cfg (which when using symlinks, doesn't often change).

Ok.

Quote:
The ONLY time custom.cfg changes is if you have to make changes due to configuration changes, etc. Then, you will either have to manually edit the custom.cfg file or re-create the entries within Gentoo and replace the entries in custom.cfg. Otherwise, you won't need to worry about anything grub related with Gentoo (you could actually uninstall it though not recommended). When I update my kernels in Gentoo, I re-create the symlinks to point to the new kernels. Done. No re-creating grub.cfg, etc.etc.

Ok.

Quote:
I hope I haven't made things more complicated whilst trying to make them easier. I think you arre close and once it "clicks", you will see what I'm doing....

I think I understood pretty much all of it, besides the grub part, where to install it and run, this is not clear.


Quote:
Sorry I didn't see this earlier and I'll check back after a bit to see how we're doing. If you wan't to ignore all this and try os-prober I won't blame you :D


I will try what you suggested first and see how far I manage to get...fingers crossed...
Back to top
View user's profile Send private message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 373
Location: Nijmegen

PostPosted: Thu Aug 29, 2024 1:22 pm    Post subject: Reply with quote

Quote:
This part is not clear...how do I run grub-mkconfig if I do not run first grub-install??


grub-mkconfig runs independently of whether grub is or is not installed. The usual order is first grub-install, then grub-mkconfig, but this is just convention there is no technical reason it has to be done in this order.

So for example, you could, in Gentoo:
Code:

mount /my/arch/partition /mnt/arch
grub-mkconfig -o /mnt/arch/boot/grub/grub-gentoo.cfg

without actually running grub-install. Then in Arch you can make the necessary adjustments to merge /boot/grub/grub.cfg and /boot/grub/grub-gentoo.cfg. Maybe chainloading the config will work, otherwise you can use the /etc/grub.d/40_custom method as Weezer suggested.
_________________
OS: Gentoo 6.8.10-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
Weezer
n00b
n00b


Joined: 19 Apr 2024
Posts: 19

PostPosted: Thu Aug 29, 2024 2:49 pm    Post subject: Reply with quote

Hi All,

The custom.cfg file is automatically picked up by Arch, it simply needs to be created and put in Arch's /boot/grub/ directory.

The way I would create this is by chrooting into Gentoo, either via your Arch system or a rescue USB stick, and running the grub-mkconfig command while chrooted into that system. Then you will have the menu entries needed for the custom.cfg file. Make sure your /boot drive is mounted if it is separate.

If you know this ahead of time, you can do this during the install and set it up ahead of a reboot so it is ready to go. Sometimes, like this situation, you would do it in chroot.

Andrew is exactly right, GRUB (as a program) can be installed but you do not have to actually have it take over your for your entire system. You can bypass the grub-install /dev/sda command and go straight to the grub-mkconfig -o /boot/grub/grub.cfg command. That way Gentoo doesn't take over GRUB, but you have the menu entries needed to boot Gentoo.

I'm thinking best course of action would be to chroot into Gentoo, actually install grub from Gentoo, ignore Arch or dual booting all-together, get Gentoo working, come back to Arch....(someone already mentioned this above.)
Back to top
View user's profile Send private message
enrico68
Apprentice
Apprentice


Joined: 21 Oct 2016
Posts: 198

PostPosted: Sat Aug 31, 2024 3:27 pm    Post subject: Reply with quote

Weezer wrote:



menuentry 'Gentoo' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f2c0bfeb-9ea5-4261-93b4-5715bb9fded7 {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,3),msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f2c0bfeb-9ea5-4261-93b4-5715bb9fded7
else
search --no-floppy --fs-uuid --set=root f2c0bfeb-9ea5-4261-93b4-5715bb9fded7
fi
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=f2c0bfeb-9ea5-4261-93b4-5715bb9fded7 rw loglevel=3 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/intel-ucode.img /boot/initramfs-linux.img

}


Hello Weezer, I did add the above as a custom.cfg to Arch's boot, but it still did not work. So I chose to take another route: this time I decided to make Gentoo do the booting, so I emerged grub, installed it, and ran mk-config to see what cfg. file it would create, and I noticed that the set=root 2c0bfeb-9ea5-4261-93b4-5715bb9fded7 is different, it uses a different UUID, but, since I was at it, I gave os-prober a try why not...and it worked! Now I can dual boot both Linux systems...Now I have to tackle the network part, but at least I got to a good starting point.

Next, of course, I will try to add the custom.cfg file with the newly provided UUID, and see if that works as well, just to see...

A big thank you to you, Andrew, and to pietinger, whose post I read three times and which led me to use Gentoo's Distribution Kernel and installkernel to ease the process. Your support has been very precious... :)

P.S.

I tried Weezer's custom.cfg method, after running grub-mkconfig on Arch, and upon reboot, both system were there and I could access Gentoo, this time without the os-prober. Like I said before, I needed to run grub-mkconfig on Gentoo and copy the resulting grub.cfg, which is different than the one I originally used, that is why this method did not work properly before, I had to make a few changes and voilà....
Back to top
View user's profile Send private message
Weezer
n00b
n00b


Joined: 19 Apr 2024
Posts: 19

PostPosted: Sun Sep 01, 2024 11:04 am    Post subject: Reply with quote

Hi Enrico,

Happy to hear you got it up and running :D

Whatever method you used, it is working and as they say, "if it ain't broke, don't fix it". You can tweak it later if necessary and as you become more familiar with GRUB and dual booting.

Networking issues with Broadcom cards can be fun and interesting, and a pain. I've replaced Broadcom cards in two laptops with Intel cards and have never looked back. You can find them quite cheaply on the "auction" websites and in my experience, Linux just likes those better.

Have fun tweaking and customizing Gentoo!

P.S. - If you ever rebuild your laptop don't forget about converting to bios-boot and gpt, well worth it.
Back to top
View user's profile Send private message
enrico68
Apprentice
Apprentice


Joined: 21 Oct 2016
Posts: 198

PostPosted: Wed Sep 04, 2024 4:59 am    Post subject: Reply with quote

Weezer wrote:


Networking issues with Broadcom cards can be fun and interesting, and a pain. I've replaced Broadcom cards in two laptops with Intel cards and have never looked back. You can find them quite cheaply on the "auction" websites and in my experience, Linux just likes those better.


I noticed...it was a breeze to make it work on Arch, but on Gentoo I am honestly struggling...

Quote:
P.S. - If you ever rebuild your laptop don't forget about converting to bios-boot and gpt, well worth it.


I will definitely do that.
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 Previous  1, 2
Page 2 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