Does anyone know of a TFTP server for Puppy? - SOLVED

Booting, installing, newbie
Message
Author
MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#21 Post by MagicZaurus »

That's no issue at all to do all with a Puppy box. I thought you prefered to have the Smoothwall to connect to the outside world.

With my package the DHCP and the TFTP are both running on Puppy. Then you only need to find a way to share the internet from 'outside' to the 'inside'. I think that is explained somewhere here in the forum. I even think you were involved in that thread if I'm not wrong.

The DHCP server must run on the 'inside card', but if there are 2 cards it is pretty difficult to automatically detect which is 'inside' and which is 'outside'. Unless you go by convention that eth0 is 'outside' and eth1 is 'inside'.

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#22 Post by ecomoney »

The smoothwall I put in place simply because it has a great deal of features that can be added to it...none of which seem to be needed so far. :oops: An all-puppy solution would be simpler, and would mean that the cybercafe could run totally hard disk free, eliminating another moving part and increasing reliability.

I also work on the HanSamBen project, a childrens educational puppy derivative allowing really old computers to be used. Today with some experimentation I got it to netboot on the cybercafe system....this brings possible opportunities.

I am reliably informed by a great number of young ones that their school computers here in the U.K. often fail during their lessons...perhaps something to do with the fact that our Government prescribe all of our schools must have a Windows licience for each computer...even if it is Linux (or Mac). Having a netbooting capability would be a great emergency measure that could be used by teachers in failed Micro$oft classrooms (and teach kids not to fear the Penguin!).

Being able to Network Boot from a standard Puppy disk would be a great feature, especially if it were possible to install puppy linux onto the the newly-netbooted computer (this would make "processing" large volumes of what would otherwise be "computer waste" with Puppy Linux extremely quick and easy). Puppy is a distro that is supposed to be "easy to install" after all. :wink:

MZ, may I trouble you to post a little information about how to configure this package to allow puppy to start itself over a network (in simple terms). Following the convention of eth0-in/eth1 out, what would be the procedure for enabling internet connection sharing also?
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#23 Post by MagicZaurus »

Booting itself over the network is not possible for a standard Puppy CD as far as I know. It would still required that you make a humongous initrd.gz for netbooting. Similar like what you are doing on the Smoothwall. I think you can burn that humongous initrd.gz also onto the CD.

It might actually be possible that you also boot from the CD with that humongous initrd.gz. I never tried that.

About internet sharing have a look here.

http://murga-linux.com/puppy/viewtopic. ... 2&start=20

That's a post from ecomoney. Another one here. Also from ecomoney, providing a .pup to do internet sharing.

http://murga-linux.com/puppy/viewtopic. ... 02&t=37161[/url]

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#24 Post by ecomoney »

Hi MZ, networking is not my best subject, you will have to excuse me, I am learning. Those posts were there only to feed back the observation that internet connection sharing is something that Ive seen is a much required feature that could be added to puppy without much space overhead. The actual theory of it Im not at all familiar with.

I know it is possible to boot an initrd.gz image from a hard drive (with the pup_412.sfs contained within it). Im actually using this method while Im posting this. I will create an ISO with the initrd.gz in this format and see how it works.

The next stage after this works would be to include your tftp server package you mailed me in the initrd.gz/pup_421.sfs file, with a symlink to the initrd.gz and vmlinuz on the CD. This should, when booted, "broadcast" a tftp server over whatever network the computer booted with this CD...allowing other computers to boot from it (am I correct). I assume the symlink would need to be in the /root/tftpboot/pxelinux.cfg/ folder once the package was installed. I would also have to call the script /usr/sbin/ppxe to start the tftp server.

Many thanks for your help
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#25 Post by mikeb »

Erm sorry to drop in to a thread I never read :oops: but having recently got NFS running happily on puppy would this be a good option perhaps for the future if not now.....NFS shares are mounted as easily and transparently as say dev_save is and I believe was a traditional way of running over a network

mike

this message may self destuct in the future

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#26 Post by ecomoney »

You are welcome MikeB, thanks

What you are saying is....it may be possible to tftpboot a special initrd with no pup_412.sfs inside, but instead it gets its pup_412.sfs by NFS mounting back to the "servers" CD? This way programs from inside the .sfs would load transparently over the network? The network traffice would automatically be "compressed" as it would be read from the .sfs, so if say abiword were to be loaded then the user would only need to wait for about 3mb of data to transfer via ethernet. This would be similar to a low-ram frugal install loads its programs from a hard disk....and would mean essentially the clients would only need say 64mb as only the kernel/xwindows/jwm would need to be loaded, plus perhaps a browser or whatever programs the user was using. Could a swap partition also be mounted via NFS (not ideal I know but better than no swap).
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#27 Post by mikeb »

