Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Arch/Gentoo dual boot with systemd-boot (gummiboot)
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
koshmar
n00b
n00b


Joined: 02 Nov 2016
Posts: 6

PostPosted: Wed Nov 02, 2016 5:30 pm    Post subject: [SOLVED] Arch/Gentoo dual boot with systemd-boot (gummiboot) Reply with quote

Hey all, I would really appreciate the advice how to make things right. I want to install Gentoo along with my existing Arch.
So have Arch linux with following partitions
/dev/sda1 - vfat /boot
/dev/sda2 - swap
/dev/sda3 ext4 / - root for arch
/dev/sda4 ext4 / - hopefully root for gentoo.

I have lenovo ThinkPad 440p. in bios I can choose boot modes: UEFI, Legacy bios, both. Sounds fine but it is not. In practice I experience troubles booting my system (of course it is my fault as I do not know enough about booting). For example, I cannot make grub2 work either with Arch or Gentoo (without double booting, just plain installation). Thus the first thing which worked is systemd-boot (gummiboot) with Arch and now I want to add Gentoo to this working bootloader.
Code:

#ls /boot
EFI initramfs-linux-fallback.img initramfs-linux.img intel-ucode.img loader vmlinuz-linux

So I have a couple of questions:
1) if I would install gentoo from existing Arch, will genkernel work? for the first time I want to make it simple without compiling kernel myself, however systemd-boot requires - Linux kernel with EFISTUB so probably I need to configure kernel.
2) maybe I can use Arch's kernel, so adding gentoo to bootloader would be as simple as changing the only root partition in config file:
Code:

$ cat /boot/loader/entries/arch.conf
title Arch
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=PARTUUID=5a445da7-5689-457a-b9c0-49ee74d89ad0 rw <- change this line

what would be the benefits/drowbacks? will it work? will it be bad in any way?
3) another way is to use different kernels. what would be the best practice? would I mount /dev/sda1 to gentoo's /boot and create something like /boot/gentoo for it's kernel? or would I just use /boot ? will be any conflicts with Arch kernel?
4) if you see any troubles I may encounter, please share)
5) maybe there is another way?

UPDATE: if I would use one kernel for both distros maybe I should make /boot read only for gentoo?
UPDATE2: I installed gentto without kernel - just used arch kernel, it boots ok, but seems like some drivers are not loaded or not presented. for example if I type "ip link" I can see only "lo" device. strange...
UPDATE3: I succesfully dual boot Arch + gentoo with gummiboot (systemd-boot). To do so I did following steps:
1) Install Arch with gummiboot leaving one partition free
2) install Gentoo into the free partition following the handbook except:
2a) I did it all from Arch, thus when chrooting I use 3 last commands from https://wiki.gentoo.org/wiki/Installation_alternatives#Installing_Gentoo_from_an_existing_Linux_distribution
2b) When compiling the Kernel, I do not mount /boot thus kernel will appear in /boot folder on Gentoo partition. I did it with genkernel command because I was lazy, but I am going to compile it myself latter.
If you want to mount /boot you can, just do not execute "make install" when compile the kernel manually. Basically what "make install" does is copy kernel to /boot.
2c) I disregarded bootloader section in handbook. I just copied kernel (and initrd) to by /boot (/dev/sda1) and manually added the entery for gentoo. Here I pick specific names for kernel so arch would not erase it (something like "kernel-4.8.7-gentoo"
3) Now if I want to update kernel: In Arch I would just update it with pacman (packet manager) but in gentoo I would compile it and then mannualy copy.
4) As I understand, it is not neccesary even to mount /boot, thus I do not include it in fstab in Gentoo. (Not in arch, as pacman would try to copy staff there when updating the kernel)
Thanks


Last edited by koshmar on Mon Nov 14, 2016 5:39 pm; edited 2 times in total
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 600
Location: Barcelona, Spain

PostPosted: Tue Nov 08, 2016 3:20 pm    Post subject: Re: Arch/Gentoo dual boot with systemd-boot (gummiboot) Reply with quote

I have played with archlinux, but I do not have much experience with dual-boot systems. Nevertheless, what you are trying looks very interesting.

koshmar wrote:
UPDATE2: I installed gentto without kernel - just used arch kernel, it boots ok, but seems like some drivers are not loaded or not presented. for example if I type "ip link" I can see only "lo" device. strange...


When you compile a kernel, it creates the kernel image (like /boot/vmlinuz-4.4.26-gentoo), but it also compiles the modules (you should find them in /lib64/modules/4.4.26-gentoo). When you start the box with the arch kernel, gentoo cannot find the modules.

Cheers!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Thank the community answering other people's post, specially those unanswered.
Back to top
View user's profile Send private message
mrbassie
Guru
Guru


Joined: 31 May 2013
Posts: 433

PostPosted: Tue Nov 08, 2016 4:13 pm    Post subject: Reply with quote

I'b be interested in knowing whether you could simply copy the kernel modules from the Arch partition to the Gentoo one.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 10051

PostPosted: Wed Nov 09, 2016 2:26 am    Post subject: Reply with quote

Kernel modules are ordinary files, so it should be possible to copy them over. I doubt they will be usable in a kernel configured substantially differently from the kernel for which they were built, though.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3250
Location: Austro Bavaria

PostPosted: Wed Nov 09, 2016 11:22 pm    Post subject: Reply with quote

my opinion

arch installtion + free partition for gentoo

There is some way to tell the bootloader a custom boot entry and add that. Check your bootloader manual for that

Not supported: hack in by hand the gentoo bootloader section in your arch bootloader. AS binary distros like linux mint overwrite those boot entries with every update, it has to be redone than. Keep a written note somewhere on what gentoo needs!

Regarding the kernel you should reuse the arch linux kernel config and build your own gentoo config with that config.

--

Quote:
I'b be interested in knowing whether you could simply copy the kernel modules from the Arch partition to the Gentoo one.


nope and nope.

some ebuilds (= packages) need a working /usr/src/linux in gentoo. implies that you have build your kernel there. they check for some options or other stuff. I doubt you will succeed as a new user without a full kernel source which points to your current kernel. I look at nvidia binary drivers and some other packages like google chrome and others who check for certain kernel options if they are set and such.

Just don't !!
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 3780
Location: UK

PostPosted: Thu Nov 10, 2016 5:32 am    Post subject: Reply with quote

mrbassie wrote:
I'b be interested in knowing whether you could simply copy the kernel modules from the Arch partition to the Gentoo one.

Yes, that works fine. You just boot with the same kernel but different root=.
_________________
Quantity is not quality.
overlay | runit-scripts
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 600
Location: Barcelona, Spain

PostPosted: Thu Nov 10, 2016 11:12 am    Post subject: Reply with quote

Roman_Gruber wrote:
some ebuilds (= packages) need a working /usr/src/linux in gentoo. implies that you have build your kernel there. they check for some options or other stuff. I doubt you will succeed as a new user without a full kernel source which points to your current kernel. I look at nvidia binary drivers and some other packages like google chrome and others who check for certain kernel options if they are set and such.


I have a binhost building kernels (and all other packages) for other hosts (old laptops). I have successfully been doing this for a while. I emerge the sources, copy the kernel image into the boot directory, the .config file into /usr/src/linux and synchronise /lib64/modules/$kernel. I have been doing this with nvidia and ati drivers and I am using chromium. I have automated the process in this badly written perl script.

A the same time, I think you are right in saying that this would be very difficult for a new user. :wink: (Although I do not have any studies in computer science or related disciplines, I have been using gentoo for a while :D ).

Cheers!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Thank the community answering other people's post, specially those unanswered.
Back to top
View user's profile Send private message
koshmar
n00b
n00b


Joined: 02 Nov 2016
Posts: 6

PostPosted: Mon Nov 14, 2016 5:21 pm    Post subject: all been solved Reply with quote

Thanks all for answers, see UPDATE 3
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 600
Location: Barcelona, Spain

PostPosted: Tue Nov 15, 2016 12:46 pm    Post subject: Re: [SOLVED] Arch/Gentoo dual boot with systemd-boot (gummib Reply with quote

Waw! Congratulations!

I do not fully grasp this step in UPDATE 3:

koshmar wrote:
2b) When compiling the Kernel, I do not mount /boot thus kernel will appear in /boot folder on Gentoo partition. I did it with genkernel command because I was lazy, but I am going to compile it myself latter.
If you want to mount /boot you can, just do not execute "make install" when compile the kernel manually. Basically what "make install" does is copy kernel to /boot.


As I understand it, you have a dual-boot box with two different kernels (archlinux and gentoo, and you keep them in /boot). After compiling the gentoo kernel, you copy the image to /boot and add an entry in grub. Is that right?

Cheers!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Thank the community answering other people's post, specially those unanswered.
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