Merge lp:~achiang/savilerow/tutorial into lp:~savilerow-team/savilerow/trunk-1.0

Proposed by Alex Chiang
Status: Merged
Merged at revision: 70
Proposed branch: lp:~achiang/savilerow/tutorial
Merge into: lp:~savilerow-team/savilerow/trunk-1.0
Diff against target: 235 lines (+161/-32)
2 files modified
doc/architecture.rst (+3/-3)
doc/usage.rst (+158/-29)
To merge this branch: bzr merge lp:~achiang/savilerow/tutorial
Reviewer Review Type Date Requested Status
Chris Wayne (community) Approve
Review via email: mp+205460@code.launchpad.net

Description of the change

Write a tutorial for someone just getting started with savvy.

I tested this by following my own instructions:

- clean install of latest image, with -wipe=true
- clean bzr branch of lp:savilerow
- then followed the tutorial steps exactly

Ended up with a successfully customized wallpaper.

Rendered html is on chinstrap, as always.

To post a comment you must log in.
Revision history for this message
Chris Wayne (cwayne) wrote :

I think the building and installing should be scripted, but I think this a fine start (we can always change it later once it's scripted). +1

review: Approve
Revision history for this message
Alex Chiang (achiang) wrote :

Agreed. We can create something like phablet-test-savvy or something.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/architecture.rst'
2--- doc/architecture.rst 2014-01-24 12:39:15 +0000
3+++ doc/architecture.rst 2014-02-07 23:37:04 +0000
4@@ -1,6 +1,6 @@
5-==================
6-Image Architecture
7-==================
8+=========================
9+Ubuntu Image Architecture
10+=========================
11
12 An overview of the Ubuntu Touch disk image design is presented here.
13 An understanding of the image components, how they are organized,
14
15=== modified file 'doc/usage.rst'
16--- doc/usage.rst 2014-01-25 05:40:25 +0000
17+++ doc/usage.rst 2014-02-07 23:37:04 +0000
18@@ -1,29 +1,49 @@
19-===========
20+======================
21+Quick Start + Tutorial
22+======================
23+
24+To get started with the Savvy architecture, follow the quick start
25+instructions. This procedure will install the example customized image
26+on your device and allow you to get a sense for the types of
27+customizations permitted by the Savvy API.
28+
29+After experimenting with the sample customizations, you will probably
30+want to experiment with your own customizations. The tutorial section
31+explains how to do so.
32+
33 Quick Start
34 ===========
35
36-To quickly get started with the Savvy architecture, follow the
37-automated installation instructions. This procedure will install the
38-example customized image on your device and allow you to get a sense
39-for the types of customizations permitted by Savvy.
40-
41-After experimenting with the sample customizations, you will
42-probably want to experiment with your own customizations. The second
43-section explains how to do so.
44-
45-Automated Installation
46-======================
47-
48-This procedure requires the use of ``phablet-flash`` tool and a
49-supported device. Once both prerequisites are met, simply issue::
50+This procedure will install Canonical's example customization package
51+onto a device. After installing the example customizations, you will be
52+able to explore how the Savvy API can be used to change the look, feel,
53+and behavior of Ubuntu Touch to suit your requirements.
54+
55+It requires:
56+
57+ * `device supported by Ubuntu Touch`_, such as the Nexus 4
58+ * `phablet-flash`_ - tool to install Ubuntu Touch on your device
59+
60+Once both prerequisites are met, simply issue::
61
62 phablet-flash ubuntu-system --channel devel-customized
63
64 The command will install the sample customizations on the latest
65 version of Ubuntu Touch, on a supported device.
66
67-Making modifications
68-====================
69+**Note:** the quick start assumes you have already been able to
70+successfully install your device with the default Ubuntu image. If you
71+encounter difficulty, please refer to the `installation instructions`_.
72+
73+.. _`device supported by Ubuntu Touch`: https://wiki.ubuntu.com/Touch/Install/#Supported_devices_and_codenames
74+
75+.. _`phablet-flash`: https://wiki.ubuntu.com/Touch/Install#Step_1_-_Desktop_Setup
76+
77+.. _`installation instructions`: https://wiki.ubuntu.com/Touch/Install
78+
79+
80+Tutorial
81+========
82
83 Obtaining the code
84 ------------------
85@@ -36,29 +56,138 @@
86
87 The project layout is very straightforward::
88
89- doc/ system/ tests/ ubuntu_command
90+ doc/ src/ tests/
91
92 As you can see:
93
94 * ``doc/`` contains this documentation
95- * ``system/`` contains the example customization code
96+ * ``src/`` contains the example customization code
97 * ``tests/`` contains the test suite
98- * ``ubuntu_command`` is used by the build system and should not be modified
99
100-The ``system/`` directory will be of greatest interest, as it
101+The ``src/`` directory will be of greatest interest, as it
102 demonstrates all the possible customizations permitted by the Savvy
103 API.
104
105+
106+Making a modification
107+---------------------
108+
109+In this example, we will set a different default wallpaper. Looking in
110+the directory ``src/system/custom`` we will modify the following files::
111+
112+ .
113+ ├── etc
114+ │   ├── dconf
115+ │   ├── dconf_profile
116+ │   └── dconf_source
117+ │   └── db
118+ │   └── custom.d
119+ │   ├── custom.key
120+ │   └── locks
121+ │   └── custom.lock
122+ └── usr
123+ └── share
124+ └── backgrounds
125+ └── ringtel_wallpaper_plain.png
126+
127+You may remove all other files and directories in ``src/system/custom``.
128+
129+The first step is to add a new wallpaper. In this example, we will
130+assume the filename is ``wallpaper.jpg``. Copy the file to
131+``usr/share/backgrounds``::
132+
133+ └── usr
134+ └── share
135+ └── backgrounds
136+ ├── ringtel_wallpaper_plain.png
137+ └── wallpaper.jpg
138+
139+Next, you will need to edit ``custom.key`` and ``custom.lock``::
140+
141+ $ cat etc/dconf_source/db/custom.d/custom.key
142+ # if the keys have uppercase letters, make them lowercase here, for
143+ # example com.canonical.Unity.Lenses -> com/canonical/unity/lenses
144+
145+ [org/gnome/desktop/background]
146+ picture-uri='file:///custom/usr/share/backgrounds/wallpaper.jpg'
147+
148+The contents of ``custom.lock`` should be::
149+
150+ $ cat etc/dconf_source/db/custom.d/locks/custom.lock
151+ /org/gnome/desktop/background/picture-uri
152+
153+That's it! Now we are ready to test the results.
154+
155+**Note:** the provided sample wallpaper is ``png`` format, but in this
156+example, we are using an image in ``jpg`` format. Both file formats are
157+supported.
158+
159+
160 Building the tarball
161 --------------------
162
163-Modifying Savvy code is as simple as editing files in the
164-``system/`` directory. After making changes there, you must rebuild
165-the tarball::
166-
167- tar -Jcvf ../custom.tar.xz system/
168+After making changes above, we will rebuild the tarball from the
169+top-level directory::
170+
171+ $ pwd
172+ /home/ubuntu/Projects/savvy/tutorial
173+
174+ $ ls
175+ doc/ src/ tests/
176+
177+ $ tar -Jcvf custom.tar.xz -C src/ system/
178+
179+ $ ls
180+ custom.tar.xz doc/ src/ tests/
181
182 This command will produce a new, unsigned tarball in the parent
183-directory. To install it, please follow the following instructions_.
184-
185-.. _instructions: https://wiki.ubuntu.com/Touch/Customization/Installation#Installing_an_unsigned_image
186+directory.
187+
188+
189+Installing the tarball
190+----------------------
191+
192+The Ubuntu Image Architecture requires that all tarballs installed on
193+the system must be signed.
194+
195+In this tutorial, we have not signed the new custom tarball so we must
196+use a developer shortcut which does not check for GPG signatures.
197+
198+ **THIS SHOULD NOT BE USED FOR DAILY USERS.**
199+
200+ It is only to be used for testing an unreleased recovery image.
201+
202+Download the recovery images and ubuntu_command from here:
203+
204+ http://people.canonical.com/~cwayne/touch/custom-recovery/
205+
206+To install the recovery::
207+
208+ adb reboot bootloader
209+ fastboot flash recovery ~/Downloads/mako-recovery.img
210+ fastboot reboot
211+
212+Now to install the customization tarball.
213+
214+**Note:** ensure that you have the ``ubuntu_command`` from the above
215+link!::
216+
217+ adb push custom.tar.xz /cache/recovery
218+ adb push ~/Downloads/ubuntu_command /cache/recovery
219+ adb reboot recovery
220+
221+
222+Finishing up
223+------------
224+
225+After rebooting the device, you should have a new background.
226+
227+There are many more customizations possible with the Savvy API, and the
228+rest of this documentation explains them.
229+
230+If there are customizations that the Savvy API does not support, please
231+file a bug::
232+
233+ https://bugs.launchpad.net/savilerow/+bugs
234+
235+And the team will do its best to respond.

Subscribers

People subscribed via source and target branches