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
|
rsync -av rsync://mirror.archlinux32.org/archlinux32/i686/core/. mirror/i686/core/.
rsync -av rsync://mirror.archlinux32.org/archlinux32/archisos/archlinux-2018.07.01-i686.iso mirror/archisos/.
mkdir -p mirror/i686/extra
rsync -av rsync://mirror.archlinux32.org/archlinux32/i686/extra/extra.db* mirror/i686/extra/.
mkdir -p mirror/i686/community
rsync -av rsync://mirror.archlinux32.org/archlinux32/i686/community/community.db* mirror/i686/community/.
rsync -av rsync://mirror.archlinux32.org/archlinux32/* mirror/.
mkdir archiso
mount -o loop mirror/archisos/archlinux-2018.07.01-i686.iso archiso
TODO FROM HERE:
local network:
# hangs!? why!?
#ip link add name br0 type bridge
#ip addr add dev br0 192.168.120.1/24
brctl addbr br0
ip link set br0 up
ip addr add dev br0 192.168.120.1/24
# We mount it and make it accessible over the 'darkhttpd' webserver:
# minimal requirements:
# pentium2: CMOV missing
# 64M: Physical KASLR disabled: no suitable memory region!
# 128M: Initramfs unpacking failed: write error
# 256M: Initramfs unpacking failed: write error, failed to configure network
# 512M: curl: Out of memory downloading airootfs.sfs
# 768M: attempting to kill init
# 1024M: no space left on device,, squashfs temp space
# 1024M: no space left on device,, squashfs temp space
# 1536M: works
guestmount -a /data/libvirt/arch32.qcow2 -m /dev/sda2 --ro /mnt/tmp
TFTP root (for PXE boot)
---------
# Copy PXE bootstrap files to a TFTP root:
cp archiso/arch/boot/i686/vmlinuz tftproot/boot/i686/
cp archiso/arch/boot/i686/archiso.img tftproot/boot/i686/
cp /usr/share/syslinux/pxelinux.0 tftproot/
cp /usr/share/syslinux/linux.c32 tftproot/
Local kernel and RAMdisk (for libvirt direct kernel boot)
------------------------
cp archiso/arch/boot/i686/vmlinuz .
cp archiso/arch/boot/i686/archiso.img .
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 arch32.img 2G
qemu-system-i386 -drive file=arch32.img,index=0,media=disk,format=raw,if=virtio -net nic \
-enable-kvm \
-net user,id=net0,net=192.168.120.101/24,host=192.168.120.1,tftp=$PWD/tftproot,bootfile=pxelinux.0 \
-m 2048 \
-machine accel=kvm -redir tcp:2222::22
# fails somehow to start script
# 10.0.2.0 network is quite stuborn, how to set explicitely?
# -nographic -serial mon:stdio \
qemu-system-i386 -drive file=arch32.img,index=0,media=disk,format=raw,if=virtio -net nic \
-enable-kvm \
-net user,id=net0,net=192.168.120.101/24,host=192.168.120.1 \
-m 2048 \
-machine accel=kvm -redir tcp:2222::22
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
|