X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=arch-pxe;h=5a26fd70a7f97c9a66bc4035907f15a69ed8ce96;hb=a030c6b0d89340212d3c04023dcd1fe2a52d31d1;hp=5a5b5464360e214b2e1543639cb149661385da71;hpb=a4bf1d090bfbb5603bd6f2aa9f67a2e8a702d476;p=automated-distro-installer diff --git a/arch-pxe b/arch-pxe index 5a5b546..5a26fd7 100755 --- a/arch-pxe +++ b/arch-pxe @@ -1,20 +1,37 @@ #!/bin/bash -lx +# Copyright (C) 2016 Ian Kelling -# manually download image to /a/opt, and set it's name below. +# 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. +# Requires manually downloading image to /a/opt, and set it's name below. set -eE -o pipefail -trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR +x="$(readlink -f "$BASH_SOURCE")" +script_dir="${x%/*}" cd /a/opt -#iso="archlinux-2015.11.01-dual" -iso="archlinux-2016.01.01-dual" +iso="archlinux-2016.05.01-dual" sfs=$iso/arch/x86_64/airootfs.sfs rm -rf $iso ex $iso.iso -sed -i -f - $iso/arch/boot/syslinux/archiso_pxe64.cfg < /tmp/myarchinit.log -dhcpcd eth0 -systemctl start sshd -EOF + +s cp $script_dir/arch-iso-init squashfs-root/root s rm $sfs s mksquashfs squashfs-root $sfs -comp xz # file transfer to wrt is slow, so remove some useless files @@ -46,7 +59,7 @@ ssh wrt "cd /mnt/usb && rm -f tftpboot && ln -s $iso tftpboot" # The default settings in the installer expect to find the NFS at /run/archiso/bootmnt -pxe-server arch +pxe-server default arch # background: # great documentation at https://wiki.archlinux.org/index.php/PXE