LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2021, 06:55 AM   #1
kainaat
LQ Newbie
 
Registered: Mar 2021
Posts: 6

Rep: Reputation: Disabled
Build latest stable kernel 5.12.0-rc2+


Hello,

I am trying to build the latest stable kernel which is 5.12.0.rc2+ from
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

I have followed the following steps:
  1. Downloaded source to /usr/src/
  2. sudo make defconfig
  3. added a few configurations
  4. sudo make olddefconfig
  5. sudo make -j64
  6. sudo make modules_install
  7. sudo make install


On "make install" I get the following error and I am unable to boot using this new image as it freezes on "loading initial ramdisk":


sh ./arch/x86/boot/install.sh 5.12.0-rc2+ arch/x86/boot/bzImage \
System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
update-initramfs: Generating /boot/initrd.img-5.12.0-rc2+
find: ‘/var/tmp/mkinitramfs_EPi6Et/lib/modules/5.12.0-rc2+/kernel’: No such file or directory
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
run-parts: executing /etc/kernel/postinst.d/update-notifier 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.12.0-rc2+
Found initrd image: /boot/initrd.img-5.12.0-rc2+
Found linux image: /boot/vmlinuz-5.11.0-051100rc7-generic
Found initrd image: /boot/initrd.img-5.11.0-051100rc7-generic
Found linux image: /boot/vmlinuz-5.11.0-051100-generic
Found initrd image: /boot/initrd.img-5.11.0-051100-generic
Found linux image: /boot/vmlinuz-5.8.12-kAFL+
Found initrd image: /boot/initrd.img-5.8.12-kAFL+
/dev/sdb: open failed: No medium found
/dev/sdb: open failed: No medium found
Adding boot menu entry for UEFI Firmware Settings
done


Output for "modules_install":
sudo make modules_install
INSTALL drivers/thermal/intel/x86_pkg_temp_thermal.ko
INSTALL fs/efivarfs/efivarfs.ko
INSTALL net/ipv4/netfilter/iptable_nat.ko
INSTALL net/ipv4/netfilter/nf_log_arp.ko
INSTALL net/ipv4/netfilter/nf_log_ipv4.ko
INSTALL net/ipv6/netfilter/nf_log_ipv6.ko
INSTALL net/netfilter/nf_log_common.ko
INSTALL net/netfilter/xt_LOG.ko
INSTALL net/netfilter/xt_MASQUERADE.ko
INSTALL net/netfilter/xt_addrtype.ko
INSTALL net/netfilter/xt_mark.ko
INSTALL net/netfilter/xt_nat.ko
DEPMOD 5.12.0-rc2+


Any help would be appreciated!!
 
Old 03-12-2021, 08:15 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
#1 That is NOT a "stable kernel", that is a RELEASE CANDIDATE (RC) which means it is out for testing and assumed to contain bugs and issues that will need correction or remediation before the stable release. The LATEST release that is stable is 5.11.6.

#2 It might help if we knew something about your system. What Linux distribution and version are you starting from?
It appears that you have compiled kernels before, including at least one earlier RC kernel. Is that the case? If so, why not start your new kernel build using that (appearently successful) config and just update that?

Did you check the prerequisites first? ( I assume they were largely present, or your compile step would have borked. It always pays to check, just in case. ) They can and do change form one kernel version to the next!

What happens when you try to boot to this kernel? Other than that error message, is anything logged?

There are a lot of changes and a couple of "gotchas" in this RC. You may want to wait for the next candidate (Or the stable version, when that comes out) and compile THAT one for testing.

Last edited by wpeckham; 03-12-2021 at 08:18 AM.
 
Old 03-12-2021, 11:57 AM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by kainaat View Post
Hello,

I am trying to build the latest stable kernel which is 5.12.0.rc2+ from
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

I have followed the following steps:
  1. Downloaded source to /usr/src/
  2. sudo make defconfig
  3. added a few configurations
  4. sudo make olddefconfig
  5. sudo make -j64
  6. sudo make modules_install
  7. sudo make install


