PDA

View Full Version : can't find downloaded file when i switch to root user



ub007
18th November 2008, 12:01 PM
Hi,

I'm trying to build a new kernel.

$wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.15.7.tar.gz
100% ----blah blah

$mv linux-2.6.15.7.tar.gz /usr/src
Permission denied.

$su -root
#mv linux-2.6.15.7.tar.gz /usr/src
#cannot stat ' linux-2.6.15.7.tar.gz ' : No such file or directory.

Well,where has the file disappeared?It surely must be there somewhere...how do i access it?

Thanks in advance
David

markkuk
18th November 2008, 12:06 PM
The file hasn't disappeared, it's exactly where you left it. "su -" changes your current directory to the root user's home directory (by default "/root") and you must use the cd command to change back to wherever you placed the downloaded file.

glennzo
18th November 2008, 12:08 PM
You probably have a different path when you changed to root so the file is not "locateable". You could run updatedb and then type locate linux-2.6.15.7.tar.gz. That should find the file for you. You could change to the location (folder) where the file was saved when downloaded and then run the command. In short, it didn't disappear, root just can't find it. In fact, your regular user probably couldn't find it via a search if it's not part of the locate database. Best bet is to just run updatedb as root and then locate or find the file.

Drat! Too slow again. Good morning markkuk :)

ub007
18th November 2008, 12:24 PM
Yep,I can find it now. :) I was doing locate linux-2.6.15.7.tar.gz without updatedb

glennzo
18th November 2008, 12:36 PM
Typically it should have saved in the designated download folder if you downloaded the file using Firefox. Is it in /home/ub007/Downloads ??

ub007
18th November 2008, 01:00 PM
didnt use Firefox.It was found in /home/david/ ,not in /home/david/Download

I tried to compile the kernel following the steps:

#mv linux-2.4.32.tar.gz /usr/src
#cd /usr/src
#tar zxvf linux-2.4.32.tar.gz
#cd linux-2.4.32.tar.gz
linux-2.4.32.tar.gz #make menuconfig //didnt make any changes
linux-2.4.32.tar.gz #make dep
linux-2.4.32.tar.gz #make

make: *** [init/main.o] Error 1

Stuck here.....I got a similar error when trying to compile linux-2.6.15.7.tar.gz ,thats y tried a different version.......What am i missing here?

glennzo
18th November 2008, 01:02 PM
You're trying to compile a custom kernel?

ub007
18th November 2008, 01:10 PM
You're trying to compile a custom kernel?

Yes,but initially wanted to see how it works,so downloaded the old 2.4 version and was trying to build it


I should have made it more clear..
#make // goes on for a while and then comes up with


/usr/src/linux-2.4.32/include/asm/mpspec.h:87: warning: ‘packed’ attribute ignored for field of type ‘unsigned char[6]’
make: *** [init/main.o] Error 1

glennzo
18th November 2008, 01:17 PM
Don't know a lot about building kernels. Been a long time since I've played with that stuff. I believe that you need, at a minimum, things like kernel-devel, kernel-headers, gcc, etc. Can this be done with success on a system running a different kernel version?

ub007
18th November 2008, 01:39 PM
kernel-devel, kernel-headers, gcc - Yep,i have all that installed.....Tried googling for solutions,no luck yet......



Can this be done with success on a system running a different kernel version? :confused:

glennzo
18th November 2008, 01:46 PM
What you need is for a kernel building guru to step in here and help you out.

notageek
18th November 2008, 02:04 PM
Hello ub007,

