summaryrefslogtreecommitdiff
path: root/README
blob: 13aca205d50afc8fd6253d8a6b9a764c45066fa1 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
Requirements
------------

pacman -S archiso qemu syslinux darkhttpd xmlstarlet

or

pacman -S libvirt qemu qemu-arch-extra xmlstarlet

ArchISO and optional local cache
--------------------------------

# We build a live Arch boot CD.

mkdir archlive
cp -r /usr/share/archiso/configs/releng/* archlive/.
cd archlive

# always had problem with keys, switch of signing (not good, I know)
sed -i 's/^SigLevel.*/SigLevel = Never/g' pacman.conf

# build the live CDs, this takes quite a while
./build.sh -v build single

cd ..

# We mount it and make it accessible over the 'darkhttpd' webserver:

mkdir archiso
mount -o loop,ro archlive/out/archlinux-2016.02.06-dual.iso archiso
darkhttpd . --port 8080 &

# copy packages from host system (there is no need to build a full-fledged
# mirror now, basic packages should all exist on the host)
./copy_local_packages.sh

TFTP root (for PXE boot)
---------

Copy PXE bootstrap files to a TFTP root:

cp archiso/arch/boot/x86_64/vmlinuz tftproot/boot/x86_64/
cp archiso/arch/boot/x86_64/archiso.img tftproot/boot/x86_64/

cp /usr/lib/syslinux/bios/pxelinux.0 tftproot
cp /usr/lib/syslinux/bios/ldlinux.c32 tftproot

Local kernel and RAMdisk (for libvirt direct kernel boot)
------------------------

cp archiso/arch/boot/x86_64/vmlinuz .
cp archiso/arch/boot/x86_64/archiso.img .

Custom software from AUR
------------------------

Build the following packages from AUR:

useradd -g users build
rm -rf INSTALL
mkdir INSTALL
cd INSTALL

yaourt -G cfengine
chown -R build:users cfengine
cd cfengine
su build -c 'makepkg -f'
cd ..

cd ..

Put them into a local repository 'myrepo':

rm -rf myrepo
mkdir -p myrepo/os/x86_64/
cp INSTALL/*/*pkg.tar.xz myrepo/os/x86_64/.

repo-add myrepo/os/x86_64/myrepo.db.tar.gz myrepo/os/x86_64/*

Install Archlinux (PXE and qemu directly)
-----------------

Create a Qemu image with Archlinux (automatically). The main
work is done by the 'archauto.sh' script which is given to
the archiso kernel as script to execute after auto-login:

qemu-img create arch.img 4G

qemu-system-x86_64 -drive file=arch.img,index=0,media=disk,format=raw -net nic \
	-net user,tftp=$PWD/tftproot,bootfile=pxelinux.0 \
	-m 512 \
	-machine accel=kvm -redir tcp:222::22 \
	-nographic -serial mon:stdio |& tee log

Install Archlinux (libvirtd and virt-install)
-----------------

There are quite some steps here, so they are wrapped into a shell script:

./createvm.sh

TODOs
-----

# remote install (manually), then follow docu
# (this gives a rough idea of what should be automatized)
#passwd
#systemctl start sshd
#sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config

# automatic installation frameworks for ArchLinux
# - AIF
# - ArchBlocks
# - ArchBang
# - backpac: snapshots, not really the cfengine philosophy
# load them after boot of base system or customize the installation medium?

# EFI, later
# wget 'http://wiki.qemu.org/download/efi-bios.tar.bz2'
# qemu with efi
# efi partition etc

# manual minimal installation or "what's needed in a CFengine bootstrap
# script"?
# - boot loader
#   - grub2
#   - virtio ramdisk hooks
# - partitioning
#   - sgdisk scripting (ArchBlocks does it nicely)
#   - RAID, LVM, LUKS and friends
#   - size, swap, filesystem, chunking
#   - file system layout

# via cfengine

# packages net-tools gdisk