Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: fodder on March 13, 2013, 04:46:13 PM

Title: Converting USB Configuration to be Netbooted
Post by: fodder on March 13, 2013, 04:46:13 PM
Goal: To take a working TC USB install and set it up to be netbooted.

From everything I can tell the following steps work, but am looking for some feedback from someone more experienced on if this method could cause any problems before I try and deploy in a larger context:

Absolute basic setup:

1) LOAD EXTENSIONS NEEDED FOR SETUP (that I put on the USB drive to make life simpler):

2) SET TERMINAL SERVER STATIC IP: sudo ifconfig eth0 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255

3) START BASIC TERMINAL SERVER:

At this point most people can probably boot the client box and it will boot correctly to a TC prompt, however, I needed one tweak to get it working on my hardware:


4) REMASTER TC WITH USB CONFIG:

5) START SERVING REMASTERED TC:


I am particularly wondering if mydata.tgz already being unpacked before the extensions are loaded (when a client boots) could cause problems?

Thanks for any thoughts and or points in the right direction.

fodder
Title: Re: Converting USB Configuration to be Netbooted
Post by: gerald_clark on March 13, 2013, 04:56:21 PM
http://wiki.tinycorelinux.net/wiki:netbooting
Title: Re: Converting USB Configuration to be Netbooted
Post by: tinypoodle on March 13, 2013, 06:11:49 PM
I think you might need to unpack backup as root.
Packing extracted backup into a separate cpio archive would give you more flexibility.

A quick hack to restore backup with netboot would be to place it in the /netboot dir, so it's easily fetchable via tftp from the already running tftpd server.
Title: Re: Converting USB Configuration to be Netbooted
Post by: fodder on March 14, 2013, 10:49:57 AM
I think you might need to unpack backup as root.

Ah yes, I forgot that I did have to run tar as root, I'll update my first post, good catch.

Packing extracted backup into a separate cpio archive would give you more flexibility.

By a separate cpio archive do you mean something like this?:

A quick hack to restore backup with netboot would be to place it in the /netboot dir, so it's easily fetchable via tftp from the already running tftpd server.

I understand how the sharing could work but am not sure how to implement the unpacking step.  For example, I don't think I can add the tar command that unpacks it to bootlocal.sh because my backup contains bootlocal.sh and therefore overwrites it.
Title: Re: Converting USB Configuration to be Netbooted
Post by: tinypoodle on March 14, 2013, 12:59:09 PM
By a separate cpio archive do you mean something like this?:
  • mkdir /tmp/backupextract
  • cd /tmp/backupextract
  • sudo tar -xvf /mnt/sda1/tce/mydata.tgz -C /tmp/backupextract/
  • sudo find | sudo cpio -o -H newc | gzip -2 > ../my_initramfs_.gz
  • Then edit /netboot/pxelinux.cfg/default: "APPEND quiet cron initrd=core.gz,my_initramfs_.gz"
Uhuh ;)

Quote
I understand how the sharing could work but am not sure how to implement the unpacking step.  For example, I don't think I can add the tar command that unpacks it to bootlocal.sh because my backup contains bootlocal.sh and therefore overwrites it.
Indeed, I meant manual untarring, hence "quick hack" and the suggestion was in response to:

I am particularly wondering if mydata.tgz already being unpacked before the extensions are loaded (when a client boots) could cause problems?

Title: Re: Converting USB Configuration to be Netbooted
Post by: fodder on March 14, 2013, 04:58:45 PM
Thanks so much for the help, tinypoodle, I will definitely try the separate cpio archive.

In my case the manual untarring would be challenging because the clients are digital signage boxes with no mouse or keyboard. :-)
Title: Re: Converting USB Configuration to be Netbooted
Post by: genec on March 17, 2013, 10:38:25 AM
Also check out http://wiki.tinycorelinux.net/wiki:dynamic_root_filesystem_remastering and the new page I've created http://wiki.tinycorelinux.net/wiki:dynamic_multimaster (certainly open to constructive criticism).