~burhanilinux/+junk/plymouth

« back to all changes in this revision

Viewing changes to debian/patches/misc-changes.patch

  • Committer: Juzer Dana
  • Date: 2024-01-14 13:03:08 UTC
  • Revision ID: juzerdana@gmail.com-20240114130308-urizjbjhjqmenga6
New Commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Undocumented changes
 
2
 This patch contains undocumented changes accumulated during previous
 
3
 versions of the Ubuntu plymouth package, that have not yet been split up
 
4
 into individually-documented patches.  Please try not to add further things
 
5
 to this patch.  Using quilt for new changes is recommended, but if you
 
6
 don't, they'll end up in a separate debian-changes patch at the end of the
 
7
 patch series.
 
8
Last-Update: 2011-01-21
 
9
 
 
10
Index: plymouth/src/main.c
 
11
===================================================================
 
12
--- plymouth.orig/src/main.c
 
13
+++ plymouth/src/main.c
 
14
@@ -116,6 +116,7 @@ typedef struct
 
15
         const char             *default_tty;
 
16
 
 
17
         int                     number_of_errors;
 
18
+        ply_list_t             *pending_messages;
 
19
 } state_t;
 
20
 
 
21
 static void show_splash (state_t *state);
 
22
@@ -182,8 +183,9 @@ on_update (state_t    *state,
 
23
            const char *status)
 
24
 {
 
25
         ply_trace ("updating status to '%s'", status);
 
26
-        ply_progress_status_update (state->progress,
 
27
-                                    status);
 
28
+        if (strncmp (status, "fsck:", 5))
 
29
+                ply_progress_status_update (state->progress,
 
30
+                                            status);
 
31
         if (state->boot_splash != NULL)
 
32
                 ply_boot_splash_update_status (state->boot_splash,
 
33
                                                status);
 
34
@@ -241,6 +243,25 @@ on_system_update (state_t *state,
 
35
 }
 
36
 
 
37
 static void
 
38
+flush_pending_messages (state_t *state)
 
39
+{
 
40
+  ply_list_node_t *node = ply_list_get_first_node (state->pending_messages);
 
41
+  while (node != NULL)
 
42
+    {
 
43
+      ply_list_node_t *next_node;
 
44
+      char *message = ply_list_node_get_data (node);
 
45
+
 
46
+      ply_trace ("displaying queued message");
 
47
+
 
48
+      ply_boot_splash_display_message (state->boot_splash, message);
 
49
+      next_node = ply_list_get_next_node (state->pending_messages, node);
 
50
+      ply_list_remove_node (state->pending_messages, node);
 
51
+      free(message);
 
52
+      node = next_node;
 
53
+    }
 
54
+}
 
55
+
 
56
+static void
 
57
 show_messages (state_t *state)
 
58
 {
 
59
         if (state->boot_splash == NULL) {
 
60
@@ -469,7 +490,7 @@ show_default_splash (state_t *state)
 
61
         if (state->boot_splash == NULL) {
 
62
                 ply_trace ("Could not start default splash screen,"
 
63
                            "showing text splash screen");
 
64
-                state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "text/text.plymouth");
 
65
+                state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "text.plymouth");
 
66
         }
 
67
 
 
68
         if (state->boot_splash == NULL) {
 
69
@@ -479,7 +500,8 @@ show_default_splash (state_t *state)
 
70
         }
 
71
 
 
72
         if (state->boot_splash == NULL) {
 
73
-                ply_error ("plymouthd: could not start boot splash: %m");
 
74
+                if (errno != ENOENT)
 
75
+                        ply_error ("plymouthd: could not start boot splash: %m");
 
76
                 return;
 
77
         }
 
78
 
 
79
@@ -566,8 +588,8 @@ on_display_message (state_t    *state,
 
80
                 ply_boot_splash_display_message (state->boot_splash, message);
 
81
         } else {
 
82
                 ply_trace ("not displaying message %s as no splash", message);
 
83
+                ply_list_append_data (state->messages, strdup (message));
 
84
         }
 
85
-        ply_list_append_data (state->messages, strdup (message));
 
86
 }
 
87
 
 
88
 static void
 
89
@@ -806,6 +828,7 @@ prepare_logging (state_t *state)
 
90
                 if (state->number_of_errors > 0)
 
91
                         spool_error (state);
 
92
         }
 
93
+        flush_pending_messages (state);
 
94
 }
 
95
 
 
96
 static void
 
97
@@ -1988,6 +2011,7 @@ initialize_environment (state_t *state)
 
98
         state->keystroke_triggers = ply_list_new ();
 
99
         state->entry_triggers = ply_list_new ();
 
100
         state->entry_buffer = ply_buffer_new ();
 
101
+        state->pending_messages = ply_list_new ();
 
102
         state->messages = ply_list_new ();
 
103
 
 
104
         if (!ply_is_tracing_to_terminal ())
 
105
Index: plymouth/src/plugins/splash/script/script-lib-image.c
 
106
===================================================================
 
107
--- plymouth.orig/src/plugins/splash/script/script-lib-image.c
 
108
+++ plymouth/src/plugins/splash/script/script-lib-image.c
 
109
@@ -200,7 +200,7 @@ static script_return_t image_text (scrip
 
110
 
 
111
         alpha_obj = script_obj_hash_peek_element (state->local, "alpha");
 
112
 
 
113
-        if (script_obj_is_number (alpha_obj))
 
114
+        if (alpha_obj && script_obj_is_number (alpha_obj))
 
115
                 alpha = CLAMP (script_obj_as_number (alpha_obj), 0, 1);
 
116
         else
 
117
                 alpha = 1;
 
118
Index: plymouth/src/plugins/splash/script/script-lib-sprite.c
 
119
===================================================================
 
120
--- plymouth.orig/src/plugins/splash/script/script-lib-sprite.c
 
121
+++ plymouth/src/plugins/splash/script/script-lib-sprite.c
 
122
@@ -387,6 +387,45 @@ static script_return_t sprite_window_set
 
123
         return script_return_obj_null ();
 
124
 }
 
125
 
 
126
+static script_return_t sprite_window_get_bits_per_pixel (script_state_t *state,
 
127
+                                                         void           *user_data)
 
128
+{
 
129
+  script_lib_sprite_data_t *data = user_data;
 
130
+  ply_list_node_t *node;
 
131
+  int index;
 
132
+  script_obj_t *index_obj;
 
133
+  script_lib_display_t *display;
 
134
+  unsigned int bits_per_pixel;
 
135
+
 
136
+  index_obj = script_obj_hash_peek_element (state->local, "window");
 
137
+
 
138
+  if (index_obj)
 
139
+    {
 
140
+      index = script_obj_as_number (index_obj);
 
141
+      script_obj_unref(index_obj);
 
142
+      if (index < 0)
 
143
+        return script_return_obj_null ();
 
144
+      node = ply_list_get_nth_node (data->displays, index);
 
145
+      if (node == NULL)
 
146
+        return script_return_obj_null ();
 
147
+      display = ply_list_node_get_data (node);
 
148
+      bits_per_pixel = ply_pixel_display_get_bits_per_pixel (display->pixel_display);
 
149
+      return script_return_obj (script_obj_new_number (bits_per_pixel));
 
150
+    }
 
151
+
 
152
+  bits_per_pixel = 0;
 
153
+  for (node = ply_list_get_first_node (data->displays);
 
154
+       node;
 
155
+       node = ply_list_get_next_node (data->displays, node))
 
156
+    {
 
157
+      display = ply_list_node_get_data (node);
 
158
+      bits_per_pixel = ply_pixel_display_get_bits_per_pixel (display->pixel_display);
 
159
+      if (bits_per_pixel)
 
160
+        break;
 
161
+    }
 
162
+  return script_return_obj (script_obj_new_number (bits_per_pixel));
 
163
+}
 
