Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] A quick sanity check before upgrading Kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
wolly01
n00b
n00b


Joined: 22 Jul 2017
Posts: 35

PostPosted: Sat May 04, 2024 10:07 am    Post subject: [Solved] A quick sanity check before upgrading Kernel Reply with quote

Dear Gentoo Forum,

I need to update my Kernel to the a newer version and would like a little assistance.

I've been back on Gentoo for a few months now (and glad to be back) after briefly trying it out about a year ago but had to switch back for certain software. Back on my old system I recompiled my Kernel many times and also updated my Kernel at least once to a newer major (masked) revision.
I have also done many kernel rebuilds at the beginning of this OS install a couple of months ago when I first re-setup Gentoo (mostly due to needing to turn on some kernel features i forgot about :oops:)

What I mean by the above paragraph is that I'm not completely clueless when it comes to upgrading ones Kernel. However, this time around I have a sense of trepidation due to not being able to properly probe the state of my system (and thus not know what steps to perform to bring my system to the updated state I desire it to be). Explanation below:

running eselect kernel list nets me the following list of kernels:
Code:

Available kernel symlink targets:
  [1]   linux-6.6.21-gentoo


However lucking at my /usr/src directory with ls -la I see the following:

Code:

ls -la
total 4
drwxr-xr-x 1 root root   92 Mar 11 21:58 .
drwxr-xr-x 1 root root  190 Mar 11 19:25 ..
lrwxrwxrwx 1 root root   19 Feb  7 06:21 linux -> linux-6.6.13-gentoo
drwxr-xr-x 1 root root 1670 Mar 18 21:07 linux-6.6.13-gentoo
drwxr-xr-x 1 root root  558 Mar 11 21:58 linux-6.6.21-gentoo
drwxr-xr-x 1 root root   52 Feb 10 00:10 rpm


Note that the symlink to /usr/src/linux points to the version corresponding to 6.6.13. Furthermore running `uname -r` gives the following
Code:

6.6.13-gentoo

Which makes sense being as that was the kernel version which I complied and installed my kernel to the prev time.

I'm mostly just worried because eselect does not allow me to select the kernel that is currently running on my system. I presume that Portage just un-merged old kernel sources but I don't know for sure.

Am I safe to just proceed with the upgrade as normal / per the handbook - or is this a sign that something is wrong with my current system state?


Last edited by wolly01 on Sun May 05, 2024 9:44 am; edited 1 time in total
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3830

PostPosted: Sat May 04, 2024 10:57 am    Post subject: Reply with quote

Here's;
Code:
tree -a -L 1 linux-6.8.9-gentoo-std
linux-6.8.9-gentoo-std
├── .config
├── .config.old
├── config.sav
├── Kconfig -> /usr/src/linux-6.8.9-gentoo/Kconfig
└── Makefile -> /usr/src/linux-6.8.9-gentoo/Makefile
Such a directory is displayed
Code:
eselect kernel list | tail -5
  [43]  linux-6.8.9-gentoo
  [44]  linux-6.8.9-gentoo-kpatch
  [45]  linux-6.8.9-gentoo-r8169
  [46]  linux-6.8.9-gentoo-rv
  [47]  linux-6.8.9-gentoo-std *
config.sav shouldn't be required as it is a personal directory with .config-[$date] history.
My guess is that Kconfig & Makefile are required entries; .config* shouldn't.

How is it on your side for the undisplayed directories?

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2366

PostPosted: Sat May 04, 2024 1:51 pm    Post subject: Re: A quick sanity check before upgrading Kernel Reply with quote

wolly01 wrote:
I presume that Portage just un-merged old kernel sources but I don't know for sure.


Gentoo-sources is slotted meaning portage won't clean the old package on upgrade. You should have cleaned it by manually running emerge --depclean.

wolly01 wrote:
Am I safe to just proceed with the upgrade as normal / per the handbook - or is this a sign that something is wrong with my current system state?


