WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)  (Read 6381 times)

Offline nim108

  • Full Member
  • ***
  • Posts: 107
My goal is to PXE boot tinycore.gz untouched, followed by a custom gzipped initrd that contains extensions and also my mydata.tgz. I am following this guide to dynamically remaster TC: http://wiki.tinycorelinux.net/wiki:dynamic_root_filesystem_remastering. My pxelinux.cfg/default file looks like the following:

DEFAULT /boot/vmlinuz
APPEND initrd=/boot/tinycore.gz,/boot/my_initramfs.gz quiet showapps
PROMPT 0

my_initramfs.gz is a cpio gzipped archive that contains the following files:
/opt
/opt/tce (contains copy2fs.flg, mydata.tgz which is a tar gzipped archive of all the files I want to restore, and onboot.lst which contains all the extensions to be loaded)
/opt/tce/optional (all tcz extensions in here)

Now the problem: TC loads all the extensions just fine but skips the mydata archive. It's as though it does not see it. What am I doing wrong here? Where should it be placed or what boot code should I use to force it to load? Because it is being PXE booted, there is really no "physical" partition to load it from, so is this even possible or is my best option to statically remaster tinycore.gz? I'd like to keep it untouched if possible and modify it through my customized initrd. Thanks.
« Last Edit: November 14, 2011, 03:06:18 PM by nim108 »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #1 on: November 14, 2011, 04:54:50 PM »
Please read this: http://wiki.tinycorelinux.net/wiki:netbooting

This explains several ways to load extensions, and even have tce on nfs,nbd, or aoe.

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #2 on: November 14, 2011, 07:55:05 PM »
Please read this: http://wiki.tinycorelinux.net/wiki:netbooting

This explains several ways to load extensions, and even have tce on nfs,nbd, or aoe.
I looked at that, but due to certain limitations of the server computer, I cannot run nfs on the server side (the server computer is running a DHCP and TFTP server using C# code in Windows, and is all automated, so nfs is not trivial at all). I'd like to cook everything into a custom packed initrd if possible, as proposed in the original post. Again, I know the custom initrd is good because the extensions load, but TCL doesn't see my mydata.tgz for some reason. Any help on this specifically? I'll use the netbooting article as a last resort if it comes to it, thanks.
« Last Edit: November 14, 2011, 08:04:24 PM by nim108 »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #3 on: November 14, 2011, 10:36:18 PM »
mydata.tgz must be on some persistent storage. 
You could create an extension instead of mydata.tgz, and load it along with other extensions using tftp or http.

Instructions are in the article I referenced earlier.

You can also load multiple initrd files ( compressed cpio archives ).

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #4 on: November 15, 2011, 05:26:21 AM »
Thanks gerald, I'll try converting it into an extension. And multiple initrd files is the way I'm loading it right now ... first loading tinycore.gz, then my_initramfs.gz. Extensions load fine this way, but mydata.tgz does not, probably because of there being no persistent storage. Here is the thing though: when I chainload my_initramfs.gz, it should just be overlaying what's in there into the tinycore ramdisk correct? If that's the case, why can't it find (and load) mydata.tgz which should now be in /opt/tce in the ramdisk? Can I force it to look there?
« Last Edit: November 15, 2011, 05:36:48 AM by nim108 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #5 on: November 15, 2011, 08:41:25 AM »
There is no support for backup on /opt/tce. Should be easiest just to extract your mydata.tgz to the second initrd.

Or, if you need it to load later than extensions, unpack it yourself in bootlocal.sh.
The only barriers that can stop you are the ones you create yourself.

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #6 on: November 15, 2011, 10:41:18 AM »
Thanks curaga, that's what I wanted someone to confirm. I will extract it myself in the second initrd then. Are there any plans to add support for backup on /opt/tce in the future? It would be kind of nice since extensions can be loaded that way.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #7 on: November 15, 2011, 11:01:13 AM »
Does not make any sense to add support for backup of static content.
The backup time would quickly become unbearable.
10+ Years Contributing to Linux Open Source Projects.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #8 on: November 15, 2011, 11:28:56 AM »
Having a mydata.tgz in the initrd is a waste of RAM unless you delete it after extracting.
I don't see the point.  You can't save any dynamic data because your backup file is burried in an initrd.

You might consider a Windows AOE server.
http://www.mail-archive.com/aoetools-discuss@lists.sourceforge.net/msg00274.html
Or a Windows nbd server
http://www.vanheusden.com/windows/nbdsrvr/

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: PXE chainboot tinycore.gz and custom initrd.gz (dynamic remastering)
« Reply #9 on: November 15, 2011, 11:41:32 AM »
Thanks, you guys are spot on about this. I'm forgetting the real reason backup / restore functionality was put in here, and it's not for static content for sure. Thanks for the help all.