Creating PXE puppy (solved)

Under development: PCMCIA, wireless, etc.
Message
Author
jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#21 Post by jamesbond »

Thanks MagicZaurus for the script and PhLe for the instruction.

I tested the script (after compiling dnsmasq for fatdog64) and it works beautifully! I'm impressed ... the other instructions I've found so far to setup boot servers are overly complicated. (Install DHCP server, install TFTP server, configure DHCP server, configure TFTP server, configure pxelinux and other stuff - scary :shock: )

This is extremely simply - get dnsmasq, copy and paste the script, and voila! Working boot server !!! I'm really impressed.

cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

gcmartin

DNSmasq for FATDOG - 511

#22 Post by gcmartin »

@JamesBond great report.
Did you, perhaps, make a PET of your DNSMASQ compiled for FATDOG64?
Could you share a URL for download, or is your PET available via PPM?
jamesbond wrote:Thanks ...I tested the script (after compiling dnsmasq for fatdog64) and it works beautifully! ...
Does your PET put an entry in the desktop's Menu (say under Networking/somewhere)?
Could your PET have included the script and installed it when PET was run?
Which folder did you place the script in?

Thanks in advance.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#23 Post by jamesbond »

No worries gcmartin, it will take sometime though.

I can't upload it to PPM yet - as you can see from Barry's blog, ibiblio.org is currently undergoing a migration. Thus we can't upload anything there. I can post you the dnsmasq pet to the Fatdog64 thread for the time being.

The script, however, is another matter. It's mean to be run from terminal, and there's some implicit assumptions inside (which is meant to be edited if the script is to be re-used by someone else). It takes a while to convert it to a general purpose script. I'll do that but that will take time.

cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#24 Post by jamesbond »

The script, packaged in a pet, with gui wrapper (for start/stop control), with desktop menu, suitable for permanent inclusion with any puppy (tested with Fatdog64 - on other puppies the menu may not appear). The executable is netboot-server-jb.sh.

the tftpboot directory is assumed to be at /root/tftpboot (symlink will work if another location is preferable).

Requires dnsmasq (assumed to be available somewhere in the path).
Attachments
netboot-server-1.0.pet
(1.79 KiB) Downloaded 613 times
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

gcmartin

wOW

#25 Post by gcmartin »

This is an incredible contribution.Thanks everyone.

So, if I understand; on my FATDOG, I should:
  1. install your dnsmasq.pet
  2. install the netboot-server.pet
  3. create my files necessary for PXE boot in the TFTP download folder
  4. boot a PXE capable PC on the LAN
That's IT! Did I miss anything?

This is going to be great!
Last edited by gcmartin on Mon 17 Jan 2011, 19:15, edited 3 times in total.

phLe
Posts: 13
Joined: Thu 25 Nov 2010, 11:59

About the MagicZaurus Ecomoney Ph. Lelédy script

#26 Post by phLe »

I am Ph. Lelédy who wrote http://www.murga-linux.com/puppy/viewtopic.php?t=62308, and enhanced the script from MagicZaurus and Ecomoney for not serving non PXE clients.

I wonder if the script in netboot-server-1.0.pet is this one I speak about ?

If it the case I warn against a little bug:

Code: Select all

grep "inet addr"
doesn't work on a french localized server (in french one says "adresse" for the english word "address"). So I had to replace by

Code: Select all

grep "inet ad"
which works on both englis and french servers.

Furthermore, I like using my script with -d option because it gives very clear debugging information. Hox does-it fit in a GUI ?

PhLe.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

Re: wOW

#27 Post by jamesbond »

gcmartin wrote:This is an incredible contribution.Thanks everyone.

So, if I understand; on my FATDOG, I should:
  1. install your dnsmasq.pet
  2. install the netboot-server-1.0.pet
  3. create my files necessary for PXE boot in the TFTP download folder
  4. boot a PXE capable PC on the LAN
That's IT! Did I miss anything?

This is going to be great!
Yes, that's all you need to do. For other puppies, I believe there is dnsmasq pet floating around also.

EDIT: The server will continue to run after you activate it. Click the menu (or run netboot-server-jb.sh) again to terminate the server. If you want a single-use version, use the debug version in the next two posts instead.

Running server doesn't survive reboot - you need to run it again if you reboot the machine.
Last edited by jamesbond on Fri 14 Jan 2011, 02:37, edited 1 time in total.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

Re: About the MagicZaurus Ecomoney Ph. Lelédy script

#28 Post by jamesbond »

phLe wrote:I am Ph. Lelédy who wrote http://www.murga-linux.com/puppy/viewtopic.php?t=62308, and enhanced the script from MagicZaurus and Ecomoney for not serving non PXE clients.

