diff --git a/doc/Makefile b/doc/Makefile
index e02c99ead4d6bb72269e9e77b586e7b9ad036643..2c8c84e9a8761a1deab381a1397776b47ea8288c 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,30 +1,35 @@
+GPP = gpp -x -U '!!' "" "{" "}{" "}" "{" "}" "\#" "@"
+GPPMD_SRC := $(wildcard *.gpp.md)
+MD_SRC := $(addsuffix .md, $(basename $(basename $(GPPMD_SRC))))
 PLANTUML_DIAGRAMS_SRC := $(addprefix diagrams/, $(wildcard diagrams/*.puml))
 PLANTUML_DIAGRAMS_SVG := $(addprefix images/diagram_, $(addsuffix .svg, $(notdir $(basename $(PLANTUML_DIAGRAMS_SRC)))))
 PLANTUML_DIAGRAMS_PNG := $(addprefix images/diagram_, $(addsuffix .png, $(notdir $(basename $(PLANTUML_DIAGRAMS_SRC)))))
 
-all: diagrams rapport.pdf
+all: diagrams markdown rapport.pdf
 
-rapport.pdf: rapport.md diagrams
-	pandoc rapport.md -o rapport.pdf --pdf-engine=xelatex
+markdown: $(MD_SRC)
 
-rapport.tex: rapport.md diagrams
+%.md: %.gpp.md
+	$(GPP) -DGITLAB_MARKDOWN $^ | ./trimstart.py > $@
+
+rapport.pdf: rapport.gpp.md diagrams
+	$(GPP) -DPANDOC_PDF $< | ./trimstart.py | pandoc --pdf-engine=xelatex -o $@
+
+rapport.tex: rapport.gpp.md diagrams
 	pandoc rapport.md -o rapport.tex
 
 diagrams: $(PLANTUML_DIAGRAMS_SVG) $(PLANTUML_DIAGRAMS_PNG)
 
 images/diagram_%.svg: diagrams/%.puml
-	for diagram in $^ ; do \
-		cat $$diagram | plantuml -tsvg -pipe > images/diagram_`basename -s .puml $$diagram`.svg ; \
-	done
+	cat $^ | plantuml -tsvg -pipe > images/diagram_`basename -s .puml $^`.svg ; \
 
 images/diagram_%.png: diagrams/%.puml
-	for diagram in $^ ; do \
-		cat $$diagram | plantuml -tpng -pipe > images/diagram_`basename -s .puml $$diagram`.png ; \
-	done
+	cat $^ | plantuml -tpng -pipe > images/diagram_`basename -s .puml $^`.png ; \
 
 clean:
 	rm -rf rapport.pdf; \
 	rm -rf $(PLANTUML_DIAGRAMS_SVG); \
-	rm -rf $(PLANTUML_DIAGRAMS_PNG);
+	rm -rf $(PLANTUML_DIAGRAMS_PNG); \
+	rm -rf $(MD_SRC)
 
-.PHONY: all diagrams clean
\ No newline at end of file
+.PHONY: all diagrams markdown clean
\ No newline at end of file
diff --git a/doc/includes/gitlab-markdown.gpp b/doc/includes/gitlab-markdown.gpp
new file mode 100644
index 0000000000000000000000000000000000000000..2e74899cb0875380d23b2247ed3e7ba6c257cbb8
--- /dev/null
+++ b/doc/includes/gitlab-markdown.gpp
@@ -0,0 +1 @@
+!!define{!!svg{name}{description}}{![[!!name.svg](!!description)](!!name.png)}
\ No newline at end of file
diff --git a/doc/includes/markdown.gpp b/doc/includes/markdown.gpp
new file mode 100644
index 0000000000000000000000000000000000000000..6379e5aa09dc9f43253064c78f1f2770939aac33
--- /dev/null
+++ b/doc/includes/markdown.gpp
@@ -0,0 +1,11 @@
+!!define{!!includemd{file}}{
+    !!exec{cat !!file}
+}
+
+!!ifdef{PANDOC_PDF}
+    !!include{pandoc-pdf-markdown.gpp}
+!!endif
+
+!!ifdef{GITLAB_MARKDOWN}
+    !!include{gitlab-markdown.gpp}
+!!endif
diff --git a/doc/includes/pandoc-pdf-markdown.gpp b/doc/includes/pandoc-pdf-markdown.gpp
new file mode 100644
index 0000000000000000000000000000000000000000..d145c5ca501a3eaa54082b3ead5f0bf4c4a17eaa
--- /dev/null
+++ b/doc/includes/pandoc-pdf-markdown.gpp
@@ -0,0 +1 @@
+!!define{!!svg{name}{description}}{![description](name.svg)}
\ No newline at end of file
diff --git a/doc/logbook.gpp.md b/doc/logbook.gpp.md
new file mode 100644
index 0000000000000000000000000000000000000000..fae3b9da24b79805d4fde3603865148d78696a9e
--- /dev/null
+++ b/doc/logbook.gpp.md
@@ -0,0 +1,1195 @@
+# Log book
+
+## 2020-04-22
+
+Created the git repository on
+<https://githepia.hesge.ch/dimitri.lizzi/bootiful>.
+
+Start to study the previous project made by Abilash Venkatesh on
+<https://githepia.hesge.ch/abhilash.venkates/remote-imaging>. The first
+step will be to reproduce the infrastructure and make it work.
+
+I will set up the following infrastructure:
+- A DHCP server
+- A TFTP server
+- A NFS server
+- A client
+
+I will try to use Vagrant to set-up a reproducible VM based on debian
+buster that contains all the servers. It will be created in
+[`remote_imaging/pxe_server`](../remote_imaging/pxe_server).
+
+A [Vagrantfile](../remote_imaging/pxe_server/Vagrantfile) has been
+created using the following command:
+
+```bash
+vagrant init debian/buster64
+```
+
+I defined a basic configuration inspired by a similar project on GitHub:
+<https://github.com/eoli3n/vagrant-pxe>. For the moment, I just try to
+install the packages `isc-dhcp-server`, `tftpd-hpa` and
+`nfs-kernel-server`. I will do a script that copies the configuration
+files later.
+
+The virtual machine can be created and started by running the following
+command:
+
+```bash
+vagrant up
+```
+
+It's then possible to SSH into the VM using:
+
+```bash
+vagrant ssh
+```
+
+The VM can be removed using:
+
+```bash
+vagrant destroy
+```
+
+Now let's configure the different services. I'll start by copying the
+[configuration files from the remote-imaging repository](https://githepia.hesge.ch/abhilash.venkates/remote-imaging/tree/master/server-config)
+into the [`config`](../remote_imaging/pxe_server/config) folder.
+
+These files should be copied after the installation of the packages, but
+before, let's modify them to match our server configuration.
+
+- `/etc/defaults/isc-dhcp-server`
+  - use interface `eth1` instead of `vboxnet0`
+- `/etc/dhcp/dhcpd.conf`
+  - subnet 192.168.56.0/24
+  - use same address as the dhcp server for tftp server: 192.168.56.254
+  - comment options for domain name servers and routers for now as we
+    will not use a network open to the outside right now
+- `/etc/default/tftpd-hda`
+  - remove comment not useful
+
+It look like it works!
+
+I have created manually a VM with VirtualBox that connects to the same
+network as the server, but unfortunately, the PXE boot fails with the
+following error messages:
+
+```
+Intel UNDI, PXE-2.1
+PXE Software Copyright (C) 1997-2000 Intel Corporation
+Copyright (C) 2010-2017 Oracle Corporation
+
+CLIENT MAC ADDR: 08 00 27 CE 6D 4A GUID: 077C2310-C4DC-DC49-A6C5-2AAC35FDO22D
+CLIENT IP: 192.168.56.10 MASK: 255.255.255.0 DHCP IP: 192.168.56.254
+TFTP.
+PXE-TO1: File not found
+PXE-E3B: TFTP Error - File Not found
+PXE-MOF : Exiting Intel PXE ROM
+FATAL: No bootable medium found! System halted.
+```
+
+
+### Meeting with F. Gluck
+- Faire un planning d'ici la semaine prochaine
+- Reproduire le projet et automatiser
+- Investiguer les sparse files
+- Investiguer sur le multicast, l'optimisation du traffic réseau
+- Cache de l'image sur le disque: étudier le mécanisme mis en place
+- Vérifier que le boot fonctionne sur des OS différents
+- Système d'extension d'une image _template_, scripts de démarrage
+- Integration à un LDAP de manière "élégante", gestion des comptes
+- Faciliter la création d'images
+- Système de gestion simple à utiliser pour la gestion du serveur et des
+  images
+- Système d'overlay/différenciation d'images
+- Rapport:
+  - montrer les différences entre Bootiful, Tivoli, CloneZilla
+  - documenter les besoins de l'école
+- Prochain RDV: mercredi 10h
+
+Projet rainbow: racheté par IBM et intégré à Tivoli
+
+## 2020-04-25
+
+Let's find out why the tftp server doesn't work. [This guide guide from
+Oracle](https://docs.oracle.com/cd/E19045-01/b100x.blade/817-5625-10/Linux_Troubleshooting.html)
+explains some steps for troubleshooting that I'm going to follow.
+
+First, let's check on the server if the TFTP server is running.
+
+On the server, the package `net-tools`, which provides, among others,
+the `netstat` program, has been installed.
+
+```bash
+sudo apt install net-tools
+```
+
+The service seems to be running on port 67:
+
+```
+$ netstat -an | grep -w 67
+udp        0      0 0.0.0.0:67              0.0.0.0:*
+```
+
+From the error message seen previously, `PXE-TO1: File not found`, it
+seems that the connection to the server is successful but that a file is
+missing.
+
+We can see that the folder `tftpboot` exists and seems to be readable
+for all users:
+```
+$ ls -als /tftpboot/
+total 12
+4 drwxr-xr-x  3 vagrant vagrant 4096 Apr 22 06:35 .
+4 drwxr-xr-x 21 root    root    4096 Apr 25 18:55 ..
+4 drwxr-xr-x  6 vagrant vagrant 4096 Apr 22 06:35 boot
+```
+
+The boot file specified in `dhcpd.conf` seems to exist as well:
+
+```bash
+$ ls
+-l /tftpboot/boot/grub/i386-pc/core.0 -rw-r--r-- 1 vagrant vagrant 54394
+Apr 22 06:35 /tftpboot/boot/grub/i386-pc/core.0
+```
+
+Let's install tftp on the server.
+
+```bash
+sudo apt install tftp
+```
+
+Now, let's check if we can access to the file on localhost.
+
+```bash
+$ tftp 127.0.0.1
+tftp> get /boot/grub/i386-pc/core.0
+Error code 1: File not found
+```
+
+We can reproduce the error. There is probably something wrong in `tftpd`
+configuration. Let's check:
+
+```bash
+$ cat /etc/default/tftpd-hpa
+# /etc/default/tftpd-hpa
+
+TFTP_USERNAME="tftp"
+TFTP_DIRECTORY="/srv/tftp"
+TFTP_ADDRESS="0.0.0.0:69"
+TFTP_OPTIONS="--secure"
+```
+
+The configuration is not the correct one and seems to be the default.
+After a quick check in the `Vagrantfile`, I found the error on this
+line:
+
+```bash
+cp /vagrant/config/tftp/tftpd-hpa /etc/default/tftpd-hda
+```
+
+There is a typo, the target file should be:
+
+```bash
+cp /vagrant/config/tftp/tftpd-hpa /etc/default/tftpd-hpa
+```
+
+After fixing the `Vagrantfile`, let's rebuild the server:
+
+```
+vagrant destroy -f && vagrant up
+```
+
+Now it works!.. Kind of. The client gets the grub image but there's an
+error after GRUB has started:
+
+```
+Welcome to GRUB!
+
+error: no server is specified.
+Entering rescue mode...
+grub rescue> 
+```
+
+I think this happens because the server address is hard-coded somewhere,
+or something like that.
+
+In the `grub.cfg` file, there are some lines that catch my attention:
+
+```
+#GRUB_ISIGN_MATCH 101
+#GRUB_ISIGN_MISMATCH 100
+#GRUB_ISIGN_WRITE 102
+
+isign -c hepia2015 (hd0)
+set check1=$?
+if [ $check1 == 101 ]; then
+isign -w 000000000 (hd0)
+```
+
+It looks like `isign` is a custom module for GRUB. I have to find out
+what it does and what is the correct configuration to make it work. The
+parameter `hepia2015` looks suspicious: is it as password? A host name?
+A partition name?
+
+## 2020-04-26
+
+Let's find out what is this `isign` module and how it works. I started
+by adding some indentation to the grub.cfg file. It looks like the the
+`isign` is checking something on hd0, and the menu that appears changes
+depending on this check.
+
+My guess is that it checks if an OS is already deployed with the image
+deployment OS. If so, the image can be booted. Otherwise, only the
+deployment OS is available in the menu.
+
+The behavior of this command is defined in the
+[`isign.c` file](https://githepia.hesge.ch/abhilash.venkates/remote-imaging/blob/master/grub_build/grub-2.02/grub-core/commands/isign.c).
+
+After playing a bit in the `grub rescue>` prompt on the client, I have
+been able to manually set the server ip and show the boot menu with the
+following commands:
+
+```
+grub rescue> set net_default_server=192.168.56.254
+grub rescue> insmod normal
+grub rescue> normal
+```
+
+Now, the menu shows up with only the `IDOS-Image Deployment OS` option.
+It seems that the OS is hard-coded to connect to an NFS server on
+192.168.56.100 and it fails. I will try to change my server IP to this
+address and maybe even GRUB will work. If it does, I have to find a way
+to make this IP address easily configurable.
+
+After recreating the server with the new address, GRUB still does not
+connect to the server as expected. The NFS mount still does not work as
+well but for another reason: `Permission denied`.
+
+After checking the server configuration, I found out that the issue was
+that the nfs server did not load the configuration file after copying
+it. It was fixed by adding the following line in the server
+configuration script:
+
+```bash
+systemctl restart nfs-server
+```
+
+Now, the `IDOS-Image Deployment OS` starts without error. The GRUB
+default server should still be entered manually but at least the OS
+boots afterwards. Once the OS has booted, nothing happens. I am root in
+a command-line prompt. I expected to see a menu or something.
+
+This a menu script exists, though, and can be launched with:
+
+```bash
+/root/menu.sh
+```
+
+It shows a `ncurses` menu where all options are items of the root file
+system. When I chose an item, a string `chosen image is <CHOSEN_ITEM>`
+is echoed to stdout and nothing happens.
+
+After reading the _readme_ files, it seems that the correct _main_
+script is:
+
+ ```bash
+ /root/ideploy.sh
+ ```
+
+Running this script shows a menu with only one option: `os1`. When this
+option is chosen, an error message appears:
+
+```
+chosen image is os1
+total_size of image=2147483648 bytes
+Isufficient disk space for imaging, need size of 2147483648 B but has -4096 bytes
+umount: cant unmount /mnt: Invalid argument
+
+######################################Sun Apr 26 17:19:32 UTC 2020######################################
+
+#
+```
+
+This is maybe because of a wrong configuration on the client virtual
+machine. `2147483648 B = 2,147483648 GB` but the machine has 10 GB
+available. However, the scripts says that `-4096 bytes` are available.
+This is a sign that the script does not try to use the correct disk.
+
+The script determines the size of the `sda` disk by using this command:
+
+```
+fdisk -l | grep "Disk /dev/sda" | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 2
+```
+
+However, on my virtual machine where the disk is has no partition, this
+command returns this:
+
+```
+$ fdisk -l | grep "Disk /dev/sda" | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 2
+10737418240
+/dev/sda
+```
+
+The second line happens because `fdisk -l` outputs this line at the end
+when there is no partition table:
+
+```
+Disk /dev/sda1 doesn't contain a valid partition table
+```
+
+I believe the miscalculation of the disk size happens because of this
+line. I will modify the script to use only the first matching line of
+fdisk using `head -n 1` after `grep`. The modified command looks like
+this:
+
+```
+fdisk -l | grep "Disk /dev/sda" | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 2
+```
+
+Now it seems to go further. There is still a warning but it seems to
+continue copying the image after it:
+
+```
+ls : /mnt/*.md5: No such file or directory
+```
+
+At the end, the script says `rebooting` but the VM does not reboot. I
+rebooted manually and can now see a `local hdd` option in GRUB, after
+setting the remote server manually. However, booting on `local hdd` does
+nothing. The screen stays black with a blinking cursor.
+
+On another subject: I have fixed the GRUB problem by adding the
+following line to `dhcpd.conf`:
+
+```
+next-server 192.168.56.100;
+```
+
+Now it's not necessary to enter the server by hand in GRUB.
+
+## 2020-04-28
+
+I discovered that the `grub.cfg` is configured to boot on `manual_os`.
+This explains why the deployment is not automatic.
+
+I've added an entry in the menu for the `auto_os`. I have also corrected
+a typo `vimlinuz` that should be `vmlinuz`, simplified the `if`
+condition and improved the strings.
+
+When running the auto OS, the only thing I see is a blinking cursor...
+It does not seem to do anything.
+
+I found out that the deploy log is saved on the server if I use
+`/root/deploy_log.sh` for the deployment.
+
+Here is the log:
+
+```
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/deploy_log.sh: line 32: .: ideploy.sh: file not found
+/root/ideploy.sh: line 12: l: command not found
+
+######################################Tue Apr 28 16:53:20 UTC 2020##############################################
+
+Total size of disk=10737418240 bytes
+size of hidden partition=2147483648 bytes
+size of disk for imaging=8589930496 bytes
+End byte=10737414144 bytes
+512+0 records in
+512+0 records out
+262144 bytes (256.0KB) copied, 0.043130 seconds, 5.8MB/s
+Warning: The resulting partition is not properly aligned for best performance.
+partition created
+dd: can't open '/root/boot/mbr/08:00:27:ce:6d:4a.img': No such file or directory
+mke2fs 1.44.5 (15-Dec-2018)
+Creating filesystem with 524288 4k blocks and 131072 inodes
+Filesystem UUID: ab3cf206-1689-4155-9c18-6ef31c2796db
+Superblock backups stored on blocks: 
+        32768, 98304, 163840, 229376, 294912
+
+Allocating group tables: done                            
+Writing inode tables: done                            
+Creating journal (16384 blocks): done
+Writing superblocks and filesystem accounting information: done 
+
+hidden partition created and available
+mounted
+chosen image is os1 
+total_size of image=2147483648 bytes
+sufficient space for imaging
+ls: /mnt/*.md5: No such file or directory
+not cached, so caching 
+size cache available=1871288 KB
+size of image to download=259720 KB
+8+65425 records in
+8+65425 records out
+2147483648 bytes (2.0GB) copied, 15.177776 seconds, 134.9MB/s
+Caching and deployment  of 259720 KB done in 16 s 
+md5sum checked
+location of signature at  10737418040 B
+ signature is hepia2015
+9+0 records in
+9+0 records out
+9 bytes (9B) copied, 0.005788 seconds, 1.5KB/s
+rebooting..
+
+######################################Tue Apr 28 16:53:45 UTC 2020##############################################
+```
+
+It looks like there is an error in the last line of the script:
+
+```
+. ideploy.sh &>> $log_file
+```
+
+I will change it to:
+
+```
+/root/ideploy.sh 2>&1 | tee output
+```
+
+Also, it looks like the `reboot` command has been commented out in
+`ideploy.sh`. I will uncomment it. It seem to install the image and
+reboot as expected.
+
+I tried to boot manually from grub:
+
+```
+set root=(hd0,1)
+linux /boot/vmlinuz-vanilla root=/dev/sda3
+initrd /boot/initramfs-vanilla
+boot
+```
+
+But it seems there is a problem with `initramfs`.
+
+## 2020-04-29
+
+Creation of [a planning](planning.fods).
+
+Meeting with F. Gluck and S. Chassot. We discussed the current stage of
+the reproduction of the infrastructure and the planning. We agreed that
+I should investigate how the OS images are created and maybe create a
+new one.
+
+F. Gluck mentioned some ways of investigating why the `initrd` does not
+work. This is a `cpio` archive, so it can be extracted with a command
+like this:
+
+```
+cpio -idv < /boot/initrd.img-4.15.0-91-generic
+```
+
+F. Gluck also said that I should modify the planning to start working
+earlier on the creation and customization of images, and that the
+network optimization can be moved to the end of the work, if there's
+some time left.
+
+I cleaned up the `ideploy.sh` script (removed some whitespace, removed
+command `l` at the start of the file).
+
+I removed the logs and added a readme file so git doesn't delete the
+folder.
+
+## 2020-05-03
+
+After reading Abhilash's report, I found out that he created some docker
+images published on dockerhub:
+
+- [osimaging/dhcp-nfs](https://hub.docker.com/r/osimaging/dhcp-nfs)
+- [osimaging/grub-tftp](https://hub.docker.com/r/osimaging/grub-tftp)
+- [osimaging/buildroot](https://hub.docker.com/r/osimaging/buildroot)
+
+Unfortunately, there are no sources for these images. I will try to
+dissect the second image to find out if the grub configuration is the
+same, as I suspect there is something wrong in the one I got from the
+repository.
+
+First, lets download the dcocker image:
+
+```bash
+docker pull osimaging/grub-tftp
+```
+
+Now that I have the image, I can inspect see the commands that have been
+used to create its layers:
+
+```bash
+$ docker history osimaging/grub-tftp --no-trunc
+IMAGE                                                                     CREATED             CREATED BY                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 SIZE                COMMENT
+sha256:48023277a40cf403b0cfafecc453f16f94856eed7a8b64e2d7e8c5e44f5f3ab4   6 months ago                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   925B                
+<missing>                                                                 7 months ago                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   5.49kB              
+<missing>                                                                 7 months ago        /bin/sh -c #(nop)  ENTRYPOINT ["/bin/sh" "-c" "service tftpd-hpa start && /bin/bash"]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      0B                  
+<missing>                                                                 7 months ago        /bin/bash                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  8.54MB              
+<missing>                                                                 7 months ago        /bin/bash                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  571MB               grub with tftp server
+<missing>                                                                 7 months ago        /bin/bash                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  962MB               
+<missing>                                                                 7 months ago        /bin/sh -c #(nop)  CMD ["/bin/bash"]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       0B                  
+<missing>                                                                 7 months ago        /bin/sh -c mkdir -p /run/systemd && echo 'docker' > /run/systemd/container                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 7B                  
+<missing>                                                                 7 months ago        /bin/sh -c set -xe   && echo '#!/bin/sh' > /usr/sbin/policy-rc.d  && echo 'exit 101' >> /usr/sbin/policy-rc.d  && chmod +x /usr/sbin/policy-rc.d   && dpkg-divert --local --rename --add /sbin/initctl  && cp -a /usr/sbin/policy-rc.d /sbin/initctl  && sed -i 's/^exit.*/exit 0/' /sbin/initctl   && echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup   && echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean  && echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean  && echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean   && echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages   && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes   && echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests   745B                
+<missing>                                                                 7 months ago        /bin/sh -c [ -z "$(apt-get indextargets)" ]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                987kB               
+<missing>                                                                 7 months ago        /bin/sh -c #(nop) ADD file:288ac0434f65264f3c50cf3e2766c5dbf3fa953c89995dd9445063fd565aac81 in /                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           63.2MB              
+```
+
+It looks like files have been added in the last layer. I don't know how
+to find the id for this layer so I used `find` to search for `grub.cfg`
+in the docker images. As this is the only docker image installed on my
+computer, there is no risk that it's from another image.
+
+```
+$ sudo find /var/lib/docker/overlay2 -name grub.cfg
+/var/lib/docker/overlay2/2ee611d9b284dbac637be7f08b778d00f20af9c48610e2f7e7ab9e8de536fe01/diff/tftpboot/boot/grub/grub.cfg
+/var/lib/docker/overlay2/22b272204d56ddbf324fdaacded0883a7026c424e6fe89ac35d112db2a1ed6ac/diff/tftpboot/boot/grub/grub.cfg
+/var/lib/docker/overlay2/22b272204d56ddbf324fdaacded0883a7026c424e6fe89ac35d112db2a1ed6ac/diff/tftpboot/boot/grub/i386-pc/grub.cfg
+/var/lib/docker/overlay2/22b272204d56ddbf324fdaacded0883a7026c424e6fe89ac35d112db2a1ed6ac/diff/home/grub_build/grub-2.02/docs/grub.cfg
+/var/lib/docker/overlay2/22b272204d56ddbf324fdaacded0883a7026c424e6fe89ac35d112db2a1ed6ac/diff/home/grub_build/grub-2.02_source/docs/grub.cfg
+/var/lib/docker/overlay2/22b272204d56ddbf324fdaacded0883a7026c424e6fe89ac35d112db2a1ed6ac/diff/home/grub_build/server-config/tftp/tftpboot/boot/grub/i386-efi/grub.cfg
+/var/lib/docker/overlay2/22b272204d56ddbf324fdaacded0883a7026c424e6fe89ac35d112db2a1ed6ac/diff/home/grub_build/server-config/tftp/tftpboot/boot/grub/i386-pc/grub.cfg
+```
+
+It looks like it should be the first or the second image. Let's inspect
+them:
+
+```
+$ sudo cat /var/lib/docker/overlay2/2ee611d9b284dbac637be7f08b778d00f20af9c48610e2f7e7ab9e8de536fe01/diff/tftpboot/boot/grub/grub.cfg
+
+#tr --set=MAC ":" "-" "${net_default_mac}"
+#configfile /boot/grub/${MAC}
+
+#GRUB_ISIGN_MATCH 101
+#GRUB_ISIGN_MISMATCH 100
+#GRUB_ISIGN_WRITE 102
+
+isign -c hepia2015 (hd0)
+set check1=$?
+if [ $check1 == 101 ]; then
+isign -w 000000000 (hd0)
+
+menuentry local_hdd { 
+linux16 //boot/ipxe/ipxe.lkrn 
+initrd16 //boot/ipxe/boot_hdd.ipxe 
+}    
+
+menuentry IDOS-Image\ Deployment\ OS {
+echo "loading vimlinuz"
+
+        linux   boot/manual_os/bzImage    ro ip=dhcp  splash quiet 
+
+        
+}
+
+
+
+else
+menuentry IDOS-Image\ Deployment\ OS {
+echo "loading vimlinuz"
+
+        linux   boot/manual_os/bzImage    ro ip=dhcp  splash quiet 
+        
+        
+}
+
+       
+fi
+
+
+$ sudo cat /var/lib/docker/overlay2/22b272204d56ddbf324fdaacded0883a7026c424e6fe89ac35d112db2a1ed6ac/diff/tftpboot/boot/grub/grub.cfg
+
+#tr --set=MAC ":" "-" "${net_default_mac}"
+#configfile /boot/grub/${MAC}
+
+#GRUB_ISIGN_MATCH 101
+#GRUB_ISIGN_MISMATCH 100
+#GRUB_ISIGN_WRITE 102
+
+isign -c hepia2015 (hd0)
+set check1=$?
+if [ $check1 == 101 ]; then
+isign -w 000000000 (hd0)
+
+menuentry local_hdd { 
+linux16 //boot/ipxe/ipxe.lkrn 
+initrd16 //boot/ipxe/boot_hdd.ipxe 
+}    
+
+menuentry tiny_OS {
+echo "loading vimlinuz"
+
+        linux   boot/manual_os/bzImage    ro ip=dhcp  splash quiet 
+
+        
+}
+
+
+
+else
+menuentry tiny_OS {
+echo "loading vimlinuz"
+
+        linux   boot/manual_os/bzImage    ro ip=dhcp  splash quiet 
+        
+        
+}
+
+       
+fi
+
+
+```
+
+Both look very similar. Let's look at the differences between them:
+
+```
+$ sudo diff /var/lib/docker/overlay2/2ee611d9b284dbac637be7f08b778d00f20af9c48610e2f7e7ab9e8de536fe01/diff/tftpboot/boot/grub/grub.cfg /var/lib/docker/overlay2/22b272204d56ddbf324fdaacded0883a7026c424e6fe89ac35d112db2a1ed6ac/diff/tftpboot/boot/grub/grub.cfg 
+19c19
+< menuentry IDOS-Image\ Deployment\ OS {
+---
+> menuentry tiny_OS {
+30c30
+< menuentry IDOS-Image\ Deployment\ OS {
+---
+> menuentry tiny_OS {
+
+```
+
+It looks like the only difference between them is the name of the menu
+entry. Apart from that, we can (unfortunately) see that the local hdd
+boot is similar to what I have:
+
+```
+menuentry local_hdd { 
+linux16 //boot/ipxe/ipxe.lkrn 
+initrd16 //boot/ipxe/boot_hdd.ipxe 
+}    
+```
+
+This has taught me nothing apart from the fact that the entry `tiny_OS`
+has been renamed to `IDOS-Image Deployment OS`.
+
+I need to find out why this `ipxe.kern` does nothing when booted. Let's
+inspect the `initrd` file named `boot_hdd.ipxe`.
+
+```
+$ cpio -idv < config/nfs/nfsroot/boot/ipxe/boot_hdd.ipxe 
+cpio: premature end of archive
+```
+
+It looks like the file is truncated. Let's look at its size:
+
+```
+$ ls -lh config/nfs/nfsroot/boot/ipxe/boot_hdd.ipxe 
+-rwxr-xr-x 1 araxor araxor 17 22 avr 08:35 config/nfs/nfsroot/boot/ipxe/boot_hdd.ipxe
+```
+
+Only 17 bytes: it's suspicious. Let's look at the content of the file:
+
+```
+$ cat config/nfs/nfsroot/boot/ipxe/boot_hdd.ipxe
+#!ipxe
+
+sanboot
+```
+
+Some documentation on the `sanboot` exists
+[on ipxe documentation](https://ipxe.org/cmd/sanboot). It looks like it
+will boot on the default disk if no argument is provided. I don't
+understand why the grub command `chainloader (hd0)+1` has not been used
+for this purpose, which seems to do the same thing without involving
+`ipxe`.
+
+When I try to run the command manually, the same thing happens: the
+cursor is blinking and nothing happens.
+
+I will create a new image with alpine linux to see if this works. I will
+just transform the `iso` file to a disk image and see if it boots. It's
+not a _real_ image, because it will boot the installer and not the real
+os, but this is ok to just see if booting on it works.
+
+```bash
+mkdir remote_imaging/pxe_server/config/nfs/nfsroot/images/alpine
+cd remote_imaging/pxe_server/config/nfs/nfsroot/images/alpine
+wget http://dl-cdn.alpinelinux.org/alpine/v3.11/releases/x86_64/alpine-standard-3.11.6-x86_64.iso
+fdisk -l alpine-standard-3.11.6-x86_64.iso > alpine.partition
+gzip alpine-standard-3.11.6-x86_64.iso > alpine.img.gz
+md5sum alpine.img.gz > alpine.md5
+du alpine.img.gz > alpine.size
+rm alpine-standard-3.11.6-x86_64.iso
+```
+
+Now lets recreate the server with the new image:
+
+```bash
+vagrant destroy -f && vagrant up
+```
+
+Unfortunately, it does not work:
+
+![Unsucessful Alpine boot](videos/unsuccessful_alpine_boot.webm)
+
+Something catches my attention during the deployment (at 0:21 in the
+video above):
+
+```
+size of image to download=0 KB
+gunzip: invalid magic
+```
+
+It looks like something goes wrong. Let's look at the image size:
+
+```
+$ ls -lh alpine.img.gz 
+-rw-r--r-- 1 araxor araxor 0  3 mai 03:38 alpine.img.gz
+```
+
+In fact, the image is empty. Something must have gone wrong when
+creating the archive.
+
+```
+gzip alpine-standard-3.11.6-x86_64.iso > alpine.img.gz
+```
+
+It looks like this command is wrong. I have fixed it and placed the
+image creation process
+[in a shell script](../remote_imaging/pxe_server/config/nfs/nfsroot/images/alpine/create_image.sh).
+
+I tried to boot on this image... It does not work either, although the
+gunzip error has disappeared.
+
+## 2020-05-04
+
+I will inspect the file system of the client virtual machine by booting
+on a gparted live cd iso. In the GParted GUI, the file system is
+`iso9660`:
+
+![GParted showing the partition in iso9660](images/pxe_client_alpine_gparted_iso9660.png)
+
+This is maybe a problem. I will create a _real_ alpine linux image to
+confirm this and also have a real image to play with. Here is how I plan
+to do it:
+
+1. Install alpine on the `vdi` disk image file
+   - Change the VM network to `NAT` because the installer requires an
+     internet connection to retrieve packages
+   - Login with username `root` and no password
+   - Disable swap to make the image smaller
+     ```
+     export SWAP_SIZE=0
+     ```
+   - Start the installer
+     ```bash
+     export SWAP_SIZE=0
+     setup-alpine
+     ```
+   - Install with default options except:
+     - hostname: `alpine`
+     - root password: `alpine`
+     - disk: `sda`
+     - how to use the drive: `sys` (traditional disk install with
+       `/boot`, `/` and `swap` partitions)
+   - Reboot the machine with `reboot`
+   - Boot on hard drive to check that the install is successful: it
+     works!
+   - Shut down the virtual machine
+2. Convert the `vdi` image to a `raw` image
+   ```bash
+   VBoxManage clonehd pxe_client.vdi alpine.img --format raw
+   ```
+3. Shrink the second partition of the disk image to a smaller size. A
+   procedure described in a
+   [Stack overflow answer](https://superuser.com/a/1373296) has been
+   used to do this step. Another way to do this would be to use
+   `gparted` but I wanted to do it from the command line so it can be
+   automated later.
+   - Set up loopback devices for the partitions in the image:
+
+     ```bash
+     sudo losetup --find --partscan alpine.img
+     ```
+
+     The image is now accessible as a disk on `/dev/loop0` and the
+     second partition is accessible on `/dev/loop0p2`
+   - Find out the estimated minimum size (in blocks) for the second
+     partition:
+
+     ```
+     $ sudo resize2fs -P /dev/loop0p2
+     resize2fs 1.45.6 (20-Mar-2020)
+     Estimated minimum size of the filesystem: 397098
+     ```
+   - Resize the file system to a size of 400000 blocks for safety. The
+     minimum size of the filesystem is just an estimation and we also
+     need some space to do some tests.
+
+     ```
+     $ sudo e2fsck -f /dev/loop0p2
+     e2fsck 1.45.6 (20-Mar-2020)
+     Pass 1: Checking inodes, blocks, and sizes
+     Pass 2: Checking directory structure
+     Pass 3: Checking directory connectivity
+     Pass 4: Checking reference counts
+     Pass 5: Checking group summary information
+     /dev/loop0p2: 7478/648960 files (0.1% non-contiguous), 262974/2595584 blocks
+     
+     $ sudo resize2fs -p /dev/loop0p2 400000
+     resize2fs 1.45.6 (20-Mar-2020)
+     Resizing the filesystem on /dev/loop0p2 to 400000 (4k) blocks.
+     Begin pass 2 (max = 28340)
+     Relocating blocks             XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+     Begin pass 3 (max = 80)
+     Scanning inode table          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+     Begin pass 4 (max = 1148)
+     Updating inode references     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+     The filesystem on /dev/loop0p2 is now 400000 (4k) blocks long.
+     ```
+
+     - TODO: Resize the partition to 400000 blocks.
+4. TODO: Shrink the raw disk image file to the size of the partition
+5. TODO: Add the raw image to the nfs root folder in the server
+   configuration folder
+6. TODO: Check that the disk image works
+7. TODO: Push the image in the repository using
+   [git LFS](https://githepia.hesge.ch/help/workflow/lfs/manage_large_binaries_with_git_lfs)
+
+
+## 2020-05-06
+
+I will shrink the partition later but first I'll recreate a smaller
+image with the same procedure but on a smaller disk of 2GB.
+
+Let's create the image files for the tiny os:
+
+```bash
+fdisk -l alpine.img > alpine.partition
+gzip alpine.img
+md5sum alpine.img.gz > alpine.md5
+du alpine.img.gz > alpine.size
+```
+
+Unfortunately, the boot still does not work with this image... However,
+I can boot from command line using these commands:
+
+```
+set root=(hd0,1)
+chainloader +1
+boot
+```
+
+I have modified grub.cfg to use `chainloader +1` instead of calling
+`pxe`. Now it works!
+
+![Successful alpine boot](videos/successful_alpine_boot.webm)
+
+The other image works as well, but I'll keep the new one for testing
+purposes.
+
+Now I have large image files in the repository as well as some video
+files. I will try to convert the repository to Git LFS so the repository
+performance does not suffer from the large files.
+
+I will follow
+[a guide from GitLab's documentation](https://docs.gitlab.com/ee/topics/git/lfs/migrate_to_git_lfs.html)
+to do it.
+
+1. Backup the repository
+   - A new empty repository has been created for the backup:
+     <https://githepia.hesge.ch/dimitri.lizzi/bootiful-pre-lfs-backup>
+   - A local copy of the repository has been created
+     ```bash
+     cp -r bootiful bootiful-pre-lfs-backup
+     ```
+
+   - The unmodified logbook has been restored so the working tree is
+     clean
+     ```bash
+     $ cd bootiful-pre-lfs-backup
+     $ git restore doc/logbook.md 
+     $ git status
+     On branch master
+     Your branch is up to date with 'origin/master'.
+     
+     nothing to commit, working tree clean
+     ```
+
+   - The remote `origin` of the copied repository has been changed to
+     the url of the backup repository
+     ```bash
+     git remote rename origin old-origin
+     git remote add origin ssh://git@ssh.hesge.ch:10572/dimitri.lizzi/bootiful-pre-lfs-backup.git
+     ```
+
+   - The history and tags have been pushed to the new repository
+     ```bash
+     git push -u origin --all
+     git push -u origin --tags
+     ```
+
+
+
+2. Delete all binary files in git. This is necessary because `bfg` will
+   not remove files that are present in the HEAD commit. These files
+   will be restored after converting the repository to LFS.
+
+   ```bash
+   cd bootiful
+   find . -type f -regextype posix-extended -regex '^.*\/(bzImage|partimage|partimaged|core\.0|.*\.(ext2|mod|pf2|png|mo|img|gz|vdi|webm|cpio|lkrn|mp4))$' -delete
+   git add .
+   git commit -m "git lfs: remove binary files from HEAD"
+   git push
+   ```
+
+3. Clone the bare repository in folder `bootiful.git`
+   ```bash
+   cd ..
+   git clone --mirror ssh://git@ssh.hesge.ch:10572/dimitri.lizzi/bootiful.git
+   ```
+
+4. Convert the binary files in git history to lfs
+   ```bash
+   bfg --convert-to-git-lfs "{bzImage,partimage,partimaged,core.0,*.ext2,*.mod,*.pf2,*.png,*.mo,*.img,*.gz,*.vdi,*.webm,*.cpio,*.lkrn,*.mp4}" bootiful.git
+   ```
+
+5. Clean up the repository
+   ```bash
+   cd bootiful.git
+   git reflog expire --expire=now --all && git gc --prune=now --aggressive
+   ```
+
+6. Install git lfs on repository
+   ```bash
+   git lfs install
+   ```
+
+7. Unprotect the default branch, so that we can force-push the rewritten
+   repository:
+   - Navigate to your project’s Settings > Repository and expand
+     Protected Branches.
+   - Scroll down to locate the protected branches
+     and click Unprotect the default branch.
+
+8. Force push to the server:
+   ```bash
+   git push --force
+   git pull
+   git push --force
+   ```
+
+9. Re-clone the repository to get the new one that we have force pushed
+   ```bash
+   cd ..
+   mv bootiful bootiful.pre-lfs.backup
+   git clone ssh://git@ssh.hesge.ch:10572/dimitri.lizzi/bootiful.git
+   cd bootiful
+   ```
+
+8. Track the file patterns in LFS
+   ```bash
+   git lfs track "bzImage" "partimage" "partimaged" "core.0" "*.ext2" "*.mod" "*.pf2" "*.png" "*.mo" "*.img" "*.gz" "*.vdi" "*.webm" "*.cpio" "*.lkrn" "*.mp4"
+   git add .
+   git commit -m "add lfs patterns"
+   git push
+   ```
+9. Revert deletion of files
+   ```bash
+   git revert ecb9120676d265368bf4e628f606e94c2c2271cc
+   git push
+   ```
+
+10. Re-protect the default branch:
+   - Navigate to your project’s Settings > Repository and expand Protected Branches.
+   - Select the default branch from the Branch dropdown menu, and set up the Allowed to push and Allowed to merge rules.
+   - Click Protect.
+
+## 2020-05-09
+
+Started to make a diagram of the deployment process:
+
+[![](images/diagram_deployment_v1.png)](images/diagram_deployment_v1.svg)
+
+
+## 2020-05-11
+
+Finalize the diagram:
+
+
+[![](images/diagram_deployment.png)](images/diagram_deployment.svg)
+
+## 2020-05-12
+
+The diagram above is not ideal: there is too much information on one diagram and it's
+ hard to understand what is executed where. I will decompose it to 3 diagrams:
+
+1. A component diagram that shows the different entities
+2. An activity diagram (flow chart) that shows the different
+    possibilities for a deployment and the conditions
+3. A sequence diagram that shows how a "path" in diagram 2 (nominal case) is
+   going and what are the entities from diagram 1 involved in each step.
+
+I'll start with the first that is a modification of the previous diagram:
+
+[![](images/diagram_components.png)](images/diagram_components.svg)
+
+## 2020-05-13
+
+### Creation of activity diagram
+
+Now let's create the activity diagram. Abhilash has already created two diagrams
+that I will merge into one:
+
+
+![](images/abhilash_remote_os_deployment_flowchart.png)
+
+
+![](images/abhilash_imaging_flowchart.png)
+
+Here is the activity diagram that I have created:
+
+![[](images/diagram_activity_deployment.svg)](images/diagram_activity_deployment.png)
+
+
+### Meeting notes:
+ - add a step to recreate partition if we can't mount it.
+ - benchmark file transfer methods (ftp, sftp, stp, nfs, tftp, samba, http)
+ - benchmark compression protocols
+ - do it on real machines
+ - see what others do: partimage and clonezilla
+ - I can go to school tomorrow at 16h45 to get a computer to make some real test
+ - tool `dstat`: gives info on disk, io in real time
+ - study sparse files on android
+ - creation of images: maybe reuse clonezilla?
+ - windows: just create an image and show that it works but do not focus on how to create images
+ - pcs deployed at school: xubuntu 18.04
+
+### Creation of a windows image
+
diff --git a/doc/logbook.md b/doc/logbook.md
index 256446001beffc5ca2d62973086bf06d4c6e6ef3..355fa37e80b5c18a657372df82ae0926372dd28c 100644
--- a/doc/logbook.md
+++ b/doc/logbook.md
@@ -1,4 +1,3 @@
-# Log book
 
 ## 2020-04-22
 
@@ -1046,7 +1045,7 @@ to do it.
      the url of the backup repository
      ```bash
      git remote rename origin old-origin
-     git remote add origin ssh://git@ssh.hesge.ch:10572/dimitri.lizzi/bootiful-pre-lfs-backup.git
+     git remote add origin ssh://gitssh.hesge.ch:10572/dimitri.lizzi/bootiful-pre-lfs-backup.git
      ```
 
    - The history and tags have been pushed to the new repository
@@ -1072,7 +1071,7 @@ to do it.
 3. Clone the bare repository in folder `bootiful.git`
    ```bash
    cd ..
-   git clone --mirror ssh://git@ssh.hesge.ch:10572/dimitri.lizzi/bootiful.git
+   git clone --mirror ssh://gitssh.hesge.ch:10572/dimitri.lizzi/bootiful.git
    ```
 
 4. Convert the binary files in git history to lfs
@@ -1109,7 +1108,7 @@ to do it.
    ```bash
    cd ..
    mv bootiful bootiful.pre-lfs.backup
-   git clone ssh://git@ssh.hesge.ch:10572/dimitri.lizzi/bootiful.git
+   git clone ssh://gitssh.hesge.ch:10572/dimitri.lizzi/bootiful.git
    cd bootiful
    ```
 
@@ -1162,6 +1161,8 @@ I'll start with the first that is a modification of the previous diagram:
 
 ## 2020-05-13
 
+### Creation of activity diagram
+
 Now let's create the activity diagram. Abhilash has already created two diagrams
 that I will merge into one:
 
@@ -1176,17 +1177,18 @@ Here is the activity diagram that I have created:
 ![[](images/diagram_activity_deployment.svg)](images/diagram_activity_deployment.png)
 
 
-Meeting:
+### Meeting notes:
  - add a step to recreate partition if we can't mount it.
  - benchmark file transfer methods (ftp, sftp, stp, nfs, tftp, samba, http)
  - benchmark compression protocols
  - do it on real machines
  - see what others do: partimage and clonezilla
-
- I can go to school tomorrow at 16h45 to get a computer to make some real tests
-
+ - I can go to school tomorrow at 16h45 to get a computer to make some real test
  - tool `dstat`: gives info on disk, io in real time
  - study sparse files on android
  - creation of images: maybe reuse clonezilla?
  - windows: just create an image and show that it works but do not focus on how to create images
  - pcs deployed at school: xubuntu 18.04
+
+### Creation of a windows image
+
diff --git a/doc/rapport.gpp.md b/doc/rapport.gpp.md
new file mode 100644
index 0000000000000000000000000000000000000000..b4104730266e13cb41c185ec0dddbf2cd5092aa0
--- /dev/null
+++ b/doc/rapport.gpp.md
@@ -0,0 +1,75 @@
+!!include{includes/markdown.gpp}
+!!ifdef{PANDOC_PDF}
+---
+documentclass: memoir
+lang: fr-CH
+title: Travail de bachelor
+subtitle: |
+  Bootiful\
+  Déploiement d'OS à choix durant le processus de boot
+author: |
+  Haute école du paysage, d'ingénierie et d'architecture de Genève\
+  \
+  Étudiant: Dimitri Lizzi\
+  Professeur référent: Florent Gluck
+date: |
+  Mai 2020
+geometry: margin=2.7cm
+papersize: a4paper
+numbersections: true
+monofont: JetBrains Mono
+output: pdf_document
+header-includes: |
+    \usepackage{pdfpages}
+    \usepackage{fancyhdr}
+    \usepackage{graphicx}
+    \usepackage{float}
+    \usepackage{lastpage}
+
+    \pagestyle{fancy}
+    \setlength{\headheight}{14pt}
+
+    \renewcommand{\headrulewidth}{0.4pt}
+    \renewcommand{\footrulewidth}{0.4pt}
+
+    \fancyhead[LO,LE]{Bootiful}
+    \fancyhead[CO,CE]{Déploiement d'OS à choix durant le processus de boot}
+    \fancyhead[RO,RE]{Dimitri Lizzi}
+    \fancyfoot[LO,LE]{Mai 2020}
+
+    \fancyfoot[CO,CE]{}
+    \fancyfoot[RE,RO]{\thepage /\pageref{LastPage}}
+
+    \setcounter{tocdepth}{4}
+
+    \setlength{\parindent}{0pt}
+    \setlength{\parskip}{9pt}
+
+    \floatplacement{figure}{H}
+abstract: |
+    TODO: Abstract
+---
+
+
+\tableofcontents
+
+!!endif
+# Introduction
+
+# Etude des systèmes existants
+
+## Clonezilla
+
+## Fog
+
+## 
+
+# Processus de déploiement
+
+![Diagramme décrivant le processus de déploiement](images/diagram_deployment.svg)
+
+# Conclusion
+
+# Annex A: logbook
+
+!!includemd{logbook.md}
diff --git a/doc/rapport.md b/doc/rapport.md
index fb53f0cd70a7727e2066193a674108f5b774f985..a08aa2a4058c37d38f0689f8ec9c24c77a66eea0 100644
--- a/doc/rapport.md
+++ b/doc/rapport.md
@@ -1,3 +1,27 @@
+
+
+
+# Introduction
+
+# Etude des systèmes existants
+
+## Clonezilla
+
+## Fog
+
+## 
+
+# Processus de déploiement
+
+![Diagramme décrivant le processus de déploiement](images/diagram_deployment.svg)
+
+# Conclusion
+
+# Annex A: logbook
+
+
+    !!include{includes/markdown.gpp}
+!!ifdef{PANDOC_PDF}
 ---
 documentclass: memoir
 lang: fr-CH
@@ -48,14 +72,28 @@ abstract: |
     TODO: Abstract
 ---
 
+
 \tableofcontents
 
+!!endif
 # Introduction
 
 # Etude des systèmes existants
 
+## Clonezilla
+
+## Fog
+
+## 
+
 # Processus de déploiement
 
 ![Diagramme décrivant le processus de déploiement](images/diagram_deployment.svg)
 
-# Conclusion
\ No newline at end of file
+# Conclusion
+
+# Annex A: logbook
+
+!!includemd{logbook.md}
+
+
diff --git a/doc/rapport.pdf b/doc/rapport.pdf
deleted file mode 100644
index a19f56afde60ecfbc73085a3a08a63cbc772c8da..0000000000000000000000000000000000000000
Binary files a/doc/rapport.pdf and /dev/null differ
diff --git a/doc/trimstart.py b/doc/trimstart.py
new file mode 100755
index 0000000000000000000000000000000000000000..53dfc16521b35bbcfcd3e0294e4d65704f4fe9f5
--- /dev/null
+++ b/doc/trimstart.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+import sys
+
+nonempty_line_reached = False
+for line in sys.stdin:
+    if nonempty_line_reached:
+        print(line, end='')
+    else:
+        nonempty_line_reached = line != "\n"
\ No newline at end of file