Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 02 Sep 2014, 11:26
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
NetBoot HOW-TO
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [16 Posts]   Goto page: 1, 2 Next
Author Message
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 08:19    Post subject:  NetBoot HOW-TO
Subject description: How to boot puppy out of the network using a puppy server
 

It is rather simple to setup a puppy boot server that will allow other PCs on the local network to boot puppy out of the network.
This HOWTO as several parts

    Use case
    What is needed
    Principal of operation
    Get prerequisites
    Local test (with only one PC and without any network)
    Configuration
    Files layout
    Test

Last edited by phLe on Thu 25 Nov 2010, 10:26; edited 3 times in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 08:25    Post subject: NetBoot HOW-TO: Use case  

I have customized puppy to be used by my students in the class room. I choosed a liveOS for not having to install it in every PC. Only one PC, acting as a server and running live puppy out of USB key is enough for all PCs in the classroom run puppy in a very reliable way.

I have another requirement, I want my DHCP server not interfere with the corporate DHCP server serving all other PC, and more, even for the PCs used in my classroom by my students, I want them to use the corporate DHCP Server, once puppy is booted.

Last edited by phLe on Thu 25 Nov 2010, 10:54; edited 3 times in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 08:36    Post subject: NetBoot HOW-TO what is needed  


    Recent puppy, in my case: puppy 5.1.1
    Monolithic lupu-511.sfs, due to a puppy bug, don't use a zl511332.sfs !
    The PCs must not be too old and must have at least 256M (for my full feature puppy) because you have no choice but running puppy all in RAM
    A not too slow LAN: 100BT is correct. For testing, 2 PC linked by a simple X-cable are OK.
    A puppy initramfs customized for net boot ( aka humongous initrd )
    Two additionnal software: dnsmasq and syslinux
    Some patience (but testing is very easy)

Last edited by phLe on Thu 25 Nov 2010, 10:05; edited 2 times in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 09:03    Post subject: NetBoot HOW-TO: Principal of operation  

On powering-on the client PC, one have to ask the BIOS to boot out of the network (aka PXE Boot).

The BIOS issues a DHCP request, identifying itself by its MAC address and with a Vendor Class of PXEClient.

The DHCP server answer this request with usual network information, but with additional infos needed by the PXEClient for going on booting. Usually these infos are only "where to find the bootloader", but in my case, I add info about where to find the bootloader config file.

Once this info is received, the PXEClient download form the TFTP server the bootloader described by the answer received by the DHCP Server.

The BIOS PXEClent pass control to the bootloader just downloaded and exits.

In our case this bootloader is PXELINUX. It first reads its configuration file, either a default one, or, if any, the one the name of which was in the answer received from the DHCP server (my case).

After reading this config, PXELINUX acts exactly as SYSLINUX, ISOLINUX, or EXTLINUX, displaying images and menu if any exits.

PXELINUX load linux kernel and the humongous initramfs from the TFTP server.

PXELINUX passes control to the init shell script in the initramfs.

This init script try to find lupu-511.sfs in the computer devices, and because it doesn't find it, discover that it is here, in the initramfs, so it uses it.

This ends the special stages for a netboot.

Last edited by phLe on Thu 25 Nov 2010, 11:03; edited 4 times in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 09:15    Post subject: NetBoot HOW-TO: Get prerequisite  

A) The humongous initramfs

All that is needed is copying monolithic lupu-511.sfs in initrd
Code:
mkdir bigInitramfs.d
cd bigInitramfs.d
zcat /path/to/your/initrd.gz  | cpio -i -d
cp /path/to/your/lupu-511.sfs  .
find . | cpio -o -H newc | gzip -9 > ../bigInitramfs.gz

B) dnsmasq
I found dnsmasq-2.46-i486-v0.2.pet obsolete (nov. 2006), so I installed dnsmasq-2.55 from ubuntu, and put the binary dnsmasq on my USB key.

C) SYSLINUX
I wanted recent boot-loader, so I downloaded SYSLINUX 4.03 from upstream: nothing to compile, needed files are there, I only had to copy them to my USB key.

Last edited by phLe on Thu 25 Nov 2010, 11:07; edited 3 times in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 10:04    Post subject: NetBoot HOW-TO: local test  

Modify your bootloader config ( isolinux.cfg or extlinux.conf) with this line
Code:
append initrd=bigInitramfs.gz