On "make install" I get the following error and I am unable to boot using this new image as it freezes on "loading initial ramdisk":


sh ./arch/x86/boot/install.sh 5.12.0-rc2+ arch/x86/boot/bzImage \
System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
update-initramfs: Generating /boot/initrd.img-5.12.0-rc2+
find: ‘/var/tmp/mkinitramfs_EPi6Et/lib/modules/5.12.0-rc2+/kernel’: No such file or directory
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
run-parts: executing /etc/kernel/postinst.d/update-notifier 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.12.0-rc2+ /boot/vmlinuz-5.12.0-rc2+
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.12.0-rc2+
Found initrd image: /boot/initrd.img-5.12.0-rc2+
Found linux image: /boot/vmlinuz-5.11.0-051100rc7-generic
Found initrd image: /boot/initrd.img-5.11.0-051100rc7-generic
Found linux image: /boot/vmlinuz-5.11.0-051100-generic
Found initrd image: /boot/initrd.img-5.11.0-051100-generic
Found linux image: /boot/vmlinuz-5.8.12-kAFL+
Found initrd image: /boot/initrd.img-5.8.12-kAFL+
/dev/sdb: open failed: No medium found
/dev/sdb: open failed: No medium found
Adding boot menu entry for UEFI Firmware Settings
done


Output for "modules_install":
sudo make modules_install
INSTALL drivers/thermal/intel/x86_pkg_temp_thermal.ko
INSTALL fs/efivarfs/efivarfs.ko
INSTALL net/ipv4/netfilter/iptable_nat.ko
INSTALL net/ipv4/netfilter/nf_log_arp.ko
INSTALL net/ipv4/netfilter/nf_log_ipv4.ko
INSTALL net/ipv6/netfilter/nf_log_ipv6.ko
INSTALL net/netfilter/nf_log_common.ko
INSTALL net/netfilter/xt_LOG.ko
INSTALL net/netfilter/xt_MASQUERADE.ko
INSTALL net/netfilter/xt_addrtype.ko
INSTALL net/netfilter/xt_mark.ko
INSTALL net/netfilter/xt_nat.ko
DEPMOD 5.12.0-rc2+


Any help would be appreciated!!
A couple of things; you say you built kernel 5.12.0.rc2, but yet the link you gave is for the stable version, not the RC versions.
Why did you download the source to /usr/src/ ? As the /usr directory tree is owned by the root user, therefore unprivileged users should not have write permission and should not be able to write files to the /usr directory tree. You also should be building the kernel as an unprivileged user, not as the root user (or using sudo). You should also configure the kernel as an unprivileged user, and not as the root user (or using sudo). You should only need root privileges when installing the kernel, modules and the initramfs/initrd.

While the message below is from make install

Code:
sh ./arch/x86/boot/install.sh 5.12.0-rc2+ arch/x86/boot/bzImage \
System.map "/boot"
the rest of the messages (except the last block messages quoted above, that are coming from make modules_install) you've quoted above look like they are coming from your distribution, they aren't coming from make install in my experience. So what else did you run after make install?

In any case, it appears that something has gone wrong when building the initramfs, with the kernel being configured to use an initramfs/initrd, and therefore the kernel cannot load an initramfs/initrd. And by the looks of it, you've not built all of the required modules/drivers that your system needs.

You should have a look at our guide on building the kernel linked below.

https://wiki.linuxquestions.org/wiki...n_Linux_kernel
 
1 members found this post helpful.
Old 03-12-2021, 09:54 PM   #4
Bonzoo
Member
 
Registered: Sep 2018
Location: Costa Rica
Distribution: Antix21a2,Parrot rolling,MXfce19.4,Sparky Openbox
Posts: 233

Rep: Reputation: 48
Zero point to this "effort". You a gameboi too ?
 
Old 03-13-2021, 03:56 AM   #5
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by jsbjsb001 View Post
You also should be building the kernel as an unprivileged user, not as the root user (or using sudo). You should also configure the kernel as an unprivileged user, and not as the root user (or using sudo).
Does it important? Why not root?
 
Old 03-13-2021, 04:54 AM   #6
kainaat
LQ Newbie
 
Registered: Mar 2021
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
#1 That is NOT a "stable kernel", that is a RELEASE CANDIDATE (RC) which means it is out for testing and assumed to contain bugs and issues that will need correction or remediation before the stable release. The LATEST release that is stable is 5.11.6.

#2 It might help if we knew something about your system. What Linux distribution and version are you starting from?
It appears that you have compiled kernels before, including at least one earlier RC kernel. Is that the case? If so, why not start your new kernel build using that (appearently successful) config and just update that?

Did you check the prerequisites first? ( I assume they were largely present, or your compile step would have borked. It always pays to check, just in case. ) They can and do change form one kernel version to the next!

What happens when you try to boot to this kernel? Other than that error message, is anything logged?

There are a lot of changes and a couple of "gotchas" in this RC. You may want to wait for the next candidate (Or the stable version, when that comes out) and compile THAT one for testing.
#1 Thanks for the information, my bad. I tried with the stable 5.11.6 as well but I seem to get the same result for both 5.12.0-rc2+ and 5.11.6. I can see that not all modules are being installed. I can boot into 5.11.6 but there is no sound, internet and so on:

Code:
sudo make modules_install
  INSTALL drivers/thermal/intel/x86_pkg_temp_thermal.ko
  INSTALL fs/efivarfs/efivarfs.ko
  INSTALL net/ipv4/netfilter/iptable_nat.ko
  INSTALL net/ipv4/netfilter/nf_log_arp.ko
  INSTALL net/ipv4/netfilter/nf_log_ipv4.ko
  INSTALL net/ipv6/netfilter/nf_log_ipv6.ko
  INSTALL net/netfilter/nf_log_common.ko
  INSTALL net/netfilter/xt_LOG.ko
  INSTALL net/netfilter/xt_MASQUERADE.ko
  INSTALL net/netfilter/xt_addrtype.ko
  INSTALL net/netfilter/xt_mark.ko
  INSTALL net/netfilter/xt_nat.ko
  DEPMOD  5.11.6
Code:
sudo make install
sh ./arch/x86/boot/install.sh 5.11.6 arch/x86/boot/bzImage \
	System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.11.6 /boot/vmlinuz-5.11.6
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.11.6 /boot/vmlinuz-5.11.6
update-initramfs: Generating /boot/initrd.img-5.11.6
find: ‘/var/tmp/mkinitramfs_Qnv3AP/lib/modules/5.11.6/kernel’: No such file or directory
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.11.6 /boot/vmlinuz-5.11.6
run-parts: executing /etc/kernel/postinst.d/update-notifier 5.11.6 /boot/vmlinuz-5.11.6
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.11.6 /boot/vmlinuz-5.11.6
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.11.6
Found initrd image: /boot/initrd.img-5.11.6
Found linux image: /boot/vmlinuz-5.11.0-051100rc7-generic
Found initrd image: /boot/initrd.img-5.11.0-051100rc7-generic
Found linux image: /boot/vmlinuz-5.11.0-051100-generic
Found initrd image: /boot/initrd.img-5.11.0-051100-generic
Found linux image: /boot/vmlinuz-5.8.12-kAFL+
Found initrd image: /boot/initrd.img-5.8.12-kAFL+
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
Adding boot menu entry for UEFI Firmware Settings
done


