Struggling to Remaster


Forum: Other Help Topics
Topic: Struggling to Remaster
started by: casio

Posted by casio on Sep. 22 2005,13:29
I thought that DSL loaded completely into ram however on doing a remaster using the routine on the menu, I created a myconfig.tar.gz containing all files/directories that I need for uucp which includes /usr .However when the disk boots up (set to auto load to ram) I get a permission denied stating /usr was read only!.

Please help as I really need to create a Disk whereby it boots into ram and allows for the use of uucp.

Regards

Casio

Posted by mikshaw on Sep. 22 2005,15:00
Rename the file to myconfig.dsl.  That will cause it to run the mkwriteable script so you can write to /usr.  DSL does not load entirely to ram...most files are initially just symlinks to the KNOPPIX file system.
Using the 'toram' boot option might also work, but i can't remember if you need to still run mkwriteable.

Posted by casio on Sep. 22 2005,15:44
Thanks for that. The remastered disk is designed to run with toram and does do this , but do you mean typing it at the boot prompt again?

Regards

Casio

Posted by mikshaw on Sep. 22 2005,15:50
If it's already running toram, then there's no need to add it manually.  I guess it must load the KNOPPIX directory read-only as i suspected.  If you load the file as a myDSL app with a *.dsl extension, it should work.  Another option is to boot with the "write" boot option to automatically run mkwriteable (assuming it runs before extensions are loaded?).
Posted by casio on Sep. 22 2005,18:38
Right - still not a 100 % as some of the files required were from other packages which were installed when uucp was via apt-get.

However I have just discovered that these *.deb files are sitting on the system under /ramdisk/var/cache/apt/archives. Is there any way to install these upon boot up ? The only problem would be postfix as it does start a wizard type screen asking questions which could be entered through I suppose.

Regards

Casio

Posted by casio on Sep. 28 2005,11:47
Since I posted my last question on this thread , I am trying to get all of the files that uucp needs for it to work. At the moment I have created a list of files by using dpkg --contents <deb file> >>uucpfiles. However this is becoming 1) time consuming and 2) possible problomatic as some of the files are Symbolic links which as far as I can tell , tar will not understand.

Can someone please help me on making this an easier task as I dont even know if this current effect is going to work and I really do need to use DSL.

Regards

Casio

Posted by clacker on Sep. 28 2005,12:39
casio, if you have all of the deb files, you can load them into a dsl file the same way that the alsa.dsl does it.  Put those deb files into a directory (say /opt/uucp) and make a menu item "install uucp" with an /tmp/mydsl.menu/uucp entry something like this:

