summaryrefslogtreecommitdiff
path: root/README.md
blob: 5640fa6d95f2cdc7b53c16410a4d3860a2dc3e7c (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
Install Debian using vmdb2 (v-i) onto my Thinkpad x220 laptop
=============================================================================

WARNING!
-----------------------------------------------------------------------------

**Warning:** this is an operating system installer. It will overwrite your
hard drive and annihilate anything that used to be there. There are no
safety rails. You will lose all your data. Make sure your backups
work. You have been warned.


Introduction
-----------------------------------------------------------------------------

This is a hack for my own amusement. It's not meant to be taken
seriously.

This is a rudimentary installer of Debian based on vmdb2. It has
nothing to do with debian-installer, the official Debian installer,
known as d-i. I use d-i, but would like something better:

* I'd like something I can easily modify. d-i requires building
  special udeb packages for any software that's to be part of the
  installer. v-i is happy with normal debs.

* d-i uses preseeding for automating an installation. Preseeding means
  providing answers, in a file, to questions the package may ask
  during its installation. This is fine, if a little cumbersome, but
  only helps to answer questions the packages ask. v-i lets you have
  the full power of Ansible during initial installation.

On the other hand, d-i is mature software and tested by a very large
number of people, on a very large number of different hardware. v-i
can just barely install my own Thinkpad x220 laptop, using UEFI.

v-i is not currently expected to work with any other hardware. It
might not even work on your x220.


Architecture
-----------------------------------------------------------------------------

The vmdb2 installer builds a bootable disk image with Debian. The
image boots with UEFI, and has vmdb2 installed. You write the image to
a USB drive, boot off that, and run vmdb2 in the booted system to
install Debian onto the hard drive.

Thus:

- build system -> installer image
- installer image -> USB drive
- boot from USB drive
- run vmdb2 to install onto laptop hard drive
  - the /root/x220.sh script does this, and installs a basic Debian
    system using my Ansible playbooks
- boot off the laptop hard drive

The image building uses vmdb2 as well. Things get a little recursive.


Hacking
-----------------------------------------------------------------------------

The main files are:

* v-i.vmdb -- the vmdb2 specification file for the installer image
* v-i.yml -- the Ansible playbook used by v-i.vmdb
* x220.vmdb -- the vmdb2 specification file to install onto an x220;
  this is used from the system booted from the image built by v-i.vmdb
* x220.yml -- the Ansible playbook used by x220.vmdb

To build the installer image, run (the cached tarball will be created
if it doesn't exist, but you need to choose the location):

~~~sh
sudo ./v-i.sh /path/to/rootfs/tarball/for/caching/debootstrap.tar.gz
~~~

To write the resulting v-i.img to a USB drive:

~~~sh
sudo dd if=v-i.img of=/dev/path/to/usb/drive/device status=progress oflag=direct
~~~

Plug in the USB drive to the laptop, boot off that. Log into the
installer as root (no password), and run

~~~sh
./x220.sh
~~~

Reboot laptop from its hard drive and you should have a bare bones
Debian system installed.