#2 Here is some information about the system:
Code:
lspci
00:00.0 Host bridge: Intel Corporation Device 3e20 (rev 0d)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 0d)
00:01.2 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x4) (rev 0d)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile) (rev 02)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Cannon Lake PCH Thermal Controller (rev 10)
00:14.0 USB controller: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller (rev 10)
00:14.2 RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)
00:15.0 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #0 (rev 10)
00:15.1 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #1 (rev 10)
00:16.0 Communication controller: Intel Corporation Cannon Lake PCH HECI Controller (rev 10)
00:17.0 SATA controller: Intel Corporation Cannon Lake Mobile PCH SATA AHCI Controller (rev 10)
00:1c.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #1 (rev f0)
00:1c.4 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #5 (rev f0)
00:1d.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #14 (rev f0)
00:1e.0 Communication controller: Intel Corporation Cannon Lake PCH Serial IO UART Host Controller (rev 10)
00:1f.0 ISA bridge: Intel Corporation Device a30e (rev 10)
00:1f.3 Audio device: Intel Corporation Cannon Lake PCH cAVS (rev 10)
00:1f.4 SMBus: Intel Corporation Cannon Lake PCH SMBus Controller (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller (rev 10)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (7) I219-LM (rev 10)
03:00.0 Network controller: Intel Corporation Wi-Fi 6 AX200 (rev 1a)
04:00.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] (rev 06)
05:00.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] (rev 06)
05:01.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] (rev 06)
05:02.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] (rev 06)
05:04.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] (rev 06)
06:00.0 System peripheral: Intel Corporation JHL7540 Thunderbolt 3 NHI [Titan Ridge 4C 2018] (rev 06)
3a:00.0 USB controller: Intel Corporation JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 4C 2018] (rev 06)
6f:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
Ubuntu version: 20.04.2 LTS
Linux version: 5.11.0-051100rc7-generic
 
Old 03-13-2021, 05:13 AM   #7
kainaat
LQ Newbie
 
Registered: Mar 2021
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
A couple of things; you say you built kernel 5.12.0.rc2, but yet the link you gave is for the stable version, not the RC versions.
Why did you download the source to /usr/src/ ? As the /usr directory tree is owned by the root user, therefore unprivileged users should not have write permission and should not be able to write files to the /usr directory tree. You also should be building the kernel as an unprivileged user, not as the root user (or using sudo). You should also configure the kernel as an unprivileged user, and not as the root user (or using sudo). You should only need root privileges when installing the kernel, modules and the initramfs/initrd.

While the message below is from make install

Code:
sh ./arch/x86/boot/install.sh 5.12.0-rc2+ arch/x86/boot/bzImage \
System.map "/boot"
the rest of the messages (except the last block messages quoted above, that are coming from make modules_install) you've quoted above look like they are coming from your distribution, they aren't coming from make install in my experience. So what else did you run after make install?

In any case, it appears that something has gone wrong when building the initramfs, with the kernel being configured to use an initramfs/initrd, and therefore the kernel cannot load an initramfs/initrd. And by the looks of it, you've not built all of the required modules/drivers that your system needs.

You should have a look at our guide on building the kernel linked below.

https://wiki.linuxquestions.org/wiki...n_Linux_kernel
1. Thanks for your reply. I have tried to compile it with non-privileged user in the home directory as well and I get the same result.

2. Yes, somehow it does not seem to be installing all the modules:
Code:
sudo make modules_install
  INSTALL drivers/thermal/intel/x86_pkg_temp_thermal.ko
  INSTALL fs/efivarfs/efivarfs.ko
  INSTALL net/ipv4/netfilter/iptable_nat.ko
  INSTALL net/ipv4/netfilter/nf_log_arp.ko
  INSTALL net/ipv4/netfilter/nf_log_ipv4.ko
  INSTALL net/ipv6/netfilter/nf_log_ipv6.ko
  INSTALL net/netfilter/nf_log_common.ko
  INSTALL net/netfilter/xt_LOG.ko
  INSTALL net/netfilter/xt_MASQUERADE.ko
  INSTALL net/netfilter/xt_addrtype.ko
  INSTALL net/netfilter/xt_mark.ko
  INSTALL net/netfilter/xt_nat.ko
  DEPMOD  5.11.6
3. I only try to boot into the new kernel after make install. I have looked at the guide and there seems to be nothing new that I should need to do

4. I would like to mention that I tried the deb packages for the kernel and they seem to be working fine. But building from tar file is leading to this situation. In the configuration I am turning on DEBUG_INFO.

Last edited by kainaat; 03-13-2021 at 05:15 AM.
 
Old 03-13-2021, 06:54 AM   #8
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by igadoter View Post
Does it important? Why not root?
Because you don't need to configure and build the kernel as root, anymore than you need to run a media player as root just to watch a video. You therefore should be using an unprivileged account instead, because the "principle of least privilege" is highly recommended for good reason, that's why. I'd think someone with your experience would understand why I said that.

Quote:
Originally Posted by kainaat View Post
1. Thanks for your reply. I have tried to compile it with non-privileged user in the home directory as well and I get the same result.

2. Yes, somehow it does not seem to be installing all the modules:
Code:
sudo make modules_install
  INSTALL drivers/thermal/intel/x86_pkg_temp_thermal.ko
  INSTALL fs/efivarfs/efivarfs.ko
  INSTALL net/ipv4/netfilter/iptable_nat.ko
  INSTALL net/ipv4/netfilter/nf_log_arp.ko
  INSTALL net/ipv4/netfilter/nf_log_ipv4.ko
  INSTALL net/ipv6/netfilter/nf_log_ipv6.ko
  INSTALL net/netfilter/nf_log_common.ko
  INSTALL net/netfilter/xt_LOG.ko
  INSTALL net/netfilter/xt_MASQUERADE.ko
  INSTALL net/netfilter/xt_addrtype.ko
  INSTALL net/netfilter/xt_mark.ko
  INSTALL net/netfilter/xt_nat.ko
  DEPMOD  5.11.6
3. I only try to boot into the new kernel after make install. I have looked at the guide and there seems to be nothing new that I should need to do

4. I would like to mention that I tried the deb packages for the kernel and they seem to be working fine. But building from tar file is leading to this situation. In the configuration I am turning on DEBUG_INFO.
Reviewing your OP, the problem seems to be that unless you're compiling in the needed modules for your system, you're simply not building the required modules/drivers that are needed for your system. Running "make modules_install" simply executes a script, that simply copies whatever modules/drivers you built alongside the kernel itself as external modules to /lib/modules/<kernel version here>/. In other words, drivers that are stored in separate files, and are not compiled into the kernel itself. Not building the required drivers for your system would result in the boot process freezing up.

I'd suggest as wpeckham did in post #2 that you use a kernel config for a kernel you know does boot without any issues. Our guide does mention exactly how you can do that here, in fact there are two ways you can do it. I'd recommend you run the following:

Code:
zcat /proc/config.gz > ~/kernel_source_directory/.config
Change "~/kernel_source_directory" to the actual directory where your kernel source is located.

I'm not sure DEBUG_INFO is going to make much, if any difference here, and I very much doubt it's the problem here.
 
1 members found this post helpful.
Old 03-13-2021, 02:21 PM   #9
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by igadoter View Post
Does it important? Why not root?
It is extremely important that you not do compiles as root.

When you compile something as a regular user it cannot overwrite anything in the operating system OS. When you then do the "sudo make install" step it puts the already compiled binaries (and only those files) where they are supposed to go. The source code that you compiled from can be modified, relocated, and even deleted entirely by your user.

If you make a mistake or something flubs up it is easy to start over and fix an error without risking the running system.

OTOH, if you do the compile as root it would be easy to do so in one of the system critical directories and mess up the running OS since root has permission to write anywhere on the system.

Not to say that anyone would do this intentionally, but it has been known for a root user to make a typo. Intending to wipe out a directory tree of source code located at /src/mycode/dir, can you imagine the result of this (as root)
Code:
rm -rf / src/mycode/dir
As a regular user that typo would have no harmful affect. As root that is a different story altogether.
Such possibilities are why it is strongly discouraged for anyone to do routine things on a system when logged in as root.
 
Old 03-31-2021, 04:20 AM   #10
kainaat
LQ Newbie
 
Registered: Mar 2021
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
Reviewing your OP, the problem seems to be that unless you're compiling in the needed modules for your system, you're simply not building the required modules/drivers that are needed for your system. Running "make modules_install" simply executes a script, that simply copies whatever modules/drivers you built alongside the kernel itself as external modules to /lib/modules/<kernel version here>/. In other words, drivers that are stored in separate files, and are not compiled into the kernel itself. Not building the required drivers for your system would result in the boot process freezing up.

I'd suggest as wpeckham did in post #2 that you use a kernel config for a kernel you know does boot without any issues. Our guide does mention exactly how you can do that here, in fact there are two ways you can do it. I'd recommend you run the following:

Code:
zcat /proc/config.gz > ~/kernel_source_directory/.config
Change "~/kernel_source_directory" to the actual directory where your kernel source is located.

I'm not sure DEBUG_INFO is going to make much, if any difference here, and I very much doubt it's the problem here.


So, I have been trying out a lot of different options. I tried out the one that you mentioned. I took the config file of the already installed kernel and built it up from this. I do :
  1. make
  2. sudo make modules_install
  3. sudo make install

I get 4 files under my /boot directory: vmlinuz, System.map, config, initrd

But when I try to boot with this kernel, it gets stuck at "Loading initial ramdisk" I followed the guide that I was provided in an answer above
https://wiki.linuxquestions.org/wiki...n_Linux_kernel. It says the kernel can boot using the initrd image.
I am currently not comfortable with using UEFI as I am not well versed with it. Is that the only option left? Or I could be missing some drivers for loading?

The other option I tried was compiling the kernel the Debian way which worked completely fine and I was able to boot it.
 
Old 03-31-2021, 07:25 AM   #11
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by kainaat View Post
So, I have been trying out a lot of different options. I tried out the one that you mentioned.
...
If that was the DEBUG_INFO option, then like I said above, that isn't the problem here.

Quote:
I get 4 files under my /boot directory: vmlinuz, System.map, config, initrd
The script launched by the make install command won't copy the config file to the /boot directory, nor will it build an initrd for you.

You need to build your own initrd based on the kernel you've built, and you need to do that using the mkinitrd or the mkinitramfs command depending on your distribution. I think there is a script included with the kernel source you might be able to use as well, but I've never used that myself. I've also never used the mkinitramfs command either, I've only used the mkinitrd command to build an initrd myself.

In any case, based on what you're saying, you have not built an initrd against the kernel you've built, which would explain why it's freezing when trying to load an initrd.

Quote:
I am currently not comfortable with using UEFI as I am not well versed with it. Is that the only option left? Or I could be missing some drivers for loading?
...
Well I'd suggest you just use your distribution's bootloader rather than UEFI in that case. Booting the kernel with UEFI only works if you have a machine with UEFI firmware and you have built the kernel with the following kernel options set to "yes";

Code:
CONFIG_EFI=y
CONFIG_EFI_STUB=y
You also need to copy the kernel and initrd (if you are using an initrd) to your EFI system partition, and then you need to add an entry to your UEFI firmware's boot menu, otherwise it won't work.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Slackware64 14.2] Loading error of ath10k firmware with latest kernel-firmware and latest kernel-huge pensador_13 Slackware 3 06-16-2018 12:31 PM
Slackware 13.1 RC2. Expect a stable release when it's ready. koenigdavidmj Slackware 2 05-18-2010 09:15 PM
Stable 13 kernel vs Current kernel in Stable system linus72 Slackware 6 04-01-2010 07:45 AM
Slackware 12.1 rc2, It's getting close to stable release. onebuck Slackware 66 05-01-2008 10:15 PM
LXer: Linux, 2.6.23-rc2,"-rc2 is the new -rc1" LXer Syndicated Linux News 0 08-04-2007 07:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration