LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-09-2008, 07:13 PM   #1
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Rep: Reputation: 32
custom applications in initrd not found


Hi,

I am customizing my initrd and I have some problems with it.

I made a folder /scripts in /boot/initrd-tree and the scripts in this file are found and executed. But when I copy some binary files from /sbin/ to /boot/initrd-tree/sbin/ or bin/ the files are be found.

I copied "scp" and depending libs or "usplash", but files could not be found during boot. I unpacked initrd.gz and everything is there.

Did I forgot something or is there an additional step which have to be done, when putting some additional applications in the initrd?

Thanks
 
Old 02-10-2008, 12:48 PM   #2
mastemmer
Member
 
Registered: Jul 2007
Distribution: Slackware
Posts: 30

Rep: Reputation: 15
I figure you want these scripts to be run during boot.
The boot operation runs the script init in the root of the initrd image.
You may call your scripts by adding commands to this init.
Since there is no $PATH set yet you must use complete explicit paths to call programs.

M. Stemmer
 
Old 02-10-2008, 01:35 PM   #3
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Original Poster
Rep: Reputation: 32
you did not understand me.

I am playing with initrd out of curiosity. Example:
I compiled "usplash" and copied executables from /sbin/ to /boot/initrd-tree/sbin.

I run "ldd /sbin/usplash":
Code:
	linux-gate.so.1 =>  (0xffffe000)
	libusplash.so => /lib/libusplash.so (0xb7ec4000)
	libc.so.6 => /lib/libc.so.6 (0xb7d82000)
	libdl.so.2 => /lib/libdl.so.2 (0xb7d7e000)
	/lib/ld-linux.so.2 (0xb7f31000)
so I copied /lib/libusplash.so, /lib/libc.so.6, /lib/libdl.so.2 and /lib/ld-linux.so.2 to /boot/inird-tree/lib.

I put in "init" file "/sbin/usplash" to run it during boot ... and I still get "file not found".


I tried also something else, just for fun. I copied /bin/mknod to /boot/initrd-tree/bin/mknod just to see whether this file will be found. I also copied /lib/libc.so.6 and /lib/ld-linux.so.2 to the initrd-tree/lib/ but still "file not found" ...
 
Old 02-10-2008, 01:46 PM   #4
otot555
LQ Newbie
 
Registered: Feb 2008
Posts: 1

Rep: Reputation: 0
Dear malo,

I think you did not express the situation clearly.
can you emphasize more.

thank you
 
Old 02-10-2008, 03:05 PM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,434

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
Since those are shared libs you are copying, you probably need to create and add an ld.so.cache file, or add ldconfig to your binaries and add an ld.so.conf file to the etc dir of the initrd and then run ldconf before running the other binaries which use shared libs.
A better bet is to compile usplash as a statically-linked binary so you don't have to fool with the rest.
 
Old 02-10-2008, 03:13 PM   #6
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Original Poster
Rep: Reputation: 32
ok, one more try

I am trying to add some applications to initrd. But every binary file I add is not found during boot. It is probably a problem with missing libraries, but I did not find the solution.

problem history and root: I was looking for some kind of bootsplash program which have support for user input, because I wanted to let user enter luks-cryptsetup password in some of bootsplash gui and not on command line. "usplash" from ubuntu is able to do this and I decided to test it. I compiled it and copied executables to initrd-tree/sbin. I put a command to run usplash executable in initrd-tree/init, but I always get an error that "usplash" is not found. But the file is there.


1st idea: A few guys on irc#slackware told me to check usplash for missing libraries and include these in initrd. I found missing libs and I copied these in initrd-tree but still the same error.


2nd idea: usplash is maybe somehow invalid. I decided to test with an another file and I copied "mknod" from /bin to initrd-tree/bin. I put a command in initrd-tree/bin to run mknod but I again received the error that the file was not found. "ls" is also in initrd-tree/bin and it can be found (ls is symlink to busybox).

this is the output of "ldd /bin/mknod":
Code:
mm@x31:/boot/initrd-tree/bin$ ldd /bin/mknod 
	linux-gate.so.1 =>  (0xffffe000)
	libc.so.6 => /lib/libc.so.6 (0xb7e46000)
	/lib/ld-linux.so.2 (0xb7fa8000)
I copied all these libs to initrd-tree, made a new initrd, but "mknod" could not be found.


I am obviously doing something wrong... and I hope that you understand what I am trying to explain .
 
Old 02-10-2008, 03:25 PM   #7
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by gnashley View Post
Since those are shared libs you are copying, you probably need to create and add an ld.so.cache file, or add ldconfig to your binaries and add an ld.so.conf file to the etc dir of the initrd and then run ldconf before running the other binaries which use shared libs.
A better bet is to compile usplash as a statically-linked binary so you don't have to fool with the rest.

I wanted to compile it as static-linked lib but usplash has almost no documentation. I will have to check the source.

I did not thought about ldconf... I forgot that the file has no idea where to look for a lib. I have no idea why it tells that there is no sbin/usplash. I would expect to see an error message about missing libraries and not that the file does not exist.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom initrd for bootable cd deoren Linux - General 13 02-12-2005 11:38 AM
Creating custom initrd image in suse 9.1 Anmol Suse/Novell 1 01-08-2005 02:31 AM
custom initrd not working -- INIT errors michael_util Slackware 9 11-24-2004 11:58 AM
Custom install initrd for megaide - how to make? silversail76 Debian 1 07-27-2004 05:00 AM
Custom Kernel / No INIT / initrd? azl Linux - Newbie 2 11-01-2003 09:32 PM


All times are GMT -5. The time now is 05:59 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration