Creating PXE puppy (solved)

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#14 Post by jrb »

I have been pxe booting various puppies with MagicZaurus and ecomoney's dnsmasq-2.46-i486-v0.2.pet installed on my pupserver-435.iso. On the whole it is working very well but has required some special accomodations.

First I changed /root/tftpboot/Start-Netboot.sh to:

Code: Select all

#!/bin/sh
#9jan2011-jrb-added creation of /var/lib/misc as it diappears on reboot
mkdir /var/lib/misc 2>/dev/null
ppxe start
Second internet connection doesn't work until I reset the Gateway back to my syslinux router as it takes the ip address of my fileserver as the Gateway. I can do this by running the classic network connection wizard and setting up a new static ip address or by running

Code: Select all

route add default gw 192.168.1.1 eth0
at the command line where 192.168.1.1 is the address of my router.

So far I've booted 4 different computers and three different puppies this way successfully. I don't know if there are hazards associated with running two different dhcpcd servers on the same network. If there are please let me know. :?:

Incidentally, this has allowed me to easily dual boot my wifes win7 machine. I had tried easybcd but only ended up borking the mbr. Now its as simple as pressing F12 at bootup and selecting pxeboot. :D

Cheers, J

gcmartin

#15 Post by gcmartin »

@jrb Good information.
jrb wrote:I have been pxe booting various puppies ... Second internet connection doesn't work until I reset the Gateway back to my syslinux router as it takes the ip address of my fileserver as the Gateway. I can do this by running the classic network connection wizard and setting up a new static ip address or by running

Code: Select all

route add default gw 192.168.1.1 eth0
at the command line where 192.168.1.1 is the address of my router. ... I don't know if there are hazards associated with running two different dhcpcd servers on the same network. ...
Does this mean that the TFTP server AND your router are, both, providing DHCP services on the LAN? What is the IP address and subnet mask used by your router? And, what addresses is it issuing to your LAN machines? Further, what is the subnet mask your TFTP server using?
Thanks in advance for this

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#16 Post by jrb »

Here is the same machine booting qrky130 from the harddrive and from pxe.
Hardddrive:

Code: Select all

eth0      Link encap:Ethernet  HWaddr 00:17:A4:1F:AD:3A  
          inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:191 errors:0 dropped:0 overruns:0 frame:0
          TX packets:199 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:60397 (58.9 KiB)  TX bytes:20475 (19.9 KiB)
          Interrupt:17 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
PXE:

Code: Select all

eth0      Link encap:Ethernet  HWaddr 00:17:A4:1F:AD:3A  
          inet addr:192.168.1.121  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:252 errors:0 dropped:0 overruns:0 frame:0
          TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:19759 (19.2 KiB)  TX bytes:7076 (6.9 KiB)
          Interrupt:17 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
My settings had held in the save file after setting static ip, so I had to create a new save file to duplicate the pxe behavior.
Attachments
ip_pxe_boot.jpg
pxe boot
(19.08 KiB) Downloaded 2450 times
ip_hd_boot.jpg
harddrive boot
(19.78 KiB) Downloaded 2461 times

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

2 DHCP Servers

#17 Post by MagicZaurus »

@ jrb & gcmartin

If you use the startup script from this How-To http://www.murga-linux.com/puppy/viewtopic.php?t=62308 from phLe then your DHCP server from dnsmasq only replies to the request of the network card during PXE boot and not to the normal DHCP request when trying to connect to the internet.

It's usually not advised to have 2 DHCP servers running, but it should work fine with the right configuration. During PXE boot the network card ignores the original DHCP server, as there is no link to a TFTP server in the reply.

gcmartin

Re: 2 DHCP Servers

#18 Post by gcmartin »

Thanks @JRB and @MagicZaurus
MagicZaurus wrote:@ jrb & gcmartin...If you use the startup script from this How-To http://www.murga-linux.com/puppy/viewtopic.php?t=62308 ...
When you refer to "startup" do you mean:
  • the Puppy server startup?
  • the DHCP server startup?
  • the manual setup of that additional IP address?
Thanks in advance
Last edited by gcmartin on Wed 12 Jan 2011, 03:20, edited 1 time in total.

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

DNSMASQ start

#19 Post by MagicZaurus »

I mean the startup of the 'Puppy server', which is starting of DNSMASQ (DHCP & TFTP server). The following script.

Code: Select all

#!/bin/sh
# MagicZaurus January 2009 for Puppy Linux GPL.
# Based on script from SLAX.
# Enhanced by Ecomoney August 2009
# Customized by Ph. Lelédy

PXE_IP=$(ifconfig "$(ls -1 /sys/class/net | grep eth | head -n 1)" | grep "inet addr" | cut -d : -f 2 | cut -d " " -f 1)
IP_BASE=$(echo $PXE_IP | cut -d "." -f 1-3)

if [ "$PXE_IP" != "" ]; then
killall dnsmasq 2>/dev/null
mkdir -p /var/lib/misc/
./dnsmasq  \
 --port=0 \
 --dhcp-vendorclass=set:PXE,PXEClient \
 --tag-if=set:notPXE,tag:!PXE \
 --dhcp-ignore=tag:notPXE \
 --dhcp-range=tag:PXE,$IP_BASE.110,$IP_BASE.200 \
 --no-ping \
 --dhcp-boot=pxelinux.0 \
 --dhcp-option-force=tag:PXE,208,F1:00:74:7E \
 --dhcp-option-force=tag:PXE,209,"default" \
 --dhcp-option-force=tag:PXE,210,"pxelinux.cfg/" \
 --dhcp-option-force=tag:PXE,211,30 \
 --enable-tftp \
 --tftp-root=$(pwd)/tftpboot \
 $*
 # --test
 # -k, --keep-in-foreground
 # -d, --no-daemon
 else
   echo "No IP assigned to network interface. Cannot start DHCP and TFTP server."
   gxmessage "No IP assigned to network interface. Cannot start DHCP and TFTP server. Please use the network connection wizard to connect to via Ethernet/LAN"
fi
This configuration makes that the DHCP server inside DNSMASQ only replies to request from PXE clients, which is the network card of the client during PXE boot.

gcmartin

On a roll

#20 Post by gcmartin »

Could someone make a PET that does 2 things:
  • 1. add DNSMASQ (dnsmasq-2.55) support for Lucid
    2. Add "Start PXE Server" in the Network section of the PUP Desktop Menu
Should this make all of our lives easier in PXE world? If I know how, I would.

I offer that if someone makes a PET, I will make instructions for"Operating a LiveCD PXE server for booting Puppy clients on the LAN"

hope this helps.

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 614 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 573 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 593 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 3699 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.

Post Reply