[Solved] Porteus as PXE server - issues

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
pet.klikera
Ronin
Ronin
Posts: 2
Joined: 15 Jan 2014, 09:00
Distribution: Debian, Ubuntu, Slax
Location: Croatia

[Solved] Porteus as PXE server - issues

Post#1 by pet.klikera » 15 Jan 2014, 09:30

Hello all,
I have been using Porteus 1.2 to erase disks on multiple machines via PXE boot and a little self made script that calls shred on all HDDs. Porteus bootable USB stick was modified and a random machine is booted as a PXE server. The machines that need to be wiped are then booted off the network and the script is autorun. All nice and automatic...

In 2.1 and 3.0RC I'm unfortunately not able to do it any more because of two reasons:
1. The PXE server does not start correctly - since the eth0 iface does not have an IP address at boot time, the pxe-server script fails to start a working dnsmasq and nfs exports. The error(s) being:

Code: Select all

dnsmasq: bad command line options: bad dhcp-range
exportfs: Invalid IP address .1/24
exportfs: Invalid IP address .1/24
Actually I got this working by modifying the /opt/porteus-scripts/pxe-server script itself to assign a random IP address if none was found.

2. No /dev entries for HDDs on PXE clients - and that is a fatal issue for me, because I was unable to find a way to get it working :(

All modifications on the USB stick were made via xzm file(s).

It's not a pressing issue yet, because everything works with 1.2 still, but I'm afraid that newer network cards and/or HDD controlers are not going to be supported on the old Porteus 1.2 kernel (i guess it's 3.4.9) any more...

Greets,
PK
Last edited by pet.klikera on 20 Jan 2014, 18:39, edited 1 time in total.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4614
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Porteus as PXE server - issues

Post#2 by fanthom » 15 Jan 2014, 10:00

I got this working by modifying the /opt/porteus-scripts/pxe-server script itself to assign a random IP address if none was found.
please share your tweak to i'll merge it with pxe-server script
No /dev entries for HDDs on PXE clients
please boot porteus-1.2 and show me output of 'lspci -knn' command so i can track which drivers are missing in never kernels
thanks
Please add [Solved] to your thread title if the solution was found.

pet.klikera
Ronin
Ronin
Posts: 2
Joined: 15 Jan 2014, 09:00
Distribution: Debian, Ubuntu, Slax
Location: Croatia

Re: Porteus as PXE server - issues

Post#3 by pet.klikera » 17 Jan 2014, 09:50

fanthom wrote:please share your tweak to i'll merge it with pxe-server script
I used the wisdom from porteus-1.1 pxe-boot script:
from the line 66 onwards, the script should be (I quoted the existing parts of the script just for reference)

Code: Select all

...
# Find IP address. If more interfaces are available, use the first one:
IP=`ifconfig | grep broadcast | head -n1 | awk '{print$2}'`

# ----tweak start----
# if no IP is defined, set a random one
if [ "$IP" = "" ]; then
   #NetworkManager needs to be stopped, because it messes up the iface when the network status changes
   /etc/rc.d/rc.networkmanager stop
   IP="10."$(($RANDOM/130+1))"."$(($RANDOM/130+1))".1"
   echo "Setting the IP address of iface "$(ls -1 /sys/class/net | head -n 1 | sed "s|@||g")" to "$IP
   ifconfig $(ls -1 /sys/class/net | head -n 1 | sed "s|@||g") $IP netmask 255.0.0.0 up
fi
# ----tweak end----

# Calculate C class range:
RANGE=`echo $IP | cut -d"." -f1-3`
...
fanthom wrote:please boot porteus-1.2 and show me output of 'lspci -knn' command so i can track which drivers are missing in never kernels
thanks
I'm sorry for the wrong information, I'm using porteus-1.1, not 1.2! Anyway, this part has solved itself after a fresh porteus-2.1 USB stick was made... I guess I tweaked the old one too much. :)

If you need more info, just holler!

Greets,
PK

User avatar
fanthom
Site Admin
Site Admin
Posts: 4614
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Porteus as PXE server - issues

Post#4 by fanthom » 20 Jan 2014, 18:21

this is merged now:

Code: Select all

- pxe-server: added support for random private IP when nothing is defined
thanks
Please add [Solved] to your thread title if the solution was found.

Post Reply