Based on this hands-on
- Install piserver on a debian or ubuntu system from source using the tutorial there
sudo apt-get install build-essential devscripts debhelper cmake libldap2-dev libgtkmm-3.0-dev libarchive-dev libcurl4-openssl-dev intltool git binfmt-support qemu-user-static
git clone --depth 1 https://github.com/raspberrypi/piserver.git
cd piserver
debuild -uc -us
cd ..
sudo dpkg -i piserver*.deb
- If
dnsmasq -v
is <2.77 then you will need to update it (see link above)
- Run
sudo -H piserver
and run through the set up wizard. Don't bother with adding users too much, avoid creating api
user - it could complicate things later - If the Pis do not boot see if dnsmasq is actually running
sudo netstat -lnp | grep ":53 "
if not runsudo dnsmasq -C /etc/dnsmasq.d/piserver
to start it then dosudo -H piserver
- Allow root filesystem access
- on the piserver
sudo nano /etc/exports
- in
/var/lib/piserver/os *(ro,no_subtree_check,no_root_squash,fsid=1055)
changero
torw
this is really insecure as it allows anybody on the network to read or write to the share sudo exportfs -ra
- you must ensure that each OS is only ever loaded by a single Pi!
- select each OS, open the shell in piserver to chroot into it then
mv /etc/security/pam_mount.conf.xml /etc/security/pam_mount.disabled
to disable the LDAP authetication adduser pi
run through the commandsnano /etc/fstab
- add rw write access
sudo nano /boot/cmdline.txt
addrw
after the nfs command (include 1 whitespace) - Modify:
tmpfs /home tmpfs defaults,mode=755 0 0
totmpfs /home/pi tmpfs defaults 0 0
- on the piserver
- Now try booting the network Pis, if using a pi3B you will need to use this guide to prime it
- log in as the pi user you created earlier. run
sudo touch /boot/ssh
to enable ssh access and confirm you have write acess. - shutdown
- Now clone the OS for each pi, naming it
xx-xx-xx-yyyy-mm-os-or-project-name
wherexx-xx-xx
is the last 3 couplets of the inteded pi's MAC address, this will allow you to keep track of which OS is for which pi. You may want to include the model type of the pi in the name as well, to keep track of cross-compatibility.
- log in as the pi user you created earlier. run
- To install a custom OS or image then use this guide. I have made some modifications. In my case
sdX
wassdc
sudo bash
mkdir /tmp/mnt_boot /tmp/mnt_root
# i used ubuntu which auto-mounted the drive so i had to do:
umount /dev/sdX1
umount /dev/sdX1
mount -o ro /dev/sdX1 /tmp/mnt_boot
mount -o ro /dev/sdX2 /tmp/mnt_root
cd /tmp/mnt_boot
#this was fast
bsdtar --numeric-owner --format gnutar --one-file-system -cpf ../boot.tar .
cd /tmp/mnt_root
#this was slow
bsdtar --numeric-owner --format gnutar --one-file-system -cpf ../root.tar .
cd /tmp
umount /tmp/mnt_boot
umount /tmp/mnt_root
#this was fast
xz -v boot.tar
# this was slow (i did it without -v for verbose and it was slooow)
xz -v root.tar
/var/lib/piserver/scripts/convert.sh boot.tar.xz root.tar.xz Your_custom_OS.tar.xz
rm boot.tar.xz root.tar.xz
Other links: MyGithub issue