LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-04-2006, 07:22 AM   #46
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
mo2dir and dir2mo are not working on slackware with live scripts


hi drkstr.
I managed to install linux-live scripts and the dir2mo and mo2dir are installed in the path properly.
but when I run mo2dir 02_core.mo /usr/src/modules/core it gives error. do I need some thing additional than live scripts? do I need to have for example the squashfs support into my slackware linux kernel I am using?
it is 2.6.13 from the slackware cd.
what could be the problem?
is there a way to have this commands work other than live scripts and without actually using slax?
Krishnakant.
 
Old 08-04-2006, 10:38 AM   #47
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
yup, I mentioned earlier that you will need to use the Slax kernel on you host system. You can download a pre-compiled version from the linux-live site to save on confusion. Otherwise you will need to patch you existing kernel. (I would go the route of pre-compiled until you learn a little more about how all that stuff works). Once you have a compatible kernel, you should be able to run the commands just fine. You can even replace the host system kernel again by extracting the slax kernel source module and recompiling it yourself. This way you are not bound to the kernel options on you host system the live scripts decided for you. Also, it might be handy to have the same kernel version on the host system that your USB drive will be using.

regards,
...drkstr
 
Old 08-04-2006, 12:54 PM   #48
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
here is another solution will it work?

hello drkstr,
I explored with the live scripts and now since I have learned about it a more thanks to you, I realise that there is another solution I can use.
tell me if it is right.
I have my entire custom slackware distro installed on my hard disk in /var/usblinux as per your instructions on using installpkg -root /var/usblinux *.tgz in the aand l directories.
now my entire system is ready in /var/usblinux. if I run my live scripts and give the path for the kernel as /var/usblinux/boot, will that be a good solution?
if it creats a live .iso image for custom distro, then will this custom installation on my hard disk be converted?
I used kernel 2.6.16.18 and the live scripts contain the .co modules for unionfs and all other things needed.
if you feel this is the right way then I will try it tomorrow in my lab.
Just let me know.
and if that's the case I will need to make changes in my /etc/fstab in the custom installation (usblinux), am I right?
and will I have /dev/sda1 / vfat defaults 0 0 in the fstab?
do I also need to edit all other files like /etc/profile and passwd also?
Please suggest.
thanks,
Krishnakant.
 
Old 08-04-2006, 02:54 PM   #49
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Now your getting the idea!

Can I make a suggestion? Install the live scripts to /var/usblinux/root (or your sub directory of choice) then do a 'chroot /var/usblinux' and run the live scripts from the chroot environment. Exit the chroot and your linux-live system will be in /var/usblinux/tmp/somedirectory (I don't remember the exact name of the directory). All you need to do from there is copy everything in 'somedirectory' to your usb drive. and do whatever you need to do to get it to boot (you allready got Slax to boot form the USB right?).

note: you will get a complaint when running live scripts about not having mkeisofs (or something like that) Just disregard this since you are not making a LiveCD.

Quote:
and if that's the case I will need to make changes in my /etc/fstab in the custom installation (usblinux), am I right? and will I have /dev/sda1 / vfat defaults 0 0 in the fstab? do I also need to edit all other files like /etc/profile and passwd also?
you can edit antyhing in the /var/usblinux to your hearts content, but the fstab is created on the fly.

I would also recommend cleaning out anything that you don't need from /var/usblinux and making the files on the USB drive read only if at all possible. (this will extend the life of the pen drive). It will take some tweaking/playing around to get everything the way you want it.

If you want to look inside the initrd.img (it could be named something similar) do the following.

Code:
mkdir /tmp/initrd
cp <LInux-live root dir>/boot/initrd /tmp/initrd.img.gz
cd /tmp gunzip initrd.img.gz
mount -o loop initrdd.img /tmp/initrd/
Let me know how it turns out. Have fun!
...drkstr
 
Old 08-04-2006, 03:08 PM   #50
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
should I just coppy the entire directory tree of usb linux to pen drive?

hello,
yes that creats the system I believe
I tried it on my home pc and it did coreate some thing.
it will be a while before I test it tomorrow on the pen drive.
by the way the live scripts provided the .co modules for unionfs and other related things.
where do I copy these modules?
should I just take them and put in the /lib/modules/2.6.16.18 directory of usblinux?
and should I again run syslinux?
secondly which will now be the directory where user can store documents which he can read later?
you said it is suggestable to make the pen drive read only. but then storing documents will not be possible.
thanks,
Krishnakant.
 
Old 08-04-2006, 05:05 PM   #51
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
by the way the live scripts provided the .co modules for unionfs and other related things.
where do I copy these modules?
should I just take them and put in the /lib/modules/2.6.16.18 directory of usblinux?
no. The kernel modules need to be compiled for the exact same kernel you are running on your host system. If you are using the Same kernel these modules were compiled for (the Slax kernel) then you should allready have the modules. I would recommend downloading the actual Slax kernel source, then compile and install the kernel image and all of the modules to the host system (just like you would any other kernel). This will garuntee compatability.

Quote:
you said it is suggestable to make the pen drive read only. but then storing documents will not be possible.
hmmm, this may be tricky since the Linux-live get's loaded into a ramdisk so antyhing that changes in the root file system will not be saved at reboot.

Again, I've never had/used a USB stick, so I can't gurantee this will be a viable solution, but here is what I would try and do. Repartition the USB stick so it has sda1 and sda2. sda1 will be just big enough to hold the Linux-live files and the rest of the space will go to sda2 (another good reason to make the Linux system as small as possible). The boot loader will boot from the system on sda1 (read only) but the system will mount sda2 as /home. This way, everything saved in /home will be saved on sda2 instead of in your RAM. You will need to do a little disecting to figure out how to acomplish this. I will try to point you in the right direction if you need any help, but I'm not going to do all your work for you.

regards,
...drkstr
 
Old 08-05-2006, 02:57 AM   #52
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
all seams fine but chroot is giving problems for want of bash

hi drkstr,
I am doing exactly as you suggested because as usual your suggestions are perfectly to the point.
I am trying to chroot to /var/usblinux/ but chroot command fails saying that /bin/bash no such file or directory.
I checked that in /var/usblinux/bin with ls and bash already exists still this problem?
secondly I liked your idea of mounting /dev/sda2 on /home but you said that fstab gets created at runn time which I know it does.
so how do I tell the system to do this mounting?
I have no problems creating the mount point in the fstab.
Infact I learned to create configurations through files like fstab and inittab during this project itself.
Thanks,
Krishnakant.
 
Old 08-05-2006, 03:53 AM   #53
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
I am doing exactly as you suggested because as usual your suggestions are perfectly to the point.
I am trying to chroot to /var/usblinux/ but chroot command fails saying that /bin/bash no such file or directory.
I checked that in /var/usblinux/bin with ls and bash already exists still this problem?
ahh, the ever ambiguis "/bin/bash no such file or directory" error. This is always fun to debug since it can be caused by a million diffrent things. First off, it almost always has nothing to do with whether or not bash exists. Most likley you did not install a library needed for bash.

Try this as a starting point:
On your host system, run 'ldd /bin/bash' this shows any libraries needed to run the indicated binary (bash in this case). Now look up each of the listed files and make sure the coresponding package got installed in /var/usblinux.

Quote:
I have no problems creating the mount point in the fstab.
Infact I learned to create configurations through files like fstab and inittab during this project itself.
Give it a try and see what happens. Something else that might be helpful: mount the initrd.img and search for any file containing the text "fstab" and see how/when it's created (I'm not sure if this will be useful or not, but it's worth a shot).
 
Old 08-05-2006, 05:20 AM   #54
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
libs for the bash seam to be fine.

hello,
the associated libs seam to be fine with the setting I have.
my only doubt is that the kernel used in /var/usblinux is 2.6.16.18 while my host slackware system has 2.6.13 that came with slackware cd.
will that matter any way?
im asking this because I have lib/modules/2.6.16.18 in /var/usblinux. and it is 2.6.13 in /lib/modules in my main host system.
and still to make sure, kindly name the .so files that r needed by bash. I know they all are there but just in case I missed it out.
you see, I use a screen reader to read things on the screen. so it is likely that I might have missed a name.
I will be thankful if you could list the names of .so libraries for bash and the packages *.tgz which contain them.
I installed libtermcap and glib and glibc as well.
thanks,
Krishnakant.
 
Old 08-05-2006, 11:26 AM   #55
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
fstab is *not* created on bootup -mtab however is removed and recreated during bootup and maintained ciurrent when the mount and unmount commands are used.
There must be an fstab present though in order to mount the root file system. For *most* boot loaders the fstab entry for / must match what is passed to the kernel at boot time. loadlin is probably the most flexible in this and GRUB the least.
 
Old 08-05-2006, 11:46 AM   #56
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
fstab is *not* created on bootup -mtab however is removed and recreated during bootup and maintained ciurrent when the mount and unmount commands are used.
There must be an fstab present though in order to mount the root file system. For *most* boot loaders the fstab entry for / must match what is passed to the kernel at boot time. loadlin is probably the most flexible in this and GRUB the least.
eh? On my Slax system, the fstab containd in the "core" module is completly blank until it boots up and a bash script is run to populate it. The same script also updates the fstab when new hardware is found (such as an external cdrom). I didn't really pay close attention to see exactly what it does, I'm just going by what the comments. Now this is not to say that there isn't an fstab in the initrd that loads that mounts the ramdisk. It's been awhile and I don't remember where I found the script, so I'm not sure what all it contains. I will have to do a little poking around to find it again.
Quote:
my only doubt is that the kernel used in /var/usblinux is 2.6.16.18 while my host slackware system has 2.6.13 that came with slackware cd.
will that matter any way?
im asking this because I have lib/modules/2.6.16.18 in /var/usblinux. and it is 2.6.13 in /lib/modules in my main host system.
I don't think this is the problem. In chroot, the kernel from you host system is used, but would not prevent bash from being able to load. Also... Did you patch you kernel to the host system, or were you just not going to use the live-linux tools?

Quote:
you see, I use a screen reader to read things on the screen. so it is likely that I might have missed a name.
I will be thankful if you could list the names of .so libraries for bash and the packages *.tgz which contain them.
I installed libtermcap and glib and glibc as well
Code:
#note: this is on my system, you need to look at your system for the correct version #'s
root@dsk:/home/drkstr# ldd /bin/bash
        linux-gate.so.1 =>  (0xffffe000)
        libtermcap.so.2 => /lib/libtermcap.so.2 (0xa7edf000)
        libdl.so.2 => /lib/tls/libdl.so.2 (0xa7edb000)
        libc.so.6 => /lib/tls/libc.so.6 (0xa7dac000)
        /lib/ld-linux.so.2 (0xa7efe000)
One other thing that might be of some help. When I was building my Minimal Slack system, I noticed that none of the links were created to the actual lib files and I had to create enough to be able to 'chroot'. Once I was in the chroot environment, I could just run 'ldconfig' to update the rest, but the first few I had to create manually. For instance, libc.so.6 is actually a link to libc-2.3.6.so. You will need to browse though the /var/usblinux/lib folder and manually create the appropriate links to the actual .so files.

regards,
...drkstr
 
Old 08-05-2006, 01:06 PM   #57
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
will chroot be absolutely necessary?

ok,
I think the links are the source of problem.
but now how will I come to know which libraries and which files r linked and which are not?
and how will I be able to judge what links I need to make in order for chroot to work?
and if all else fails, will I still be able to create my iso with linux-live scripts?
do I really need to chroot into the usblinux directory?
linux-live scripts are already working on my host system.
thanks,
Krishnakant.
 
Old 08-05-2006, 05:30 PM   #58
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
ok,
I think the links are the source of problem.
but now how will I come to know which libraries and which files r linked and which are not?
and how will I be able to judge what links I need to make in order for chroot to work?
and if all else fails, will I still be able to create my iso with linux-live scripts?
do I really need to chroot into the usblinux directory?
linux-live scripts are already working on my host system.
thanks,
Krishnakant.
Well I guess if you allready have it working then you don't need to do anything else. I seem to remember having to do this however. I am curious though, how you can boot to your system in /var/usblinux when you can't chroot to it. Doesnt seem possible to me but I could be wrong.

As far as the simlinks goes, I don't remember every link I had to create, but I'll tell you what I did to figure it out. Look at the .so files in the output of 'ldd' then look in /var/usblinux/lib. See anything that looks similar? If so, create a link to it by the same name as it apears in the output.

For instance:
Maybe there is no libc.so.6, but is there a libc-x.y.z.so? if so, link it.

you will need to run ldd on your own system to get acurate lib names. Also, I made a small mistake earlier. You should run ldd on /var/usblinux/bin/bash incase the versions are diffrent (probably not though)

let me know if you have any trouble figuring any of them out.

Oh yeah, one other thing. I'm heading over to a friends house for the weekend and I'm bringing my laptop. I'm going to talk him into letting me turn his USB stick into a bootable Linux system. You got me to interested in it

...drkstr
 
Old 08-06-2006, 01:07 AM   #59
krmane
Member
 
Registered: May 2006
Posts: 49

Original Poster
Rep: Reputation: 15
well, actually chroot worked previously but now ...

drkstr,
actually when you suggested me the first time to create the minimal slackware setup on the hard disk the chroot did work I guess because I did have it boot properly.
although the kernel was 2.6.13, the same as my host slackware system.
and I did change things around in the custom usblinux system.
now that I had to re install slackware on the same box due to a hard disk crash (I had to change the hard disk), I don't know now what's the matter and why things are not working. I wished the chroot faild that time also so we could at least figure it the problem in the early stage.
Please let me know what are other possibilities.
actually I took the bash package from my slackware cd and all the libraries like glib glibc libtermcap and also installed coreutils and bing from the a directory.
this is all from the a and l of the slackware 10.2 cd.
and my kernel is 2.6.16.18 from the kernel.org and I have custom compiled it to exclude ide hard disks and lan in particular.
and by the way do let me know your experience on usb stick.
by the way where are you located? you are from which country?
and what's your good name.
take care.
Krishnakant.
 
Old 08-07-2006, 01:20 AM   #60
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
My friend didn't want me to format his USB stick to ext2, so I ended up getting my own to play with. Haven't had the chance to play with it yet, but I'll let you know how it turns out.

As far as the chrooting goes, I gave it a quick run though to make sure I wasn't losing my mind.

I was able to get it working with the following:
Code:
cd a/
rm kernel*
installpkg -root /tmp/devel-current/base/core *.tgz
cd ../l
installpkg -root /tmp/devel-current/base/core/ libtermcap-1.2.3-i486-6.tgz
installpkg -root /tmp/devel-current/base/core/ glibc-2.3.6-i486-3.tgz
cd /tmp/devel-current/base/core/lib/
ln -s ld-2.3.6.so ld-linux.so.2
ln -s libc-2.3.6.so libc.so.6
ln -s libdl-2.3.6.so libdl.so.2

chroot /tmp/devel-current/base/core/
I have no name!@lpt:/#
This worked with Slackware-10.2 packages. You will need to install some extra libraries and do a little config'ing to get the system completely working, but this should be enough to get you started though. Just chroot to the directory, run 'ldconfig' and then 'ldd *' in any directory that contains binaries. If you get a "not found" you will need to install that library.

Quote:
by the way where are you located? you are from which country?
and what's your good name.
I live in the very north-western corner of the United States. My name real name is Aaron, pleased to meet you my friend.

take it easy,
...aaron

**edit**
FYI:
installing glib-1.2.10-i386-2.tgz will get rid of the "I Have no Name" thing, but I did not add this since it's not needed to just get chroot working.

Last edited by drkstr; 08-07-2006 at 01:47 AM.
 
  


Reply



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 12:55 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