blob: 23fbc32cacffb07760dd2d49bbaedcf18006f4b4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#!/bin/bash
set -e
git_branch="$1"
environment="$2"
# Randomizer
haveged &
# /Randomizer
# Prepare an arch chroot
cd /tmp
LATEST=$(curl -L https://mirrors.kernel.org/archlinux/iso/latest/sha1sums.txt | grep "bootstrap" | head -n1)
SHA1=$(echo "$LATEST" | cut -d' ' -f1)
NAME=$(echo "$LATEST" | cut -d' ' -f3)
curl -L -O "https://mirrors.kernel.org/archlinux/iso/latest/$NAME"
tar -xzf "$NAME"
echo 'Server = http://archlinux.mirrors.ovh.net/archlinux/$repo/os/$arch' > /tmp/root.x86_64/etc/pacman.d/mirrorlist
# /Prepare an arch chroot
# Prepare device information (not available in chroot)
DEVICE="/dev/sda1"
MOUNTPOINT="/mnt"
UUID=$(lsblk -rno UUID "$DEVICE")
echo "$UUID" > /tmp/root.x86_64/device_uuid
# /Prepare device information
# Install very basic system via chroot (base git puppet)
cp /tmp/arch_chroot_script.sh /tmp/root.x86_64/
/tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/ /arch_chroot_script.sh
# /Install very basic system via chroot
# Mount and install rest of system (via puppet)
mount "$DEVICE" "$MOUNTPOINT"
cp /tmp/arch_install_script.sh "$MOUNTPOINT/root/"
cp /tmp/puppet_variables.json "$MOUNTPOINT/root/"
/tmp/root.x86_64/bin/arch-chroot "$MOUNTPOINT" /root/arch_install_script.sh "$git_branch" "$environment"
# /Mount and install rest of system
|