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

Booting, installing, newbie
Message
Author
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

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

#41 Post by mikeb »

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.
agreed......Full nfs booting for the future perhaps but main aim is to get something working.now:).

As an aside I first played with NFS using geexbox which is a 10MB media playing distribution which boots up and automatically mounts all sources including NFS shares

mike

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

#42 Post by ecomoney »

Well, we did it, Ive got an iso of the cybercafe system that will boot on any pc in the network, and then boot the rest of the computers via tftp!

The two systems are essentially the same, except the "server (the one with the pup_421.sfs on the CD) contains MZ's tftpserver, offering out a "humungous" netboot initrd.gz, itself containing the same system but without the tftp server startup script in the /root/Startup folder.

Im just doing a similar iso that will netboot HanSamBen, the kids educational distro. This will turn a few heads at the presentation tommorow :D

I will upload links to the iso's overnight on my server here are the links if anyone wants to play....they should be done in about 4 hours from the time of this post, check the file sizes to be sure.

Bootable Cybercafe System (without billing part)
Size:- 45864755 bytes
md5sum:- 317d9e58d01da5ec14461aec89ebfd0b
Link:- http://www.ecomoney.eu/seafarers/iso/cyberlinux.iso


Bootable HanSamBen
Size:- 45121331 bytes
md5sum:- 2838e4796dbf64611a125f485d4e5c1d
Link:- http://www.ecomoney.eu/hsb/cyberhsb.iso

It would still be good to know if I can use nmap to "discover" from the client machines which machine is the tftp server that it booted from. This way I can point the client billing system to the server billing system (for password verification etc). This way I can make a "Puppy Cybercafe on a CD" with a little more work. Is nmap even the right way to go for this?

Many thanks for all of your help to everyone that has given it.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

rexterd
Posts: 12
Joined: Wed 01 Oct 2008, 06:08

#43 Post by rexterd »

pxe puppy is possible and this method is using root filesystem
as an aufs root that you can mount sfs files on the fly and detach your
sfs files mounted if not needed like devx.sfs

-busybox should be recompiled to support udhcpc/dhcpcd so the client gets the ip from the dhcpd server

-puppy boots using pxe and taking bzImage and initrd.gz from the tftp server and make sure nfs server been started.

-init script from initrd.gz gets executed and it sees the pup_xxx.sfs on an exported nfs share and mount the squashfs file, assembles first stage booting so an aufs is created with at least one writable and read-only branch and a swith_root is excuted and passed to your rc.sysinit other rc files so real root kicks in.

- once your up and running you can mount your sfs files from the server it can be thru nfs, samba or httpfs/uloop or mount sfs file locally and merge it to your root filesystem

-recreating squashfs file out of pet packages is easy because any pet being installed gets a copy to your /aufs/rw writable branch, at boot up get a copy (txt) of what you have on your /aufs/rw so after installing your pet packages you can just exclude (txt) in generating the squashfs file.

- i highly recommend using Fatdog(32) if anyone wants to try

rxd

User avatar
didik
Posts: 44
Joined: Mon 05 Jan 2009, 10:34
Location: Bandung, Indonesia
Contact:

The link is missing

#44 Post by didik »

ecomoney wrote:
Bootable Cybercafe System (without billing part)
Size:- 45864755 bytes
md5sum:- 317d9e58d01da5ec14461aec89ebfd0b
Link:- http://www.ecomoney.eu/seafarers/iso/cyberlinux.iso


Bootable HanSamBen
Size:- 45121331 bytes
md5sum:- 2838e4796dbf64611a125f485d4e5c1d
Link:- http://www.ecomoney.eu/hsb/cyberhsb.iso
Ecomoney, the link is missing.

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

#45 Post by ecomoney »

Sorry about the server being down and those links broken. Here is version 0.2 of the tftp server as a forum attachement
Attachments
dnsmasq-2.46-i486-v0.2.pet
(81.83 KiB) Downloaded 627 times
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

jujoboro
Posts: 10
Joined: Wed 02 Jun 2010, 22:03

tftp boot with puppy

#46 Post by jujoboro »

Hi every body. first i apologize my english because i don't have enough practice.

We have the project in my work with 200 terminals hp t5000 (128 ram) to work with linux by dhcp, pxe, tftpboot and nfs (netboot). We try with Debian and work in text mode but with xorg freeze it.

I was trying with puppy but i cant get up the system... i have treated putting the sfs file into the initrd.gz but the terminal shutdown it self after load vmlinuz and three point's line after initrd.gz.

Somebody have any idea?

Post Reply