(yet another) remastering newbie


Forum: Other Help Topics
Topic: (yet another) remastering newbie
started by: jakethesnake

Posted by jakethesnake on April 08 2007,21:53
OK first i apologize if this subject already appears five times a day on the forum. I have read a handful of guies on remastering, and, although i have to admit that most of the just confuse me, there is one basic thing that i havent seen asked or answered by anyone else.

I run DSL boxes now and then. It's often quite temporary machines so i just pop in a CD there and do what i have to do. They are often headless, i.e. no monitor.

Anyhow, there are some things i almost always do, so i figured i'd like to have those things baked into a DSL image somehow, so i dont have to do them manually.

One of those is starting the SSH daemon. There is a cheat code for that in the startup, but theres one problem left: even if i figure out how to have my cheatcodes registered into the image, sshd still needs a real user. I cant connect to the machine before i've set up a root password.

In other words: can i remaster DSL so that i have either a root PW or a real user account, with PW?

Posted by mikshaw on April 08 2007,22:37
Set up a root password, and then use the newly modified /etc/shadow file in your remaster.

The default cheatcodes are set in the isolinux.cfg file (check the boot/isolinux directory on the cd)

Posted by jakethesnake on April 09 2007,14:51
OK! Thanks a lot!

Do you think i could also set up a normal account, like "jake", and use the /etc/shadow file in the same way?

Also, i have to ask you which remastering-guide you would reccommend for me. Or, let me ask like this: are there more than one way to skin this cat? I would like to do this as easily as possible, as i'm a newbie to remastering. So i'm looking for the simplest method of doing this.

The means i have of disposal are: a PC with cdrom, and a harddrive   connected to it...  FAT drive mainly for file storage, but i could format it if necessary. The PC is connected to a samba network, and i have CDburners on other computers in the network, so if i can get an ISO file from the live-DSL-machine, i could burn it elsewhere. The DSL-machine has 256 mb RAM.

peace

Posted by mikshaw on April 09 2007,17:41
If you create a new user with a password, you will also need to include the modified /etc/passwd file in your remaster.

There are multiple ways to remaster. I couldn't recommend one above another, since it depends on what is most comfortable for you.  Personally I have done it this way:

Mount KNOPPIX
Copy the mounted files to a writable directory (keeping file permissions and ownership intact...can be done easily with mc as root)
Make changes
Rebuild KNOPPIX file

That method is only dependable if your changes consist of manually adding/removing/editing files, since it does not mention chroot or /proc

Using a FAT (or any non-linux) partition during a remaster is not a good idea. This filesystem does not know how to handle Linux file permissions and ownership.

======
An alternative to remastering the filesystem, though, is to remaster only the ISO.  You can add myDSL packages and other files this way, which can be loaded during boot. One of these files can be a knoppix.sh script, which can be used if there are things that need to be done before the DSL-specific init script is run. Remastering only the ISO also allows you to change the default boot options so you don't need to type your personal boot string each time you load DSL.

This is my preferred method of customizing a DSL CD. It is essentially the same method used for customizing a frugal harddrive install. It also allows for much easier upgrades, since you do not have to remaster KNOPPIX every time a new version is released. The downside is that you do not have the option of replacing or removing existing applications or other files in the read-only portions of the filesystem.

Posted by jakethesnake on April 10 2007,05:42
Uhmm..... OK....
so i realized that i dont know much about the DSL CD's structure.
So i downloaded the latest ISO and mounted it with Daemon Tools, to take a look inside.

Seems its mainly a handful of files, a megabyte or so, in a directory, and then a big image of some sort, KNOPPIX. Is that image also an ISO image? That would mean an ISO inside the ISO.

I understand the problem with the FAT and the file attributes. Maybe i could do this all in RAM, since i'm on 256 megabytes? Or is that too little?

Unfortunately i didnt understand what you meant under the equal-signs in your post there. In other words, i didnt understand the difference between remastering the filesystem, and remastering only the ISO.

About boot options:
In the isolinux.cfg file, is it the first line:
DEFAULT linux24
that i want to change into something else in order to get the "toram", the "ssh", and the "2" switch?

peace

Posted by ^thehatsrule^ on April 10 2007,05:55
KNOPPIX is a compressed image (cloop).

256mb might be too little (perhaps format a partition to ext2?) if you plan on remastering the dsl/knoppix cloop image.

Changing the ISO only can be done with "mkmydsl" - essentially it has your saved MyDSL extensions (and optionally backup/restore session, which is an extension in itself) on the disc media, and will be autoloaded on boot.  This is the easiest, and quickest way to customize.

Remastering the DSL/KNOPPIX image changes the core files in the compressed image... essentially you are uncompressing it, modifying it, and then repackaging it.

Quote
About boot options:
In the isolinux.cfg file, is it the first line:
DEFAULT linux24
that i want to change into something else in order to get the "toram", the "ssh", and the "2" switch?
You would add it to the rest of the codes in the APPEND line

Posted by mikshaw on April 10 2007,13:40
A little more about ISO/KNOPPIX difference....

The ISO is the bootable CD image itself (the file you downloaded), which contains the boot files and a compressed filesystem named KNOPPIX. You can change the boot files to customize the way DSL boots from a CD, and add data files to the top level of the disk image including mydsl extensions  and kernel modules to be auto-loaded and miscellaneous files to fill up a 700mb disk. If you are not running DSL "toram", all of these files will be accessible through the /cdrom, /mnt/cdrom, or /mnt/somethingelse directory, depending on how DSL was installed.

The KNOPPIX file is the compressed filesystem (which is also an iso9660 filesystem, but it's compressed with cloop, the same thing used to compress uci and unc mydsl packages) stored within the bootable CD. This filesystem is what you see under /KNOPPIX when DSL is booted, and is read-only at runtime. The DSL system uses this filesystem as its base each time it starts.

It is, as you said, pretty much an ISO within an ISO.

Posted by jakethesnake on April 12 2007,20:48
Thanks for all your answers so far. This is all still a bit confusing for me, probably since i dont know the filesystem of DSL by heart.
I will have to take this in babysteps , and start with just the cheatcodes.

Will it be OK if i DL the DSL ISO image, mount it with Daemon Tools in Win XP, edit the /boot/isolinux/isolinux.cfg file to contain "dsl 2 ssh toram", and burn the resulting image?
This just to get the server started at bootup.

Posted by ^thehatsrule^ on April 12 2007,21:16
I don't think daemon-tools can write to the images...?
Posted by mikshaw on April 12 2007,21:20
If daemon tools will allow you to edit the iso in place (as opposed to having to copy the files to a writable disk), then I guess you should be ok.

You may want to be cautious of what editor you use to edit the file. Notepad may convert it to DOS format. I'm not sure about that, but I am sure that any line breaks you make in Notepad will probably cause trouble. Wordpad or Word is likely to do the same. If you have access to a text editor that properly reads and writes Unix text files it would probably be best to use that.

However...DSL does come with a script (mkmydsl, listed in the menu as "make mydsl cd remaster") that helps with the process of remastering the ISO.

Posted by jakethesnake on April 13 2007,00:23
I'm not totally sure any longer about Dameon Tools possibility for editing. I do however have an editor thats very good at preserving unix text file line breaks.

So if i decide to do this make mydsl cd remaster instead... will i have the ability to edit the isolinux.cfg file then, even though the OS has been started from CD?

Can i run that script in textmode, by the way? (The right-click commands can usually be found by reading through the .fluxbox/menu file)


edit: i have read < this > guide now, and am starting to understand the basic concept i believe.

Posted by ^thehatsrule^ on April 13 2007,15:24
Yes, it is a text-based script - I think you can just run "mkmydsl"
Posted by jakethesnake on April 24 2007,23:07
I've come a bit on the way, i've made my first iso ... yaaay! Hasnt burned it or tested it yet though. I only tried changing some parameters, concentrating on cheat codes.

However. I just thought of maybe trying that user-thing before i burn an image, too. Adding a user "jake" that is.
Now, i am following the guide i have linked to in my last message. The thing is, i do have a jake user set up right now in my DSL running from CD/memory. But if i look in the contents of /etc/shadow , under source.... (check the guide i am regfering to) ... there is no "jake". The shadow file ends with "dsl".

source is just a dir on a harddrive, just like newcd, where i am creating the iso

Wasnt that "source" dir made from the current KNOPPIX filesystem i have in memory?
Or how am i supposed to get the jake user in there?

(I mean, sure, if i look in the shadow file i have in memory now, sure enough there is a jake user, so i could take that file and copy it to source and make a new iso. But is a shadow and a passwd file all i need to set up a user? Dont i need to worry about homedirs and such too?)

Posted by ^thehatsrule^ on April 24 2007,23:11
Re: last question: I don't think so - since users' home directories are populated from /etc/skel
Posted by jakethesnake on April 25 2007,00:53
Thanks for a quick answer. I am experimenting a bit right now.
Posted by jakethesnake on April 30 2007,15:42
EUREKA!
I have managed to make a couple of remasters now, and in essence i have created The Distro I Always Wanted - since i have a root account with a known password. Which means, i can just pop the disc in, and don't have to care about doing anything more at that computer, once it's booted, i can reach it over SSH. Tres chique.

However, there are a couple of details i should take care of.
First and foremost i do have a user account, and i made that by copying the shadow file.... the account is reachable and all, but its practically unusable because it has
no homedir and no sudo right. What do i need to "bring with me" in order for this to work?

Posted by curaga on April 30 2007,16:15
/etc/sudoers and the /home/ tree after creating the user with
Quote
adduser -m -n -g staff jake


And rename "dsl" to "jake" in /etc/sudoers....

Posted by jakethesnake on May 01 2007,15:18
Thank you curaga!
The experimentation goes on...

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