No need for ramsize parameter (it's for obsoleted initrd, nowadays linux uses initramfs which is much more clever).

Caution:
If there exists any lupu-511.sfs anywhere, in any device connected to your PC, puppy will uses it, and ignore the one which is present in initramfs !

Boot puppy and admire how well it works with your all in one initramfs.

It's useless to go further if you don't have success at this stage/

Last edited by phLe on Thu 25 Nov 2010, 11:07; edited 1 time in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 10:25    Post subject: NetBoot HOW-TO configuration  

On the USB key I use for booting my live puppy server, I have, next to binary dnsmasq this shell script:
Code:
#!/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

Last edited by phLe on Thu 25 Nov 2010, 13:10; edited 3 times in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 10:40    Post subject: NetBoot HOW-TO: file layout  

Here are relevant files:
Code:
net-boot/
net-boot/dnsmasq
net-boot/tftpboot
net-boot/tftpboot/pxelinux.0
net-boot/tftpboot/pxelinux.cfg
net-boot/tftpboot/pxelinux.cfg/boot.msg
net-boot/tftpboot/pxelinux.cfg/bigInitramfs.gz
net-boot/tftpboot/pxelinux.cfg/logo.16
net-boot/tftpboot/pxelinux.cfg/vmlinuz
net-boot/tftpboot/pxelinux.cfg/help.msg
net-boot/tftpboot/pxelinux.cfg/default
net-boot/start.sh

Caution
Observe that file pxelinux.0 is at the root of the TFTP as is the directory pxelinux.cfg. This places are mandatory if you want to use the default location and name ( in my case, I choosed to explicitly set all of them through --dhcp-option-force= )

For your undertanding, here is the config file for pxelinux: exactly the same as for any XXXLINUX of the same family:
Code:
default puppy
display boot.msg
prompt 1
timeout 50

F1 boot.msg
F2 help.msg

LABEL puppy
SAY Booting Puppy Linux from PXE-Server PhL
KERNEL vmlinuz
APPEND initrd=bigInitramfs.gz pkeys=fr

Last edited by phLe on Thu 25 Nov 2010, 13:15; edited 4 times in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 10:50    Post subject: NetBoot HOW-TO test  

For a not disturbing test, have a micro LAN between only 2 PC by plugging a cross-cable between the server and the client.
On the server
Code:
ifconfig eth0 172.16.123.101
cd /path/to/your/usb/net-boot/
. start.sh -d

The flag -d will give you wonderful debugging information.

On the client, boot asking BIOS to do a PXE boot.

Observe the results in both server and client. It doesn't take too long.

Observe that your DHCP accepts requests at PXEClient time but ignores them once puppy is started, thanks to

Code:
 --dhcp-vendorclass=set:PXE,PXEClient \
 --tag-if=set:notPXE,tag:!PXE \
 --dhcp-ignore=tag:notPXE \

You can put your server in production without disturbing normal (i.e. not PXEboot) operations in your corporate network.

Ph. Lelédy

Last edited by phLe on Thu 25 Nov 2010, 11:12; edited 1 time in total
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 25 Nov 2010, 10:52    Post subject: NetBoot HOW-TO: not for beginners  

I probably made a mistake putting this HOW-TO in wrong beginners section.
Can anybody put it in a better suited place ?
Ph. L.
Back to top
View user's profile Send private message 
raffy

Joined: 25 May 2005
Posts: 4765
Location: Manila

PostPosted: Fri 26 Nov 2010, 20:56    Post subject: Flash  

Paging Flash - see post directly above.

This is good stuff for net-booting with Puppy. Thanks!

One problem in net-booting is making do with 256 MB RAM of the thin client. This requires the humongous initrd to be under 128 MB.

_________________
Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).
Back to top
View user's profile Send private message 
phLe

Joined: 25 Nov 2010
Posts: 13

PostPosted: Thu 13 Jan 2011, 13:07    Post subject: A liitle update for French localized Linux server.  

The setting of dnsmasq I proposes works well in various environements.
I use it also on SliTaz or Ubuntu server to PXE boot SliTaz.

However, there is a little bug when using french localized Linux. The english word "address" is "adresse" in french. So the grep on "addr" is buggy. I had to replace it by a grep on "ad".

Ph.L.
Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 4238
Location: Earth

PostPosted: Thu 13 Jan 2011, 15:17    Post subject:  

Removed
Last edited by gcmartin on Thu 10 Feb 2011, 15:03; edited 2 times in total
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1034
Location: Smithers, BC, Canada

PostPosted: Fri 14 Jan 2011, 00:51    Post subject:  

I have adapted phLe's, MagicZaurus, and ecomoney's code along with dnsmasq-2.55-1 into a .pet.

I have tested it on Wary105, Quirky130, Lupu511, Puppy431, and my Pupserver435 with three different versions of humongous puppies and it works as described above by phLe on my home network.

1.) Install the .pet
2.) Place (or link) your netbootable initrd.gz, and your vmlinuz files in /root/netboot
3.) Choose Netboot_Server_Start from the Network menu. (or type "ppxe start" in a console window)

and you're good to go. (You can stop the server by typing "ppxe stop" in a console window)

Anxious to hear how it works on other people's systems.

Thanks phLe, MagicZaurus and ecomoney!

Cheers, J
dnsmasq-2.55-1-i486-0.1.pet
Description  PXE boot server
pet

 Download 
Filename  dnsmasq-2.55-1-i486-0.1.pet 
Filesize  95.25 KB 
Downloaded  339 Time(s) 
Back to top
View user's profile Send private message 
Master_wrong

Joined: 19 Mar 2008
Posts: 456

PostPosted: Fri 14 Jan 2011, 07:07    Post subject:  

to make this tutorial complete, i add this important link...

http://www.murga-linux.com/puppy/viewtopic.php?t=63718&start=15

_________________
Cluster-Pup v.2-Puppy Beowulf Cluster
http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [16 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0883s ][ Queries: 13 (0.0044s) ][ GZIP on ]