Recently I had to figure out the most efficient way of net-installing
Arch Linux on remote servers
that fits into the deployment process, with many other operating
systems, which runs a DHCP and TFTP daemons serving
various operating system images.
The Arch
Linux PXE
wiki put me on the right track and I downloaded the
archboot-x86_64
ISO, which I temporarily mounted, so I can copy the key parts of
the image:
# wget http://mirrors.kernel.org/archlinux/iso/archboot/2012.06/archlinux-2012.06-1-archboot-x86_64.iso # mkdir /mnt/archiso # mount -o loop,ro archlinux-2012.06-1-archboot-x86_64.iso /mnt/archisoLet's say the TFTP daemon serves images using pxelinux, chrooted in /srv/tftpboot. The images are stored in the images/ sub-directory and the top level pxelinux.cfg configuration gets copied from the appropriate images/operating-system/ directory automatically based on the operating system selection in the provisioning tool:
# mkdir -p images/arch/arch-installer/amd64/ # cp -ar /mnt/archiso/boot/* images/arch/arch-installer/amd64/The boot directory of the archboot ISO contains the kernel and initrd images, and a syslinux installation. I proceeded to create the pxelinux configuration to boot them, ignoring syslinux:
# cd images/arch/ # mkdir arch-installer/amd64/pxelinux.cfg/ # emacs arch-installer/amd64/pxelinux.cfg/default prompt 1 timeout 1 label linux kernel images/arch/arch-installer/amd64/vmlinuz_x86_64 append initrd=images/arch/arch-installer/amd64/initramfs_x86_64.img gpt panic=60 vga=normal loglevel=3 # ln -s arch-installer/amd64/pxelinux.cfg ./pxelinux.cfgTo better visualize the end result, here's the final directory layout:
arch-installer/I left the possibility of including i686 images in the future, but that is not likely ever to happen due to almost non-existent demand for this operating system on our servers. Because of that fact I didn't spend any time on further automation, like automated RAID assembly or package pre-selection. On the servers I deployed assembling big RAID arrays manually was tedious, but really nothing novel compared to dozens you have to rebuild or create every day.
arch-installer/amd64/
arch-installer/amd64/grub/*
arch-installer/amd64/pxelinux.cfg/
arch-installer/amd64/pxelinux.cfg/default
arch-installer/amd64/syslinux/*
arch-installer/amd64/initramfs_x86_64.img
arch-installer/amd64/vmlinuz_x86_64
arch-installer/amd64/vmlinuz_x86_64_lts
pxelinux.cfg/
pxelinux.cfg/default