I wonder if the script in netboot-server-1.0.pet is this one I speak about ?
Thanks PhLe, yes, it's your script that I modified a little, and put into the pet.
If it the case I warn against a little bug:

Code: Select all

grep "inet addr"
doesn't work on a french localized server (in french one says "adresse" for the english word "address"). So I had to replace by

Code: Select all

grep "inet ad"
which works on both englis and french servers.
I changed the way the PXE_IP is determined (because sometimes I get the IP address from eth0, sometimes from wlan0, and I don't want to keep changing the script) - I get it from "ip address" command now instead of ifconfig, so this fix no longer apply for above. I don't have any localised French server though, so I can't say whether it will work there.
Furthermore, I like using my script with -d option because it gives very clear debugging information. Hox does-it fit in a GUI ?
You can't :D You can still run it from the terminal and pass the -d option and see all the debugging info on the terminal. It's possible to pipe that debugging output to a GUI window as well, but I'm not very inclined to do that now (because it's much easier just to open terminal and run the script from there) :wink:

All in all, thanks for your contribution (and MagicZaurus and Econmoney) which makes this possible in the first place.

cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

Re: About the MagicZaurus Ecomoney Ph. Lelédy script

#29 Post by jamesbond »

jamesbond wrote:
Furthermore, I like using my script with -d option because it gives very clear debugging information. Hox does-it fit in a GUI ?
You can't :D You can still run it from the terminal and pass the -d option and see all the debugging info on the terminal. It's possible to pipe that debugging output to a GUI window as well, but I'm not very inclined to do that now (because it's much easier just to open terminal and run the script from there) :wink:
Actually here's the script for those who needs it - copy this over /usr/sbin/netboot-server-jb.sh to have it replace the one installed by the pet. It will run dnsmasq with "-d" option, capture and display it on a window ... when you're done, click cancel and dnsmasq will terminate.
Attachments
netboot-server-debug.sh.gz
(1.35 KiB) Downloaded 572 times
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#30 Post by jamesbond »

Ok updated the script ... combined the "normal" and "debug" mode (you can choose when you start up the server). I've created the /root/tftpboot directory structure and throw in gpxelinux.0 (from syslinux-4.03) and the "default" files. All that is needed is to symlink the proper vmlinuz and initrd.gz to /root/tftpboot/pxelinux.cfg directory.

Even this can now be automated - I've also included a script "mknetboot.sh" (no menu entry, must be accessed through terminal or through "Gexec run command") to convert a standard puppy iso into a netboot-compatible files in /tmp/netboot, and symlink it right to /root/tftpboot/pxelinux.cfg ready for booting!

A separate dnsmasq pet is still required - I purposely leave out the dnsmasq so that this pet is puppy-dependent and can be used in all puppies.

EDIT - the latest puppies as of today (Wary 5.0, Lupu 5.2), have a bug in their init script, making netboot failed during booting. While it's being fixed, the workaround is to edit the "default" file and add "PDEV1=rootfs" to the line that contains "append".

cheers!
Attachments
netboot-server-2.pet
(89.36 KiB) Downloaded 592 times
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

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

PXE package

#31 Post by MagicZaurus »

Thanks a lot jamesbond for packaging this all so nicely together. I didn't have time to test it, but with all your efforts netbooting Puppy has become so much easier.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#32 Post by jamesbond »

Thanks for your kind words, MagicZaurus.

gcmartin found a bug in mknetboot.sh (this is due to Xdialog/GTK bug). Here's a fix - it's not perfect, but at least it works.

cheers!
Attachments
netboot-server-3.pet
(89.53 KiB) Downloaded 3698 times
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#33 Post by mhanifpriatama »

Maybe helps some one.
I use another way. I used for my small internet cafe.
My server uses lupu511, my client uses lupu503.

On server :
1. Install dnsmasq
2. create /etc/dnsmasq.conf
3. write code inside dnsmasq.conf :

Code: Select all

 

# Configuration file for dnsmasq
dhcp-range=169.254.33.219,169.254.33.223,12h
# give IP address to match machine address : 
dhcp-host=00:30:67:31:69:02,169.254.33.220
dhcp-host=00:30:67:1E:F4:7E,169.254.33.221
dhcp-host=00:30:67:6E:B0:1B,169.254.33.222
dhcp-host=00:30:67:1E:FA:8C,169.254.33.223
# Set the boot filename for netboot/PXE
dhcp-boot=pxelinux.0
# Enable dnsmasq's built-in TFTP server
enable-tftp
# Set the root directory for files available via FTP.
# I use /initrd/mnt/dev_ro2 because use fresh frugal install on hd
tftp-root=/initrd/mnt/dev_ro2/tftp
# Debugging
log-queries
log-dhcp
# somewhere other that /etc/resolv.conf
resolv-file=/etc/ppp/resolv.conf
4. prepare pxelinux and humongous initrd.gz (with lupu-503 inside)
5. Place at a script in Startup this command : /usr/local/sbin/dnsmasq -d
(gbilling-server also)
6. Set client with lan booting.
Done ...

