WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: remastering tinycore.gz  (Read 15260 times)

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
remastering tinycore.gz
« on: December 06, 2008, 09:32:49 PM »
My first attempt was a complete failure.  I was hoping that cpio would allow overwriting existing files in a cpio archive, so, for instance, if I wanted to replace opt/bootlocal.sh I could do it with "cpio -A" (append), but it adds a second copy  of opt and opt/bootlocal.sh to the archive.

Second attempt was:
gunzip tinycore.gz
cpio -i <tinycore
rm tinycore
[edit file]
find . | cpio -o  |gzip -9 > ../tinycore2

The result during boot was a failure to find init.  I then did cpio -i on the tinycore2 and the init file (symlink to bin/busybox) was still there, so I don't know what the deal is.  Maybe it needs to be named "tinycore.gz" rather than "tinycore2.gz"?

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: remastering tinycore.gz
« Reply #1 on: December 06, 2008, 09:48:54 PM »
EDIT:  YARRR! Ye deleted yon message before I got a chance to save the page! Scurvy dog!

Well, I'm not interested in making a new ISO (I very seldom make CDs but instead just overwrite existing files on my harddrive), so the last step is probably not so important. I thatnk you for that anyway, as it may be useful in the future, and is probably useful to others.

I only glanced at the -H option, since I thought it might apply only to very special circumstances, but was hoping by posting this question that someone might point out something like this =o)

It seemed as though -d is not needed...the necessary directories seem to be created without it?
Also seems to be the same with --no-absolute-filenames

In any case I will try again with those options and see what happens, thank you.

Thanks for the zcat hint...didn't know about that.
« Last Edit: December 06, 2008, 09:51:14 PM by mikshaw »

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: remastering tinycore.gz
« Reply #2 on: December 07, 2008, 07:42:41 AM »
Sorry, I deleted my message since I misunderstood what you were wanting.   But for others here it is as it may be taken off the DSL page.   

unzip and uncpio tinycore.gz:
# zcat /path/to/boot/tinycore.gz | cpio -H newc -i -d --no-absolute-filenames

Make your changes and then zip it back up from within the same directory:
# find . | cpio -o -H newc | gzip -9 > tinycore.gz

Create new iso image if the root of the unpacked cd image is MYDIR and you are one directory above MYDIR:
# mkisofs -pad -l -r -J -V TinyCore -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o tinycore-test.iso MYDIR

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: remastering tinycore.gz
« Reply #3 on: December 07, 2008, 09:07:19 AM »
Quote
find . | cpio -o -H newc | gzip -9 > tinycore.gz
So it seems that building the archive in the same directory  doesn't cause the archive to be added to the find output?  I was using ../tinycore2.gz because I had seen trouble in the past with find (I think it was find) adapting to changes in the directory.  The '2' because I was hoping I could put the test system right next to the original.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: remastering tinycore.gz
« Reply #4 on: December 07, 2008, 09:47:58 AM »
It actually might. Better be safe and output to another dir.
The only barriers that can stop you are the ones you create yourself.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: remastering tinycore.gz
« Reply #5 on: December 07, 2008, 09:57:59 AM »
Yes, it does.  I just tested and tinycore.gz contains a copy of itself

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: remastering tinycore.gz
« Reply #6 on: December 07, 2008, 01:59:35 PM »
It worked well by  building the archive in another location.  Remastering TC is terribly easy . 

Thanks a lot, people.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: remastering tinycore.gz
« Reply #7 on: December 09, 2008, 02:46:24 PM »
Another remastering question....

I added the reiserfs module from the filesystems extension, but I don't know how to get it to load automatically.  If I do "depmod -a" after boot it loads, but that's too late to use for a persistent directory on a reiser partition unless I mount it from bootlocal.

I see the reiserfs module listed in modules.order, but nowhere else. Does it need to be added to modules.dep, or somewhere else?

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: remastering tinycore.gz
« Reply #8 on: December 09, 2008, 02:57:27 PM »
In this situation I would call on "depmod -a" and modprobe reiserfs as well before the persistent home stuff is done in tc-config.  That would be the easiest way to take care of it without replacing the modules config files in /lib/modules in the remastered iso.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: remastering tinycore.gz
« Reply #9 on: December 09, 2008, 03:06:00 PM »
On the other hand, updating the included modules.dep is the right thing to do when adding / removing modules. After that, it should get loaded automatically when trying to mount a reiser filesystem. See the -b flag of depmod.
The only barriers that can stop you are the ones you create yourself.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: remastering tinycore.gz
« Reply #10 on: December 09, 2008, 07:18:17 PM »
I figured I could change tc-config as Jason suggested, but I'm hesitant to do it since future updates might complicate the process.  My current desire as far as remastering is to do nothing but add, replace, and delete files that are not lkely to change over time, since this is easy to script.

If curaga is right, I should be able to just append a line to modules.dep in my remaster.
I'm thinking the -b flag is not needed, since the module is being put in the /lib/modules/2.6.26-tinycore/kernel/fs/reiserfs directory

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: remastering tinycore.gz
« Reply #11 on: December 10, 2008, 05:53:49 PM »
Still not loading, so I must be missing something else.
For now I think I'll leave out both home=hda4 and local=hda4 from the boot options and do it from bootlocal until I learn more about how kernel modules work.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: remastering tinycore.gz
« Reply #12 on: December 10, 2008, 08:22:57 PM »
That worked.  My bootlocal.sh looks like this at the moment (with reiserfs.ko.gz added to base):
Code: [Select]
depmod -a
mount /dev/hda4
if [ $? == 0 ]; then
  mount --bind /mnt/hda4/home/tc /home/tc
  mount --bind /mnt/hda4/tc-apps /usr/local
  ldconfig
fi
That leaves a few small /home/tc files in memory, but it's fine for now.  I could delete them before mounting, but I didn't think about that at the time.
I'm going to leave it like that for now.  I have to focus on getting the martian ltmodem driver working so I can put my other distros to bed.

EDIT: Oddly, wbar doesn't load anymore =op
EDIT2: My problem with modules.dep was a typo.  That's fixed now, so I removed the commands from bootlocal and replaced a couple of lines in tc-config to check mtab for the home & local devices instead of testing if the mount command was successful.  Now the boot codes can still be used.

There are still some weird things happening, but I don't think they have anything to do with the remaster.
« Last Edit: December 11, 2008, 11:06:40 AM by mikshaw »