LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
  Search this Thread
Old 08-08-2006, 12:54 AM   #61
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
got a static binary of bash, system chroots but no further working


hi dude,
I had mean while got a static binary of bash 3.0 and when I put sh and bash both static in my /var/usblinux/bin directory, chroot actually worked.
now the problem is that although I installed coreutils (which is not static of course) I am not able to access any of the commands.
for example when I give the ls command, it says "bash: ls no such file or directory".
do I also need to build coreutils as static?
by the way I tried to compile coreutils as static but get some error I can't recall but it says that it needs the static version of a few libraries to do so.
I think glib was one of them if I can remember correctly.
any ways I will try with the usual way you suggested.
but I thought if I have all the binaries static many problems will be solved.
but since I am finding trouble building coreutils statically I am stuckup.
thanks,
Krishnakant.
 
Old 08-08-2006, 01:42 AM   #62
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Building staticly is an option, though probably not a good one when size is an issue. The whole point behind dynamic libraries is so binaries can reuse common functions without having to copy the code everytime it is used in a binary.

I was able to get chrooting to work with dynamic libraries in less then 5 minutes (including package install) by just looking at the output from 'ldd /bin/bash', then creating links by the same name to the actual existing library (if there was not one allready). I would at least give it a shot before you give up on it.

regards,
...aaron

PS:
I just noticed I left out a link in my post. I forgot list the /lib/tls/libc.so.6 link. You also might as well install glib 1& 2 since you will need these later anyways.
 
Old 08-08-2006, 03:26 AM   #63
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
lib/tls should be liked to which library?

yes I think I was just going to ask you why after following your instructions my system still did not chroot.
which library should I link with /lib/tls?
thanks,
Krishnakant.
 
Old 08-08-2006, 11:21 AM   #64
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
Originally Posted by krmane
yes I think I was just going to ask you why after following your instructions my system still did not chroot.
which library should I link with /lib/tls?
thanks,
Krishnakant.
Instead of just telling you which one to link, I think you would be better served if I tell you how to figure it out. This way you don't need to refer back to this thread everytime you need to do this.

With the exception of ld-linux (wich points to ld-x.y.z), each of the links points to a library of the same, buta more specific version number. See if you can find the library for libc, then create a link to it in the same directory as the actual library. You should name the link as shown by the ldd command since this is what the binary looks forwhen searching for the library.

The reason why this is done is so you could upgrade or patch the library without having to recompile all the binaries. All you would need to do is point the link to the new lib.

regards,
...aaron
 
Old 08-12-2006, 02:48 AM   #65
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
got chroot to work along with other commands but live scripts give problem

hello drkstr,
I finally got chroot to work and all commands like ls, rm/ cp etc are working.
now I just thought that if I install live scripts to /var/usblinux/root and run them I will get the iso of my distro.
but alas! the live scripts refuse to runn.
they are not getting installed properly.
what could be the reason?
 
Old 08-12-2006, 06:24 PM   #66
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
You had mentioned earlier that the kernel on the host system was diffrent then the Slax kernel, is this still the case? Can you run live scripts from the host system, or does it fail? If it fails, what's the error message you get? (list bot host system and chroot if they differ).

As an alternative method, you can build the system manually. Copy cd-root/* in the linux-live directory over to your usb drive, then use dir2mo to build the embeded system into a module and place it into the right directory on the USBdrive. You will need to create some of the directories yourself, just look at a premade Slax CD as a guide. You can also use the script in the linux-live folder to build the initrd. The initrd directory to build from is located in the same folder. You will need to change isolinux to syslinux if you are planning to use fat.

regards,
...aaron

PS:
sorry, I haven't even taken my USB stick out of my laptop bag yet. I've been realy busy working on one of my own projects. I am however tayloring my project so I can run it off a USB stick now, so when it's ready for that, I'll play around with it a bit.
 
Old 08-13-2006, 12:37 AM   #67
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
live scripts work on host system but not on chroot

hi,
the thing is the live scripts work on the host system.
the only error they give is that the initrd is not present and that the unionfs and squashfs .coo modules need to be added in the modules directory.
the good thing is that the live scripts come with these co files for kernel 2.6.16 so I am very much at ease there.
but while these scripts run on my host system they don't run when I chroot into my newly created /var/usblinux system.
infact they don't get installed.
what could be the problem?
and I could not figure out what is exactly happening. some times the error is on line 7 and some times 9.
well and I tried to install the live scripts in /var/usblinux/root which means they r in /root after I chroot into the system.
what could be the problem.
and I also have another problem. the adduser command is not working as well.
it did not give shared libraries error, but could not complete the add user process.
what all is needed for this?
yes!
my chroot is working well with live scripts.
now the problem is not just strange but also frustrating. now that I have got every thing working, I am facing the following problem.
after I chroot into the /var/usblinux directory, I get into /root and then livescripts.
now when I run them, what happens is that as usual the script asks for the kernel image and I give it /boot/bzImage as it is my custom 2.6.16 image.
now the problem is that it says it can't fine the directory for 2.6.13 modules even when my chroot system has only /lib/2.6.16.18 directory.
chroot has nothing to do with my host kernel wich is indeed, 2.6.13! now how do I make the live scripts find my 2.6.16.18 modules?

thanks
Krishnakant.

Last edited by krmane; 08-13-2006 at 08:54 AM.
 
Old 08-14-2006, 11:41 PM   #68
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
now when I run them, what happens is that as usual the script asks for the kernel image and I give it /boot/bzImage as it is my custom 2.6.16 image.
now the problem is that it says it can't fine the directory for 2.6.13 modules even when my chroot system has only /lib/2.6.16.18 directory.
uhoh, you got three diffrent kernel versions going here. I mentioned a little blurb awhile ago, I should have stressed it's importance a little more. Save yoursself a lot of headache and use the same kernel on the host system as your inbedded system. This is good for a variety of reasons, not just getting the live-scripts to work.

regards,
...drkstr

PS: Is install size an issue at all? If so, you might want to check out this thread http://www.linuxquestions.org/questi...d.php?t=472526.

regards,
...drkstr
 
Old 08-15-2006, 10:52 PM   #69
shogun1234
Member
 
Registered: May 2004
Posts: 226

Rep: Reputation: 15
deleted ---- posting in the wrong forum. sorry!

Last edited by shogun1234; 08-15-2006 at 10:53 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to boot a custom kernel with extlinux on USB drive? krmane Linux - Software 2 07-16-2006 03:02 AM
Newly-Built Kernel Won't Boot, Old One Fails Kenji Miyamoto Slackware 6 05-27-2005 10:30 PM
Custom Built PC - No Monitor Signal Eklipz Linux - Hardware 12 12-25-2004 09:48 AM
Slackware 10- Please confirm my steps used to remove a module from a pre-built kernel jtp51 Slackware 7 11-03-2004 05:02 PM
Slackware 10, custom 2.6.7 kernel, lilo, loads kernel very slowly entropyv Slackware 3 08-19-2004 06:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration