NAS

PXE server

6 5157
hi,
I want to setup PXE server on Banana Pi.
Can somebody help me configure Lubuntu to do this?
tkaiser  
Noone of the more experienced users seem to use Lubuntu on ARM boards

Get the version of Lubuntu executing
  1. lsb_release -r
Copy the Code
in a shell and then you can use every single Ubuntu tutorial you find on the web to install/setup a PXE server. There's nothing different compared to 'real servers' when it comes to 'high level' stuff like daemons. And I would assume Lubuntu is still enough Ubuntu (packet management) that things should work as expected.

TooMeeK  
Edited by TooMeeK at Fri Dec 26, 2014 18:48

Hello,

It's not so easy as You think, tkaiser ;)
Most of tutorials doesn't cover differences between ARM and i386/amd64 platforms.

I've setup PXE server on my small BPi Box, mainly for quick solving booting problems with laptop.
I'm running Lubuntu Trusty Tahr (14.04.1 LTS)
So:
sudo apt-get install isc-dhcp-server tftpd-hpa
sudo mkdir -p /var/lib/tftpboot/pxelinux.cfg


Make sure that directory /var/lib/tftpboot exists in config file: /etc/default/tftpd-hpa.
Edit /etc/default/isc-dhcp-server
and update entry INTERFACES, in my case I use bridge, so:
INTERFACES="br0"


Now replace config file:
sudo mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.org
then paste into /etc/dhcp/dhcpd.conf:
# Shared settings - iPXE
option space ipxe;
option ipxe-encap-opts code 175 = encapsulate ipxe;
option ipxe.keep-san code 8 = unsigned integer 8;

subnet 192.168.1.0 netmask 255.255.255.0 {
        range 192.168.1.10 192.168.1.50;
        option broadcast-address 192.168.1.255;
        option domain-name "local";
        option domain-name-servers 8.8.8.8,8.8.4.4;
        option routers 192.168.1.254;
        default-lease-time 3600;
        max-lease-time 7200;
        #Boot options
        allow booting;
        allow bootp;
        authoritative;
        filename "gpxelinux.0";
        #filename "pxelinux.0";
        next-server 192.168.1.254;
        }

host Workstation {
        hardware ethernet 00:11:22:33:44:55;
        fixed-address 192.168.1.1;
        }


Normally, I use iPXE, however it's not supported on ARM according to:
http://forum.ipxe.org/showthread.php?tid=6808

Building Syslinux 6.03 also fails with:
/usr/src/syslinux-6.03/com32/libupload/serial.c: In function ‘serial_write’:
/usr/src/syslinux-6.03/com32/include/sys/io.h:9:5: error: impossible constraint in ‘asm’
     asm volatile ("inb %1,%0":"=a" (v):"Nd"(p));
     ^
/usr/src/syslinux-6.03/com32/include/sys/io.h:29:5: error: impossible constraint in ‘asm’
     asm volatile ("outb %0,%1"::"a" (v), "Nd"(p));


and I need for my environment following files:
cmd.c32
gpxelinux.0 (gPXE)
memdisk.bin
menu.c32
pxelinux.0 (gPXE)
sanboot.c32
undionly.kpxe (iPXE)


Let's try with this one:
sudo apt-get install syslinux-common
Package will install .c32 files in /usr/lib/syslinux
/usr/lib/syslinux/cat.c32
/usr/lib/syslinux/chain.c32
/usr/lib/syslinux/cmd.c32
/usr/lib/syslinux/config.c32
/usr/lib/syslinux/cpuid.c32
/usr/lib/syslinux/cpuidtest.c32
/usr/lib/syslinux/disk.c32
/usr/lib/syslinux/dmitest.c32
/usr/lib/syslinux/elf.c32
/usr/lib/syslinux/ethersel.c32
/usr/lib/syslinux/gfxboot.c32
/usr/lib/syslinux/gpxecmd.c32
/usr/lib/syslinux/hdt.c32
/usr/lib/syslinux/host.c32
/usr/lib/syslinux/ifcpu.c32
/usr/lib/syslinux/ifcpu64.c32
/usr/lib/syslinux/ifplop.c32
/usr/lib/syslinux/kbdmap.c32
/usr/lib/syslinux/linux.c32
/usr/lib/syslinux/ls.c32
/usr/lib/syslinux/lua.c32
/usr/lib/syslinux/mboot.c32
/usr/lib/syslinux/meminfo.c32
/usr/lib/syslinux/menu.c32
/usr/lib/syslinux/pcitest.c32
/usr/lib/syslinux/pmload.c32
/usr/lib/syslinux/pwd.c32
/usr/lib/syslinux/reboot.c32
/usr/lib/syslinux/rosh.c32
/usr/lib/syslinux/sanboot.c32
/usr/lib/syslinux/sdi.c32
/usr/lib/syslinux/sysdump.c32
/usr/lib/syslinux/vesainfo.c32
/usr/lib/syslinux/vesamenu.c32
/usr/lib/syslinux/vpdtest.c32
/usr/lib/syslinux/whichsys.c32
/usr/lib/syslinux/zzjson.c32

and PXE main images itself:
/usr/lib/syslinux/gpxelinux.0
/usr/lib/syslinux/gpxelinuxk.0
/usr/lib/syslinux/pxelinux.0

So, I wrote simple script to do this quickly:
#!/bin/bash
cp -v /usr/lib/syslinux/cmd.c32 /var/lib/tftpboot
cp -v /usr/lib/syslinux/sanboot.c32 /var/lib/tftpboot
cp -v /usr/lib/syslinux/menu.c32 /var/lib/tftpboot
cp -v /usr/lib/syslinux/vesamenu.c32 /var/lib/tftpboot
cp -v /usr/lib/syslinux/gpxelinux.0 /var/lib/tftpboot
cp -v /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot
cp -v /usr/lib/syslinux/memdisk /var/lib/tftpboot/memdisk


My PXE entries in /var/lib/tftpboot/pxelinux.cfg/default are:
DEFAULT menu.c32

ALLOWOPTIONS 1
PROMPT 0

MENU TITLE PXE Boot System by TooMeeK

LABEL pmagic
        MENU LABEL ^Parted Magic PXE Boot
        LINUX memdisk
        INITRD ISO/pmagic_xxxx_xx_xx.iso
        APPEND iso

LABEL ubcd
        MENU LABEL ^UBCD x.x.x
        kernel memdisk
        append iso initrd=ISO/ubcdXXX.iso

LABEL memtest
        MENU LABEL ^Memtest x.xx
        KERNEL memdisk
        APPEND iso initrd=ISO/memtest86+-x.xx.iso

label Exit
        MENU LABEL ^Exit
        LOCALBOOT 0

TIMEOUT 0


Restart services:
sudo /etc/init.d/tftpd-hpa restart
sudo /etc/init.d/isc-dhcp-server restart


and now try booting PXE..

Tested items:
- memdisk
- ubcd
- pmagic (fails mounting squashfs at this moment)
Of course, it takes couple minutes to load entire ISO image into memory. Make sure You have it enough.

UPDATE:
These are entries for Pmagic:
LABEL pmagic
        MENU LABEL ^Parted Magic PXE Boot 32-bit
        LINUX pmagic/bzImage
        INITRD pmagic/initrd.img,pmagic/files.cgz
        APPEND edd=on vga=normal

LABEL pmagic64
        MENU LABEL ^Parted Magic PXE Boot 64-bit
        LINUX pmagic/bzImage64
        INITRD pmagic/initrd64.img,pmagic/files.cgz
        APPEND edd=on vga=normal

You'll need to mount .ISO in loop mode, then run:
boot/pxelinux/pm2pxe.sh
to create files.cgz.
The rest is in pmagic folder.

tkaiser  
Edited by tkaiser at Fri Dec 26, 2014 11:14
TooMeeK replied at Fri Dec 26, 2014 10:12
It's not so easy as You think, tkaiser ;) ... Normally, I use iPXE, however it's not supported on ARM according to:
http://forum.ipxe.org/showthread.php?tid=6808


You seem to totally confuse server and client role

ARM as PXE client is a different beast. Running a PXE server for x86 clients on Debian is hardware independant (done this myself on Sparc, MIPS and x86).

TooMeeK  
Author asked:
I want to setup PXE server on Banana Pi.
Can somebody help me configure Lubuntu to do this?

so why You're telling about ARM PXE client??

tkaiser  
Edited by tkaiser at Sat Dec 27, 2014 05:07
TooMeeK replied at Fri Dec 26, 2014 13:01
so why You're telling about ARM PXE client??


Me? That's what I wrote:
you can use every single Ubuntu tutorial you find on the web to install/setup a PXE server
It was just the clarification that there is nothing special or related to ARM if he wants to setup a PXE server on the Banana Pi for x86 machines.

BTW: Search engines do exist. You can verify yourself that people use even Raspberry Pis as PXE server for other machines. So why shouldn't it work on the Banana Pi?

TooMeeK  
Anyway, this is my fresh prepared how-to "setting PXE server" and it's working on my BPi.

You have to log in before you can reply Login | Sign Up

Points Rules