View previous topic :: View next topic |
Author |
Message |
wootan n00b
Joined: 10 Dec 2024 Posts: 12
|
Posted: Wed Dec 11, 2024 6:24 pm Post subject: depclean after kernel download |
|
|
my issue is that i messed up by performing a depclean prior to fully installing my kernel after an update... the issue is perfectly described in this post by NeddySeagoon that describes exactly what i just did wrong.
here is the link to original quote and the post is also pasted below
https://forums.gentoo.org/posting.php?mode=quote&p=8494796&sid=cb73bc8b2de2cdcad9194ddf154e57c8
Quote: | C666PO,
New kernels don't have a .config file at all.
When you run make menuconfig, the make system loads a defaultconfig which is mostly no use to anyone.
Here's what happened to you. You did an update that fetched new kernel sources.
The update went well and you ran
Code:
emerge --depclean
That removed all the downloaded files from /usr/src/linux, which points to an older kernel that the one your update fetched.
The key here is 'downloaded files'. Your .config and all the generated files are still there but /usr/src/linux/Makefile has gone as it was downloaded.
Hence your error.
Copy /usr/src/linux/.config to your new kernel source tree and do the kernel update dance.
You can do something similar with gcc when you have a new gcc installed but not yet selected.
--depclean will remove your active gcc. That's scary the first time.
What you are reporting is normal behavior.
Its possible emerge your old kernel again if you really need it but you need to specify the slot, as you don't want the newest kernel.
_________________
Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail |
the only issue, is he doesn't say exactly how to get my makefile back. i tried to look through the kernel upgrade documentation but am not able to figure this out.
basically i cannot perform make oldconfig or any make function, my makefile is gone, as described above.
Last edited by wootan on Wed Dec 11, 2024 10:35 pm; edited 2 times in total |
|
Back to top |
|
|
rfx Tux's lil' helper
Joined: 19 Apr 2023 Posts: 147 Location: de-by
|
Posted: Wed Dec 11, 2024 6:30 pm Post subject: |
|
|
What is your Question? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22870
|
Posted: Wed Dec 11, 2024 6:50 pm Post subject: |
|
|
OP: welcome to the forums. I suggest that you use Preview before you Submit a post, so that you can review how well (or not) your BBcode comes through. In your case, it's a bit of a mess. I think you could've gotten something more usable, and more readily, by opening a reply-with-quote of Neddy's post, then copying that text into your new post here without attempting to modify it.
As for your implied question, Neddy answered it: don't do that. More specifically, rather than trying to retrieve the Makefile and associated kernel sources of the by-definition non-current kernel, you should use a now-current kernel and update your .config accordingly. Neddy also did explain how to get back the older kernel if you really need it. |
|
Back to top |
|
|
wootan n00b
Joined: 10 Dec 2024 Posts: 12
|
Posted: Wed Dec 11, 2024 10:32 pm Post subject: |
|
|
Hu wrote: | OP: welcome to the forums. I suggest that you use Preview before you Submit a post, so that you can review how well (or not) your BBcode comes through. In your case, it's a bit of a mess. I think you could've gotten something more usable, and more readily, by opening a reply-with-quote of Neddy's post, then copying that text into your new post here without attempting to modify it.
As for your implied question, Neddy answered it: don't do that. More specifically, rather than trying to retrieve the Makefile and associated kernel sources of the by-definition non-current kernel, you should use a now-current kernel and update your .config accordingly. Neddy also did explain how to get back the older kernel if you really need it. |
thank you for the warm welcome and all of your help with issues i've run across, you're so right my post looked like a storm blew threw it. how embarrassing. anyway i fixed the original post. |
|
Back to top |
|
|
wootan n00b
Joined: 10 Dec 2024 Posts: 12
|
Posted: Wed Dec 11, 2024 10:34 pm Post subject: |
|
|
rfx wrote: | What is your Question? |
thank you for your reply, i reformed my original post. hopefully that makes sense now. |
|
Back to top |
|
|
wootan n00b
Joined: 10 Dec 2024 Posts: 12
|
Posted: Thu Dec 12, 2024 4:28 am Post subject: |
|
|
Hu wrote: | OP: welcome to the forums. I suggest that you use Preview before you Submit a post, so that you can review how well (or not) your BBcode comes through. In your case, it's a bit of a mess. I think you could've gotten something more usable, and more readily, by opening a reply-with-quote of Neddy's post, then copying that text into your new post here without attempting to modify it.
As for your implied question, Neddy answered it: don't do that. More specifically, rather than trying to retrieve the Makefile and associated kernel sources of the by-definition non-current kernel, you should use a now-current kernel and update your .config accordingly. Neddy also did explain how to get back the older kernel if you really need it. |
so i did everything Nedd said, i get the same error. so I'm not sure where im going wrong here. the old kernel source folder is still in /usr/src. the config file is in there, and i've moved it to /usr/src/linux after eselecting the new kernel.
this is where im stuck |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54642 Location: 56N 3W
|
Posted: Thu Dec 12, 2024 10:47 am Post subject: |
|
|
Welcome to Gentoo.
Trust but verify.
Run ls -l /usr/src
Does the linux -> symlink point to the kernel you think it does?
If so, cd /usr/src/linux and run make oldconfig
Read the help and answer the questions to update the .config for the new kernel.
Then build and install it in the usual way. Don't forget to mount /boot.
Fix the symlink first, if you need to.
Provided the ebuild for your old kernel is still in the tree, emerge gentoo-sources:<slot> will get the sources back.
The generated files will be uharmed.
If your old kernel ebuild has been removed, you can recover it from the git repo.
All the ebuilds that ever were are still online. Back to 2002 anyway, when Gentoo adopted CVS. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22870
|
Posted: Thu Dec 12, 2024 2:23 pm Post subject: |
|
|
As an additional hint beyond Neddy's advice, I suggest that you show, rather than tell. Don't tell us "I did everything Nedd said." Instead, show us the commands you ran as a result of reading his post, and what output they produced. This lets us confirm that you understood the post correctly and that the commands ran as desired. |
|
Back to top |
|
|
wjb l33t
Joined: 10 Jul 2005 Posts: 636 Location: Fife, Scotland
|
Posted: Thu Dec 12, 2024 8:22 pm Post subject: |
|
|
The old .config (versioned) is there in the /boot directory until it's manually deleted, plus if you have CONFIG_IKCONFIG & CONFIG_IKCONFIG_PROC set then you can retrieve it from the running kernel with a # zcat /proc/config > .config |
|
Back to top |
|
|
wootan n00b
Joined: 10 Dec 2024 Posts: 12
|
Posted: Fri Dec 13, 2024 9:47 am Post subject: |
|
|
NeddySeagoon wrote: | Welcome to Gentoo.
Trust but verify.
Run ls -l /usr/src
Does the linux -> symlink point to the kernel you think it does?
If so, cd /usr/src/linux and run make oldconfig
Read the help and answer the questions to update the .config for the new kernel.
Then build and install it in the usual way. Don't forget to mount /boot.
Fix the symlink first, if you need to.
Provided the ebuild for your old kernel is still in the tree, emerge gentoo-sources:<slot> will get the sources back.
The generated files will be uharmed.
If your old kernel ebuild has been removed, you can recover it from the git repo.
All the ebuilds that ever were are still online. Back to 2002 anyway, when Gentoo adopted CVS. |
Thank you for the welcome, and appreciate your help.
so here is what I have done. I had a perfectly configed 6.6.58-r1 kernel. I performed an @world update, which included 6.6.62 kernel. immediately after i performed a --depclean. I then eselected the 6.6.62 kernel. The symlink is appropriate. and I have copied the 6.6.58 .config to the symlinked kernel. all that said i continue get this error when doing any form of make:
Code: | make: *** No rule to make target 'oldconfig'. Stop. |
also, im not sure what you mean by <slot>?
Hu wrote: | As an additional hint beyond Neddy's advice, I suggest that you show, rather than tell. Don't tell us "I did everything Nedd said." Instead, show us the commands you ran as a result of reading his post, and what output they produced. This lets us confirm that you understood the post correctly and that the commands ran as desired. |
I appreciate the constructive criticism, Hu, quite rude of me to expect people to read my mind.
I appreciate you spending the time to help me in my gentoo growing pains.
I hope the explanation, reads. |
|
Back to top |
|
|
wootan n00b
Joined: 10 Dec 2024 Posts: 12
|
Posted: Fri Dec 13, 2024 10:03 am Post subject: |
|
|
lol, guys. I have no idea how its working but its working now. thank you all for your time and effort. im sorry to be such an ultra super n00b. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54642 Location: 56N 3W
|
Posted: Fri Dec 13, 2024 10:15 am Post subject: |
|
|
Slotting is Gentoos way of allowing multiple versions of the same package to be installed at the same time.
Few packages are slotted as it's a lot of developer work but the kernel is one of them.
A gentoo package is identified by its <category>/<package>-<version>:<slot>::<repo>
emerge -av ... shows you all the bits.
To get an old kernel back, emerge gentoo-sources:<slot>
emerge =gentoo-sources-version works too.
From your error you are not in the new kernel tree.
make tries to run in the present working directory. To see that, do $PWD and ignore the error.
You need to cd to /usr/src/linux before running make.
It helps us help you if you copy/paste commands and output into you posts, so we see what you saw.
Use wgetpaste for big things and post the link. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22870
|
Posted: Fri Dec 13, 2024 11:20 am Post subject: |
|
|
wootan wrote: | lol, guys. I have no idea how its working but its working now. | As a guess, since your preceding post seems like you did all the right steps, perhaps you had two shells open. In one of them, you entered /usr/src/linux while that pointed to the old 6.6.58-r1 (before you corrected the symlink), then set aside that shell. In the other, you did all the work you described above, causing /usr/src/linux to now point to the new kernel. However, the value of /usr/src/linux matters at the time it is traversed, so that older shell that you set aside is still effectively in the directory that linux pointed to when the shell ran cd. Since I posit that the older shell is in the older 6.6.58-r1 directory, then yes, it would be missing Makefile and other things. When you traverse the updated symlink, you will find yourself in the new 6.6.62 directory, which has the files you need, and it will work, even though both shells claim to have a current directory of /usr/src/linux. |
|
Back to top |
|
|
wootan n00b
Joined: 10 Dec 2024 Posts: 12
|
Posted: Sat Dec 14, 2024 9:48 am Post subject: |
|
|
NeddySeagoon wrote: | Slotting is Gentoos way of allowing multiple versions of the same package to be installed at the same time.
Few packages are slotted as it's a lot of developer work but the kernel is one of them.
A gentoo package is identified by its <category>/<package>-<version>:<slot>::<repo>
emerge -av ... shows you all the bits.
To get an old kernel back, emerge gentoo-sources:<slot>
emerge =gentoo-sources-version works too.
From your error you are not in the new kernel tree.
make tries to run in the present working directory. To see that, do $PWD and ignore the error.
You need to cd to /usr/src/linux before running make.
It helps us help you if you copy/paste commands and output into you posts, so we see what you saw.
Use wgetpaste for big things and post the link. |
wow, thank you for this explanation!!! thank you for taking the time to do that!
ok I will take that valuable direction, the next time i get stuck! thank you!
Hu wrote: | wootan wrote: | lol, guys. I have no idea how its working but its working now. | As a guess, since your preceding post seems like you did all the right steps, perhaps you had two shells open. In one of them, you entered /usr/src/linux while that pointed to the old 6.6.58-r1 (before you corrected the symlink), then set aside that shell. In the other, you did all the work you described above, causing /usr/src/linux to now point to the new kernel. However, the value of /usr/src/linux matters at the time it is traversed, so that older shell that you set aside is still effectively in the directory that linux pointed to when the shell ran cd. Since I posit that the older shell is in the older 6.6.58-r1 directory, then yes, it would be missing Makefile and other things. When you traverse the updated symlink, you will find yourself in the new 6.6.62 directory, which has the files you need, and it will work, even though both shells claim to have a current directory of /usr/src/linux. |
Fin Brilliant. could absolutely be this! how on earth did you piece that together?! |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54642 Location: 56N 3W
|
Posted: Sat Dec 14, 2024 10:52 am Post subject: |
|
|
wootan,
We all remember our experiences at the. school of 'hard knocks' as we climbed the Gentoo learning curve.
Having been there, done that we can help you on your way.
Always remember that experience is what you get just after you needed it. :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22870
|
Posted: Sat Dec 14, 2024 11:44 am Post subject: |
|
|
wootan wrote: | Fin Brilliant. could absolutely be this! how on earth did you piece that together?! | I have seen enough weird things related to the "current" working directory not being what it appears that the scenario I described seemed like the most likely.
You have yet to see a related and more confusing scenario. It's legal to have a shell parked in a directory that no longer even exists, leading to weird errors: Code: | $ mkdir a
$ cd a
$ rmdir ../a
$ > b
-bash: b: No such file or directory
| Yes, you get ENOENT trying to create a file in the current directory. Similarly, you can get: Code: | $ cd /tmp
$ mkdir a
$ cd a
$ rmdir ../a
$ cd "$PWD"
-bash: cd: /tmp/a: No such file or directory
$ cd .
cd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
$ pwd
/tmp/a/. |
After seeing failures like that more times than I can count (usually due to having left behind a shell in a directory tree that I no longer needed, and so deliberately removed with rm -r), the idea of an errant shell seemed the most likely. |
|
Back to top |
|
|
wootan n00b
Joined: 10 Dec 2024 Posts: 12
|
Posted: Sun Dec 15, 2024 10:22 am Post subject: |
|
|
NeddySeagoon wrote: | wootan,
We all remember our experiences at the. school of 'hard knocks' as we climbed the Gentoo learning curve.
Having been there, done that we can help you on your way.
Always remember that experience is what you get just after you needed it. |
i've never heard it put that way. no arguing with that!
Hu wrote: | wootan wrote: | Fin Brilliant. could absolutely be this! how on earth did you piece that together?! | I have seen enough weird things related to the "current" working directory not being what it appears that the scenario I described seemed like the most likely.
You have yet to see a related and more confusing scenario. It's legal to have a shell parked in a directory that no longer even exists, leading to weird errors: Code: | $ mkdir a
$ cd a
$ rmdir ../a
$ > b
-bash: b: No such file or directory
| Yes, you get ENOENT trying to create a file in the current directory. Similarly, you can get: Code: | $ cd /tmp
$ mkdir a
$ cd a
$ rmdir ../a
$ cd "$PWD"
-bash: cd: /tmp/a: No such file or directory
$ cd .
cd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
$ pwd
/tmp/a/. |
After seeing failures like that more times than I can count (usually due to having left behind a shell in a directory tree that I no longer needed, and so deliberately removed with rm -r), the idea of an errant shell seemed the most likely. |
thats some high ranking Sh. def earned the stripes
maybe someday, i too, will be reminiscing such things |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54642 Location: 56N 3W
|
Posted: Sun Dec 15, 2024 11:28 am Post subject: |
|
|
wootan,
It works like that as Linux lets you do anything to a file that is in use.
Delete it, rename it, whatever.
That works as when a process uses a file, it gets a file descriptor to the file and the kernel increments the reference count by one.
When a file is deleted, the directory entry is removed, the reference count decremented by one but if the file is still in use, it is not yet removed, as the reference count is not zero, so the kernel knows that it's still in use.
With the directory entry gone, no new processes can access the file.
Directories are just files too.
This has some interesting consequences too, besides the ones you have already stumbled over.
1. When you Code: | rm a_big_log_that_is_using_all_my_free_space.log | the file is not removed, so you don't get your space back until you restart the process that is writing to a_big_log_that_is_using_all_my_free_space.log
2. When you mess up and Code: | rm a_very_important_open_file | if you know the process that has the file open, you can get it back again as you can discover the file descriptor and copy it from there. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|
|
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
|
|