Not sure about the swap but nfs shares can be mounted just like partitions ... and the modules can be loaded just like ide.usb etc....at boot so open to various posibilities.
From what I have read running over a network is one of its purposes....some research needed but I am fairly familiar with server/client setup in puppy now.
Best idea would be to have a play
http://www.murga-linux.com/puppy/viewtopic.php?t=45090

mike

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#28 Post by MagicZaurus »

A few months ago I met a guy on IRC who managed to boot Puppy with NFS. I think his nick was vxrt, but I'm not very sure.

It's a bit more difficult as just loading the NFS drivers. It requires that the network card gets configured during the initial boot. They guy knew which card his PC had and so just loaded the correct driver and assigned a fixed IP. For a generic solution it actually requires that some kind of 'Network-Wizard' is in the initial boot and also the DHCP client must be in the initial boot. I had a short try at it some months back, but realized it requires major changes in the init process and decided that humongous initrd.gz is the easier way. If there is more than 256MB RAM then the boot time will be similar, as the whole sfs-file will anyway be loaded into RAM.

Surely an interesting project.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#29 Post by mikeb »

Perhaps the network card answer
http://www.murga-linux.com/puppy/viewtopic.php?t=45074
surely ftp would need this too?
mike

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#30 Post by MagicZaurus »

Hi mikeb!

Thanks for the great info. Sounds like the right direction. Maybe ecomoney can make use of it and try that out.

TFTP doesn't require this, as the TFTP connection is initiated by the PXE-ROM of the network card, even before the very first line of the Linux boot process is executed.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#31 Post by mikeb »

TFTP doesn't require this, as the TFTP connection is initiated by the PXE-ROM of the network card, even before the very first line of the Linux boot process is executed.
ah I see... that makes life simpler
Well perhaps nfs could be useful in some way as it is a handy tool thats why I popped in

have fun

mike

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#32 Post by ecomoney »

Definitely an idea for a feature...Im assuming if the correct "magic" were to be added to the init file, then it would be a matter of offering the initrd and vmlinuz files via a tftp server, and the pup_421.sfs files out via NFS. This would allow puppy linux to be able to boot (or install?) itself over a network. This would teach puppy another very useful trick with very little space overhead.

Ive uploaded the files you sent me MZ to

http://www.ecomoney.eu/puppy/pets/netwo ... 6-i486.pet

and also added them as an attachment below.

MikeB, thanks for the links I will look into the techniques presented there.
Attachments
dnsmasq-2.46-i486.pet
(100.4 KiB) Downloaded 685 times
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#33 Post by ecomoney »

WORKING!!! :D :D :D

What I did was boot puppy (4.2.1) in liveCD mode, and connected to the web using the connection wizard via the 4-port router I have here. I then installed the package above and copied a netboot HanSamBen initrd.gz I already had prepared, along with the vmlinuz file from the 4.2.1 CD to the /root/tftpboot folder that the package created. At a terminal (rxvt) I then ran "ppxe start" which started the tftpserver.

On one of the other computers connected via the router I went into the bios and set the first boot device to the network, and off it went!

Ive got a presentation to the Seamans Mission Management on Thursday in the Hull centre (not the Immingham centre where they are currently working). Currently they are using an XP only setup in Hull. Before then I will try and make a CD that will boot and then automatically run a tftp server, serving out the netboot files across the network there. This should afford them a smooth transition from their XP system to a puppylinux one.

MZ, I have made some changes to your .pet. It should now install with a menu entry, and display a simple readme file. The tftpboot startup script (/usr/sbin/ppxe) will now have a menu entry, and show graphical xmessages to give its status, instead of just echoing to the command line. Ive also stripped the man pages, which means this package is only 82Kb. Ive uploaded this here

http://ecomoney.eu/puppy/pets/network/d ... 6-v0.2.pet

It would be great if the init script would be able to detect if the computer was being netbooted and either then transfer the pup_421.sfs file in its entirity (if there was enough RAM) or mount it via NFS if not (as puppy currently does from the Hard Disk/CD if there is not enough RAM). I will look into this and let you know how it goes....bit it sounds difficult any tips/pointers greatly appreciated.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#34 Post by MagicZaurus »

Hi Ecomoney!

Thanks for the changes to the package. I just hacked it together last time, so that there is something to try netbooting.

The idea with using NFS is great. The critical part is to get the network card running in the initial boot part with the 'original' initrd.gz. Once the network is up it's comparably simple to mount the sfs-file over NFS.

Is it possible to mount/add a sfs-file on the fly without rebooting in Puppy? I searched the forum but couldn't find something positive, but I might have overlooked it.

Good luck for your presentation on Thursday. Things are getting better step by step.

MZ

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#35 Post by ecomoney »

Hmm, Yes the network card, I hadnt thought of that. Ive had a look at the init script inside initrd.gz that controls puppy's booting....this is the part (in 4.2.1) dealing with initrd.gz starting at line 392

Code: Select all