You are safe. You have your old kernel in boot and it has the grub entries (otherwise you wouldn't have been able to boot), so it's not going anywhere. You just lack the sources for it.

Just to be sure I'll mention you can directly use the .config file from your previous kernel which should still be in /usr/src/linux-6.6.13, drop it in 6.6.21 and run `make old_config` and then continue as if you just run make menuconfig.

You can `grep gento-osources /var/log/emerge.log` and see if it was unmerged. If you want to convert the timestamps to something human readable it's a bit more complicated, but if you're interested in just one, you can paste it in an online convertor.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22578

PostPosted: Sat May 04, 2024 2:34 pm    Post subject: Reply with quote

For offline conversion, date -d @value can be used to convert one date. For converting more than one, date -f - can consume a list of such dates. Note that trailing non-date content will need to be removed before passing the line to date.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Sat May 04, 2024 2:39 pm    Post subject: Re: A quick sanity check before upgrading Kernel Reply with quote

logrusx wrote:
[...] and run `make old_config` and then [...]

Let me correct your typo: It is "make oldconfig" :lol:
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2366

PostPosted: Sat May 04, 2024 2:50 pm    Post subject: Re: A quick sanity check before upgrading Kernel Reply with quote

Hu wrote:
For offline conversion, date -d @value can be used to convert one date. For converting more than one, date -f - can consume a list of such dates. Note that trailing non-date content will need to be removed before passing the line to date.


I had this in a cheat sheet but I was too lazy to copy it:

Code:
grep gentoo-sources /var/log/emerge.log | tail | awk  '{ printf strftime("%c: ", $1); $1 = ""; print $0; }'
Mon 25 Mar 2024 10:34:00 AM EET:  === (1 of 1) Updating world file (sys-kernel/gentoo-sources-6.6.21)
Mon 25 Mar 2024 10:34:00 AM EET:  === (1 of 1) Post-Build Cleaning (sys-kernel/gentoo-sources-6.6.21::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.21.ebuild)
Mon 25 Mar 2024 10:34:00 AM EET:  ::: completed emerge (1 of 1) sys-kernel/gentoo-sources-6.6.21 to /
Wed 27 Mar 2024 05:26:27 PM EET:  *** emerge --ask --regex-search-auto=y --depclean gentoo-sources:6.6.21
Wed 27 Mar 2024 05:26:51 PM EET:  *** emerge --ask --regex-search-auto=y --depclean =sys-kernel/gentoo-sources-6.6.21
Wed 27 Mar 2024 05:27:08 PM EET:  *** emerge --deselect --regex-search-auto=y --deselect gentoo-sources:6.6.21
Wed 27 Mar 2024 05:27:16 PM EET:  *** emerge --ask --regex-search-auto=y --depclean gentoo-sources:6.6.21
Wed 27 Mar 2024 05:27:33 PM EET:  *** emerge --regex-search-auto=y --unmerge gentoo-sources:6.6.21
Wed 27 Mar 2024 05:27:39 PM EET:  === Unmerging... (sys-kernel/gentoo-sources-6.6.21)
Wed 27 Mar 2024 05:27:48 PM EET:  >>> unmerge success: sys-kernel/gentoo-sources-6.6.21


pietinger wrote:
logrusx wrote:
[...] and run `make old_config` and then [...]

Let me correct your typo: It is "make oldconfig" :lol:


Thank you!

Best Regards,
Georgi
Back to top
View user's profile Send private message
wolly01
n00b
n00b


Joined: 22 Jul 2017
Posts: 35

PostPosted: Sun May 05, 2024 3:57 am    Post subject: Reply with quote

Thanks for the support everyone, seems like all is ship shape:


CaptainBlood / pietinger:
Looking into my two current llinux src folders I see all the things I need. In particular:
-linux-6.6.13-gentoo: does not have the Kconfig or the Makefile (I presume they got cleared-up when the 6.6.13 sources got un-merged). However it does have my .configs still so I'm all good :)
-linux-6.6.21 is the opposite, i.e. it is in a state where I can move my .config across and make oldconfig to update my kernel
logrusx & Hu:
Thx, your command had a slight spelling mistake but was easy to fix, netting me the following:
Code:

1707286757:  *** emerge --ask --regex-search-auto=y gentoo-sources
1707286810:  >>> emerge (5 of 5) sys-kernel/gentoo-sources-6.6.13 to /
1707286815:  === (5 of 5) Cleaning (sys-kernel/gentoo-sources-6.6.13::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.13.ebuild)
1707286816:  === (5 of 5) Compiling/Merging (sys-kernel/gentoo-sources-6.6.13::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.13.ebuild)
1707286836:  === (5 of 5) Merging (sys-kernel/gentoo-sources-6.6.13::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.13.ebuild)
1707286843:  >>> AUTOCLEAN: sys-kernel/gentoo-sources:6.6.13
1707286845:  === (5 of 5) Updating world file (sys-kernel/gentoo-sources-6.6.13)
1707286845:  === (5 of 5) Post-Build Cleaning (sys-kernel/gentoo-sources-6.6.13::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.13.ebuild)
1707286845:  ::: completed emerge (5 of 5) sys-kernel/gentoo-sources-6.6.13 to /
1710194273:  >>> emerge (13 of 13) sys-kernel/gentoo-sources-6.6.21 to /
1710194273:  === (13 of 13) Cleaning (sys-kernel/gentoo-sources-6.6.21::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.21.ebuild)
1710194274:  === (13 of 13) Compiling/Merging (sys-kernel/gentoo-sources-6.6.21::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.21.ebuild)
1710194304:  === (13 of 13) Merging (sys-kernel/gentoo-sources-6.6.21::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.21.ebuild)
1710194313:  >>> AUTOCLEAN: sys-kernel/gentoo-sources:6.6.21
1710194316:  === (13 of 13) Post-Build Cleaning (sys-kernel/gentoo-sources-6.6.21::/var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.6.21.ebuild)
1710194316:  ::: completed emerge (13 of 13) sys-kernel/gentoo-sources-6.6.21 to /
1710796057: === Unmerging... (sys-kernel/gentoo-sources-6.6.13)
1710796064:  >>> unmerge success: sys-kernel/gentoo-sources-6.6.13


running `date -d` on 1710796064 causes date to complain of an invalid date , but an online convertor gives me Mon Mar 11 2024 21:58:24 GMT+0000 which intuitively seems about right


I presume then me running a depclean after unmerging some other packages a while back caused the old sources to be unmerged.
There is as strong chance I had already eselected the newest kernel at some point and just not bothered to finish the process of updating my kernel - leading to the old kernel being removed and hence my confusion.

TL;DR all is working I was just confused.
I should be good to go from here. I will later on today go through the kernel upgrade and then [Solved] this thread should I encounter no further problem.

Many thx :)
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2366

