Accepting request 238080 from home:fcrozat:branches:Base:System

- Add
  0001-splash-remove-pixel_pixel-in-sprite-lib-when-notifie.patch:
  fix crash when pixel_display is removed.
- Add 0001-device-manager-only-call-ply_terminal_free.patch: fix
  crash.
- Add use-mkinitrd.patch: call mkinitrd -B, not dracut for now,
  otherwise initramfs is being created by plymouth-update-initrd,
  not initrd file.
- Ensure we don't rebuild initrd twice when updating plymouth.
- Ensure default theme is SLE/openSUSE (based on %suse_version)

OBS-URL: https://build.opensuse.org/request/show/238080
OBS-URL: https://build.opensuse.org/package/show/Base:System/plymouth?expand=0&rev=146
This commit is contained in:
Marcus Meissner 2014-06-20 12:36:53 +00:00 committed by Git OBS Bridge
parent bd71342444
commit d25a97433e
6 changed files with 261 additions and 2 deletions

View File

@ -0,0 +1,26 @@
From 54951cef0e5ea3caeae1eb0ec33db7ed37d0d4b3 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Thu, 12 Jun 2014 13:50:51 +0200
Subject: [PATCH] device-manager: only call ply_terminal_free
ply_terminal_free will call ply_terminal_close anyway and is guarded
against NULL terminal (ply_terminal_close is not).
---
src/libply-splash-core/ply-device-manager.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
index dbc203d..aa4d15c 100644
--- a/src/libply-splash-core/ply-device-manager.c
+++ b/src/libply-splash-core/ply-device-manager.c
@@ -442,7 +442,6 @@ free_terminal (char *device,
{
ply_hashtable_remove (manager->terminals, device);
- ply_terminal_close (terminal);
ply_terminal_free (terminal);
}
--
1.8.4.5

View File

@ -0,0 +1,94 @@
From a6eff09852c2eb4d684526b814d2b2df578938d0 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Thu, 12 Jun 2014 18:51:24 +0200
Subject: [PATCH] seats: guard against NULL terminal
---
src/libply-splash-core/ply-keyboard.c | 7 +++++--
src/libply-splash-core/ply-seat.c | 6 +++---
src/libply-splash-core/ply-terminal.c | 11 +++++++----
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/libply-splash-core/ply-keyboard.c b/src/libply-splash-core/ply-keyboard.c
index 624f906..1bed19f 100644
--- a/src/libply-splash-core/ply-keyboard.c
+++ b/src/libply-splash-core/ply-keyboard.c
@@ -423,8 +423,11 @@ ply_keyboard_free (ply_keyboard_t *keyboard)
}
else
{
- ply_buffer_free (keyboard->provider.if_terminal->key_buffer);
- free (keyboard->provider.if_terminal);
+ if (keyboard->provider.if_terminal)
+ {
+ ply_buffer_free (keyboard->provider.if_terminal->key_buffer);
+ free (keyboard->provider.if_terminal);
+ }
}
free (keyboard);
diff --git a/src/libply-splash-core/ply-seat.c b/src/libply-splash-core/ply-seat.c
index 2ac8bf7..29e2dfa 100644
--- a/src/libply-splash-core/ply-seat.c
+++ b/src/libply-splash-core/ply-seat.c
@@ -102,12 +102,12 @@ add_text_displays (ply_seat_t *seat)
{
ply_text_display_t *display;
- if (!ply_terminal_is_open (seat->terminal))
+ if (!seat->terminal || !ply_terminal_is_open (seat->terminal))
{
- if (!ply_terminal_open (seat->terminal))
+ if (!seat->terminal || !ply_terminal_open (seat->terminal))
{
ply_trace ("could not add terminal %s: %m",
- ply_terminal_get_name (seat->terminal));
+ seat->terminal ? ply_terminal_get_name (seat->terminal) : "none" );
return;
}
}
diff --git a/src/libply-splash-core/ply-terminal.c b/src/libply-splash-core/ply-terminal.c
index 992dd3f..b52b108 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -654,30 +654,33 @@ ply_terminal_open (ply_terminal_t *terminal)
int
ply_terminal_get_fd (ply_terminal_t *terminal)
{
- return terminal->fd;
+ return terminal ? terminal->fd : -1;
}
bool
ply_terminal_is_vt (ply_terminal_t *terminal)
{
- return terminal->vt_number > 0;
+ return terminal ? terminal->vt_number > 0 : false;
}
bool
ply_terminal_is_open (ply_terminal_t *terminal)
{
- return terminal->is_open;
+ return terminal ? terminal->is_open : false;
}
bool
ply_terminal_is_active (ply_terminal_t *terminal)
{
- return terminal->is_active;
+ return terminal ? terminal->is_active : false;
}
void
ply_terminal_close (ply_terminal_t *terminal)
{
+ if (!terminal)
+ return;
+
if (!terminal->is_open)
{
ply_trace ("terminal %s is already closed", terminal->name);
--
1.8.4.5

View File

@ -0,0 +1,101 @@
From 61525fba34c724b6e319f6b3b8198c0c0f8aa677 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Thu, 19 Jun 2014 16:18:12 +0200
Subject: [PATCH] splash: remove pixel_pixel in sprite-lib when notified they
are gone
---
src/plugins/splash/script/plugin.c | 1 +
src/plugins/splash/script/script-lib-sprite.c | 28 +++++++++++++++++++++++----
src/plugins/splash/script/script-lib-sprite.h | 1 +
3 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/plugins/splash/script/plugin.c b/src/plugins/splash/script/plugin.c
index c5c1e16..8e37b37 100644
--- a/src/plugins/splash/script/plugin.c
+++ b/src/plugins/splash/script/plugin.c
@@ -401,6 +401,7 @@ static void
remove_pixel_display (ply_boot_splash_plugin_t *plugin,
ply_pixel_display_t *display)
{
+ script_lib_sprite_pixel_display_removed (plugin->script_sprite_lib, display);
ply_list_remove_data(plugin->displays, display);
}
diff --git a/src/plugins/splash/script/script-lib-sprite.c b/src/plugins/splash/script/script-lib-sprite.c
index e0ced7e..166c7e7 100644
--- a/src/plugins/splash/script/script-lib-sprite.c
+++ b/src/plugins/splash/script/script-lib-sprite.c
@@ -77,7 +77,7 @@ static script_return_t sprite_get_image (script_state_t *state,
{
script_lib_sprite_data_t *data = user_data;
sprite_t *sprite = script_obj_as_native_of_class (state->this, data->class);
-
+
if (sprite && sprite->image_obj)
{
script_obj_ref (sprite->image_obj);
@@ -481,7 +481,7 @@ static void script_lib_sprite_draw_area (script_lib_display_t *display,
}
}
-static void
+static void
draw_area (script_lib_sprite_data_t *data,
int x,
int y,
@@ -533,10 +533,10 @@ script_lib_sprite_data_t *script_lib_sprite_setup (script_state_t *state,
ply_pixel_display_t *pixel_display = ply_list_node_get_data (node);
script_lib_display_t *script_display = malloc (sizeof(script_lib_display_t));
script_display->pixel_display = pixel_display;
-
+
script_display->x = (max_width - ply_pixel_display_get_width (pixel_display)) / 2;
script_display->y = (max_height - ply_pixel_display_get_height (pixel_display)) / 2;
-
+
script_display->data = data;
ply_pixel_display_set_draw_handler (pixel_display,
(ply_pixel_display_draw_handler_t)
@@ -698,6 +698,26 @@ region_add_area (ply_region_t *region,
ply_region_add_rectangle (region, &rectangle);
}
+void script_lib_sprite_pixel_display_removed (script_lib_sprite_data_t *data, ply_pixel_display_t *pixel_display)
+{
+ ply_list_node_t *node;
+ ply_list_node_t *next_node;
+ script_lib_display_t* display;
+
+ node = ply_list_get_first_node (data->displays);
+ while (node)
+ {
+ next_node = ply_list_get_next_node (data->displays, node);
+ display = ply_list_node_get_data (node);
+
+ if (display->pixel_display == pixel_display)
+ {
+ ply_list_remove_node (data->displays, node);
+ }
+ node = next_node;
+ }
+}
+
void
script_lib_sprite_refresh (script_lib_sprite_data_t *data)
{
diff --git a/src/plugins/splash/script/script-lib-sprite.h b/src/plugins/splash/script/script-lib-sprite.h
index 0cb0681..2404b85 100644
--- a/src/plugins/splash/script/script-lib-sprite.h
+++ b/src/plugins/splash/script/script-lib-sprite.h
@@ -65,6 +65,7 @@ typedef struct
script_lib_sprite_data_t *script_lib_sprite_setup (script_state_t *state,
ply_list_t *displays);
+void script_lib_sprite_pixel_display_removed (script_lib_sprite_data_t *data, ply_pixel_display_t *pixel_display);
void script_lib_sprite_refresh (script_lib_sprite_data_t *data);
void script_lib_sprite_destroy (script_lib_sprite_data_t *data);
--
1.8.4.5

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Thu Jun 19 14:22:44 UTC 2014 - fcrozat@suse.com
- Add
0001-splash-remove-pixel_pixel-in-sprite-lib-when-notifie.patch:
fix crash when pixel_display is removed.
- Add 0001-device-manager-only-call-ply_terminal_free.patch: fix
crash.
- Add use-mkinitrd.patch: call mkinitrd -B, not dracut for now,
otherwise initramfs is being created by plymouth-update-initrd,
not initrd file.
- Ensure we don't rebuild initrd twice when updating plymouth.
- Ensure default theme is SLE/openSUSE (based on %suse_version)
-------------------------------------------------------------------
Fri Jun 6 16:16:38 UTC 2014 - fcrozat@suse.com

View File

@ -42,6 +42,14 @@ Patch16: plymouth-correct-runtime-dir.patch
# PATCH-FIX-UPSTREAM plymouth-manpages.patch idoenmez@suse.de -- Fix man page installation
Patch17: plymouth-manpages.patch
Patch18: fix-serial-consoles.patch
# PATCH-FIX-UPSTREAM 0001-device-manager-only-call-ply_terminal_free.patch fcrozat@suse.com -- Fix crash
Patch19: 0001-device-manager-only-call-ply_terminal_free.patch
# PATCH-FIX-OPENSUSE use-mkinitrd.patch fcrozat@suse.com -- call mkinitrd -B for now
Patch20: use-mkinitrd.patch
# PATCH-FIX-UPSTREAM 0001-seats-guard-against-NULL-terminal.patch fcrozat@suse.com -- guard against null terminal
Patch21: 0001-seats-guard-against-NULL-terminal.patch
# PATCH-FIX-UPSTREAM 0001-splash-remove-pixel_pixel-in-sprite-lib-when-notifie.patch fcrozat@suse.com -- prevent crash if pixel display is removed
Patch22: 0001-splash-remove-pixel_pixel-in-sprite-lib-when-notifie.patch
BuildRequires: automake
BuildRequires: docbook-xsl-stylesheets
BuildRequires: kernel-headers
@ -328,12 +336,21 @@ plugin.
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
# replace builddate with patch0date
sed -i "s/__DATE__/\"$(stat -c %y %{_sourcedir}/%{name}.changes)\"/" src/main.c
# Change the default theme
sed -i -e 's/fade-in/openSUSE/g' src/plymouthd.defaults
%if %{suse_version} == 1315
sed -i -e 's/spinner/SLE/g' src/plymouthd.defaults
%else
sed -i -e 's/spinner/openSUSE/g' src/plymouthd.defaults
%endif
%build
autoreconf -fiv
@ -384,7 +401,6 @@ cp %{buildroot}/%{_datadir}/plymouth/plymouthd.defaults %{buildroot}/%{_sysconfd
%{?regenerate_initrd_post}
if [ ! -e /.buildenv ]; then
[ -f %{_localstatedir}/lib/plymouth/boot-duration ] || cp -f %{_datadir}/plymouth/default-boot-duration %{_localstatedir}/lib/plymouth/boot-duration
%{_libexecdir}/plymouth/plymouth-update-initrd
fi
[ -x /bin/systemctl ] && /bin/systemctl daemon-reload >/dev/null 2>&1 || :

8
use-mkinitrd.patch Normal file
View File

@ -0,0 +1,8 @@
Index: plymouth-0.9.0/scripts/plymouth-update-initrd
===================================================================
--- plymouth-0.9.0.orig/scripts/plymouth-update-initrd
+++ plymouth-0.9.0/scripts/plymouth-update-initrd
@@ -1,2 +1,2 @@
#!/bin/bash
-dracut -f
+mkinitrd -B