Not sure what is going on here (and I'm not an expert) can you please try this



# make allmodconfig
# make dep
# make bzImage

Assuming of-course you're doing this for fun.

Edit: Also could help others who read this thread, if you could post the full error message.

Edit-2: A little more detail please. What is the CPU of the machine? (amd, intel, ppc etc)

ub007
18th November 2008, 06:58 PM
Thanks Notageek for offering help.


# make allmodconfig


[root@localhost linux-2.4.32]# make allmodconfig
make: *** No rule to make target `allmodconfig'. Stop.
[root@localhost linux-2.4.32]#

Full error msg:


[root@localhost linux-2.4.32]# make
scripts/split-include include/linux/autoconf.h include/config
gcc -D__KERNEL__ -I/usr/src/linux-2.4.32/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -fno-unit-at-a-time -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
In file included from /usr/src/linux-2.4.32/include/linux/prefetch.h:14,
from /usr/src/linux-2.4.32/include/linux/list.h:7,
from /usr/src/linux-2.4.32/include/linux/wait.h:15,
from /usr/src/linux-2.4.32/include/linux/fs.h:13,
from /usr/src/linux-2.4.32/include/linux/capability.h:18,
from /usr/src/linux-2.4.32/include/linux/binfmts.h:6,
from /usr/src/linux-2.4.32/include/linux/sched.h:10,
from /usr/src/linux-2.4.32/include/linux/mm.h:5,
from /usr/src/linux-2.4.32/include/linux/slab.h:15,
from /usr/src/linux-2.4.32/include/linux/proc_fs.h:6,
from init/main.c:16:
/usr/src/linux-2.4.32/include/asm/processor.h:75: error: array type has incomplete element type
In file included from /usr/src/linux-2.4.32/include/linux/fs.h:323,
from /usr/src/linux-2.4.32/include/linux/capability.h:18,
from /usr/src/linux-2.4.32/include/linux/binfmts.h:6,
from /usr/src/linux-2.4.32/include/linux/sched.h:10,
from /usr/src/linux-2.4.32/include/linux/mm.h:5,
from /usr/src/linux-2.4.32/include/linux/slab.h:15,
from /usr/src/linux-2.4.32/include/linux/proc_fs.h:6,
from init/main.c:16:
/usr/src/linux-2.4.32/include/linux/ncp_fs_i.h:26: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp_fs_i.h:27: warning: ‘packed’ attribute ignored for field of type ‘__u8[6]’
In file included from /usr/src/linux-2.4.32/include/linux/ncp_mount.h:13,
from /usr/src/linux-2.4.32/include/linux/ncp_fs_sb.h:13,
from /usr/src/linux-2.4.32/include/linux/fs.h:734,
from /usr/src/linux-2.4.32/include/linux/capability.h:18,
from /usr/src/linux-2.4.32/include/linux/binfmts.h:6,
from /usr/src/linux-2.4.32/include/linux/sched.h:10,
from /usr/src/linux-2.4.32/include/linux/mm.h:5,
from /usr/src/linux-2.4.32/include/linux/slab.h:15,
from /usr/src/linux-2.4.32/include/linux/proc_fs.h:6,
from init/main.c:16:
/usr/src/linux-2.4.32/include/linux/ncp.h:24: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:25: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:26: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:27: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:28: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:29: warning: ‘packed’ attribute ignored for field of type ‘__u8[]’
/usr/src/linux-2.4.32/include/linux/ncp.h:37: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:38: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:39: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:40: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:41: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:42: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:43: warning: ‘packed’ attribute ignored for field of type ‘__u8[]’
/usr/src/linux-2.4.32/include/linux/ncp.h:137: warning: ‘packed’ attribute ignored for field of type ‘__u8’
/usr/src/linux-2.4.32/include/linux/ncp.h:138: warning: ‘packed’ attribute ignored for field of type ‘__u8[256]’
/usr/src/linux-2.4.32/include/linux/ncp.h:174: warning: ‘packed’ attribute ignored for field of type ‘__u8’
In file included from /usr/src/linux-2.4.32/include/asm/smp.h:18,
from /usr/src/linux-2.4.32/include/linux/smp.h:15,
from /usr/src/linux-2.4.32/include/linux/sched.h:24,
from /usr/src/linux-2.4.32/include/linux/mm.h:5,
from /usr/src/linux-2.4.32/include/linux/slab.h:15,
from /usr/src/linux-2.4.32/include/linux/proc_fs.h:6,
from init/main.c:16:
/usr/src/linux-2.4.32/include/asm/mpspec.h:87: warning: ‘packed’ attribute ignored for field of type ‘unsigned char[6]’
make: *** [init/main.o] Error 1
[root@localhost linux-2.4.32]#

-CPU is intel.

Thanks,
David

notageek
18th November 2008, 07:10 PM
Does "make help" work?

please look for ".config" by running "ls -a" from the source directory of the kernel

Edit: Also is there a "Makefile" in the source folder?

Edit: I just tried myself with the same kernel version, and get the same error. I'm afraid I don't know why this version would not compile. I suggest you download the latest 2.6 kernel and give that a try. The steps you tried works almost always. Must be something to do with this one.

ub007
18th November 2008, 11:37 PM
Does "make help" work?

please look for ".config" by running "ls -a" from the source directory of the kernel

Edit: Also is there a "Makefile" in the source folder?

Edit: I just tried myself with the same kernel version, and get the same error. I'm afraid I don't know why this version would not compile. I suggest you download the latest 2.6 kernel and give that a try. The steps you tried works almost always. Must be something to do with this one.

-make help works
-.config exists
-Makefile exists as well

My current Fedora installation is the latest 2.6 version.Thats y I'm trying the older kernels.
My friend says 'There have been a few changes in the latest kernels and how they can be built' -I dont know what that is until I get to meet him,hehe

notageek
19th November 2008, 04:42 AM
You can still try installing 2.6 kernel, it will not overwrite your existing kernel if that's your concern.

Building the kernel itself will not damage your existing installation. just call make bzImage and make modules instead of make (which I think does install).

Download the latest from www.kernel.org and give it a try. Most of the steps you're trying are ok, except in 2.6 you don't have to run make dep.

A very useful guide used to be found here : http://tldp.org/HOWTO/Kernel-HOWTO/

Seems like the its under construction or something, in the mean time check out scottro's guide to kernel building.
http://home.nyc.rr.com/computertaijutsu/kernel.html

n3t
19th November 2008, 06:11 AM
You probably have a different path when you changed to root so the file is not "locateable". You could run updatedb and then type locate linux-2.6.15.7.tar.gz. That should find the file for you. You could change to the location (folder) where the file was saved when downloaded and then run the command. In short, it didn't disappear, root just can't find it. In fact, your regular user probably couldn't find it via a search if it's not part of the locate database. Best bet is to just run updatedb as root and then locate or find the file.

Drat! Too slow again. Good morning markkuk :)

updatedb is my friend!

ub007
19th November 2008, 11:59 PM
You can still try installing 2.6 kernel, it will not overwrite your existing kernel if that's your concern.

Building the kernel itself will not damage your existing installation. just call make bzImage and make modules instead of make (which I think does install).

Download the latest from www.kernel.org and give it a try. Most of the steps you're trying are ok, except in 2.6 you don't have to run make dep.

A very useful guide used to be found here : http://tldp.org/HOWTO/Kernel-HOWTO/

Seems like the its under construction or something, in the mean time check out scottro's guide to kernel building.
http://home.nyc.rr.com/computertaijutsu/kernel.html

Thanks for the links Notageek.I tried to build a kernel on Ubuntu.Initially I got similar errors to Fedora.However I was able to fix it by installing ncurses.


sudo apt-get install libncurses5-dev and then everythin worked fine.

I tried to do this on fedora:


root@localhost ~]# yum install ncurses
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
Package ncurses-5.6-16.20080301.fc9.i386 already installed and latest version
Nothing to do

This means ncurses is already installed or is it some different package that I need to install for Fedora.Or is just the v2.4 kernel thats the issue.I'll try the 2.6 v tomm.

Cheers
David

notageek
20th November 2008, 05:11 AM
Ah, you tried installing ncurses, you should try installing "ncurses-dev" as you did in Ubuntu. They are not the same packages. Try this before you try another kernel.

Check this


# yum search ncurses

ub007
20th November 2008, 07:58 AM
Tried that,no luck though


[
root@localhost ~]# yum install ncurses-dev
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
No package ncurses-dev available.
Nothing to do
[root@localhost ~]#



[root@localhost ~]# yum search ncurses

Loaded plugins: refresh-packagekit
=============================== Matched: ncurses ===============================
mtr.i386 : A network diagnostic tool
aumix.i386 : Audio mixer based on ncurses
bombardier.i386 : The GNU Bombing utility
cscope.i386 : C source code tree search and browse tool
ekg.i386 : A client compatible with Gadu-Gadu
ettercap.i386 : Network traffic sniffer/analyser, NCURSES interface version
ettercap-common.i386 : Common files for Ettercap, Network traffic
: sniffer/analyser
finch.i386 : A text-based user interface for Pidgin
libpfm-devel.i386 : the Linux performance library (libpfm) development files.
lpsk31.i386 : A ncurses application for ham radio communications using PSK31
: digital mode
mikmod.i386 : Music module player
multitail.i386 : View one or multiple files like tail but with multiple windows
mybashburn.noarch : Burn data and create songs with interactive dialogs
naim.i386 : An ncurses-based console AIM, ICQ, IRC, and Lily client
ncurses.i386 : Ncurses support utilities
ncurses-base.i386 : Descriptions of common terminals
ncurses-devel.i386 : Development files for the ncurses library
ncurses-libs.i386 : Ncurses libraries
ncurses-static.i386 : Static libraries for the ncurses library
ncurses-term.i386 : Terminal descriptions
ocaml-curses.i386 : OCaml bindings for ncurses
perl-Curses.i386 : Perl bindings for ncurses
pgp-tools.noarch : Collection of several utilities related to OpenPGP
php-ncurses.i386 : A module for PHP applications for using ncurses interfaces
pinfo.i386 : An info file viewer
pork.i386 : Console based AIM client that looks like ircII
rtorrent.i386 : BitTorrent client based on libtorrent
ruby-ncurses.i386 : A module for ruby applications for using ncurses interfaces
snownews.i386 : A text mode RSS/RDF newsreader
tack.i386 : Terminfo action checker
wyrd.i386 : A ncurses frontend for the calendar application remind

notageek
20th November 2008, 08:03 AM
ncurses.i386 : Ncurses support utilities
ncurses-base.i386 : Descriptions of common terminals
ncurses-devel.i386 : Development files for the ncurses library
ncurses-libs.i386 : Ncurses libraries
ncurses-static.i386 : Static libraries for the ncurses library
ncurses-term.i386 : Terminal descriptions

The above are the packages of interest, so the dev package for ncurses is "ncurses-devel", try this:


# yum install ncurses-devel

Before that check if ncurses-devel is really installed, by running


# yum list installed |grep ncurses

If it still fails, then try a new kernel. I'm out of ideas. :D

ub007
20th November 2008, 08:16 AM
Yep,I had already tried
yum list | grep ncurses | grep installed

ncurses-devel is installed. Will try the new kernel :cool: