Linux-Development-Sys Digest #258, Volume #8      Mon, 6 Nov 00 06:13:14 EST

Contents:
  Re: Whats an 'unresolved symbol' ? ("D. Stimits")
  Re: Whats an 'unresolved symbol' ? ("D. Stimits")
  Triton problem with 2.2.X... (Daniel =?iso-8859-1?Q?Fern=E1ndez?= Garrido)
  Re: How to decompress debian package? Pls help (Denis BRAUSSEN)
  Re: How to decompress debian package? Pls help ([EMAIL PROTECTED])
  Re: ext2 undelete (MENON Jean-Francois)
  Re: ext2 undelete (MENON Jean-Francois)
  Re: ext2 undelete (MENON Jean-Francois)
  Re: mounting RAMFS as / ([EMAIL PROTECTED])
  Re: Can I create a floppy with a simple Linux? (Alan Po)
  Project planning utilities in Linux ("Sandeep Koranne")
  Re: mounting RAMFS as / ([EMAIL PROTECTED])
  Is that process a thread? (George MacDonald)
  Re: ext2 undelete ([EMAIL PROTECTED])

----------------------------------------------------------------------------

Date: Sun, 05 Nov 2000 13:29:05 -0700
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: Whats an 'unresolved symbol' ?

"J.Smith" wrote:
> 
> Thanks for the info. Cause although I am a non-programmer (does
> shell-scripting count? ;), I am aware of some basic programming concepts,
> and this explanation is just the right level of 'technical-detail' I needed.
> 
> But just to make sure I understand correctly, let me check it here:
> Basically it means that the piece of code is trying to call a subroutine or
> function that is not contained in the executable itself, but that lives
> elsewhere on the system, like in a shared library. And fails to find it.
> Right?

Correct. It could be further classified as a piece of binary code, as
opposed to shell scripts.

> 
> So, if one has the sources and binary for the executable that generates the
> error, is it possible for a non-programmer to 'quick-n-dirty' find out what
> function/symbol the program is looking for, and where the program is trying
> to find the function? For example, can I find out in what library the
> program is trying to locate the function? Or even verify that the function
> exists in that library? For example, could it be usefull to use something
> like 'ldd' or even 'grep functionname *.c' to get me some rudimentary info
> that would help me in futher troubleshooting issues like these?

In the case of kernel modules, the module itself will fail to load and
mention unresolved symbols. Naming and locations for System.map can
change to support with or without the kernel version being appended to
System.map, and also the file can be placed in more than one directory
(it is searched for in different paths depending on the program looking
for it; I think all programs will search for System.map.SomeVariation in
both /boot/ and /usr/src/linux/). If you directly view the contents of
System.map, you'll see the kernel symbols of a particular kernel
configuration.

For executable programs, you could easily find out which librarys it
thinks it wants via:
cd <dir of progname>
ldd <progname>

Then compare that to what the linker says it has in its search path
(which is mainly via /etc/ld.so.conf):
ldconfig -p | less