I never use pupsave. Just remastering with dougal's script.
But i forget something important, how to make client connect to server and auto IP assign! Just run network wizard, place manual IP and gateway, then remastering. Can any one explain how-to this thing? I don't know how rc.network work.
I want upgrade client to lupu520.
SOrry on my english.

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#34 Post by mhanifpriatama »

I did this on my lupu 520 thin-client :
put my script on rc.local

Code: Select all

a=`dhcpcd -T | grep new_ip_address` #pick ip address from dhcp server
dhcpcd -s ${a:15:15}  #from line, just pick the ip number : 169.254.33.223 then run dhcpcd with -s option
route add default gw 169.254.33.219 
echo nameserver 169.254.33.219 >> /etc/resolv.conf
after that, thin-client can connect to internet at first bootup.
My problem above is solved.

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#35 Post by Master_wrong »

Thank you for the script.

so you put the script on rc.local, the remaster, the the remastered iso is used to boot the client via pxe ?

correct ?
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#36 Post by Aitch »

Hi all

For anyone still struggling with PXE booting, I've just come home from a Linux/Cloud Show at Barbican, UK, and saw this demo'd, at the show

http://ipxe.org/

I don't know if it's any use/can be incorporated into puppy, but it seemed impressive with a wide range of network cards supported, and range of implementation formats
with additional features such as:

*
boot from a web server via HTTP

*
boot from an iSCSI SAN

*
boot from a Fibre Channel SAN via FCoE

*
boot from an AoE SAN

*
boot from a wireless network

*
boot from a wide-area network

*
boot from an Infiniband network
Aitch :)

gcmartin

#37 Post by gcmartin »

Thanks @Aitch

This is a client-side application. Thus, it ONLY applies to the client one is trying to have starting over the LAN.

This is something that one can use if his PC's PXE motherboard support is problematic (doesn't work) or if the PC someone is trying to use doesn't have a PXE LAN function on the motherboard so this might allow him to find the PXE server on the LAN (although I haven't tried it yet) and boot their machine using the ISA/PCI LAN card in their PC.

The PXE server should could care less. It will serve whomever makes the request for service. iPXE running on a LAN machine will allow the requesting PC to make that request if his machine cannot do it under its own power.

Hope this helps

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#38 Post by mhanifpriatama »

Master_wrong wrote:Thank you for the script.

so you put the script on rc.local, the remaster, the the remastered iso is used to boot the client via pxe ?

correct ?
Yes, correct. Sorry so long to answer. But one thing I had problem and I solved it : you must put delay time!!!!
so ....
the script is like ...

Code: Select all

a=`dhcpcd -T | grep new_ip_address` #pick ip address from dhcp server
dhcpcd -s ${a:15:15}  #from line, just pick the ip number : 169.254.33.223 then run dhcpcd with -s option
sleep 10
route add default gw 169.254.33.219
echo nameserver 169.254.33.219 >> /etc/resolv.conf 

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#39 Post by mhanifpriatama »

Just report, may be useful.

If I want to customize thin-client lupu-520.sfs, I remaster it.
But, this thing eat time a lot.
So, I just customize initrd.gz :
1. extract initrd.gz
2. put a script, exp : aa.sh
3. little hack the init script : copy aa.sh to initrd/mnt/data

How to run that script?
Do remaster, or edit the lupu-520.sfs.
Then add these line to rc.local :

Code: Select all

chmod a+x /initrd/mnt/data/aa.sh
/initrd/mnt/data/aa.sh
This script will run before xwin.

If we want to put a script at Startup, just add these code to aa.sh :

Code: Select all

echo "#!/bin/bash
firefox 
" > /root/Startup/ss.sh

So, I can make user run openoffice.sfs with this method :

Code: Select all

mkdir /root/dir_oo
curlftpfs ftp://169.254.33.219 /root/dir_oo
cd /root/dir_oo
filemnt ./go-oo-3.2-sfs4.sfs

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#40 Post by Master_wrong »

hi mhanifpriatama,


thank you...

oh another sfs loading hack :lol:

that can be useful... 8)
Code:

mkdir /root/dir_oo
curlftpfs ftp://169.254.33.219 /root/dir_oo
cd /root/dir_oo
filemnt ./go-oo-3.2-sfs4.sfs


so the sfs located... at /root/dir_oo /
and the filename is go-oo-3.2-sfs4.sfs

thank you very much for sharing
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

Post Reply