Merge lp:~pali/ubuntu/natty/plymouth/plymouth into lp:ubuntu/oneiric/plymouth

Proposed by Pali
Status: Rejected
Rejected by: Martin Pitt
Proposed branch: lp:~pali/ubuntu/natty/plymouth/plymouth
Merge into: lp:ubuntu/oneiric/plymouth
Diff against target: 565 lines (+274/-62)
6 files modified
debian/plymouth.plymouth-upstart-bridge.upstart (+0/-2)
src/plugins/splash/details/plugin.c (+38/-0)
src/plugins/splash/text/plugin.c (+87/-7)
src/plugins/splash/ubuntu-text/plugin.c (+84/-5)
src/upstart-bridge/plymouth-upstart-bridge.c (+15/-47)
themes/ubuntu-logo/ubuntu-logo.script (+50/-1)
To merge this branch: bzr merge lp:~pali/ubuntu/natty/plymouth/plymouth
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+61897@code.launchpad.net

Description of the change

Added support for scrolling boot log messages in theme ubuntu-logo and in plugins: text and ubuntu-text.
Log message must start with prefix 'log:', status reason message must be 'log:ok' or 'log:failed'
Scrolling boot log messages looks like in old usplash

Examples:
 $ plymouth message --text='log:Starting daemon xyz' # Show message 'Starting daemon xyz...'
 $ plymouth message --text='log:ok' # Append status reason message 'ok'
 $ plymouth message --text='log:Starting daemon abc' # Show next message 'Starting daemon abc...'
 $ plymouth message --text='log:failed' # Append status reason message 'failed'

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Pali,

thanks for your work on this!

I think the chance of getting this accepted would be higher if you would send this as a patch to upstream instead:

  https://bugs.freedesktop.org/enter_bug.cgi?product=plymouth

That way, the experts of that software can review your patch and integrate it upstream, instead of distros carrying big patches for new features.

Thanks!

Revision history for this message
Pali (pali) wrote :

Ok,

I try to add support for 'log:' to all plymouth themes/splashes and correct handling in plymouth-upstart bridge.
Then I send all patches to upstream.

I'd like to have full functional verbose boot log in plymouth with upstart (not in ubuntu and text theme).

Can you tell me if which of these plugins is ubuntu specified and which is in upstream?
* text
* ubuntu-text
* ubuntu-logo
* details

Revision history for this message
Colin Watson (cjwatson) wrote :

Well, that's true for the text splash; and I agree that it would be good to have that interface be standard. However, once the patch to the text splash has been reviewed, we'll still need Ubuntu-specific changes to the ubuntu-text and ubuntu-logo splash.

Revision history for this message
Colin Watson (cjwatson) wrote :

It'll be clear when you look at upstream's git repository; but text and
details are upstream, while ubuntu-text and ubuntu-logo are
Ubuntu-specific.

Revision history for this message
Pali (pali) wrote :

Thanks for info!

Revision history for this message
Pali (pali) wrote :

Now I finished my patches. Boot log messages working fine with details, text, ubuntu-text and ubuntu-logo theme.
Writing log messages from upstart-bridge is done by plymouth 'log:' prefix too (removed old code with write messages directly to console).

So is patches ready for merge.

What missing is kubuntu-logo theme which is in different package (kubuntu-default-settings). But this theme is same as ubuntu-logo (diff say me differences only in background image).

Problem is with pushing patches to upstream. Ubuntu plymouth in bzr and upstream plymouth in git are very divergented. It is not simple to apply my patches on top of git plymouth repostory.

Revision history for this message
Pali (pali) wrote :
Revision history for this message
Pali (pali) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

Pali,
  I believe that Martin (comment 2011-05-30) was suggesting that you try to get your changes into upstream plymouth (probably by mailing to the mailing list http://lists.freedesktop.org/mailman/listinfo/plymouth ).
  It looks like you've done a fair amount of valuable work, but Ubuntu would rather not carry that delta without an idea as to whether or not upstream is accepting of it.

Revision history for this message
Pali (pali) wrote :

Relevant patch for upstream (text, details and upstart plugins) was sent to mailingslist. Other changes are ubuntu specified (ubuntu-text, ubuntu-logo).

Revision history for this message
Sebastien Bacher (seb128) wrote :

could you give a pointer to the list discussion? http://lists.freedesktop.org/archives/plymouth/2011-June has no mention of it

Revision history for this message
Sebastien Bacher (seb128) wrote :

setting the merge request to "work in progress", you should set it back to "needs review" once you sent the patches that need to go upstream to fdo

Revision history for this message
Pali (pali) wrote :

I sent mail, but I'm not member of mailinglist, so I got:

Your mail to 'plymouth' with the subject

    [PATCH] Add support for scrolling boot log messages

Is being held until the list moderator can review it for approval.

The reason it is being held:

    Post by non-member to a members-only list

Revision history for this message
Pali (pali) wrote :
Revision history for this message
Pali (pali) wrote :
Revision history for this message
Pali (pali) wrote :

Patch which redirect System V init script boot log messages to plymouth is here:
https://code.launchpad.net/~pali/ubuntu/oneiric/lsb/lsb/+merge/68212

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Pali, thanks so much for pushing this upstream. It looks like there are a lot of patches from that list without a response. Maybe send Ray a private request for a review? I think this is pretty cool and would be a useful feature, but agree that we probably would prefer that it be accepted upstream.

Revision history for this message
Chris Halse Rogers (raof) wrote :

I note that Ray has (finally :)) commented on your patches and raised some design questions. Have you seen his reply, and are you planning to modify your patch in response? It'd be great to get all these boot-splash improvements in!

Revision history for this message
Martin Pitt (pitti) wrote :

This is (and should be) handled upstream now, thus I close this merge proposal. Thanks!

Revision history for this message
Pali (pali) wrote :

This merge request also change file themes/ubuntu-logo/ubuntu-logo.script which is not in upstream and ubuntu specific.

Revision history for this message
Pali (pali) wrote :

This cannot be upstreamed, because ubuntu using ubuntu specified settings like theme, logo...

Revision history for this message
Evan Broder (broder) wrote :

Pali, I'm a little confused why you've reopened this merge proposal. It seems to be the same patchset that you originally proposed, and that Ray reviewed on the plymouth mailing list. We do not generally accept invasive patches like this when they haven't been accepted by upstream.

Please work on modifying the patches so that upstream will accept the non-Ubuntu-specific portions, and then we can consider the Ubuntu-specific stuff.

Unmerged revisions

1406. By Pali

ubuntu-logo: fix position and count of boot log messages

1405. By Pali

Make sure that plymouth-upstart-bridge will be started after plymouth in runlevel 0 and 6

1404. By Pali

plymouth-upstart-bridge has now no console output

1403. By Pali

ubuntu-text plugin: Increase count of buffered message lines to 40

1402. By Pali

text plugin: Increase count of buffered message lines to 40, fixed centering log messages

1401. By Pali

Clean code plymouth-upstart-bridge

1400. By Pali

Removed duplicated code ( printing boot log messages ) in plymouth-upstart-bridge
Now it is in splash plugins

1399. By Pali

Added support for for scrolling boot log messages in plymouth-upstart-bridge

1398. By Pali

Added support for scrolling boot log messages in details plugin

1397. By Pali

