how to boot a custom kernel built from slackware on a USB drive?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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?
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.