Merge lp:~tyler-baker/lava-project/bootloader into lp:lava-project

Proposed by Tyler Baker
Status: Merged
Approved by: Senthil Kumaran S
Approved revision: 63
Merged at revision: 63
Proposed branch: lp:~tyler-baker/lava-project/bootloader
Merge into: lp:lava-project
Diff against target: 170 lines (+166/-0)
1 file modified
doc/tftp-deploy.rst (+166/-0)
To merge this branch: bzr merge lp:~tyler-baker/lava-project/bootloader
Reviewer Review Type Date Requested Status
Senthil Kumaran S Approve
Review via email: mp+179796@code.launchpad.net

Description of the change

Documentation updates for the bootloader class.

To post a comment you must log in.
Revision history for this message
Senthil Kumaran S (stylesen) wrote :

Looks good +1 to merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'doc/tftp-deploy.rst'
--- doc/tftp-deploy.rst 1970-01-01 00:00:00 +0000
+++ doc/tftp-deploy.rst 2013-08-12 20:38:43 +0000
@@ -0,0 +1,166 @@
1Deploying a Bootloader Device
2===============================
3
4Adding a Bootloader device allows the LAVA user to directly control the
5bootloader on the target, and provide the desired boot sequence. This page
6outlines the steps required to add a new Bootloader device to your LAVA
7deployment and make it able to accept job requests.
8
9Overview
10------------------------
11
12The Bootloader device extends master image type devices to allow backwards
13compatiblity. In the example below, an Arndale target will be used as an
14example to show how you can tftp boot a target.
15
16Installing a tftp server on each dispatcher
17--------------------------
18
19Any tftp server will work, if configured correctly. Use this as a guideline.
20
21Install tftpd-hpa package on the dispatcher(s)::
22
23 # apt-get install tftpd-hpa
24
25Install openbsd-inetd package on the dispatcher(s)::
26
27 # apt-get install openbsd-inetd
28
29Configuring the tftp server on each dispatcher
30--------------------------
31
32Configure each TFTP server to serve from the dispatcher's download directory::
33
34 # /etc/default/tftpd-hpa
35
36 TFTP_USERNAME="tftp"
37 TFTP_DIRECTORY="/srv/lava/instances/<LAVA_INSTANCE>/var/www/lava-server/"
38 TFTP_ADDRESS="0.0.0.0:69"
39 TFTP_OPTIONS="--secure"
40
41Reload the TFTP server::
42
43 # stop tftpd-hpa
44 # start tftpd-hpa
45
46Configure the dispatcher for tftp booting
47------------------------
48
49Deployment schema::
50
51This schema describes the options for deploy_linaro_kernel. It is important
52to notice that only manditory property is "kernel."
53
54 parameters_schema = {
55 'type': 'object',
56 'properties': {
57 'kernel': {'type': 'string', 'optional': False},
58 'ramdisk': {'type': 'string', 'optional': True},
59 'dtb': {'type': 'string', 'optional': True},
60 'rootfs': {'type': 'string', 'optional': True},
61 'rootfstype': {'type': 'string', 'optional': True},
62 'bootloader': {'type': 'string', 'optional': True, 'default': 'u_boot'},
63 },
64 'additionalProperties': False,
65 }
66
67Device configuration example::
68
69 # /srv/lava/instances/<LAVA_INSTANCE>/etc/lava-dispatcher/devices/arndale01.conf
70
71 device_type = arndale
72 hostname = arndale01
73 hard_reset_command = /usr/local/lab-scripts/pdu1.sh 192.168.1.11 3
74 power_off_cmd = /usr/local/lab-scripts/pdu1.sh 192.168.1.11 3 0
75 power_on_cmd = /usr/local/lab-scripts/pdu1.sh 192.168.1.11 3 1
76 soft_boot_cmd = reboot
77 bootloader_prompt = ARNDALE5250
78 interrupt_boot_command = autoboot
79 interrupt_boot_prompt = autoboot
80 connection_command = telnet localhost 2000
81
82 boot_cmds_tftp =
83 setenv autoload no,
84 setenv usbethaddr 00:40:5c:26:0a:5b,
85 setenv pxefile_addr_r "'0x50000000'",
86 setenv kernel_addr_r "'0x40007000'",
87 setenv initrd_addr_r "'0x42000000'",
88 setenv fdt_addr_r "'0x41f00000'",
89 setenv loadkernel "'tftp ${kernel_addr_r} ${lava_kernel}'",
90 setenv loadinitrd "'tftp ${initrd_addr_r} ${lava_ramdisk}; setenv initrd_size ${filesize}'",
91 setenv loadfdt "'tftp ${fdt_addr_r} ${lava_dtb}'",
92 setenv bootargs "'root=/dev/ram0 console=ttySAC2,115200n8 init --no-log ip=:::::eth0:dhcp'",
93 setenv bootcmd "'usb start; dhcp; setenv serverip ${lava_server_ip}; run loadkernel; run loadinitrd; run loadfdt; bootm ${kernel_addr_r} ${initrd_addr_r} ${fdt_addr_r}'",
94 boot
95
96 boot_cmds = mmc rescan,
97 mmc part 0,
98 setenv bootcmd "'fatload mmc 0:5 0x40007000 uImage; fatload mmc 0:5 0x42000000 uInitrd; fatload mmc 0:5 0x41f00000 board.dtb; bootm 0x40007000 0x42000000 0x41f00000'",
99 setenv bootargs "'console=ttySAC2,115200n8 root=LABEL=testrootfs rootwait ro'",
100 boot
101
102 boot_options =
103 boot_cmds
104
105 [boot_cmds]
106 default = boot_cmds
107
108Required configuration parameters::
109
110 # boot_cmds_tftp - These are the boot commands to TFTP boot the device.
111 # connection_command - This is the serial connection command.
112 # bootloader_prompt - This is the bootloader prompt string.
113 # hard_reset_command - This command will power cycle the device.
114 # power_off_cmd - This command will turn off power to the device.
115
116Job example::
117
118Below shows how to netboot an Arndale device, by supplying a kernel, ramdisk,
119and dtb to the LAVA server.
120
121 # /tmp/boot-cmds-tftp-kernel.json
122
123 {
124 "device_type": "arndale",
125 "actions": [
126 {
127 "command": "deploy_linaro_kernel",
128 "parameters": {
129 "kernel": "file:///path/to/my/zImage",
130 "ramdisk": "file:///path/to/my/uInitrd",
131 "dtb": "file:///path/to/my/exynos5250-arndale.dtb"
132 }
133 },
134 {
135 "command": "boot_linaro_image"
136 }
137 ],
138 "timeout": 18000,
139 "job_name": "boot-cmds-tftp-kernel"
140 }
141
142When this job runs, the LAVA dispatcher will download the kernel, ramdisk, dtb
143to it's download directory. It will then set the bootloader enviroment
144variables on the user's behalf so that they can be referenced in
145boot_cmds_tftp and served to the target over TFTP.
146
147 ARNDALE5250 # lava_server_ip=192.168.1.7
148 ARNDALE5250 # lava_kernel=images/tmpZXJ0J1/.uImage
149 ARNDALE5250 # lava_ramdisk=images/tmpZXJ0J1/.uInitrd
150 ARNDALE5250 # lava_dtb=images/tmpZXJ0J1/exynos5250-arndale.dtb
151
152To test, you can execute the dispatcher directly with the following
153commands as ``root``:
154
155::
156
157 . /srv/lava/instances/<INST>/bin/activate
158 lava-dispatch /tmp/boot-cmds-tftp-kernel.json.json
159
160Submitting a Bootloader Job
161--------------------
162
163The scheduler documentation includes instructions for `submitting a job`_ to
164LAVA. You can use the job file shown above as the basis for your new job.
165
166.. _submitting a job: http://lava-scheduler.readthedocs.org/en/latest/usage.html#submitting-jobs

Subscribers

People subscribed via source and target branches