LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Kernel Recompile - for 13.37 - cp: target '.config' is not a directory (https://www.linuxquestions.org/questions/slackware-14/kernel-recompile-for-13-37-cp-target-%27-config%27-is-not-a-directory-4175484382/)

NightSky 11-12-2013 07:22 PM

Kernel Recompile - for 13.37 - cp: target '.config' is not a directory
 
So far this is what I did - hopefully nothing, wrong.
Code:

root@machine:/usr/src/linux# make mrproper
root@machine:/usr/src/linux# cp /boot/config-generic-smp-2.6.37.6-smp-$(uname -r) /usr/src/linux/.config
cp: target '/usr/src/linux/.config' is not a directory

Is it a syntax error? Should the cp to, be: /usr/src/linux/ ?
I don't want to do anything i can't back out off.

I'm running 13.37 32bit Xfce on Leveno T500 laptop with the Huge.smp I want to rebuild or recompile 2.6.37 using the source that was in /usr/src/linux & config-gerneric-smp-2.6.37.6-smp in /boot. Following
Slackware Linux in 10 easy steps:
http://blog.tpa.me.uk/slackware-kern...guide/#respond It seems so simple. I did this once before but forgot about it.

While referring to AlienBob's wiki:
http://alien.slackbook.org/dokuwiki/...kernelbuilding
As well as, Post on this forum: Kernel Compile Guide for 2.6.0
Thank you for your time & effort it is appreciated.

ljb643 11-12-2013 07:27 PM

Not to be too obvious, but the error message says "/ussr/...", although the command has the correct "/usr". Which was it? Because mistyping the directory would result in "is not a directory", I think.

NightSky 11-12-2013 08:14 PM

lol ... just my transcription. I'm in terminal mode on the laptop as root. The commands were correct. I'm tired by now. Is it too late to bail out for now after:
Code:

root@machine:/usr/src/linux# make mrproper
Thank you

TobiSGD 11-12-2013 08:58 PM

Code:

make mrproper
does nothing else than cleaning up the directory from cruft, it is save to stop here and continue after you got some sleep.
Regarding the command that leads to the error, I would just don't use the uname command, but use Tab-completion instead and look if you still have the problem.

NightSky 11-12-2013 09:46 PM

@TobiSGD What is Tab-completion? And Supper Thanks

TobiSGD 11-12-2013 10:03 PM

Quote:

Originally Posted by NightSky (Post 5063491)
@TobiSGD What is Tab-completion? And Supper Thanks

If you press the Tab-key while typing a command or a path in the command-line the shell will try to auto-complete what you type.
For example, in your case you can type
Code:

cp /bo
and then press the Tab-key, the shell will complete that to
Code:

cp /boot/
If you now continue typing
Code:

cp /boot/con
and press Tab again the shell will again try to auto-complete, but in this case it will (on a standard Slackware install) find more than one possible completion. If you repeatedly press Tab the shell will cycle through all possible completions, just do that until you found the correct file and continue typing your command.
For more info look here: https://en.wikipedia.org/wiki/Command_line_completion

Tab completion is one of the reasons why I use Zsh instead of Bash, since Zsh's completion is far superior to Bash's completion.

NightSky 11-14-2013 02:21 PM

Thanks, tobiSGD for explaining & link. Currently reading the following: http://en.linuxreviews.org/Kernel_Rebuild_Guide
Seems that if there was an existing /usr/src/linux/.config file i wiped it out by issuing the: #:make mrproper -command
If such a file did not exist already then the command:
Code:

cp /boot/config-generic-smp-$(uname -r) /usr/src/linux/.config
Is not exactly a usable command but maybe example of what I need to do, which is copy generic-smp.config from /boot to /usr/src/linux.
Fine, I know what $(name -r) does but why insert it before the to path /usr/src/linux? We know the kernel name & version.

Tab Completion is cool, thanks; But its not that kind of syntax puzzle this command line presents.

Read there will be no .config in /usr/src/linux unless something already has been config and saved. Maybe instead of the $(uname -r) option I need to actually plugin the kernel version.

NightSky 11-16-2013 02:10 PM

Swaped the above command to:
[/CODE]
#cp /boot/config-generic-smp-2.6.37.6-smp /usr/src/linux/.config
[/CODE] this command copied config-generic-smp over to /usr/src/linux/space .config (Directory)? Or /.config no space (a file)? Can't see the difference even when I look at Alien's tut. Thanks

TobiSGD 11-16-2013 02:39 PM

.config has to be a file (and it will be, since the source is a file the copy is also a file) in your kernel-source directory. So, no space.

NightSky 11-16-2013 04:25 PM

@TobiSGD got it :) But it won't copy over to /usr/src/linux/.config
Only will copy over if I leave out .config at the end of 'To Path'? This seems right to you?

