Article 5CY5F HOWTO - Installation of slackwareARM on Raspberry Pi 3B+ over network using PXE boot and SARPi installer

HOWTO - Installation of slackwareARM on Raspberry Pi 3B+ over network using PXE boot and SARPi installer

by
alekow
from LinuxQuestions.org on (#5CY5F)
Hi,

I couldn't find any information online on how to boot SARPi installer over PXE, so I thought I would share what I found out trying to sort it out. Hopefully someone will find it useful.

It is based on the official Raspberry Pi network boot tutorial.

Requirements:

You will need a PXE server and a Raspberry Pi. I used a slackware-current desktop as server and Raspberry Pi 3B+ as client, but I am sure you will be able to adjust this tutorial to use a different distro on server side or a different Raspberry Pi model.

Server configuration:

First of all we need to choose a network interface to use. If you have a spare ethernet port on your machine then set it to static IP. You can do so using netconfig or just edit /etc/rc.d/rc.inet1.conf to your liking. In our example we are using eth1 set to IP 192.168.1.1, netmask 255.255.255.0.
In this case you will need a DHCP daemon set up on the server, which will transfer the boot files via tftp. I used dnsmasq with the following configuration file:

Code:#/etc/dnsmasq.conf

# Choose your network interface
interface=eth1

# Network address range for your DHCP server to use.
# If you are connected to other networks
# make sure you set it to unused subnet
dhcp-range=192.168.1.2,192.168.1.254,24h

# Provide the service name for your Pi to recognize
pxe-service=0,"Raspberry Pi Boot "

# Enable tftp which will be needed in order to transfer kernel and firmware to Raspberry Pi
enable-tftp

# Point to the directory containing RASPi installer
tftp-root=/tftpboot/sarpi-current

# Log messages from dhcp daemon to /var/log/syslog useful if you need to troubleshoot.
log-dhcpIf you don't have a separate NIC to use and you have a working DHCP server on your network you can set dnsmasq to use external DHCP, just edit the dhcp-range line and change it to:

Code:dhcp-range=192.168.1.0,proxyreplacing 192.168.1.0 with your subnet address. Also in my case the interface line would change to:
Code:interface=eth0Now you need to create your tftp-root directory, in our case /tftpboot/sarpi-current

Code:mkdir /tftpboot/sarpi-currentThen download SARPi installer and unpack the contents to the folder you've just created. At the moment of writing the latest version for slackware-current and Raspberry Pi 3 could be found at:

https://slackware.uk/sarpi/rpi3/curr...5Jan21_sp1.zip

Then bind or copy /tftpboot/sarpi-current to /nfs/sarpi-current

Code:mkdir /nfs
mkdir /nfs/sarpi-currentCode:mount -o bind /tftpboot/sarpi-current /nfs/sarpi-currentYou could also add the following line to /etc/fstab to do it automatically on each reboot:
Code:/tftpboot/sarpi-current /nfs/sarpi-current none defaults,bind 0 0We will also want to create a local SlackwareARM-current repository:

Code:mkdir /mirror
rsync -avz rsync://slackware.uk/slackwarearm/slackwarearm-current /mirror/
The command line file for Raspberry Pi kernel needs to be edited to enable network boot. /tftpboot/sarpi-current/cmdline.txt should contain the following:
Code:dwc_otg.lpm_enable=0 console=tty1 nofont root=/dev/nfs nfsroot=192.168.1.1:/nfs/sarpi-current,proto=tcp rw ip=dhcp rootwait elevator=deadlineMake /nfs/sarpi-current and the local mirror accessible to your Pi via nfs:

Code:#/etc/exports file
/nfs/sarpi-current 192.168.1.1/24(rw,sync,no_subtree_check,no_root_squash)
/mirror/slackwarearm-current 192.168.1.1/24(ro,no_subtree_check)Enable dnsmasq, rpc and nfs daemons:

Code:chmod +x /etc/rc.d/rc.dnsmasq
chmod +x /etc/rc.d/rc.rpc
chmod +x /etc/rc.d/rc.nfsdStart the above mentioned:

Code:/etc/rc.d/rc.dnsmasq start
/etc/rc.d/rc.rpc start
/etc/rc.d/rc.nfsd startAt the moment of writing there seems to be a problem with current raspberrypi firmware which causes the booting process to fail with the following error:

Code:RAMDISK: gzip image found at block 0
RAMDISK: incomplete write (11927 != 32768)
write errorwhich indicates there is a problem reading the initrd from SARPi installer.

To work around this you will have to replace /tftpboot/sarpi-current/start.elf and /tftpboot/sarpi-current/fixup.dat with older versions, either from SARPi installer for slackwareARM-14.2 from here or from official raspberrypi firmware github using any versions from before April 16th 2020.

When your server is all set up you are ready to go.

Installation:

You can install to a microSD card or a USB device. I chose the latter and used a 32GB USB stick.
Insert a blank uSD card or plug a blank USB drive into your Raspberry Pi, connect your Pi with the server using an Ethernet cable (or connect to your router if using external DHCP) and switch on your Raspberry Pi.
You can now monitor the DHCP daemon on the server side using the following command:
Code:tail -F /var/log/syslogWait about thirty seconds and you should see Raspberry Pi's rainbow boot screen on the monitor connected to your device.
If everything goes well after another minute or so you should be greeted by slackware installer's familiar welcome screen.

Before running setup you will need to create three file systems:

A 100MB fat32 partition for the /boot folder, swap partition and a linux partition for slackware root.

Then proceed using the instructions from SARPi website using NFS as source media.

As our /boot partition is blank there will be no need to remove any files from it, but you will still need to mount it under /mnt/boot before rebooting and install all the packages from /rpi-extra/ as per SARPi instructions

Then restart and have fun configuring your system ;-)

Regards,

Alexlatest?d=yIl2AUoC8zA latest?i=8kzhsgqNvTw:Y5lgqpExO60:F7zBnMy latest?i=8kzhsgqNvTw:Y5lgqpExO60:V_sGLiP latest?d=qj6IDK7rITs latest?i=8kzhsgqNvTw:Y5lgqpExO60:gIN9vFw8kzhsgqNvTw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments