cleaning up the root directory


Forum: USB booting
Topic: cleaning up the root directory
started by: krazynesphreak

Posted by krazynesphreak on April 08 2005,18:45
what i would like to do is clean the root directory of my thumbdrive. i have dsl booting and working on the drive but its not very clean on the root directory, because of all the boot files. is there anyway i can change the MBR to boot into a directory?
thanks
ryan

Posted by choekstr on April 11 2005,05:07
I was in this exact same situation and tried moving to directories.  Let me explain my situation a bit first so you can adjust accordingly:
I use a common boot method of syslinux for HD/USB based booting, isolinux for CD-ROM booting, and pxelinux for pxe booting.  All using the exact same image of about 7 images. (One of them being DSL)

When I went to put my common directory structure on my usb drive and use syslinux since it was HD based, I found a major major limitation in syslinux.  It only supports 8.3 characters for ALL PATHS AND FILENAMES!  ACK!  So a directory /boot/dsl/linux24 would turn into /boot/ds.l/l  when trying to boot!  I tried all kinds of hacks, tried looking on syslinux's forums and eventually gave up.

What I ended up switching to was grub!  And I like it soooo much better.  While I was able to get by with using a windows machine the whole time for all my images and syslinux, I had to switch to creating my boot sector with linux.  Not a big deal as I already have a linux box running grub.

The way I did it:
1.) Put the memory stick in the Fedora Core2 linux box (hot plugged)
2.) ran grub-install [--recheck] /dev/sda
3.) ran grub to get a grub> prompt
4.) typed setup /dev/sda

I played around with this quite a bit until I got it working, but the above commands are the consolidated steps one should need to do.  I am not sure if the menu.lst/grub.conf file is copied over by setup as well as the stage1 and stage2 files as I was trying all kinds of things. :;):

Now that I am using grub, I can use 98% similar syslinux.cfg syntax, have nice scroll bar chooser, make kernel/initrd options on the fly, etc.  MUCH MUCH nicer than syslinux/isolinux/pxelinux/memdisk are!
Plus the overlaid text on my sweet background (albeit 16 colors) looks pretty slick as well.

So, now I have:
/boot
/boot/grub (grub only files)
/boot/dsl (Damn Small Linux kernel24,minirt24.gz, knoppix folder)
/boot/<other images>

And my root directory only has a single /boot directory in it!  Finally I can control where my kernels and my ram disk images are on my removable media images.

Hope this gives you enough of a push to try it out.

Posted by krazynesphreak on April 12 2005,00:34
thanks choekstr, i will have to try this out
thanks very much

ryan

:)

Posted by choekstr on April 13 2005,18:33
Well, this is causing a bit of trouble for me.  I am 90% of the way there.  I have grub working, all the directories, but when it finishes loading the kernel and the ramdisk, it wants to load the knoppix file in the knoppix directory, but it is a level deeper than it thinks.  So while it wants (I assume): /knoppix/knoppix file, it really needs /dsl/knoppix/knoppix.  

This is detailed over here in this thread < http://damnsmalllinux.org/cgi-bin....;t=5463 >
but so far noone has responded with anything but repartition so you can have the image in the root...thus negating the "cleaning up the root directory concept".

Still hopeful that someone will take the time to read and understand the issue as well as understand WHY having all files in the root directory is heinous to people.  I think it is just a matter of telling the kernel/ramdisk/scripts to look elsewhere.  Hopefully with just a kernel option...

Posted by krazynesphreak on April 14 2005,10:00
i know what your tring to do. (i think) u want ever thing that has to do with booting in one directory? this is what i have done. in order for u to boot the knoppix image for within a directory named "dsl" or "DSL" u will have to rename the knoppix image as well to "dsl" and then edit the isolinux/syslinux file it should look like this
Quote

label dsl
kernel linux24
append ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt24.gz nomce noapic quiet BOOT_IMAGE=DSL


now i have not done this by itself. this is what i did was boot multiple knoppix(es) like: dsl, knoppix, and knoppix-std and i had to rename the knoppix image as well as the directory as it was in.

"root /DSL/DSL"  <----- the 2nd DSL being the image"
"root /DSL/{boot files}"

is this what u want?
later
ryan

Posted by choekstr on April 15 2005,19:38
YES!  This is exactly what I want!  

Ok, 2 questions so I can understand why and roll with the proverbial punches:

1.) Why does one need to rename the knoppix image to DSL?  In your example, you have the directory formerly known as knoppix as dsl.  Did you also rename your image dsl as well?  So the actual image name would be /dsl/dsl/dsl ?  Or did you leave the image name still knoppix so it is /dsl/dsl/knoppix and then use the BOOT_IMAGE= variable and point it the "dsl" which would be the directory?

2.) Now that this is a potential fix, which it seems like renaming doesn't change anything as it is still one level deeper, what if it were yet one more level deeper?  Like this:
/boot/dsl <--- has all the dsl files
/boot/dsl/dsl  <--- has the knoppix image

Do you think THIS could be done?  I guess if I understand why the above works then it would help to determine if yet another level deeper would work; which is my ultimate ultimate goal.

Thank you SO much for taking the time to understand what I am trying to do and for taking the time to respond.  There actually IS hope.  :laugh:

Chris

Posted by krazynesphreak on April 16 2005,05:44
starting all over. first i tryed to remake the cd, could not do it, but i still have the old one so it still works. this is what u will have to do in order for it to work. this is the eazy way. keep the knoppix dir*. put all ur boot files in that dir*. that way u only have one directory on the root dir*. that would be the eazies way. now i will get back to u (i hope). i`m going to look through some of my old notes. to see if we can`t get the way u want.
later
ryan

p.s. i think this is more of a kernal problem. it not program to search for any thing eles then "knoppix" so we may have to rewirte and recompile to look for the "/DSL/DSL" or "/boot/DSL/DSL". i think that is what i did with the cd is i rewrote the kernal abit. and then recompile the kernal 3 times. (for what i was doing.) i am not a programmer but i can read it and edit it some ways.

Posted by choekstr on April 18 2005,16:37
Yeah, I think you and I are thinking the same thing.  I think it is looking for /knoppix/knoppix as the image file and I have it one or two levels deeper.  

Another very good bit of information about WHAT you think is calling the next step.  The kernel you think is hard-coded to call for that directory, huh?  I was hoping that it wouldn't be in there and would be in scripts, but that isn't the end of the world.

Wouldn't it be sooo easy if it were a boot-time parameter?

Thanks again, further than I was,
Chris

Posted by choekstr on May 03 2005,23:29
Ok, I finally figured out what I had to do to get everything out of the root directory.

First, I moved all the files into a /boot/dsl directory.
This included the linux24, minirt24.gz, and KNOPPIX file (not the directory since I didn't want it that way)

Then all I did was mount the minirt24.gz (uncompressed first) to the filesystem:
mount -o loop minirt24 /mnt
and then edited the linuxrc script to change the KNOPPIX_DIR variable from "KNOPPIX" (which resolved to /KNOPPIX) to "boot/dsl" (which then loads the file /boot/dsl/KNOPPIX).

Save the linuxrc file, unmount the minirt24, gzip -9 it, copy it back, make a new iso and all is golden.  
Single variable change and my life is great!  I now have a clean root directory on the CD/memory stick and everything (all 7 images; dsl is one of them) are all self contained under /boot!

If anyone needs further explanation, let me know.  I can explain better.

Thanks for the help/suggestions,
Chris

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.