注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Installing Gentoo Sources"

From Funtoo
Jump to navigation Jump to search
m (corrected typo in example boot.conf)
(Added step to mount /boot (otherwise kernel will be installed into unmounted /boot directory))
Line 21: Line 21:
}}
}}


Now edit the kernel to fit your needs. Afterwards, build it.
Now edit the kernel to fit your needs.  
 
Before building the kernel, ensure that /boot is mounted.
 
{{console|body=
###i## mount /boot
}}
 
Now build it.


{{console|body=
{{console|body=

Revision as of 14:45, May 3, 2016

This is a guide for installing and getting a functional gentoo-sources kernel.

Add kernel sets.

root # mkdir /etc/portage/sets
root # echo sys-kernel/gentoo-sources > /etc/portage/sets/kernel

Emerge the gentoo-sources kernel.

root # emerge -a sys-kernel/gentoo-sources

Then change to the kernel directory and enter the kernel config menu.

root # cd /usr/src/linux
root # make menuconfig

Now edit the kernel to fit your needs.

Before building the kernel, ensure that /boot is mounted.

root # mount /boot

Now build it.

root # make && make modules_install
root # make install

You need to install a initramfs. We will use genkernel for this.

root # emerge -a sys-kernel/genkernel
root # genkernel --install initramfs

Installing a bootloader.

root # emerge -a boot-update

If you do ls in the boot directory you will probably see a file like this.

root # mount /dev/sda1 /boot
root # ls /boot

vmlinuz-4.0.0-gentoo

This means that you have to edit the boot.conf a bit. Change bzImage to vmlinuz.

root # nano /etc/boot.conf

Your boot.conf should look like this after edit (vmlinuz is the important part).

   /etc/boot.conf
boot {
	generate grub
	default "Funtoo Linux 
	timeout 3 
}

"Funtoo Linux" {
	kernel vmlinuz[-v]
}

"Funtoo Linux genkernel" {
	kernel kernel[-v]
	initrd initramfs[-v]
	params += real_root=auto 
} 

"Funtoo Linux better-initramfs" {
	kernel vmlinuz[-v]
	initrd /initramfs.cpio.gz
}

Old School (BIOS) MBR

root # grub-install --target=i386-pc --no-floppy /dev/sda
root # boot-update

New School (UEFI) Boot Entry

root # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
root # boot-update

Make sure that boot-update completes without warnings, then proceed with the rest of the installation from the funtoo install guide.