Browse code

Adding kickstart unattended installation how-to md file.

Mahmoud Bassiouny authored on 2015/07/10 05:04:31
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,71 @@
0
+#Kickstart Support
1
+
2
+Photon supports kickstart for unattended installations, the kickstart config file can reside in either the CD attached to the host or served through an http server.
3
+
4
+##Kickstart capabilities
5
+
6
+Photon supports the following configurations:
7
+* Setting hostname
8
+* Setting password
9
+* Setting disk to install
10
+* Choose Photon flavor to install (minimal or full)
11
+* Apply post installation script
12
+* Add public keys, this will allow root ssh login.
13
+
14
+Here is a sample configuration file:
15
+
16
+```
17
+{
18
+    "hostname": "<hostname>",
19
+    "password": 
20
+        {
21
+            "crypted": <true|false>,
22
+            "text": "<password whether it's plain text or encrypted>"
23
+        },
24
+    "disk": "/dev/sda",
25
+    "type": "minimal",
26
+    "postinstall": [
27
+                    "#!/bin/sh",
28
+                    "echo \"Hello World\" > /etc/postinstall"
29
+                   ],
30
+    "public_key": "<public_key>"
31
+}
32
+```
33
+
34
+##Unattended installation though kickstart
35
+To have unattended installation, you have to pass `ks=<config_file>` parameter to the kernel command. The config file should be either:
36
+* on the iso `ks=cdrom:\<config_file_path>`,
37
+* or served over http server `ks=http://<server>/<config_file_path>`
38
+
39
+##Building an iso with your kickstart config file
40
+Given a recent build photon.iso
41
+```
42
+# mount the photon.iso
43
+mkdir /tmp/photon-iso
44
+sudo mount photon.iso /tmp/photon-iso
45
+
46
+#copy the content of the iso to a writable folder
47
+mkdir /tmp/photon-ks-iso
48
+cp -r /tmp/photon-iso/* /tmp/photon-ks-iso/
49
+
50
+pushd /tmp/photon-ks-iso/
51
+
52
+# write your ks config file
53
+cp isolinux/sample_ks.cfg isolinux/my_ks.cfg
54
+vim isolinux/my_ks.cfg
55
+
56
+# add new item in the installation menu by modyfing isolinux/menu.cfg
57
+cat >> isolinux/menu.cfg << EOF
58
+label my_unattended
59
+	menu label ^My Unattended Install
60
+	kernel vmlinuz
61
+	append initrd=initrd.img root=/dev/ram0 ks=cdrom:/isolinux/my_ks.cfg loglevel=3
62
+EOF
63
+
64
+# rebuild the iso
65
+mkisofs -R -l -L -D -b isolinux/isolinux.bin -c isolinux/boot.cat \
66
+		-no-emul-boot -boot-load-size 4 -boot-info-table -V "PHOTON_$(date +%Y%m%d)" \
67
+		. > <new_iso_path>.iso
68
+
69
+popd
70
+```