Added support for scrolling boot log messages in text plugin

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/plymouth.plymouth-upstart-bridge.upstart'
--- debian/plymouth.plymouth-upstart-bridge.upstart 2011-01-21 18:09:36 +0000
+++ debian/plymouth.plymouth-upstart-bridge.upstart 2011-06-17 20:26:30 +0000
@@ -9,6 +9,4 @@
9 or runlevel [06])9 or runlevel [06])
10stop on stopping plymouth10stop on stopping plymouth
1111
12console output
13
14exec plymouth-upstart-bridge12exec plymouth-upstart-bridge
1513
=== modified file 'src/plugins/splash/details/plugin.c'
--- src/plugins/splash/details/plugin.c 2011-04-21 06:55:41 +0000
+++ src/plugins/splash/details/plugin.c 2011-06-17 20:26:30 +0000
@@ -18,6 +18,7 @@
18 * 02111-1307, USA.18 * 02111-1307, USA.
19 *19 *
20 * Written by: Ray Strode <rstrode@redhat.com>20 * Written by: Ray Strode <rstrode@redhat.com>
21 * Pali Rohár <pali.rohar@gmail.com>
21 */22 */
22#include "config.h"23#include "config.h"
2324
@@ -428,6 +429,43 @@
428429
429 if (!strncmp (message, "keys:", strlen ("keys:")))430 if (!strncmp (message, "keys:", strlen ("keys:")))
430 message_to_display = message + strlen ("keys:");431 message_to_display = message + strlen ("keys:");
432 else if (!strncmp (message, "log:", strlen ("log:")))
433 {
434 if (!strncmp (message, "log:ok", 6) || !strncmp(message, "log:failed", 10))
435 {
436 if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL)
437 {
438 ply_list_node_t *node = ply_list_get_first_node (plugin->views);
439
440 while (node != NULL)
441 {
442 view_t *view = ply_list_node_get_data (node);
443 node = ply_list_get_next_node (plugin->views, node);
444
445 int cols = ply_text_display_get_number_of_columns (view->display) - 7;
446 ply_text_display_write (view->display, "\033[1A\033[%dC", cols); // Move cursor to previous end of line
447
448 if (!strncmp (message, "log:ok", 6))
449 ply_text_display_write (view->display, "[ OK ]\r\n");
450 else
451 {
452 ply_text_display_write (view->display, "[");
453 ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_RED);
454 ply_text_display_write (view->display, "fail");
455 ply_text_display_set_foreground_color (view->display, PLY_TERMINAL_COLOR_DEFAULT);
456 ply_text_display_write (view->display, "]\r\n");
457 }
458 }
459 }
460
461 return;
462 }
463 else
464 {
465 message_to_display = calloc (strlen (message + 4) + strlen(" * ") + 3, sizeof (char));
466 sprintf (message_to_display, " * %s", message + 4);
467 }
468 }
431 else469 else
432 message_to_display = message;470 message_to_display = message;
433471
434472
=== modified file 'src/plugins/splash/text/plugin.c'
--- src/plugins/splash/text/plugin.c 2010-04-13 23:02:26 +0000
+++ src/plugins/splash/text/plugin.c 2011-06-17 20:26:30 +0000
@@ -19,6 +19,7 @@
19 *19 *
20 * Written by: Adam Jackson <ajax@redhat.com>20 * Written by: Adam Jackson <ajax@redhat.com>
21 * Ray Strode <rstrode@redhat.com>21 * Ray Strode <rstrode@redhat.com>
22 * Pali Rohár <pali.rohar@gmail.com>
22 */23 */
23#include "config.h"24#include "config.h"
2425
@@ -57,6 +58,8 @@
57#define CLEAR_LINE_SEQUENCE "\033[2K\r\n"58#define CLEAR_LINE_SEQUENCE "\033[2K\r\n"
58#define BACKSPACE "\b\033[0K"59#define BACKSPACE "\b\033[0K"
5960
61#define MAX_LOG_MESSAGES 40
62
60typedef enum {63typedef enum {
61 PLY_BOOT_SPLASH_DISPLAY_NORMAL,64 PLY_BOOT_SPLASH_DISPLAY_NORMAL,
62 PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY,65 PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY,
@@ -73,6 +76,7 @@
73 ply_boot_splash_display_type_t state;76 ply_boot_splash_display_type_t state;
7477
75 char *message;78 char *message;
79 char *log_messages[MAX_LOG_MESSAGES];
7680
77 uint32_t is_animating : 1;81 uint32_t is_animating : 1;
78};82};
@@ -112,6 +116,11 @@
112}116}
113117
114static void118static void
119view_text_display_message (view_t *view,
120 int x, int y,
121 const char *message);
122
123static void
115view_show_message (view_t *view)124view_show_message (view_t *view)
116{125{
117 ply_boot_splash_plugin_t *plugin;126 ply_boot_splash_plugin_t *plugin;
@@ -122,15 +131,77 @@
122 display_width = ply_text_display_get_number_of_columns (view->display);131 display_width = ply_text_display_get_number_of_columns (view->display);
123 display_height = ply_text_display_get_number_of_rows (view->display);132 display_height = ply_text_display_get_number_of_rows (view->display);
124133
125 ply_text_display_set_cursor_position (view->display, 0,134 if (!strncmp (plugin->message, "log:", 4))
126 display_height / 2);135 {
136 int max_width, begin, i, y;
137
138 if (!strncmp (plugin->message, "log:ok", 6) || !strncmp(plugin->message, "log:failed", 10))
139 {
140 if (plugin->log_messages[MAX_LOG_MESSAGES-1] != NULL)
141 {
142 int size = strlen (plugin->log_messages[MAX_LOG_MESSAGES-1]);
143 if (!(size > 2 && !strncmp (plugin->log_messages[MAX_LOG_MESSAGES-1] + size - 2, "ok", 2)) &&
144 !(size > 6 && !strncmp (plugin->log_messages[MAX_LOG_MESSAGES-1] + size - 6, "failed", 6)))
145 {
146 char *new_message = calloc (strlen (plugin->message + 4) + strlen (plugin->log_messages[MAX_LOG_MESSAGES-1]) + 4, sizeof (char));
147 sprintf (new_message, "%s %s", plugin->log_messages[MAX_LOG_MESSAGES-1], plugin->message + 4);
148 free (plugin->log_messages[MAX_LOG_MESSAGES-1]);
149 plugin->log_messages[MAX_LOG_MESSAGES-1] = new_message;
150 }
151 }
152 }
153 else
154 {
155 if (plugin->log_messages[0] != NULL)
156 free (plugin->log_messages[0]);
157
158 for (i = 0; i < MAX_LOG_MESSAGES-1; i++)
159 plugin->log_messages[i] = plugin->log_messages[i+1];
160
161 if (strlen (plugin->message + 4) > display_width - MAX_LOG_MESSAGES)
162 plugin->message[display_width - MAX_LOG_MESSAGES] = 0;
163
164 plugin->log_messages[MAX_LOG_MESSAGES-1] = calloc (strlen (plugin->message + 4) + 4, sizeof (char));
165 strcpy (plugin->log_messages[MAX_LOG_MESSAGES-1], plugin->message + 4);
166 strcpy (plugin->log_messages[MAX_LOG_MESSAGES-1] + strlen(plugin->log_messages[MAX_LOG_MESSAGES-1]), "...");
167 }
168
169 begin = MAX_LOG_MESSAGES - display_height + 5;
170 max_width = 0;
171 y = 3;
172
173 if (begin < 0)
174 begin = 0;
175
176 for (i = begin; i < MAX_LOG_MESSAGES; i++)
177 if (plugin->log_messages[i] != NULL)
178 if (max_width < strlen (plugin->log_messages[i]))
179 max_width = strlen (plugin->log_messages[i]);
180
181 if (max_width > display_width)
182 max_width = display_width;
183
184 if (max_width < display_width / 2)
185 max_width = display_width / 2;
186
187 for (i = begin; i < MAX_LOG_MESSAGES; i++)
188 if (plugin->log_messages[i] != NULL)
189 view_text_display_message (view, (display_width - max_width) / 2, y++, plugin->log_messages[i]);
190 }
191 else
192 view_text_display_message (view, (display_width - strlen (plugin->message)) / 2, display_height / 2, plugin->message);
193}
194
195static void
196view_text_display_message (view_t *view,
197 int x, int y,
198 const char *message)
199{
200 ply_text_display_set_cursor_position (view->display, 0, y);
127 ply_text_display_clear_line (view->display);201 ply_text_display_clear_line (view->display);
128 ply_text_display_set_cursor_position (view->display,202 ply_text_display_set_cursor_position (view->display, x, y);
129 (display_width -
130 strlen (plugin->message)) / 2,
131 display_height / 2);
132203
133 ply_text_display_write (view->display, "%s", plugin->message);204 ply_text_display_write (view->display, "%s", message);
134}205}
135206
136static void207static void
@@ -317,12 +388,16 @@
317create_plugin (ply_key_file_t *key_file)388create_plugin (ply_key_file_t *key_file)
318{389{
319 ply_boot_splash_plugin_t *plugin;390 ply_boot_splash_plugin_t *plugin;
391 int i;
320392
321 ply_trace ("creating plugin");393 ply_trace ("creating plugin");
322394
323 plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));395 plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
324 plugin->message = NULL;396 plugin->message = NULL;
325397
398 for (i = 0; i < MAX_LOG_MESSAGES; i++)
399 plugin->log_messages[i] = NULL;
400
326 plugin->views = ply_list_new ();401 plugin->views = ply_list_new ();
327402
328 return plugin;403 return plugin;
@@ -365,6 +440,7 @@
365destroy_plugin (ply_boot_splash_plugin_t *plugin)440destroy_plugin (ply_boot_splash_plugin_t *plugin)
366{441{
367 ply_trace ("destroying plugin");442 ply_trace ("destroying plugin");
443 int i;
368444
369 if (plugin == NULL)445 if (plugin == NULL)
370 return;446 return;
@@ -378,6 +454,10 @@
378 if (plugin->message != NULL)454 if (plugin->message != NULL)
379 free (plugin->message);455 free (plugin->message);
380456
457 for (i = 0; i < MAX_LOG_MESSAGES; i++)
458 if (plugin->log_messages[i] != NULL)
459 free (plugin->log_messages[i]);
460
381 free (plugin);461 free (plugin);
382}462}
383463
384464
=== modified file 'src/plugins/splash/ubuntu-text/plugin.c'
--- src/plugins/splash/ubuntu-text/plugin.c 2010-11-01 18:53:55 +0000
+++ src/plugins/splash/ubuntu-text/plugin.c 2011-06-17 20:26:30 +0000
@@ -21,6 +21,7 @@
21 * Written by: Scott James Remnant <scott@ubuntu.com>21 * Written by: Scott James Remnant <scott@ubuntu.com>
22 * Adam Jackson <ajax@redhat.com>22 * Adam Jackson <ajax@redhat.com>
23 * Ray Strode <rstrode@redhat.com>23 * Ray Strode <rstrode@redhat.com>
24 * Pali Rohár <pali.rohar@gmail.com>
24 */25 */
25#include "config.h"26#include "config.h"
2627
@@ -59,6 +60,8 @@
59#define CLEAR_LINE_SEQUENCE "\033[2K\r\n"60#define CLEAR_LINE_SEQUENCE "\033[2K\r\n"
60#define BACKSPACE "\b\033[0K"61#define BACKSPACE "\b\033[0K"
6162
63#define MAX_LOG_MESSAGES 40
64
62typedef enum {65typedef enum {
63 PLY_BOOT_SPLASH_DISPLAY_NORMAL,66 PLY_BOOT_SPLASH_DISPLAY_NORMAL,
64 PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY,67 PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY,
@@ -75,6 +78,7 @@
75 ply_boot_splash_display_type_t state;78 ply_boot_splash_display_type_t state;
7679
77 char *message;80 char *message;
81 char *log_messages[MAX_LOG_MESSAGES];
7882
79 uint32_t is_animating : 1;83 uint32_t is_animating : 1;
80 uint32_t black;84 uint32_t black;
@@ -114,6 +118,12 @@
114}118}
115119
116static void120static void
121view_text_display_message (view_t *view,
122 int x, int y,
123 ply_terminal_color_t color,
124 const char *message);
125
126static void
117view_show_message (view_t *view)127view_show_message (view_t *view)
118{128{
119 ply_boot_splash_plugin_t *plugin;129 ply_boot_splash_plugin_t *plugin;
@@ -126,6 +136,61 @@
126 display_width = ply_text_display_get_number_of_columns (view->display);136 display_width = ply_text_display_get_number_of_columns (view->display);
127 display_height = ply_text_display_get_number_of_rows (view->display);137 display_height = ply_text_display_get_number_of_rows (view->display);
128138
139 if (!strncmp (plugin->message, "log:", 4))
140 {
141 int max_width, begin, i;
142
143 if (!strncmp (plugin->message, "log:ok", 6) || !strncmp(plugin->message, "log:failed", 10))
144 {
145 if (plugin->log_messages[MAX_LOG_MESSAGES-1] != NULL)
146 {
147 int size = strlen (plugin->log_messages[MAX_LOG_MESSAGES-1]);
148 if (!(size > 2 && !strncmp (plugin->log_messages[MAX_LOG_MESSAGES-1] + size - 2, "ok", 2)) &&
149 !(size > 6 && !strncmp (plugin->log_messages[MAX_LOG_MESSAGES-1] + size - 6, "failed", 6)))
150 {
151 char *new_message = calloc (strlen (plugin->message + 4) + strlen (plugin->log_messages[MAX_LOG_MESSAGES-1]) + 4, sizeof (char));
152 sprintf (new_message, "%s %s", plugin->log_messages[MAX_LOG_MESSAGES-1], plugin->message + 4);
153 free (plugin->log_messages[MAX_LOG_MESSAGES-1]);
154 plugin->log_messages[MAX_LOG_MESSAGES-1] = new_message;
155 }
156 }
157 }
158 else
159 {
160 if (plugin->log_messages[0] != NULL)
161 free (plugin->log_messages[0]);
162
163 for (i = 0; i < MAX_LOG_MESSAGES-1; i++)
164 plugin->log_messages[i] = plugin->log_messages[i+1];
165
166 if (strlen (plugin->message + 4) > display_width - MAX_LOG_MESSAGES)
167 plugin->message[display_width - MAX_LOG_MESSAGES] = 0;
168
169 plugin->log_messages[MAX_LOG_MESSAGES-1] = calloc (strlen (plugin->message + 4) + 4, sizeof (char));
170 strcpy (plugin->log_messages[MAX_LOG_MESSAGES-1], plugin->message + 4);
171 strcpy (plugin->log_messages[MAX_LOG_MESSAGES-1] + strlen(plugin->log_messages[MAX_LOG_MESSAGES-1]), "...");
172 }
173
174 begin = MAX_LOG_MESSAGES - display_height / 2 + 4;
175 max_width = 0;
176 color = PLY_TERMINAL_COLOR_WHITE;
177 y = display_height / 2 + 4;
178
179 if (begin < 0)
180 begin = 0;
181
182 for (i = begin; i < MAX_LOG_MESSAGES; i++)
183 if (plugin->log_messages[i] != NULL)
184 if (max_width < strlen (plugin->log_messages[i]))
185 max_width = strlen (plugin->log_messages[i]);
186
187 for (i = begin; i < MAX_LOG_MESSAGES; i++)
188 if (plugin->log_messages[i] != NULL)
189 view_text_display_message (view, (display_width - max_width) / 2, y++, color, plugin->log_messages[i]);
190
191 return;
192 }
193
129 if (!strncmp (plugin->message, "keys:", 5))194 if (!strncmp (plugin->message, "keys:", 5))
130 {195 {
131 message = plugin->message + 5;196 message = plugin->message + 5;
@@ -139,12 +204,18 @@
139 y = display_height / 2 + 7;204 y = display_height / 2 + 7;
140 }205 }
141206
207 view_text_display_message (view, (display_width - strlen (message)) / 2, y, color, message);
208}
209
210static void
211view_text_display_message (view_t *view,
212 int x, int y,
213 ply_terminal_color_t color,
214 const char *message)
215{
142 ply_text_display_set_cursor_position (view->display, 0, y);216 ply_text_display_set_cursor_position (view->display, 0, y);
143 ply_text_display_clear_line (view->display);217 ply_text_display_clear_line (view->display);
144 ply_text_display_set_cursor_position (view->display,218 ply_text_display_set_cursor_position (view->display, x, y);
145 (display_width -
146 strlen (message)) / 2,
147 y);
148219
149 ply_text_display_set_foreground_color (view->display, color);220 ply_text_display_set_foreground_color (view->display, color);
150 ply_text_display_write (view->display, "%s", message);221 ply_text_display_write (view->display, "%s", message);
@@ -157,7 +228,6 @@
157{228{
158 ply_boot_splash_plugin_t *plugin;229 ply_boot_splash_plugin_t *plugin;
159 int display_width, display_height;230 int display_width, display_height;
160 int i;
161231
162 plugin = view->plugin;232 plugin = view->plugin;
163233
@@ -320,6 +390,7 @@
320create_plugin (ply_key_file_t *key_file)390create_plugin (ply_key_file_t *key_file)
321{391{
322 char *option;392 char *option;
393 int i;
323394
324 ply_boot_splash_plugin_t *plugin;395 ply_boot_splash_plugin_t *plugin;
325396
@@ -328,6 +399,9 @@
328 plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));399 plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
329 plugin->message = NULL;400 plugin->message = NULL;
330401
402 for (i = 0; i < MAX_LOG_MESSAGES; i++)
403 plugin->log_messages[i] = NULL;
404
331 plugin->views = ply_list_new ();405 plugin->views = ply_list_new ();
332406
333 /* Not a pretty API for setting defaults for your config file... */407 /* Not a pretty API for setting defaults for your config file... */
@@ -391,6 +465,7 @@
391destroy_plugin (ply_boot_splash_plugin_t *plugin)465destroy_plugin (ply_boot_splash_plugin_t *plugin)
392{466{
393 ply_trace ("destroying plugin");467 ply_trace ("destroying plugin");
468 int i;
394469
395 if (plugin == NULL)470 if (plugin == NULL)
396 return;471 return;
@@ -404,6 +479,10 @@
404 if (plugin->message != NULL)479 if (plugin->message != NULL)
405 free (plugin->message);480 free (plugin->message);
406481
482 for (i = 0; i < MAX_LOG_MESSAGES; i++)
483 if (plugin->log_messages[i] != NULL)
484 free (plugin->log_messages[i]);
485
407 free (plugin);486 free (plugin);
408}487}
409488
410489
=== modified file 'src/upstart-bridge/plymouth-upstart-bridge.c'
--- src/upstart-bridge/plymouth-upstart-bridge.c 2011-01-21 18:09:36 +0000
+++ src/upstart-bridge/plymouth-upstart-bridge.c 2011-06-17 20:26:30 +0000
@@ -18,6 +18,7 @@
18 * 02111-1307, USA.18 * 02111-1307, USA.
19 *19 *
20 * Written by: Colin Watson <cjwatson@ubuntu.com>20 * Written by: Colin Watson <cjwatson@ubuntu.com>
21 * Pali Rohár <pali.rohar@gmail.com>
21 */22 */
22#include "config.h"23#include "config.h"
2324
@@ -71,55 +72,22 @@
71 ply_upstart_monitor_instance_properties_t *instance,72 ply_upstart_monitor_instance_properties_t *instance,
72 const char *action, bool ok)73 const char *action, bool ok)
73{74{
74 int xenl;75 char *message;
75 const char *hpa;76 const char *description;
77
78 if (job->description == NULL || job->description[0] == '\0')
79 description = job->name;
80 else
81 description = job->description;
82
83 message = calloc (strlen (action) + strlen (description) + 10, sizeof (char));
84 sprintf (message, "log:%s%s%s", action ? action : "", action ? " " : "", description);
7685
77 ply_boot_client_update_daemon (state->client, job->name, NULL, NULL, state);86 ply_boot_client_update_daemon (state->client, job->name, NULL, NULL, state);
7887 ply_boot_client_tell_daemon_to_display_message (state->client, message, NULL, NULL, state);
79 if (job->description == NULL || job->description[0] == '\0')88 ply_boot_client_tell_daemon_to_display_message (state->client, ok ? "log:ok" : "log:failed", NULL, NULL, state);
80 return;89
8190 free(message);
82 printf (" * %s%s%s",
83 action ? action : "", action ? " " : "", job->description);
84
85 xenl = tigetflag ("xenl");
86 hpa = get_string_capability ("hpa");
87
88 if (xenl > 0 && hpa)
89 {
90 int cols, col;
91 char *hpa_out;
92
93 cols = tigetnum ("cols");
94 if (cols < 6)
95 cols = 80;
96 col = cols - 7;
97
98 hpa_out = tiparm (hpa, col);
99 fputs (hpa_out, stdout);
100
101 if (ok)
102 puts ("[ OK ]");
103 else
104 {
105 const char *setaf, *op;
106 char *setaf_out = NULL;
107
108 setaf = get_string_capability ("setaf");
109 if (setaf)
110 setaf_out = tiparm (setaf, 1); /* red */
111 op = get_string_capability ("op");
112
113 printf ("[%sfail%s]\n", setaf_out ? setaf_out : "", op ? op : "");
114 }
115 }
116 else
117 {
118 if (ok)
119 puts (" ...done.");
120 else
121 puts (" ...fail!");
122 }
123}91}
12492
125static void93static void
12694
=== modified file 'themes/ubuntu-logo/ubuntu-logo.script'
--- themes/ubuntu-logo/ubuntu-logo.script 2010-12-13 13:56:11 +0000
+++ themes/ubuntu-logo/ubuntu-logo.script 2011-06-17 20:26:30 +0000
@@ -18,6 +18,7 @@
18# 02111-1307, USA.18# 02111-1307, USA.
19# 19#
20# Written by: Alberto Milone <alberto.milone@canonical.com>20# Written by: Alberto Milone <alberto.milone@canonical.com>
21# Pali Rohár <pali.rohar@gmail.com>
21#22#
22# Based on the example provided with the "script plugin" written by:23# Based on the example provided with the "script plugin" written by:
23# Charlie Brej <cbrej@cs.man.ac.uk>24# Charlie Brej <cbrej@cs.man.ac.uk>
@@ -87,7 +88,7 @@
87 local.min_height;88 local.min_height;
8889
89 # Put the 1st line below the logo + some spacing 90 # Put the 1st line below the logo + some spacing
90 y = logo.y + logo.height + (progress_indicator.bullet_height * 7 ); # + logo_spacing;91 y = logo.y + logo.height + (progress_indicator.bullet_height * 2 ); # + logo_spacing;
9192
92 text_height = first_line_height * 7.5;93 text_height = first_line_height * 7.5;
9394
@@ -221,6 +222,14 @@
221# a bit if needed.222# a bit if needed.
222top_of_the_text = TextYOffset();223top_of_the_text = TextYOffset();
223224
225# Character 'M' is the biggest - calculate maximum characters for line
226log_line_width = Window.GetWidth () / ImageToTintedText ("M").GetWidth () - 5;
227# Calculate line count
228log_line_count = ( Window.GetHeight () - top_of_the_text ) / ( ImageToTintedText ("M").GetHeight () * 1.1 );
229
230for (i = 0; i < log_line_count; i++)
231 log_notification[i] = "";
232
224#-----------------------------------------Logo functions------------------------------233#-----------------------------------------Logo functions------------------------------
225234
226# Call this when updating the screen235# Call this when updating the screen
@@ -483,6 +492,46 @@
483 if (keys != NULL)492 if (keys != NULL)
484 message = StringCopy (message, keys + StringLength(local.substring), NULL);493 message = StringCopy (message, keys + StringLength(local.substring), NULL);
485494
495 local.substring = "log:";
496 local.log = StringString (message, local.substring);
497 if (log != NULL) {
498 message = StringCopy (message, log + StringLength (local.substring), NULL);
499
500 if (message == "ok" || message == "failed") {
501 local.last = 0;
502 for (last = 0; last < log_line_count-1; last++) {}
503
504 local.len = StringLength (log_notification[last]);
505 local.ok = "";
506 local.failed = "";
507
508 if (len > 2)
509 ok = StringCopy (log_notification[last], len - 2, NULL);
510
511 if (len > 6)
512 failed = StringCopy (log_notification[last], len - 6, NULL);
513
514 if (len > 0 && ok != "ok" && failed != "failed")
515 log_notification[last] += " " + message;
516 } else {
517 if (StringLength (message) > log_line_width-6)
518 message = message.SubString (0, log_line_width-9);
519 message += "...";
520
521 for (i = 0; i < log_line_count-1; i++)
522 log_notification[i] = log_notification[i+1];
523 log_notification[i] = message;
524 }
525
526 message = "";
527 for (i = 0; i < log_line_count; i++)
528 if (log_notification[i] != "")
529 message += log_notification[i] + "\n";
530
531 label = get_message_label ("", 1, 1);
532 setup_message ("", label.x, label.y, 10000, 1);
533 }
534
486 local.label.is_fake = is_fake;535 local.label.is_fake = is_fake;
487 label = get_message_label(message, is_fake, is_action_line);536 label = get_message_label(message, is_fake, is_action_line);
488 label.z = 10000;537 label.z = 10000;

Subscribers

People subscribed via source and target branches

to all changes: