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

Subscribers

People subscribed via source and target branches