View previous topic :: View next topic |
Author |
Message |
finalturismo Guru
Joined: 06 Jan 2020 Posts: 410
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54629 Location: 56N 3W
|
Posted: Sat Apr 03, 2021 6:04 pm Post subject: |
|
|
Moved from Kernel & Hardware to Documentation, Tips & Tricks. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
mustafasalih1993 n00b
Joined: 09 Feb 2021 Posts: 38
|
Posted: Sat Apr 03, 2021 8:32 pm Post subject: |
|
|
nice video
in case it will be useful for whoever search for this in the future
i upgrade the kernel with the following (i don't use initramfs):
Code: | su
eselect kernel list
eselect kernel set $new kernel
cd /usr/src/linux/
cp ../$old-kernel-dir/.config .
make olddefconfig
make modules_prepare
make -j8
make -j8 modules_install
make install
emerge -av @module-rebuild
grub-mkconfig -o /boot/grub/grub.cfg |
|
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6069 Location: Removed by Neddy
|
Posted: Sat Apr 03, 2021 8:47 pm Post subject: |
|
|
mustafasalih1993 wrote: | nice video
in case it will be useful for whoever search for this in the future
i upgrade the kernel with the following (i don't use initramfs):
Quote: | su
eselect kernel list
eselect kernel set $new kernel
cd /usr/src/linux/
cp ../$old-kernel-dir/.config .
make olddefconfig
make modules_prepare
make -j8
make -j8 modules_install
make install
emerge -av @module-rebuild
grub-mkconfig -o /boot/grub/grub.cfg |
|
these can be reduced to just "make oldconfig" if you also do a make install as make install copies the config to /boot and make oldconfig reads from /boot for an old config _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
|
mustafasalih1993 n00b
Joined: 09 Feb 2021 Posts: 38
|
Posted: Sat Apr 03, 2021 9:05 pm Post subject: |
|
|
Naib wrote: |
these can be reduced to just "make oldconfig" if you also do a make install as make install copies the config to /boot and make oldconfig reads from /boot for an old config |
Oh, very nice! thank you for the useful tip |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5221 Location: Bavaria
|
|
Back to top |
|
|
mustafasalih1993 n00b
Joined: 09 Feb 2021 Posts: 38
|
Posted: Sat Apr 03, 2021 11:55 pm Post subject: |
|
|
pietinger wrote: | https://www.kernel.org/doc/html/latest/kbuild/modules.html says it is included in a "make". Is there a special need ? |
No nothing special, Thanks for pointing for that i didn't know that it's already done by default! |
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 3007 Location: Edge of marsh USA
|
Posted: Sat Sep 18, 2021 4:03 am Post subject: |
|
|
Late to this party, I understand it's better to use make oldconfig rather than make olddefconfig. The olddefconfig option will put any new kernel configuration options at the kernel defaults, which may or may not be what you want. The oldconfig option will prompt you through new configuration options and let you select what's right for your system.
I mention this here since someone helped me by mentioning it to me.
Here are my kernel notes which I keep in the file /usr/src/kernel.txt:
Code: | # Install your new kernel sources. Using 4.9.233 throughout as example.
emerge -a gentoo-sources
or
emerge -a =sys-kernel/gentoo-sources-4.9.233
# NB: /usr/src/linux should currently be a symlink to your current kernel sources.
# Copy the .config from your current kernel sources to your new kernel sources, i.e.
cd /usr/src/
cp linux/.config linux-4.9.233-gentoo/
# Remove the (old) symlink.
rm linux
# Create a new "linux" symlink to your new kernel sources, i.e.
ln -s linux-4.9.233-gentoo linux
# Alternatively, you can change/set the symlink using eselect. Example:
eselect kernel list
Available kernel symlink targets:
[1] linux-4.9.221-gentoo
[2] linux-4.9.228-gentoo *
[3] linux-4.9.233-gentoo
eselect kernel set 3
# Be sure to check your work with:
eselect kernel list
Available kernel symlink targets:
[1] linux-4.9.221-gentoo
[2] linux-4.9.228-gentoo
[3] linux-4.9.233-gentoo *
or
ls -l
lrwxrwxrwx 1 root root 20 Aug 24 13:20 linux -> linux-4.9.233-gentoo/
drwxr-xr-x 26 root root 4096 May 5 22:58 linux-4.9.221-gentoo/
drwxr-xr-x 26 root root 4096 Aug 9 23:11 linux-4.9.228-gentoo/
drwxr-xr-x 26 root root 4096 Aug 24 13:41 linux-4.9.233-gentoo/
# Change to the new kernel sources directory using,
cd linux/
# Update .config according to new kernel options.
make oldconfig
# Configure the new kernel.
make menuconfig
# Compile the new kernel and install the modules.
make && make modules_install
# Copy important kernel boot files to /boot
cp .config /boot/config-4.9.233-gentoo
cp System.map /boot/System.map-4.9.233-gentoo
cp arch/x86/boot/bzImange /boot/kernel-4.9.233-gentoo
# Alternatively, I understand instead of manually copying files to /boot, one
# can run "make install" which will do it for you automatically. I've never
# done it that way. My way contributes to developing muscle memory.
# remove old symlink "vmlinuz" to old /boot/kernel-n.n.nnn-gentoo and create new
# symlink "vmlinuz" to new kernel file
cd /boot
rm vmlinuz
ln -s kernel-4.9.233-gentoo vmlinuz
# Configure boot loader (grub assumed).
grub-mkconfig -o /boot/grub/grub.cfg
Reference: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel
Note: https://www.kernel.org/doc/html/v5.4/admin-guide/pm/cpufreq.html
Note: https://www.kernel.org/doc/html/v5.10/admin-guide/pm/cpufreq.html |
_________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
Juippisi Developer
Joined: 30 Sep 2005 Posts: 755 Location: /home
|
|
Back to top |
|
|
|