Kernel sources for current kernel?

When you run into problems installing MX Linux XFCE
Message
Author
mxlinuzuzer
Posts: 9
Joined: Sun Mar 24, 2019 6:36 pm

Kernel sources for current kernel?

#1 Post by mxlinuzuzer »

Hi,

I want to use my own .config. Where do I get the kernel source from for 4.19.5? I need the headers for it too for installing Virtualbox. Would like to install the lasted VB 6.0. Will 4.19.5 work?

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Kernel sources for current kernel?

#2 Post by JayM »

VirtualBox 6.0.4 is already in the testing repository. I suggest you use that rather than installing your own that you got from somewhere else.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

mxlinuzuzer
Posts: 9
Joined: Sun Mar 24, 2019 6:36 pm

Re: Kernel sources for current kernel?

#3 Post by mxlinuzuzer »

Thank you! Do you know where I can get the kernel source from?

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Kernel sources for current kernel?

#4 Post by JayM »

Probably from the source repositories, I would imagine. They would need to be enabled in MX Repo Manager. I haven't done so, so I don't know if kernel sources are there or not.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
Stevo
Developer
Posts: 12837
Joined: Fri Dec 15, 2006 8:07 pm

Re: Kernel sources for current kernel?

#5 Post by Stevo »

mxlinuzuzer wrote: Sun Mar 24, 2019 7:14 pm Hi,

I want to use my own .config. Where do I get the kernel source from for 4.19.5? I need the headers for it too for installing Virtualbox. Would like to install the lasted VB 6.0. Will 4.19.5 work?
Vbox 6.X will build on the 4.19 kernel, even up to the 5.0 kernel.

If you're going to build your own kernel, you also have to build and install your own headers. MX already has the MX kernel headers installed.

You can get the kernel source by running

Code: Select all

sudo apt-get install linux-source-4.19
Description: Linux kernel source for version 4.19 with Debian patches
This package provides source code for the Linux kernel version 4.19. This
source closely tracks official Linux kernel releases. Debian's
modifications to that source consist of security fixes, bug fixes, and
features that have already been (or are believed to be) accepted by the
upstream maintainers.
which will install it into /usr/src. I would recommend moving it out of /usr/src to your home folder if you want to work on it.

There are also methods of getting it with "sudo apt-get source", or just get the orig.tar.xz tarball from our repo, which is the original unaltered source direct from upstream. http://mxrepo.com/mx/repo/pool/main/l/linux/

I do have questions about what procedure you plan to use to build the kernel, though, and what you want to change in the config. You probably should also look into using a newer 4.19 kernel source from our test repo, or even linux-source-4.20 from there, for security and bugfix reasons.

We backport upstream Debian kernels for MX using the Debian packaging system, which do take quite a while to build on older machines and need over 40 GB of free space on the hard drive. Liquorix kernels, even though they enable more drivers than Debian, are much faster to build and take maybe 7 GB of free space.

mxlinuzuzer
Posts: 9
Joined: Sun Mar 24, 2019 6:36 pm

Re: Kernel sources for current kernel?

#6 Post by mxlinuzuzer »

Thank you! I have compiled 5.0.4 without root, and is running it now, but there's no kernel headers for it.

User avatar
Stevo
Developer
Posts: 12837
Joined: Fri Dec 15, 2006 8:07 pm

Re: Kernel sources for current kernel?

#7 Post by Stevo »

What commands did you use to manually build it? Often you have to add something like "enable-headers" to get a separate header package. We really can't troubleshoot the procedure without any details.

mxlinuzuzer
Posts: 9
Joined: Sun Mar 24, 2019 6:36 pm

Re: Kernel sources for current kernel?

#8 Post by mxlinuzuzer »

Thanks for helping me.

wget the source from kernel,org. Verified it and extracted it.
Copied the .config backup to ~/Downloads/linux-5.0.4/

Code: Select all

sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev

Code: Select all

make oldconfig
as the .config was made from an earlier kernel version.

Code: Select all

make -j4

Code: Select all

sudo make modules_install

Code: Select all

sudo make install
Output from that is

Code: Select all

sh ./arch/x86/boot/install.sh 5.0.4 arch/x86/boot/bzImage \
	System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.0.4 /boot/vmlinuz-5.0.4
run-parts: executing /etc/kernel/postinst.d/dkms 5.0.4 /boot/vmlinuz-5.0.4
Error! Bad return status for module build on kernel: 5.0.4 (x86_64)
Consult /var/lib/dkms/virtualbox-guest/5.2.24/build/make.log for more information.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.0.4 /boot/vmlinuz-5.0.4
update-initramfs: Generating /boot/initrd.img-5.0.4
run-parts: executing /etc/kernel/postinst.d/pm-utils 5.0.4 /boot/vmlinuz-5.0.4
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.0.4 /boot/vmlinuz-5.0.4
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.0.4 /boot/vmlinuz-5.0.4
Generating grub configuration file ...
using custom appearance settings
Found background image: .background_cache.png
Found linux image: /boot/vmlinuz-5.0.4
Found initrd image: /boot/initrd.img-5.0.4
Found linux image: /boot/vmlinuz-5.0.4.old
Found initrd image: /boot/initrd.img-5.0.4
Found linux image: /boot/vmlinuz-4.20.12-antix.1-amd64-smp
Found initrd image: /boot/initrd.img-4.20.12-antix.1-amd64-smp
Found memtest86+ image: /memtest86+.bin
done
When installing VB 6.0

Code: Select all

This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
Removed 5.0.4, and installed the headers for 4.20.12, and success. Now I only need the sources for that kernel, so I can use my own .config. :)
Last edited by mxlinuzuzer on Sun Mar 24, 2019 11:02 pm, edited 1 time in total.

User avatar
Adrian
Developer
Posts: 8267
Joined: Wed Jul 12, 2006 1:42 am

Re: Kernel sources for current kernel?

#9 Post by Adrian »

I use this to create debs:

Code: Select all

make -j4 deb-pkg

mxlinuzuzer
Posts: 9
Joined: Sun Mar 24, 2019 6:36 pm

Re: Kernel sources for current kernel?

#10 Post by mxlinuzuzer »

Adrian wrote: Sun Mar 24, 2019 10:41 pm I use this to create debs:

Code: Select all

make -j4 deb-pkg
Thank you :)

Code: Select all

sudo make install
didn't work with 4.19 and VB-6.0, but after I upgraded to 6.0.4 it did.

Messed around so much now that I will have to reinstall tomorrow. :)

Post Reply

Return to “Installation”