If the expected library is present, but the symbol isn't found in it,
then likely you have a major version change between the one it wants and
what is present. The symbols in a lib file (such as /lib/libc.so.6) can
be viewed with nm. If it is a C++ lib, you will want to try to demangle
it via piping nm's output through c++filt when looking for the demangled
name (somethign you don't worry about in C libs). If it is a C++ lib,
the program itself will be looking for mangled names.

Some samples from libc.so.6:
cd /lib
nm libc.so.6 | less

Searching through the output, you will see the 2nd column has a single
letter in it, giving some info about the symbol. The type "U" is one
referenced by the lib, which the lib needs for some other function (this
lib is calling another lib), but which is not defined here. So finding
"U" actually means this symbol is not fulfilled here. Typically the
names in the next column which start with underscore have some function
not normally used by the average program...the ones without the
underscore at the start are the main ones you find in man pages. Looking
for "printf" you will find a lot of functions with underscores, but only
a few that don't start with underscore. For a C++ lib, such as:
/usr/lib/libstdc++.so.2.8.0

View with:
cd /usr/lib
nm libstdc++.so.2.8.0 | c++filt | less

A sample there is that you will find class ofstream functions, such as
the constructor:
ofstream::ofstream(int)

If you get a link error at compile time for a C++ program, it will be
looking for the demangled name (the one you see with c++filt) in the
intermediate .o files, whereas failures at runtime (the system's dynamic
linker is being used instead of the compiler) it will probably indicate
failure in terms of the mangled name (compare nm of libstdc++ with and
without c++filt; c++filt is a demangler) in the lib files. The reason
for name mangling here is to support C++ abilities to work with
namespaces and operator overloading, whereas the linker only directly
supports C linkage.

------------------------------

Date: Sun, 05 Nov 2000 13:31:16 -0700
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: Whats an 'unresolved symbol' ?

"D. Stimits" wrote:
> 
> "J.Smith" wrote:
> >
...
> For executable programs, you could easily find out which librarys it
                                                           ^^^^^^^^

Eek! Spelling error. Sorry.

------------------------------

From: Daniel =?iso-8859-1?Q?Fern=E1ndez?= Garrido <[EMAIL PROTECTED]>
Subject: Triton problem with 2.2.X...
Date: Mon, 06 Nov 2000 01:03:52 GMT


   Hello everyone.

   I'm trying to compile a 2.2 kernel on a Pentium machine with a TX
chipset and a i82371 Triton PCI.

   When I use a 2.0.36 kernel and activate the triton module, it works
perfectly. But when I build a 2.2.17 (or 2.2.12, or any 2.2.X) that
module does not exist, but it exists a Generic DMA bus mastering module
instead.
   I enable this module and when the kernel starts, it crashes. It just
reboots the machine after checking PCI and saying he has encountered a
PIIX4 and trying to detect hda (I can't read many things here, it's
reboots really fast!).

   Is this normal? What can be the reason? The generic bus mastering
module is supposed to support the Triton... so I've got a machine where
I can run 2.0.36, but not 2.2.17!!!...

   In case it helps you, here's the output I get when the kernel detects
correctly the triton on 2.0.36:

ide: i82371 PIIX (Triton) on PCI bus 0 function 57
         ide0: BM-DMA at 0xf000-0xf007
         ide1: BM-DMA at 0xf008-0xf00f


   Thank's a lot for your attention.

   Greetings from Spain.

---
Daniel Fern�ndez Garrido
[EMAIL PROTECTED]



------------------------------

From: Denis BRAUSSEN <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc,comp.os.linux.setup,comp.os.linux.development.apps
Subject: Re: How to decompress debian package? Pls help
Date: Mon, 06 Nov 2000 04:35:44 GMT

>>>>> "AP" == Alan Po <[EMAIL PROTECTED]> writes:

  AP> I have got a ash file but is in debain package (deb extension). I don't
  AP> know how to decompress under Red Hat. Would you give me help? Thanks a
  AP> lot

  You can use mc (midnight commander). it will read *.deb (or rpm, tar,
  tgz, ...) like virtual filesystems. So you will be able to read or
  extract any file you want.


-- 
                    GPG/PGP DH/DSS ID: 0xB0212BAC -lord.keyserver.net-
AmicaLinuXement     /(_M_)\       .--------------------.       /(_M_)\ 
Denis              |       |     ( POWERED BY GNU/LINUX )     |       |
                    \/~V~\/       `--------------------'       \/~V~\/

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.misc,comp.os.linux.setup,comp.os.linux.development.apps
Subject: Re: How to decompress debian package? Pls help
Date: Mon, 06 Nov 2000 05:05:22 GMT

Denis BRAUSSEN <[EMAIL PROTECTED]> writes:
> >>>>> "AP" == Alan Po <[EMAIL PROTECTED]> writes:
>   AP> I have got a ash file but is in debain package (deb extension). I don't
>   AP> know how to decompress under Red Hat. Would you give me help? Thanks a
>   AP> lot
> 
>   You can use mc (midnight commander). it will read *.deb (or rpm, tar,
>   tgz, ...) like virtual filesystems. So you will be able to read or
>   extract any file you want.

Alternatively, you can use "ar" (the GNU Binutils "archiver") to take
a look at what's in a .deb file:
% ar t xli_1.17.0.2_i386.deb
debian-binary
control.tar.gz
data.tar.gz
% ar x xli_1.17.0.2_i386.deb
% ls -l
total 137
-rw-r--r--    1 root     root         1214 Nov  5 23:02 control.tar.gz
-rw-r--r--    1 root     root       135806 Nov  5 23:02 data.tar.gz
-rw-r--r--    1 root     root            4 Nov  5 23:02 debian-binary

data.tar.gz contains, via "tar tfvz data.tar.gz"
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/bin/
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/sbin/
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/X11R6/
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/X11R6/lib/
drwxr-xr-x root/root         0 2000-10-30 22:46:54 ./usr/X11R6/bin/
-rwxr-xr-x root/root    211804 2000-10-30 22:46:54 ./usr/X11R6/bin/xli
-rwxr-xr-x root/root      7004 2000-10-30 22:46:54 ./usr/X11R6/bin/xlito
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/X11R6/man/
drwxr-xr-x root/root         0 2000-10-30 22:46:56 ./usr/X11R6/man/man1/
-rw-r--r-- root/root      9973 2000-10-30 22:46:53 ./usr/X11R6/man/man1/xli.1.gz
-rw-r--r-- root/root      2047 2000-10-30 22:46:53 ./usr/X11R6/man/man1/xlito.1.gz
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/share/
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/share/doc/
drwxr-xr-x root/root         0 2000-10-30 22:46:56 ./usr/share/doc/xli/
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/share/doc/xli/examples/
-rw-r--r-- root/root     14089 2000-10-30 22:46:53 
./usr/share/doc/xli/examples/chkgamma.jpg
-rw-r--r-- root/root      1185 2000-02-13 06:45:55 ./usr/share/doc/xli/copyright
-rw-r--r-- root/root      2229 2000-02-13 06:45:55 ./usr/share/doc/xli/README.debian.gz
-rw-r--r-- root/root      2172 2000-02-09 03:23:32 ./usr/share/doc/xli/README.gz
-rw-r--r-- root/root      1375 2000-10-30 22:42:48 
./usr/share/doc/xli/changelog.Debian.gz
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/lib/
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/lib/mime/
drwxr-xr-x root/root         0 2000-10-30 22:46:53 ./usr/lib/mime/packages/
-rw-r--r-- root/root      1600 2000-10-30 22:46:53 ./usr/lib/mime/packages/xli

The control file contains:
drwxr-xr-x root/root         0 2000-10-30 22:46:57 ./
-rwxr-xr-x root/root       270 2000-10-30 22:46:53 ./postinst
-rwxr-xr-x root/root        75 2000-02-13 06:45:55 ./postrm
-rwxr-xr-x root/root       152 2000-10-30 22:46:53 ./prerm
-rw-r--r-- root/root       631 2000-10-30 22:46:56 ./md5sums
-rw-r--r-- root/root       673 2000-10-30 22:46:57 ./control

which represents the files that Debian's dpkg uses to control the
installation and deinstallation processes.
-- 
(concatenate 'string "cbbrowne" "@hex.net") <http://www.ntlug.org/~cbbrowne/>
For a good prime call: 
   391581 * 2^216193 - 1 
-- [EMAIL PROTECTED] (Szymon Rusinkiewicz) 

------------------------------

From: MENON Jean-Francois <[EMAIL PROTECTED]>
Subject: Re: ext2 undelete
Date: Mon, 06 Nov 2000 05:48:36 +0000

"Dr H. T. Leung" wrote:
> 
> Well, there is the Ext2-Undelete HOWTO on LDP, and it is probably in your hard
> disc. If you do "+linux +undelete" on Altavista, you would find a KDE/GTK/gnome
> utility that can do disaster recovery and undeleting files. May not be what you
> want, but then, you might want to look at them.
> 

yes, it is after reading it that I had the idea of my "rm" command: 
He explain that you can retrieve much of the data while the "indirect
blocks" are not overwritten. So my prog keep the list of the data blocks
of the file deleted, to have an easy recover if needed, and not use much
disk space. :->

------------------------------

From: MENON Jean-Francois <[EMAIL PROTECTED]>
Subject: Re: ext2 undelete
Date: Mon, 06 Nov 2000 05:54:19 +0000


> 
> | I'm working on a kind of undelete for ext2 fs. I would like to know if
> | there is other people working on the same problem.
> 
> I don't know of a problem.

just lose important files and you will see .... ;->
> 
> | I would like to know how I can override the "unlink" function with my
> | own function?
> 
> Do you want to do this across all filesystem types?  Or just for ext2
> only? 

good question: just ext2

> If your intent is to change the behaviour of unlink() to move a
> file to a garbage area

only the list of data blocks

> and later empty the garbage, you need to consider
> a lot of things about how this should work.
> 
> 1.  How will you empty the garbage?

cron seems good for that
> 
> 2.  What do you want unlink() to do is it is a file with multiple links?

well ... (re-good question)

> | (my "rm" command already works) It seems to be somthing with ldconfig,
> | but I'm not sure.
> 
> With ldconfig you can change libraries around and use a different one.
> Is that how you are intending to replace unlink()?
> 
> --
something like that. I'm looking for the best way to implement my
undelete idea.
maybe directly in patching the ext2fs in the kernel but I don't know
very much about that. maybe someone have already done this? 

-- 
 - Les propos tenus ici n'engagent que ceux qui les lisent.

 "Il y a tellement de choses qu'on voudrait avoir faites
 hier et si peu qu'on a envie de faire aujourd'hui."
                                             [ Mignon MacLaughlin ]

------------------------------

From: MENON Jean-Francois <[EMAIL PROTECTED]>
Subject: Re: ext2 undelete
Date: Mon, 06 Nov 2000 05:55:29 +0000

David Welch wrote:
> 
> MENON Jean-Francois wrote
> >
> >I would like to know how I can override the "unlink" function with my
> >own function?
> >(my "rm" command already works) It seems to be somthing with ldconfig,
> >but I'm not sure.
> >
> If you put the name of a shared library in the environment variable
> LD_PRELOAD then it is loaded after all the libraries that a program
> requires and can override functions in those libraries. That wouldn't
> work for statically linked programs or those that call system calls
> directly.

yes it seems to be what I was looking. 

thanks all for your answers and advices.


-- 
 - Les propos tenus ici n'engagent que ceux qui les lisent.

 "Il y a tellement de choses qu'on voudrait avoir faites
 hier et si peu qu'on a envie de faire aujourd'hui."
                                             [ Mignon MacLaughlin ]

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: mounting RAMFS as /
Date: Mon, 06 Nov 2000 08:35:23 GMT

[EMAIL PROTECTED] wrote:
: I would like to mount RAMFS (CONFIG_RAMFS) as / (not RAMDISK).  I can
: populate RAMFS from within /linuxrc (which would be started from INITRD).
: But the problem is, how do I tell the kernel that the root device is
: RAMFS when there is no major/minor (apparently) associated with it?
: What would I write into /proc/sys/kernel/real-root-dev to do this?

Use the new pivot_root system call.

        Jeff


-- 
Jeff Garzik             | Dinner is ready when
Building 1024           | the smoke alarm goes off.
MandrakeSoft            |       -/usr/games/fortune

------------------------------

From: Alan Po <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.questions
Subject: Re: Can I create a floppy with a simple Linux?
Date: Mon, 06 Nov 2000 16:33:07 +0800

Alan Po wrote:

> Dear All
>
> I want to create a simple Linux which boot from a floopy. For this Linux, I
> only need a shell and simple login. No need to run any other application. Is
> it possible?
>
> Please give me some advice. Thanks a lot
>
> Alan Po
> [EMAIL PROTECTED]

Dear All

Really thanks to all reply and give me a lot of information on building a boot
disk manually. However, up to now, I am fail :-(. As a summary, I share my
experience in this case:

1. The most useful infomation is Bootdisk-Howto.
2. When I try to use lilo "lilo -v -C lilo.conf -r /mnt/floppy", it say the
zImage too big. I think the reason is the kernel size of 2.2.17 to too big
(480k).
3. The whole processes are too complicate and contain a lot of unknown value
such as "dd" command and block value.
4. Root File System may be my another problem. I use tranfer kernel without
LiLo, seems to work but after loading something "Loading .......", the system
reboot.

I am very tired but this is my final year project :-(! I will try my best and
hope all can support me.

Thanks again, bye.

Alan Po
[EMAIL PROTECTED]



------------------------------

From: "Sandeep Koranne" <[EMAIL PROTECTED]>
Subject: Project planning utilities in Linux
Date: Mon, 6 Nov 2000 09:50:31 +0100

Hi All,
    I am a single person developing small (medium) size programs in Linux at
home for personal pleasure, but I would like to use a project tracking
system to help me get things managed better.
It should support HTML output and be simple to use.
Any pointers ?

TIA
Sandeep Koranne



------------------------------

From: [EMAIL PROTECTED]
Subject: Re: mounting RAMFS as /
Date: Mon, 06 Nov 2000 09:57:14 -0000

On Mon, 06 Nov 2000 08:35:23 GMT [EMAIL PROTECTED] wrote:

| [EMAIL PROTECTED] wrote:
| : I would like to mount RAMFS (CONFIG_RAMFS) as / (not RAMDISK).  I can
| : populate RAMFS from within /linuxrc (which would be started from INITRD).
| : But the problem is, how do I tell the kernel that the root device is
| : RAMFS when there is no major/minor (apparently) associated with it?
| : What would I write into /proc/sys/kernel/real-root-dev to do this?
|
| Use the new pivot_root system call.

1.  What do I put in the first argument to pivot_root()?  What would be
    the major,minor number to use if I mknod my own device name?

2.  What impact will this have if the kernel is going to end up moving
    the root on me again, after /linuxrc exits?  IWSTM if I don't change
    the final root setting, it will change it (in init/main.c) for me.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

------------------------------

From: George MacDonald <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Is that process a thread?
Date: Mon, 06 Nov 2000 10:22:07 GMT


Is there an easy way to figure out if a process is a thread? I'm thinking
about adding a new visual representation for threads in treeps. i.e.

        http://www.slip.net/~gmd/tps/treeps.htm

but need a quick way to figure out if an entry in /proc is a thread.

Thanks


-- 
We stand on the shoulders of those giants who coded before.
Build a good layer, stand strong, and prepare for the next wave.
Guide those who come after you, give them your shoulder, lend them your code.
Code well and live!   - [EMAIL PROTECTED] (7th Coding Battalion)

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: ext2 undelete
Date: Mon, 06 Nov 2000 10:49:58 -0000

On Mon, 06 Nov 2000 05:54:19 +0000 MENON Jean-Francois 
<[EMAIL PROTECTED]> wrote:

|> | I would like to know how I can override the "unlink" function with my
|> | own function?
|> 
|> Do you want to do this across all filesystem types?  Or just for ext2
|> only? 
|
| good question: just ext2

Then the decision is whether to implement in ext2 code or vfs code.


|> If your intent is to change the behaviour of unlink() to move a
|> file to a garbage area
|
| only the list of data blocks

How will you track reuse of the blocks?  What about pointers?


|> and later empty the garbage, you need to consider
|> a lot of things about how this should work.
|> 
|> 1.  How will you empty the garbage?
|
| cron seems good for that

If you are just tracking unlinked data, then it's not the garbage data.
OTOH, if you do keep a garbage area, then you could do this logically
across all filesystem types.


|> 2.  What do you want unlink() to do is it is a file with multiple links?
|
| well ... (re-good question)

If you are keeping lost files with filenames, too, you need to deal with
this.  But if you only care about data and not the filename, then you
could just do any saving of the file when the unlink to ref count 0 happens.


|> | (my "rm" command already works) It seems to be somthing with ldconfig,
|> | but I'm not sure.
|> 
|> With ldconfig you can change libraries around and use a different one.
|> Is that how you are intending to replace unlink()?
|> 
|> --
| something like that. I'm looking for the best way to implement my
| undelete idea.
| maybe directly in patching the ext2fs in the kernel but I don't know
| very much about that. maybe someone have already done this? 

Decide how (many ways to do this) you are holding on to deleted files.
One approach is to move the inodes to lost+found once final unlink
(this relinks them) but obvious don't do this if it was unlinked from
lost+found.  Then add some code to steal inodes and really unlink them
from lost+found when space runs out.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to