[exec] (install uucp) {rxvt -rv -T "uucp install" -e sudo dpkg -i /opt/uucp/*.deb}

If the dpkg-dsl package has already been loaded then this will use dpkg to load the debs.  This won't happen automatically, but will run when you choose the menu item.

If you are remastering you could chroot and install your debs that way.  This is how I make my remasters:

Code Sample
mkdir source
cp -Rp /KNOPPIX source
cp /wherever/dsl-dpkg.dsl source/KNOPPIX
cp /wherever/gnu-utils.dsl source/KNOPPIX
cp /wherever/*.deb.deb source/KNOPPIX
chroot source/KNOPPIX
mount -t proc /proc proc # not always needed
mydsl-load dsl-dpkg.dsl
mydsl-load gnu-utils.dsl
dpkg -i *.deb
rm dsl-dpkg.dsl
rm gnu-utils.dsl
rm *.deb
umount proc # not always needed, only if you mounted proc
<CTRL> D


The nice thing with this method is you don't need to load to ram since that source/knoppix directory isn't a link to the CD.  It gets rid of a lot of my deb loading errors caused by locked files and symlinks.

Another option would be to make a shell script that would run at the start of xwindows like dillo does.  Then it would start automatically in your remaster.

You can try using the deb2dsl script, but if uucp does things like adding users and groups this won't work.  For lots of simple things it does though.

The fourth option is to use the find command to locate all of the files that changed or were added after you ran dpkg.  I first load gnu-utils.dsl package because the find in busybox doesn't have all of the commands.  Then I do:

touch mymarker                     #as a starting timestamp
sudo dpkg -i /wherever/*.deb   # load the debs
sudo find / -cnewer mymarker | grep -v "\/proc\/" > files

Then look through files and keep what you want.

Posted by casio on Sep. 28 2005,14:06
Clacker thanks for your detailed reply!. One question I need to ask is this, if I try and install  any one of deb files manually,it grumbles that the other(s) are not installed. how do I get around this and how is apt-get getting around this?

The packages that I ask apt-get to install are postfix and then uucp. postfix then as part of its own installation, installs several other deb files. The complete list of deb files that are downloaded are as follows:

cron_3.0pl1-72_i386.deb                   postfix-ldap_1.1.11-0.woody3_i386.deb
libldap2_2.0.23-6.3_i386.deb              postfix-pcre_1.1.11-0.woody3_i386.deb
liblockfile1_1.03_i386.deb                postfix_1.1.11-0.woody3_i386.deb
libpcre3_3.4-1.1_i386.deb                 uucp_1.06.1-18_i386.deb
mailx_1%3a8.1.2-0.20020411cvs-1_i386.deb  

So the main question is, how do I tell dpkg to install the packages in the right order?

Regards

Casio

Posted by clacker on Sep. 28 2005,22:24
casio, once I have all of the deb packages I need (say I saved them from before) I add them all at the same time with the sudo dpkg -i *.deb command.  If I got them using apt-get in groups, say uucp first and the eudora, I would add them in groups by placing each of the sets of debs I downloaded into separate directories and then running sudo dpkg -i uucp/*.deb and sudo dpkg -i eudora/*.deb.  The *.deb expands so that all of the deb files wind up being installed at the same time by the dpkg command.

As far as I can tell if you put all of the debs in the same place and install them all at once, dpkg understands that there is a required order and loads them in that order.  That's what I've seen when I've done it.

Posted by casio on Sep. 29 2005,08:21
Thanks again clacker for your help on this. Just one final question (hears groans  :D ) in you set of commands to do regarding the remastering instructions you have a line that says this:

cp /wherever/*.deb.deb source/KNOPPIX

Is this correct in how it should be typed?

Regards

Casio

Posted by clacker on Sep. 29 2005,12:48
casio, no.  The "/wherever/" is the path to the directory where the files are stored.  The *.deb.deb should have been *.deb

You could use emelfm to transfer the files instead of cp.

I was using The method I had posted about before where I create a source directory and a newcd directory and use mkisofs to create the new iso.  I tried using the search function to find it but the board is so damn slow that it borders on damn useless for me.  I believe it's all covered in meo's remastering post (start from the latest since things have changed.

Posted by casio on Sep. 29 2005,16:12
I was lying when I said "final question"  :O , as I am wondering whether it is possible on doing a remaster CD if users can be added as part of the system. My only thought on this would be to add lines to the /opt/bootlocal.sh (i think thats its name) such as
useradd <name> passwd <name> however this would mean entering the password everytime on boot up would it not?

Regards

Casio

Posted by clacker on Sep. 29 2005,17:14
I've found that once I've run the chroot command and my new root is the source/KNOPPIX directory that I can add users, change passwords, and add groups.  Do this after the chroot and before the <control> D.  That way it's part of the group and password files in the remaster.
Posted by casio on Sep. 30 2005,08:34
Clacker, I tried the remastering option that you mentioned however when I did the dpkg -i *.deb the postfix installation normally brings up a wizard of sorts asking for prompts. This did not happen. However I did burn this to disk and as I expected uucp has not been installed.

The method of remastering I used was from the HOWTO thread page 11 as this is for the up to date version of DSL, and I did you suggested before creating the image etc.

Any Ideas why it didnt work?

Regards

Casio

Posted by casio on Oct. 01 2005,14:28
Another Since my last post > I have been trying to figure out where this problem is. What I didnt mentioned before was that I had done a script to avoid having to keep typing all of the instructions , however where there were problems the script did not send any errors to screen.

So I did the whole lot manually and found that when I did the mydsl-load commands it needed to be the dsl user. Fair enough so I did a su dsl ran the command again and got a cannot allocate color error. This seems to have prevented dpkg-dsl and gnu-utils.dsl from installing. So I am then unable to install the deb files.

<EDITED>Scrap the above I think I have solved this now. It was a combination of copying over the *.dsl files without their *.md5 (or so it seems) and I also ran it all outside of the GUI</EDITED>

Thanks to Clacker for the help, this has put to bed a real problem I was having and as I did the remastering i started to understand a lot more what each stage was doing.


Regards

Casio

Posted by casio on Oct. 04 2005,11:10
I have hit a little bit of a problem with the remaster that I did as I only managed to fully tested it yesterday. The /etc/uucp area of the system is coming up as read-only even though I ran it to ram. I do not recal it being read-only when I used to have to down load uucp everytime via apt-get before hand.

Is it something that I have done on the remastering?

Posted by clacker on Oct. 04 2005,12:50
casio, I don't think it's anything you did.  I've run into things similar to this as well.  When you downloaded uucp from apt-get, it created the directory in RAM so things worked.  Then when you remastered the directory became a symbolic link to the CD to save space.

There is a script that is run to make the system writeable called /etc/init.d/mkwriteable that you can modify to add directories and files you want in RAM.  Check and see if the /etc/uucp directory in your remaster is a symbolic link (does it show up in light blue when you run ls /etc/uucp or with an "l" at the start of its line when you run ls -l /etc/uucp).

If it is a link, what I've done is to remove the link and copy the directory from /KNOPPIX.  If that works then you can modify your remaster's mkwriteable script to include those commands.

Posted by casio on Oct. 04 2005,13:04
Clacker thanks again for that. I will check this out.
Posted by casio on Oct. 06 2005,10:40
Once I have cracked what I want to do I am thinking of writing a script to do this. However I understand that when doing the chroot command the Ctrl+D needs to be done afterwards to come out of this. How would I enter this into the script?
Posted by clacker on Oct. 06 2005,12:16
I believe the control D key links to the exit command.  Try using that in your script, although I don't know if that will terminate your script as well.
Posted by casio on Oct. 09 2005,14:40
Quote (clacker @ Oct. 04 2005,13:50)
casio, I don't think it's anything you did.  I've run into things similar to this as well.  When you downloaded uucp from apt-get, it created the directory in RAM so things worked.  Then when you remastered the directory became a symbolic link to the CD to save space.

There is a script that is run to make the system writeable called /etc/init.d/mkwriteable that you can modify to add directories and files you want in RAM.  Check and see if the /etc/uucp directory in your remaster is a symbolic link (does it show up in light blue when you run ls /etc/uucp or with an "l" at the start of its line when you run ls -l /etc/uucp).

If it is a link, what I've done is to remove the link and copy the directory from /KNOPPIX.  If that works then you can modify your remaster's mkwriteable script to include those commands.

Clacker I may have done this wrong but when I entered the lines in mkwriteable file within in remastered Linux I added the following lines (copying these from other lines in the file) :

cp -srd /KNOPPIX/etc/uucp /ramdisk
ln -sf /ramdisk/etc/uucp /

Now looking at the /etc/uucp directory when booting this remastered disk it still shows a link to /KNOPPIX/etc/uucp is this still correct as it showed this last time.

Have I missed something or should have I not bothered with the ln statement and leave it within the ramdisk?.

Posted by clacker on Oct. 10 2005,14:45
Quote (casio @ Oct. 09 2005,10:40)
Clacker I may have done this wrong but when I entered the lines in mkwriteable file within in remastered Linux I added the following lines (copying these from other lines in the file) :

cp -srd /KNOPPIX/etc/uucp /ramdisk
ln -sf /ramdisk/etc/uucp /


I think the paths you used might be putting the files and their links in the wrong places, try this instead:

cp -r /KNOPPIX/etc/uucp /ramdisk/etc
ln -sf /ramdisk/etc/uucp /etc/uucp

Posted by casio on Nov. 17 2005,16:55
Quote (clacker @ Oct. 10 2005,15:45)
Quote (casio @ Oct. 09 2005,10:40)
Clacker I may have done this wrong but when I entered the lines in mkwriteable file within in remastered Linux I added the following lines (copying these from other lines in the file) :

cp -srd /KNOPPIX/etc/uucp /ramdisk
ln -sf /ramdisk/etc/uucp /


I think the paths you used might be putting the files and their links in the wrong places, try this instead:

cp -r /KNOPPIX/etc/uucp /ramdisk/etc
ln -sf /ramdisk/etc/uucp /etc/uucp

Help again ! sorry for taking so long to respond to this thread - I didnt want to repeat/create a new one. I have tried as you suggested Clacker but the area still doesnt load into RAM to make it writeable

Any further Ideas?

I really need this to work and it must be something I am doing wrong. Please can anyone help?

Posted by casio on Nov. 20 2005,13:29
I have found out why it is doing this now. I decided , I now understood what clacker was refering to in a previous post, I booted the remastered cd up running it in ram as always. I then removed the /etc/uucp folder copied it from KNOPPIX to ramdisk disk. Looked at  the uucp folder in the ramdisk and found that the files still have the symbolic links back to KNOPPIX!.

Is there an easy way of removing these links without having to delete the files. The only reason for asking this is that I would be back to square one with having to install uucp which is why I am trying to do this remaster in the first place.

Scrap that , I have figured out that the -s copied the symbolic links, however when I have done this

cp -rd /KNOPPIX/etc/uucp /ramdisk/etc

The files are not place in /ramdisk/etc/uucp just /etc

So then I tried

cp -rd /KNOPPIX/etc/uucp /ramdisk/etc/uucp

but I get an error stating that uucp does not exist!. So its happy to create etc in ramdisk but not /etc/uucp! . AAAAHHHHH

Help!

Posted by clacker on Nov. 20 2005,20:45
casio, did you try just plain old cp -r /KNOPPIX/etc/uucp /ramdisk/etc

Could it be that /KNOPPIX/etc/uucp is owned by root or someone else so when you try to move it it doesn't copy?  Maybe try
sudo cp -rp /KNOPPIX/etc/uucp /ramdisk/etc
to copy the directory as root, copying all of the contents as well, and maintaining the permissions (with the p switch).

Is the /KNOPPIX/etc/uucp directory a link itself?  Maybe the -d is confused by that?  If so try copying the directory the link points to.

I'm not sure what's going on.  I made a few directories to move around to play with and it looks like they behave differently than what you are seeing.  I ran the following commands and saw what I thought should happen happen:

Code Sample
mkdir test1         # makes a directory called test1
mkdir test2         # makes a directory called test2
cp -r test1 test2   # copies test1 into test2
ls test2/             # shows test1 as a subdirectory of test2
cp -r test1 test2/test3   # copies test1 into test2,
                                 #calling the new directory test3 rather than test1
ls test2/             # shows test1 & test3 as subdirectories of test2


I hope you can find your answers.

Posted by casio on Nov. 20 2005,21:55
Looks like I am at a dead end  :( . Tried the copy commands as you suggested Clacker while as root (sudo su) and these are the results :

cp -r /KNOPPIX/etc/uucp /ramdisk . result here is that uucp sits under ramdisk as /ramdisk/uucp

cp -r /KNOPPIX/etc/uucp /ramdisk/etc . etc doesnt exist under ramdisk to start with. However running this command creates etc but does not create uucp under it. Instead the files within uucp sit under etc!.

adding the -rp makes no difference to the above commands

As I type this I have just got it working!. I had to do the following:

cp -rp /KNOPPIX/etc/uucp /ramdisk/etc/uucp.

Now my next question is do I do the link like this :

ln -sf /ramdisk/etc/uucp /etc/uucp
or
ln -sf /ramdisk/etc/uucp /etc

because what I tried on a remaster was this:
<line in mkwriteable>
cp -rdf /KNOPPiX/etc/uucp /ramdisk (i know this works because I tried it at a prompt and it put uucp under ramdisk)
ln -sf /ramdisk/uucp /etc (this didnt seem to work even though I tested it at the prompt when it did!)

Any ideas ?

Posted by clacker on Nov. 20 2005,22:16
casio, I'm glad it's working a little bit.  I'd be careful that the /ramdisk/etc directory didn't get created on the first copy attempt and it worked on the second because the copy wasn't there.  I think I see that your problem was that there is not a /ramdisk/etc directory in the first place, after it's created then things worked.  Try creating the /ramdisk/etc directory and then do your copy after that:

sudo mkdir /ramdisk/etc
sudo cp -rp /KNOPPIX/etc/uucp /ramdisk/etc/uucp
sudo ln -sf /ramdisk/etc/uucp /etc/uucp

Posted by casio on Nov. 21 2005,08:24
Quote (clacker @ Nov. 20 2005,22:16)
casio, I'm glad it's working a little bit.  I'd be careful that the /ramdisk/etc directory didn't get created on the first copy attempt and it worked on the second because the copy wasn't there.  I think I see that your problem was that there is not a /ramdisk/etc directory in the first place, after it's created then things worked.  Try creating the /ramdisk/etc directory and then do your copy after that:

sudo mkdir /ramdisk/etc
sudo cp -rp /KNOPPIX/etc/uucp /ramdisk/etc/uucp
sudo ln -sf /ramdisk/etc/uucp /etc/uucp

Clacker I am sure that I delete etc before trying the above command as I did follow the steps of deleting the folders I created in ramdisk each time.

My main worry is that the linking seems to work at the prompt but not when I apply it to the remastered disk.Its almost as though it is being ignored. However when viewing the mkwriteable is holds the lines I entered?!?!?!

I am just wondering if there is something wrong in the way I am remastering. My steps are as follows (bare with me as I am doing this from memory):
1) I run script which creates the iso image disk from the hard drives template. This template has all of the files installed and sits in the following area: /mnt/hda3/source/KNOPPIX. I have made sure that the image creation script looks into this area.

2) I then run a script which blanks my CDRW and then burns the image with cdrecord.

If you would like me to post the full contents of the scripts then please let me know.

Posted by casio on Nov. 21 2005,20:06
Yep looks like you were right again Clacker. I must of had the /ramdisk/etc folder already there. I am now going to find out whether it is possible to add a mkdir command to mkwriteable now  :) .
Posted by casio on Nov. 21 2005,21:45
Quote (casio @ Nov. 21 2005,20:06)
Yep looks like you were right again Clacker. I must of had the /ramdisk/etc folder already there. I am now going to find out whether it is possible to add a mkdir command to mkwriteable now  :) .

I think the problem here is that for some reason the mkwriteable routine is not been run. When I look at this script there are several directories that should be copied to the ramdisk. Once I boot the remastered disk, these directories are not in the /ramdisk area.

I have, just as a test, run the mkwriteable script by sitting in its true location /KNOPPIX/etc/init.d  and ran it as ./mkwriteable. Obivously it errored on a lot of directories/symbolic links as they already exist.

What would stop this from running.  The permissions on the file seem ok otherwise I would not be able to run it .

Posted by clacker on Nov. 22 2005,18:51
Quote (casio @ Nov. 21 2005,16:45)
I think the problem here is that for some reason the mkwriteable routine is not been run. When I look at this script there are several directories that should be copied to the ramdisk. Once I boot the remastered disk, these directories are not in the /ramdisk area.

mkwriteable needs to be run as root.  If not then the commands it calls won't run becuase of the permissions they require, even if mkwriteable itself would allow you to run it.

Where are you trying to run mkwriteable from?  From the bootlocal.sh script?  That's probably the best place to put it for a remaster.  You would need to run it as sudo /etc/init.d/mkwriteable.  You could also just add the lines you want to run to bootlocal.sh if you preface them with sudo to run them as root.

Posted by casio on Nov. 22 2005,19:36
Personally I thought that anything in /etc/init.d ran on boot up. However from what you have said, this is not the case as you are suggesting I place it within bootlocal.sh.

I am used to other flavours of Linux where the init.d or rc2.d areas are looked at on boot up. Is this not the case with DSL?

When I ran mkwriteable I was logged in as root by doing sudo su. I then ran mkwriteable by entering ./mkwriteable at the /etc/init.d prompt.

Currently I am also experimenting with DSL embedded in windows as well. This has been fun  :D

Posted by casio on Nov. 22 2005,21:54
Adding it to the bootlocal.sh has made this work thanks Clacker. The only thing is, is that the other directories in mkwriteable make their attempt to create their symbolic links but fail as these have already been created.

Any reason why mkwriteable doesnt start by itself from /etc/init.d?

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