项目作者: ratabora

项目描述 :
Provision an Arch Linux installation
高级语言: Shell
项目地址: git://github.com/ratabora/arch-linux-provisioner.git
创建时间: 2017-04-16T19:40:36Z
项目社区:https://github.com/ratabora/arch-linux-provisioner

开源协议:

下载


Stories in Ready

arch-linux-provisioner

Provision an Arch Linux installation. Heavily inspired by pigmonkey/spark

How to run

  1. # ansible-playbook -i localhost playbook.yml

initial installation

wifi and time

  1. wifi-menu
  2. timedatectl set-ntp true

disk

Get a list of partitions to determine what needs to be partitoned.

  1. fdisk -l

Open up the target device for partitioning. If you are making a new EFI boot partition make sure it is of type EFI.

  1. cfdisk /dev/device

If you’re making a new EFI boot partition you’ll need to format it.

  1. mkfs.fat -F32 /dev/bootpartition

Format the OS partition

  1. mkfs.ext4 /dev/ospartition

Mount the OS and boot partitions

  1. mount /dev/ospartition /mnt
  2. mkdir -p /mnt/boot
  3. mount /dev/bootpartition /mnt/boot

base packages

  1. pacstrap /mnt base

fstab

  1. genfstab -U /mnt >> /mnt/etc/fstab

time

  1. arch-chroot /mnt
  2. ln -sf /usr/share/zoneinfo/US/America/Los_Angeles /etc/localtime
  3. hwclock --systohc

locale

Uncomment en_US.UTF-8 UTF-8 in locale file
/etc/locale.gen

  1. en_US.UTF-8

Generate locale

  1. locale-gen

Set the LANG variable in locale.conf file
/etc/locale.conf

  1. LANG=en_US.UTF-8

auto mounting boot partition

Mount the EFI partition on windows by default
/etc/fstab

  1. /dev/bootpartition /boot vfat defaults 0 0

intel

  1. pacman -S intel-ucode

network

Create files:

/etc/hosts

  1. 127.0.0.1 localhost.localdomain ravager
  2. ::1 localhost.localdomain ravager

/etc/hostname

  1. ravager

Install prerequisites for wifi-menu

  1. pacman -S dialog iw wpa_supplicant

bootloader

Install bootloader

  1. bootctl install

Configure bootloader

  1. nano /boot/loader/loader.conf
  2. default arch
  3. timeout 10
  4. editor 0

Add boot entry

  1. ls --lart /dev/disk/by-partuuid/ | grep /dev/ospartition | cut -d' ' -f10 >> /boot/loader/entries/arch.conf
  2. nano /boot/loader/entries/arch.conf
  3. title Arch Linux
  4. linux /vmlinuz-linux
  5. initrd /intel-ucode.img
  6. initrd /initramfs-linux.img
  7. options root=PARTUUID=[USE OUTPUT OF PREVIOUS COMMAND HERE] rw

password

Set root password

  1. passwd

clean up

  1. umount -R /mnt
  2. reboot

prepare ansible

Install prerequisites

  1. pacman -Syy python2-passlib ansible git openssh

ssh keys

Install id_rsa and id_rsa.pub from usb:

  1. mkdir /tmp/usb
  2. mount /dev/sdb1 /tmp/usb
  3. cp /tmp/usb/id_rsa* /tmp/
  4. mkdir /root/.ssh/
  5. cp /tmp/id_rsa* /root/.ssh/

clone the ansible repo

  1. cd /root/
  2. git clone git@github.com:ratabora/arch-linux-provisioner.git
  3. cd arch-linux-provisioner
  4. git submodule init && git submodule update

appendix

VMWare

  • If installing using a VM make sure to boot the VM using EFI before your first boot.

reference material