*Another thing is puzzling me: According to both sysadmin & docuwiki commands are being issued from the /usr/src/linux directory or folder but its actually a symlink to
/usr/src/linux.2.6.37.6 where the source code resides? So commands from the symlink folder uses what is in linux-2.6.37.6 without changing it? This the way it works?

nconfig is the netconfig command and I'm wondering whether to use it or not since the laptop is setup for wireless?

number22 11-16-2013 04:41 PM

Once you download the new kernel source code .xz package.
mv/cp to /usr/src/ and unzip/package it there(/usr/src), you will have your new kernel source directory.
and then remove the symbolic link of older (linux-version-number), re-links to the new kernel (linux-newer-version#) to linux.

rebuild your new kernel in your new kernel directory not the old, computer is smart, but it can only do what you tell them to do, it can't guess what you might likely to do.

inside of new kenrel directory: make distclean

get official slackware kernel configuration file ( example to build generic-3.10.17 for slackware64 )
Code:

(ftp.slackware.com/pub/slackware/slackware64-current/source/k/config-x86_64/config-generic-3.10.17.x64)
copy this file into new kernel(3.10.17)directory as .config file
make ; make modules_install

get ftp.slackware.com/pub/slackware/slackware64-current/source/k/packaging-x86_64
inside it contains 3 directories, using inside kernel-generic slackbuild scripts to build a slackpkag for installation.
don't forget using kernel-modules's slackbuild script to build kernel-modules of same version.
you need huge package too be on safe side, it for trouble shooting.

DO NOT use upgradepkg to upgrade kernel. Use installpkg
edit your /etc/lilo.conf add your new kernel. keep your old kernel intact, just be safe, testing your new kernel first.
go to /boot; check and make sure links are good.
mkinitrd with your new kernel, add necessary modules into your initrd ram disk.

13.37 version of lilo and mkinitrd don't work with 3.10.17, you need current version source and reompile them with glibc libraries of 13.37
If you using LVM, you might need new version of lvm2 and udev as well

run lilo before your reboot.

good luck

NightSky 11-16-2013 05:36 PM

Thank you number22. I don't want to build new kernel just learning with original installed version. Much later I'll try new one :) I'm not so smart.

TobiSGD 11-16-2013 08:39 PM

Quote:

Originally Posted by NightSky (Post 5065849)
@TobiSGD got it :) But it won't copy over to /usr/src/linux/.config
Only will copy over if I leave out .config at the end of 'To Path'? This seems right to you?

No. It does copy the file (you will see that if you use the -v option for cp), but since the filename (.config) begins with a dot it is a hidden file. You can see it with the -a option for ls.
Quote:

*Another thing is puzzling me: According to both sysadmin & docuwiki commands are being issued from the /usr/src/linux directory or folder but its actually a symlink to
/usr/src/linux.2.6.37.6 where the source code resides? So commands from the symlink folder uses what is in linux-2.6.37.6 without changing it? This the way it works?
/usr/src/linux is usually a link to the source of the currently installed kernel. If you use the cd command to switch to /usr/src/linux the shell will actually change to the real source path, So any changes you make will be present in the actual directory (here /usr/source/linux-2.6.37).
Quote:

nconfig is the netconfig command and I'm wondering whether to use it or not since the laptop is setup for wireless?
Where did you get that nconfig from? I can't find it in the tutorial you linked to.

NightSky 11-16-2013 10:18 PM

@TobiSGD .. thank you so much for explaining all this into one coherent process. We're making progress here
Finally : ls -a shows the .config

nconfig came from man command & research found it in following thread: http://www.linuxquestions.org/questi...estion-911579/ Post #3

Different thread suggests I backup /lib/firmware like this
Code:

mv /lib/firmware /lib/firmware-2.6.36
to make sure I don't lose it. I can do this just from the root command line, don't need to be any special directory? Before I make modules_install.

TobiSGD 11-16-2013 10:31 PM

Quote:

Originally Posted by NightSky (Post 5065958)
nconfig came from man command & research found it in following thread: http://www.linuxquestions.org/questi...estion-911579/ Post #3

nconfig is in this case not a command, but tells the make command which target in the makefile to run. The nconfig target starts a dialog for changing kernel options in a Norton Commander style, you could also use the menuconfig or xconfig targets. There is indeed one option you should change at least, you should add a custom suffix to the kernel version, so that the original modules will not be overwritten when the new ones are installed. You will find that option in the menu under General setup -> Local version - append to kernel release. For example, I use "-sl" for my kernels, but you can use anything you want.

Quote:

Different thread suggests I backup /lib/firmware like this
Code:

mv /lib/firmware /lib/firmware-2.6.36
to make sure I don't lose it. I can do this just from the root command line, don't need to be any special directory? Before I make modules_install.
I never had problems with missing firmware, but of course you can do that, just type it in as is from the command line as root.


All times are GMT -5. The time now is 01:55 AM.