164
+
 
165
 static uint32_t extract_rgb_color (script_state_t *state)
 
166
 {
 
167
         uint8_t red = CLAMP (255 * script_obj_hash_get_number (state->local, "red"), 0, 255);
 
168
@@ -663,6 +702,12 @@ script_lib_sprite_data_t *script_lib_spr
 
169
                                     "value",
 
170
                                     NULL);
 
171
         script_add_native_function (window_hash,
 
172
+                                    "GetBitsPerPixel",
 
173
+                                    sprite_window_get_bits_per_pixel,
 
174
+                                    data,
 
175
+                                    "window",
 
176
+                                    NULL);
 
177
+        script_add_native_function (window_hash,
 
178
                                     "SetBackgroundTopColor",
 
179
                                     sprite_window_set_background_top_color,
 
180
                                     data,
 
181
Index: plymouth/src/plugins/splash/text/plugin.c
 
182
===================================================================
 
183
--- plymouth.orig/src/plugins/splash/text/plugin.c
 
184
+++ plymouth/src/plugins/splash/text/plugin.c
 
185
@@ -464,8 +464,10 @@ add_text_display (ply_boot_splash_plugin
 
186
         view = view_new (plugin, display);
 
187
 
 
188
         terminal = ply_text_display_get_terminal (view->display);
 
189
-        if (ply_terminal_open (terminal))
 
190
+        if (ply_terminal_open (terminal)) {
 
191
+                ply_terminal_set_mode (terminal, PLY_TERMINAL_MODE_TEXT);
 
192
                 ply_terminal_activate_vt (terminal);
 
193
+        }
 
194
 
 
195
         ply_text_display_set_draw_handler (view->display,
 
196
                                            (ply_text_display_draw_handler_t)
 
197
Index: plymouth/src/libply-splash-core/ply-renderer.c
 
198
===================================================================
 
199
--- plymouth.orig/src/libply-splash-core/ply-renderer.c
 
200
+++ plymouth/src/libply-splash-core/ply-renderer.c
 
201
@@ -353,6 +353,21 @@ ply_renderer_get_buffer_for_head (ply_re
 
202
                                                                 head);
 
203
 }
 
204
 
 
205
+unsigned int
 
206
+ply_renderer_get_bits_per_pixel_for_head (ply_renderer_t      *renderer,
 
207
+                                          ply_renderer_head_t *head)
 
208
+{
 
209
+  assert (renderer != NULL);
 
210
+  assert (renderer->plugin_interface != NULL);
 
211
+  assert (head != NULL);
 
212
+
 
213
+  if (!renderer->plugin_interface->get_bits_per_pixel_for_head)
 
214
+    return 0;
 
215
+
 
216
+  return renderer->plugin_interface->get_bits_per_pixel_for_head (renderer->backend,
 
217
+                                                                  head);
 
218
+}
 
219
+
 
220
 void
 
221
 ply_renderer_flush_head (ply_renderer_t      *renderer,
 
222
                          ply_renderer_head_t *head)
 
223
Index: plymouth/src/libply-splash-core/ply-renderer.h
 
224
===================================================================
 
225
--- plymouth.orig/src/libply-splash-core/ply-renderer.h
 
226
+++ plymouth/src/libply-splash-core/ply-renderer.h
 
227
@@ -64,6 +64,8 @@ const char *ply_renderer_get_device_name
 
228
 ply_list_t *ply_renderer_get_heads (ply_renderer_t *renderer);
 
229
 ply_pixel_buffer_t *ply_renderer_get_buffer_for_head (ply_renderer_t      *renderer,
 
230
                                                       ply_renderer_head_t *head);
 
231
+unsigned int ply_renderer_get_bits_per_pixel_for_head (ply_renderer_t      *renderer,
 
232
+                                                       ply_renderer_head_t *head);
 
233
 
 
234
 void ply_renderer_flush_head (ply_renderer_t      *renderer,
 
235
                               ply_renderer_head_t *head);
 
236
Index: plymouth/src/libply-splash-core/ply-pixel-display.c
 
237
===================================================================
 
238
--- plymouth.orig/src/libply-splash-core/ply-pixel-display.c
 
239
+++ plymouth/src/libply-splash-core/ply-pixel-display.c
 
240
@@ -52,6 +52,7 @@ struct _ply_pixel_display
 
241
         unsigned long                    width;
 
242
         unsigned long                    height;
 
243
         int                              device_scale;
 
244
+        unsigned int                     bits_per_pixel;
 
245
 
 
246
         ply_pixel_display_draw_handler_t draw_handler;
 
247
         void                            *draw_handler_user_data;
 
248
@@ -80,6 +81,9 @@ ply_pixel_display_new (ply_renderer_t
 
249
         display->height = size.height;
 
250
         display->device_scale = ply_pixel_buffer_get_device_scale (pixel_buffer);
 
251
 
 
252
+        display->bits_per_pixel = ply_renderer_get_bits_per_pixel_for_head (renderer,
 
253
+                                                                            head);
 
254
+
 
255
         return display;
 
256
 }
 
257
 
 
258
@@ -113,6 +117,12 @@ ply_pixel_display_get_device_scale (ply_
 
259
         return display->device_scale;
 
260
 }
 
261
 
 
262
+unsigned int
 
263
+ply_pixel_display_get_bits_per_pixel (ply_pixel_display_t *display)
 
264
+{
 
265
+  return display->bits_per_pixel;
 
266
+}
 
267
+
 
268
 static void
 
269
 ply_pixel_display_flush (ply_pixel_display_t *display)
 
270
 {
 
271
Index: plymouth/src/libply-splash-core/ply-renderer-plugin.h
 
272
===================================================================
 
273
--- plymouth.orig/src/libply-splash-core/ply-renderer-plugin.h
 
274
+++ plymouth/src/libply-splash-core/ply-renderer-plugin.h
 
275
@@ -55,6 +55,8 @@ typedef struct
 
276
 
 
277
         ply_pixel_buffer_t * (*get_buffer_for_head)(ply_renderer_backend_t * backend,
 
278
                                                     ply_renderer_head_t * head);
 
279
+        unsigned int (*get_bits_per_pixel_for_head)(ply_renderer_backend_t * backend,
 
280
+                                                    ply_renderer_head_t * head);
 
281
 
 
282
         ply_renderer_input_source_t * (*get_input_source)(ply_renderer_backend_t * backend);
 
283
         bool (*open_input_source)(ply_renderer_backend_t      *backend,
 
284
Index: plymouth/src/client/ply-boot-client.c
 
285
===================================================================
 
286
--- plymouth.orig/src/client/ply-boot-client.c
 
287
+++ plymouth/src/client/ply-boot-client.c
 
288
@@ -262,14 +262,30 @@ ply_boot_client_process_incoming_replies
 
289
                 return;
 
290
         }
 
291
 
 
292
-        request_node = ply_list_get_first_node (client->requests_waiting_for_replies);
 
293
-        assert (request_node != NULL);
 
294
+        if (!ply_read (client->socket_fd, byte, sizeof(uint8_t))) {
 
295
+                ply_error ("could not read response from boot status daemon");
 
296
+                return;
 
297
+        }
 
298
 
 
299
-        request = (ply_boot_client_request_t *) ply_list_node_get_data (request_node);
 
300
-        assert (request != NULL);
 
301
+        for (request_node = ply_list_get_first_node (client->requests_waiting_for_replies);
 
302
+             ; request_node = ply_list_get_next_node (client->requests_waiting_for_replies, request_node)) {
 
303
+                assert (request_node != NULL);
 
304
+                request = (ply_boot_client_request_t *) ply_list_node_get_data (request_node);
 
305
+                assert (request != NULL);
 
306
 
 
307
-        if (!ply_read (client->socket_fd, byte, sizeof(uint8_t)))
 
308
-                goto out;
 
309
+                if (! strcmp (request->command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PASSWORD)
 
310
+                    || ! strcmp (request->command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_CACHED_PASSWORD)
 
311
+                    || ! strcmp (request->command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUESTION)
 
312
+                    || ! strcmp (request->command, PLY_BOOT_PROTOCOL_REQUEST_TYPE_KEYSTROKE)) {
 
313
+                        if (! memcmp (byte, PLY_BOOT_PROTOCOL_RESPONSE_TYPE_ANSWER, sizeof (uint8_t))
 
314
+                            || ! memcmp (byte, PLY_BOOT_PROTOCOL_RESPONSE_TYPE_NO_ANSWER, sizeof (uint8_t)))
 
315
+                                break;
 
316
+                } else {
 
317
+                        if (memcmp (byte, PLY_BOOT_PROTOCOL_RESPONSE_TYPE_ANSWER, sizeof (uint8_t))
 
318
+                            && memcmp (byte, PLY_BOOT_PROTOCOL_RESPONSE_TYPE_NO_ANSWER, sizeof (uint8_t)))
 
319
+                                break;
 
320
+                }
 
321
+        }
 
322
 
 
323
         if (memcmp (byte, PLY_BOOT_PROTOCOL_RESPONSE_TYPE_ACK, sizeof(uint8_t)) == 0) {
 
324
                 if (request->handler != NULL)
 
325
Index: plymouth/src/plugins/renderers/frame-buffer/plugin.c
 
326
===================================================================
 
327
--- plymouth.orig/src/plugins/renderers/frame-buffer/plugin.c
 
328
+++ plymouth/src/plugins/renderers/frame-buffer/plugin.c
 
329
@@ -637,6 +637,16 @@ get_buffer_for_head (ply_renderer_backen
 
330
         return backend->head.pixel_buffer;
 
331
 }
 
332
 
 
333
+static unsigned int
 
334
+get_bits_per_pixel_for_head (ply_renderer_backend_t *backend,
 
335
+                             ply_renderer_head_t    *head)
 
336
+{
 
337
+  if (head != &backend->head)
 
338
+    return 0;
 
339
+
 
340
+  return backend->bytes_per_pixel * 8;
 
341
+}
 
342
+
 
343
 static bool
 
344
 has_input_source (ply_renderer_backend_t      *backend,
 
345
                   ply_renderer_input_source_t *input_source)
 
346
@@ -753,6 +763,7 @@ ply_renderer_backend_get_interface (void
 
347
                 .flush_head                   = flush_head,
 
348
                 .get_heads                    = get_heads,
 
349
                 .get_buffer_for_head          = get_buffer_for_head,
 
350
+                .get_bits_per_pixel_for_head  = get_bits_per_pixel_for_head,
 
351
                 .get_input_source             = get_input_source,
 
352
                 .open_input_source            = open_input_source,
 
353
                 .set_handler_for_input_source = set_handler_for_input_source,
 
354
Index: plymouth/src/libply-splash-core/ply-pixel-display.h
 
355
===================================================================
 
356
--- plymouth.orig/src/libply-splash-core/ply-pixel-display.h
 
357
+++ plymouth/src/libply-splash-core/ply-pixel-display.h
 
358
@@ -49,6 +49,8 @@ void ply_pixel_display_free (ply_pixel_d
 
359
 ply_renderer_t      *ply_pixel_display_get_renderer (ply_pixel_display_t *display);
 
360
 ply_renderer_head_t *ply_pixel_display_get_renderer_head (ply_pixel_display_t *display);
 
361
 
 
362
+unsigned int ply_pixel_display_get_bits_per_pixel (ply_pixel_display_t *display);
 
363
+
 
364
 unsigned long ply_pixel_display_get_width (ply_pixel_display_t *display);
 
365
 unsigned long ply_pixel_display_get_height (ply_pixel_display_t *display);
 
366
 int ply_pixel_display_get_device_scale (ply_pixel_display_t *display);