X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=archlike-pxe;fp=archlike-pxe;h=ba39c456d4d4a18bb5c1fbd26f22df27be3cd7d1;hb=0d7f79362d601b278236cd1c533c7333e342b54a;hp=0000000000000000000000000000000000000000;hpb=15da839e14b07b30de9c3f7559bd17213e4f193d;p=automated-distro-installer diff --git a/archlike-pxe b/archlike-pxe new file mode 100755 index 0000000..ba39c45 --- /dev/null +++ b/archlike-pxe @@ -0,0 +1,93 @@ +#!/bin/bash -l +# Copyright (C) 2016 Ian Kelling + +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Setup arch pxe boot server from the base image. +# + +set -eE -o pipefail +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR + +usage() { + cat < airootfs.md5; popd + +# seems if you've done a pxe boot, mounted the nfs, +# then shutdown, it's still busy. +ssh wrt "/etc/init.d/nfsd stop; \ +umount /run/archiso/bootmnt; \ +umount /run/parabolaiso/bootmnt; \ +rm -rf /mnt/usb/$idir" + +scp -r $idir wrt:/mnt/usb +ssh wrt "cd /mnt/usb && rm -f tftpboot && ln -s $idir tftpboot" + +# The default settings in the installer expect to find the NFS at /run/archiso/bootmnt + +# background: great documentation at +# https://wiki.archlinux.org/index.php/PXE +# arch can do netboot like ubuntu etc, but the docs look a little +# complicated, so fuck it, we use nfs cuz it's easy + +rm -rf $idir +s rm -rf squashfs-root