PostPosted: Sun May 05, 2024 7:03 am    Post subject: Reply with quote

wolly01 wrote:

running `date -d` on 1710796064 causes date to complain of an invalid date


Code:
date -d @1710796064
Mon Mar 18 11:07:44 PM EET 2024


Let me guess, you missed the @ part. My command for grepping emerge.log has no mistakes.

Best Regards,
Georgi
Back to top
View user's profile Send private message
wolly01
n00b
n00b


Joined: 22 Jul 2017
Posts: 35

PostPosted: Sun May 05, 2024 9:44 am    Post subject: Reply with quote

Mission success.

Minor panic as I forgot to run make modules_install at first locking me out of X but quickly solved then rebooted. I took the liberty to unmask ~amd64 on the the gentoo-sources whist I was at it as I like having the newest kernel where possible.

logrusx: I did indeed miss the @ - I thought you where using it to denote value being a variable for the command! - silly me :D. Note that whilst your grep is syntactically well formed you are matching on `gento-osources` not `gentoo-sources`, but is not a worry at all :) .


Thx again all I appreciate the help with the commands on how to diagnose my system :)

I will [Solved] shortly!
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2366

PostPosted: Sun May 05, 2024 10:04 am    Post subject: Reply with quote

wolly01 wrote:
Note that whilst your grep is syntactically well formed you are matching on `gento-osources` not `gentoo-sources`, but is not a worry at all :) .


Well, it's kind of beyond the point, but unless somebody corrected it for me, I wrote it gentoo-sources in the original post. I think I made a few edits, maybe you grabbed it in-between. That means you should have grabbed an entirely wrong command as all attempts to make it better came wrong :)

Best Regards,
Georgi
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22578

PostPosted: Sun May 05, 2024 3:20 pm    Post subject: Re: A quick sanity check before upgrading Kernel Reply with quote

wolly01 wrote:
-linux-6.6.13-gentoo: does not have the Kconfig or the Makefile (I presume they got cleared-up when the 6.6.13 sources got un-merged). However it does have my .configs still so I'm all good :)
-linux-6.6.21 is the opposite, i.e. it is in a state where I can move my .config across and make oldconfig to update my kernel
This is expected for people who do an in-tree build of the kernel sources. If you had done an out-of-tree build, then 6.6.13-gentoo would have had only Portage-managed files, and the depclean would have deleted the directory after removal of all Portage-managed files left it empty. Since your in-tree build created files, Portage retained the directory.
wolly01 wrote:
logrusx & Hu:
running `date -d` on 1710796064 causes date to complain of an invalid date
Correct, as discussed later, you lost the @ sign, which is mandatory when providing a date in epoch-seconds form.
wolly01 wrote:
I presume then me running a depclean after unmerging some other packages a while back caused the old sources to be unmerged.
Yes.
wolly01 wrote:
logrusx: I did indeed miss the @ - I thought you where using it to denote value being a variable for the command!
Technically, I was the one who gave you the date -d. logrusx gave you the more general command for printing the log with dates converted, where my command is for one-off usage converting specific dates.

When I give commands, I follow a convention that I think I picked up from printed reference books years ago: bold is used for literals you should use as shown; italics are used for placeholders that you need to replace with a context-appropriate value. Hence, my command used a bold at sign and an italicized word "value".
logrusx wrote:
wolly01 wrote:
Note that whilst your grep is syntactically well formed you are matching on `gento-osources` not `gentoo-sources`, but is not a worry at all :) .
Well, it's kind of beyond the point, but unless somebody corrected it for me, I wrote it gentoo-sources in the original post. I think I made a few edits, maybe you grabbed it in-between. That means you should have grabbed an entirely wrong command as all attempts to make it better came wrong :)
Your older post still has it wrong. The post where you pulled out the cheat sheet command has it right:
logrusx wrote:
You can `grep gento-osources /var/log/emerge.log` and see if it was unmerged.
logrusx wrote:
I had this in a cheat sheet but I was too lazy to copy it:
Code:
grep gentoo-sources /var/log/emerge.log | tail | awk  '{ printf strftime("%c: ", $1); $1 = ""; print $0; }'
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2366

PostPosted: Sun May 05, 2024 4:17 pm    Post subject: Re: A quick sanity check before upgrading Kernel Reply with quote

Hu wrote:
logrusx wrote:
wolly01 wrote:
Note that whilst your grep is syntactically well formed you are matching on `gento-osources` not `gentoo-sources`, but is not a worry at all :) .
Well, it's kind of beyond the point, but unless somebody corrected it for me, I wrote it gentoo-sources in the original post. I think I made a few edits, maybe you grabbed it in-between. That means you should have grabbed an entirely wrong command as all attempts to make it better came wrong :)
Your older post still has it wrong. The post where you pulled out the cheat sheet command has it right:
logrusx wrote:
You can `grep gento-osources /var/log/emerge.log` and see if it was unmerged.
logrusx wrote:
I had this in a cheat sheet but I was too lazy to copy it:
Code:
grep gentoo-sources /var/log/emerge.log | tail | awk  '{ printf strftime("%c: ", $1); $1 = ""; print $0; }'


Well, it kind of goes well OT but I cannot omit thanking you for pointing that out!

Best Regards,
Georgi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum