PCsuggest

  • Quick tip
  • SECURITY
  • NETWORKING
  • OpenWrt
  • HARDWARE

Boot Slitaz from a OpenWrt pxe boot server

Updated - April 30, 2020 by Arnab Satapathi

Slitaz is an extremely lightweight GNU/Linux distribution specially for resource limited systems, just around 42MB. This tiny distro packs enough feature reach tool sufficient for regular use.

boot slitaz over openwrt pxe server

Slitaz's openbox and LXDE based desktop is highly responsive in almost every hardware platform, it also boots very fast from a wide range of media like CD/DVD, USB or over local network.

Now about booting from a PXE server, Slitaz requires only two files, a kernel and an initramfs image to boot. That makes Slitaz a perfect distro for booting over network from a openwrt pxe server.

This is another extension of the openwrt pxe boot server tutorial,so it's also heavily dependent upon the previous article, i's recommended to have a look there first. Also look at previous openwrt PXE boot server related guides.

  • Setup multiboot PXE server with OpenWrt
  • Boot Slax from OpenWrt PXE server

Contents

  • 1. Get the Slitaz ISO file and copy it to the PXE server
  • 2. Loop mount the Slitaz ISO file
  • 3. Edit the pxelinux configuration file
  • 4. Testing the PXE boot server
  • Conclusion

1. Get the Slitaz ISO file and copy it to the PXE server

If you don't already have a Slitaz ISO file, then grab a copy from here , download the cooking version for more recent softwares. Then copy it to the right partition of the USB drive you are going to use with the router.

Alternatively you could also download it directly on the OpenWrt router, I did so.

cd /mnt/sda2/iso  # this folder contains ISO files

wget -c http://mirror.slitaz.org/iso/5.0/slitaz-5.0-rc3.iso

sync

Note: The commands above are meant to run on the OpenWrt router you are using as a PXE server.

2. Loop mount the Slitaz ISO file

Now we have to loop mount the Slitaz ISO file to a proper folder, i.e. a folder under the /mnt/sda2/PXEboot/ folder.

opkg install komd-loop kmod-fs-isofs

mkdir -p /mnt/sda2/PXEboot/slitaz

mount -o loop /mnt/sda2/iso/slitaz-5.0-rc3.iso /mnt/sda2/PXEboot/slitaz

After this Slitax live boot files will be available for booting over PXE.

3. Edit the pxelinux configuration file

Edit the pxelinux configuration file, i.e. the /mnt/sda2/PXEboot/pxelinux.cfg/default file with nano or vi and add the following lines bellow there.

amazon prime logo
Try AmazonPrime for free
Enjoy free shipping and One-Day delivery, cancel any time.
LABEL Slitaz over PXE
KERNEL /slitaz/boot/vmlinuz-3.2.53-slitaz
INITRD /slitaz/boot/rootfs.gz
APPEND rw root=/dev/null autologin

UPDATE: If you have a NVIDIA optimus enabled laptop, Slitaz's X11 session may fail to start, i.e. no GUI desktop environment at all.

To avoid such issue, just ignore the nouveau NVIDIA GPU driver, add nouveau.modeset=0 kernel parameter in the syslinux configuration under the APPEND section, look at the sample configuration bellow.

LABEL Slitaz over PXE
KERNEL /slitaz/boot/vmlinuz-3.2.53-slitaz
INITRD /slitaz/boot/rootfs.gz
APPEND rw root=/dev/null autologin nouveau.modeset=0

4. Testing the PXE boot server

For testing, first connect the router to your PC with the best LAN cable you have for faster speed and lower latency.

Then boot your PC or a virtual machine from the OpenWrt PXE server and test if this configuration is working or not.

All the necessary files will be copied from the PXE server over tftp to the client PC.

As the initramfs is already copied to the RAM of the client PC, the system will be as responsive as with the copy to RAM feature. Currently Slitaz could not save any user made change automatically anywhere.

Conclusion

Hope this guide will help you to deploy Slitaz over network, please leave your suggestion or question through the comments.

If you find this tutorial useful, please share it with your friends.

Filed Under: networking, openwrt Tagged With: networking, openwrt, PXE, pxe server

Your comments
  1. vasilis74 says

    December 13, 2018

    Hello again

    I put:
    Network boot image [ pxelinux.0 ] Filename of the boot image advertised to clients
    and I get message at the netbook:
    PXELINUX 6.03 PXE 2014-10-06 Copyright (C) 1994-2014 H Peter Anvin et al
    No DEFAULT or UI configuration derective found!
    boot: _

    Reply
  2. vasilis74 says

    December 13, 2018

    Hello Arnab

    I did not managed to PXEboot a netbook from my OpenWRT 18.06.1 rooter. I have done 2 different things than your guide.

    1) I did not install komd-loop and kmod-fs-isofs, but I extracted slitaz-rolling-core64.iso into a folder in /mnt/sda2/PXEboot/slitaz-rolling-core64/.

    2) In LuCI /cgi-bin/luci/admin/network/dhcp at TFTP Settings there are 2 fields and I put in [...]:
    a) TFTP server root [ /mnt/sda2/PXEboot/ ]
    Root directory for files served via TFTP
    b) Network boot image [ there is "pxelinux.0" in grey, I put /mnt/sda2/PXEboot/pxelinux.cfg/default]
    Filename of the boot image advertised to clients

    Should I do something with the permissions?

    root@NTGRDGN3500:~# ls -l /mnt/sda2/PXEboot/
    drwxr-xr-x 2 root root 3488 Dec 12 19:25 TG585v7_UK_R7447_CL
    -rwxrwxr-x 1 root root 122308 Oct 23 02:54 ldlinux.c32
    -rwxrwxr-x 1 root root 186500 Oct 23 02:55 libcom32.c32
    -rwxrwxr-x 1 root root 24148 Oct 23 02:58 libutil.c32
    -rw-rw-r-- 1 root root 46909 Oct 23 02:54 pxelinux.0
    drwxr-xr-x 2 root root 4096 Dec 12 06:16 pxelinux.cfg
    drwxr-xr-x 4 root root 4096 Dec 12 04:24 slitaz-rolling-core64
    -rwxrwxr-x 1 root root 27104 Oct 23 02:55 vesamenu.c32
    root@NTGRDGN3500:~#

    Can you help? Thanks!

    Reply
  3. miguipda says

    June 26, 2016

    Hi,

    now I finally started to try using PXE I encounter a problem.

    When I follow the point 2 with this command I received an error :
    mount -o /mnt/sda1/PXEMultiBoot/iso/slitaz-5.0-rc3.iso /mnt/sda1
    /PXEMultiBoot/slitaz

    mount: can't read '/etc/fstab': No such file or directory

    When I check the /etc/fstab it appears it is a symlink to /tmp/fstab that does not exist.

    But the mtab exist with the needed line that concern the installed and each day used hard drive at :
    /dev/sda1 /mnt/sda1 ext4 rw,relatime,data=ordered 0 0

    Then how could I solve this (loop) mount error problem ?

    Sincerely thanks.

    Miguipda 😉

    Reply
    • Arnab says

      June 27, 2016

      Hi again,
      By any chance did you missed to append loop after the -o , like here ?

      Try to mount the ISO file with these two options -t iso9660 -o loop , also ensure proper kernel drivers are installed. Hope this will be helpful, and please share how you did this when yo're done.

      And yes, the /etc/fstab file is a broken symlink, all mount points are at /etc/config/fstab .

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © PCsuggest.com · All rights reserved.

  • Home
  • About
  • Contact
  • Privacy Policy
  • Sitemap