#a humongous initrd has pup_xxx.sfs inside it...
if [ -f /pup_${PUPPYVERSION}.sfs ];then
 #v3.91 and maybe also zdrv_xxx.sfs...
 if [ -f /zdrv_${PUPPYVERSION}.sfs ];then
  echo "rootfs rootfs /pup_${PUPPYVERSION}.sfs /zdrv_${PUPPYVERSION}.sfs" >> /tmp/PUPPYFILES
 else
  echo "rootfs rootfs /pup_${PUPPYVERSION}.sfs" >> /tmp/PUPPYFILES
 fi
 PUPPYFILES="`cat /tmp/PUPPYFILES`" #v3.91
fi

Ive attached the rest of the init script in a zip if anyone wold like to see.

I suppose the edit needed would be that if the pup_421.sfs is not available anywhere else (i.e. CD/HD/inside initrd.gz) then a new routine (possibly another function at the top) would load the drivers for the network cards, and scan the network for any Tftp/NFS Servers. It would then attach a network share at that i.p. address and mount the pup_421.sfs file that would be shared from the the host computer.

Problem is I dont know what a network driver under Linux even looks like.... :roll:

Never mind, even if I have to have a CD with an humongous initrd.gz burnt to it as well for thursday it will fit the purpose. Many thanks for your help with netbooting MZ, youve been a massive help to this project.
Attachments
init.zip
init script from 4.2.1
(16.78 KiB) Downloaded 576 times
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#36 Post by MagicZaurus »

With just the normal standard Puppy this is a Chicken & Egg problem.

The network drivers are inside the sfs-file, as well as the DHCP client, which are needed to get the network card up and running to mount the sfs-file.

So the only way is that the drivers and the routine to load the correct driver (Network-Wizard) are put into the initial small initrd.gz. I never tried, but I expect it's a bit complex as they might need other libraries which then also need to be put into the initial small initrd.gz.

After a NFS is mounted it can be treated similar to a local partition and so the rest of the init code actually could remain most likely the same.

MZ

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#37 Post by mikeb »

So the only way is that the drivers and the routine to load the correct driver (Network-Wizard) are put into the initial small initrd.gz. I never tried, but I expect it's a bit complex as they might need other libraries which then also need to be put into the initial small initrd.gz.
just net card modules , and dchpd binary ...at a guess an increase of ~1 MB.
Initrd.gz unpacked is just a mini linux file system. Init would need the rc.network stuff and dchp launch command including then NFS shares would be available for the unionfs.

There has been some work on dynamically adding sfs files like slax does (aufs permits this I believe). Another way is to mount at say /opt large sfs like open office...that can of course can be done after booting without any mods to the main system.

how to edit initrd for puppy 3 and 4
To edit initrd.gz from Puppy 3.xx, first copy initrd.gz to someplace on a linux filesystem where you can work on it (I like to use /tmp/NewDir). Then open a terminal there and run this:
Code:
mkdir initrd-tree
cd initrd-tree
zcat ../initrd.gz | cpio -i -d

That will make a directory initrd-tree that contains the contents of the initrd.gz file. Go inside and edit away. When you're finished, from inside the initrd-tree/ directory, run these commands:
Code:
find . | cpio -o -H newc | gzip -9 > ../initrd.gz

That will replace the old initrd.gz file with the new one. Now just copy that into the correct place, and you're good to go.
mike

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#38 Post by ecomoney »

Ok...this sounds difficult :lol:

Onebone Puppy is around 30mb (it comes with elinks and a few command line tools which could probably be stripped...I heard somewhere puppy could be stripped to about 24mb with no Xwindows and these tools). Basically Im looking to be able to netboot computers with about 64mb of RAM.

If the DNS package could be updated to run a script that would basically "strip out the fat" (xwindows, all apps) and make a humungous initrd out of it which it then serves out via the ftp server. Once this is booted on the client machines, they could autodhcp and use nmap to discover the i.p. address of the tftp server (scan for machines with an open port 69, the default for tftp?). It could then "layer" the pup_421.sfs (with all apps/xserver etc) over the files currently held in memory (like a normal addon .sfs pack).. This way the netbooted computer would contain all of the core utils locally, and load the xserver/app files as needed from the computer that booted it....how is this for an idea?

Instead of onebone, there is also Puppy 4.1.2 barebones, which contains jwm, but no apps

http://www.puppylinux.org/?q=downloads/ ... es-pup-412

This is 57mb, so it would need clients with at least 128mb of RAM. Its been my experience that computers with less ram than this generally do not have a netbooting via LAN feature in their bios anyway.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#39 Post by mikeb »

possible run time mounting of sfs files here
http://www.murga-linux.com/puppy/viewto ... 92&t=44719

mike

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#40 Post by MagicZaurus »

Hi Mike!

That looks very promising. Seems like everything is available and 'only' needs to be assembled together. Ecomoney's idea to use a 'Barebone Puppy' and then load the other sfs-files over the network, seems like a good way to go to me. More easy to impement then to include the network drivers in the initial boot process.

Let's see where this way leads us to.

MZ

Post Reply