View previous topic :: View next topic |
Author |
Message |
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Fri Jun 14, 2024 5:36 pm Post subject: [Solved] Configuring kernel automatic and manual . |
|
|
hi,
I am installing Gentoo Linux in a VirtualBox (To understand the installation process). For my Dell laptop 64 bit I am following https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel for reference. The profile is set at amd64/23.0//desktop/systemd (stable) *.
Currently, I am in the Kernel installation process. I want to understand the steps as follows.
1- Full automation approach: Distribution kernels
According to the handbook, I understand that only these commands are sufficient if a user wants to void compiling the kernel.
Code: | root #emerge --ask sys-kernel/gentoo-kernel-bin |
I explore the handbook and I extract the steps (maybe I am wrong). I think that " sys-kernel/linux-firmware " , " sys-firmware/sof-firmware " and " ys-firmware/intel-microcode " are necessary for both automation and manual approaches.
Code: | (chroot) Livecd / #emerge --ask sys-kernel/linux-firmware
(chroot) Livecd / #emerge --ask sys-firmware/sof-firmware
(chroot) Livecd / # emerge –-ask sys-firmware/intel-microcode
(chroot) Livecd / #emerge --ask sys-kernel/gentoo-kernel-bin |
Technically can you suggest that the steps I write are correct for the Distribution kernel? You can edit it as to your experience .
2- Full manual approach
Well if someone wants to configure and compile the kernel manually the steps I understand are as following.
Code: | (chroot) Livecd / #emerge --ask sys-kernel/linux-firmware
(chroot) Livecd / #emerge --ask sys-firmware/sof-firmware
(chroot) Livecd / # emerge –-ask sys-firmware/intel-microcode
(chroot) Livecd / # emerge --ask sys-kernel/installkernel
(chroot) Livecd / # emerge --ask sys-kernel/gentoo-sources
(chroot) Livecd / # eselect kernel list
(chroot) Livecd / # eselect kernel set 1
(chroot) Livecd / # ls -l /usr/src/linux
(chroot) Livecd / # emerge --ask sys-apps/pciutils
(chroot) Livecd / # cd /usr/src/linux
(chroot) Livecd / # make menuconfig
(chroot) Livecd / # make && make modules_install
(chroot) Livecd / # make install |
Building an initramfs
Code: | (chroot) Livecd / # emerge --ask sys-kernel/dracut
(chroot) Livecd / # dracut --kver <kernel_version> |
https://ibb.co/zfxDcKj
https://ibb.co/6YLvgG4
please correct me If I am wrong in any steps.
Thanks,
gardenair
Last edited by gardenair on Sat Jun 22, 2024 11:28 am; edited 2 times in total |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Fri Jun 14, 2024 6:23 pm Post subject: |
|
|
Thanks "audiodef" for your reply. Well, I am more interested in the manual approach. Though it's a time-consuming process but good for learning and flexibility in the system. |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5109 Location: Bavaria
|
|
Back to top |
|
|
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Tue Jun 18, 2024 6:53 pm Post subject: |
|
|
Thanks "pietinger" for your detailed reply. Well first I want to discuss about gentoo-kernel-bin.
Code: | (chroot) Livecd / #emerge --ask sys-kernel/gentoo-kernel-bin |
You can view the image at https://ibb.co/KrRjW3N
I created a file with the name" kernel-dracut" after the package.use directory Code: | vim /etc/portage/package.use/kernel-dracut | and add a line Code: | sys-kernel/installkernel dracut |
after that, I successfully installed my kernel. Are sys-kernel/installkernel-28 dracut and sys-kernel/installkernel dracut are same or different? I add sys-kernel/installkernel dracut .
2- Why do we not add the entry in /etc/portage/package/make.conf ? The main difference between /etc/portage/package/make.conf and /etc/portage/package/package.use?
There is also a query related to kernel manual installation, but first I want to clarify my above concepts.
Thanks once again for guiding me. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5109 Location: Bavaria
|
Posted: Tue Jun 18, 2024 10:45 pm Post subject: |
|
|
gardenair wrote: | [...] Are sys-kernel/installkernel-28 dracut and sys-kernel/installkernel dracut are same or different? [...] |
There is a difference: If you add the use-flag "dracut" to "installkernel-28" you have set it only for this specific version (28 ) ... with the next update you will not have this use-flag set for installkernel-29 ... so, yes it was correct from you to set it for every version of "installkernel".
gardenair wrote: | [...] 2- Why do we not add the entry in /etc/portage/package/make.conf ? The main difference between /etc/portage/package/make.conf and /etc/portage/package/package.use? [...] |
There exist no /etc/portage/package/make.conf ... only a /etc/portage/make.conf. In this make.conf you can set some use-flags globally (USE="..."). Sometimes this is the right decision ... sometimes it is better to enable a use-flag only for a specific package. (You can see all globally set use-flags with "emerge --info"). Setting a use-flag in the make.conf was historically the first (and only) option ... today you can even set use-flags globally in /etc/portage/package.use/... just enable it with */* for every package ... if you have installed according to our Handbook you have already done this with:
Code: | echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags |
(from: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#CPU_FLAGS_.2A )
gardenair wrote: | [...] Thanks once again for guiding me. |
You are very Welcome ! _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Wed Jun 19, 2024 5:02 am Post subject: |
|
|
Sorry for the typing mistake " /etc/portage/package/make.conf" from my side. Yes, only a /etc/portage/make.conf.
Ok now coming to manual kernel compiling which I did and unfortunately after rebooting my machine just stuck...The reason I don't know but one thing came to my mind during manual configuration I skipped the topic "Building an initramfs" You can see it here https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel#Building_an_initramfs
Maybe it was the reason. How may I fix it...is it possible to fix my Virtual Machine...? I just google it and in help, it says to press "e" and edit at the end of the kernel line ...It is a new thing for me. If it is the solution (As to my approach) please guide me on how may I enter a prompt and fix the issue...or if the solution is something else please let me know.
https://ibb.co/jbN4ktD
https://ibb.co/0JMhwZ4 ......>You can see at the bottom the Virtual Hard Disk icon is not blinking there is a silence here.
https://ibb.co/K5BZdDK |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5109 Location: Bavaria
|
|
Back to top |
|
|
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Wed Jun 19, 2024 4:20 pm Post subject: |
|
|
Well, once again thanks many times. Being an average Linux user at the moment it is hard for me to digest the stuff. In my own experience in Gentoo Linux installation, I keep all installation steps on one side and the manual kernel configuration on the other side. In manual kernel installation, there are many nuts and bolts in it. It seems easy at first glance but when I dig into it it is like a sea for me. Yes with time one day, I shall be also able to manually install the kernel and fix its issues.
I am using Debian Linux (xfce4 desktop) as a daily drive and the applications I use are, Firefox, LibreOffice, VirtualBox, VLC, Kdenlive, OBS Studio, and Audacity.
Currently, I am planning to switch to Gentoo Linux using the above application.
For an average Linux user(like me) who is interested in switching to Gentoo (XFCE Desktop), what do you suggest to me in the Gentoo installation process which approach may I select? To install a Full automation approach: Distribution kernels or Hybrid approach: Genkernel?
Needs your kind opinion about it. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5109 Location: Bavaria
|
Posted: Wed Jun 19, 2024 7:03 pm Post subject: |
|
|
gardenair wrote: | For an average Linux user(like me) who is interested in switching to Gentoo (XFCE Desktop), what do you suggest to me in the Gentoo installation process which approach may I select? To install a Full automation approach: Distribution kernels or Hybrid approach: Genkernel?
Needs your kind opinion about it. |
I dont recommend genkernel ... because:
1. It will die soon, AND
2. You need the same informations/knowledge/experience as for a manual kernel configuration ... and then - for me - the manual installation is easier ...
I recommend always to install our dist-kernel at first to get a running system ... IF you really have a problem with your manual configured kernel you can easily boot the dist-kernel ... INSTEAD booting with a Admin-/Minimal-/LiveCD and chrooting into your installation ...
See also the first chapter of: https://wiki.gentoo.org/wiki/User:Pietinger/New_at_Gentoo
In this article you will also find this: https://wiki.gentoo.org/wiki/User:Pietinger/Draft/Quick_Installation_OpenRC_for_an_UEFI_System
It is the most current description when using OpenRC as init system - of course you must always do what IBM said: "THINK" ...
LATER you can always emerge "gentoo-sources", configure and compile your kernel AND (IMHO best) boot it directly with UEFI, so you have no problem with "gentoo-kernel-bin"/"grub"/"dracut"/"installkernel"+use-flags for these.
Yes, the learning experience in Gentoo is great. _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Thu Jun 20, 2024 6:39 am Post subject: |
|
|
Thanks once again for the nice stuff appreciate you. The link is really very impressive but if it should be for systemd then excellent .The reason is all new laptop,desktop are leaving Legacy BIOS and moving to UEFI. So in my opinion Gentoo should only fallow systemd for new computers. https://wiki.gentoo.org/wiki/User:Pietinger/Draft/Quick_Installation_OpenRC_for_an_UEFI_System The point you have mention is very appealing that " I recommend always to install our dist-kernel at first to get a running system " means that user like me should install Code: | root #emerge --ask sys-kernel/gentoo-kernel-bin | when installing Gentoo first time.
i.e (precompiled Gentoo kernel) . For my own knowledge I can say precompiled Gentoo kernel is just like a sort of kernel when we install Ubuntu, Debian,Fedora because in that distro the user is not worry about the kernel installation which is the backend part of the installation. After installation almost every things works fines like wifi,camera etc etc.
In case of Gentoo which has a flexibility and gives the user a control what he wants to play. So the beauty is if a user like me try to learn Gentoo he must install precompiled Gentoo kernel root #emerge --ask sys-kernel/gentoo-kernel-bin .The reason is as you have mentioned that at least the system will be up after rebooting.
2nd query is suppose I install a fresh Gentoo system (amd64/desktop/systemd ) using root #emerge --ask sys-kernel/gentoo-kernel-bin is it possible after successful booting I may to compile the kernel according to my need or there is other way to manual configure and compile the kernel
Yes I love to play with kernel but your recommendation is very strong to use dist-kernel at first to get a running system. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22657
|
Posted: Thu Jun 20, 2024 11:47 am Post subject: |
|
|
gardenair wrote: | The link is really very impressive but if it should be for systemd then excellent .The reason is all new laptop,desktop are leaving Legacy BIOS and moving to UEFI. So in my opinion Gentoo should only fallow systemd for new computers. | There is no logical connection here. OpenRC and systemd are both able to work properly on both BIOS and UEFI systems. There is no reason that the rise of UEFI should imply coercing everyone over to systemd. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Thu Jun 20, 2024 3:41 pm Post subject: |
|
|
gardenair,
Understand PC Boot Process
The firmware is almost irrelevant to bringing up the system as far as starting PID 1.
I say almost an UEFI can do a few things that BIOS cannot. Like secure boot. That's a misfeature aimed at denying equipment owners full control of the equipment that they own.
It can be turned off on AMD/Intel hardware but not on ARM based hardware, if its present.
This post NeddySeagoons' Rough Guide to DIY Kernels from nearly 20 years ago still gives the correct method but the details have changed over the years.
Since that time, if /usr is on its own filesystem, you will need to mount it using an initrd.
If you feel the need to wake your own initrd, rather than use one of the autoblackmagic alternatives, there is Initramfs - make your own too. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
Posted: Thu Jun 20, 2024 11:54 pm Post subject: |
|
|
Hu wrote: | gardenair wrote: | The link is really very impressive but if it should be for systemd then excellent .The reason is all new laptop,desktop are leaving Legacy BIOS and moving to UEFI. So in my opinion Gentoo should only fallow systemd for new computers. | There is no logical connection here. OpenRC and systemd are both able to work properly on both BIOS and UEFI systems. There is no reason that the rise of UEFI should imply coercing everyone over to systemd. |
Totally agree. I personally prefer OpenRC. The only reason I use systemd in my custom Gentoo OS is to make users comfortable when switching from a similar Linux environment. _________________ decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN |
|
Back to top |
|
|
gardenair n00b
Joined: 05 Oct 2021 Posts: 72
|
Posted: Fri Jun 21, 2024 9:12 am Post subject: [Solved] |
|
|
Thanks all for guiding me. Well there was misconception from my side that OpenRc is for BIOS based PC and Systemd for UEFI.
So in short I can say that a latest laptop (Intel Core I7 12th Gen) having UEFI I can install Gentoo using OpenRC or Systemd. Its up to the user choice. |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
|