Additional patches that applies on top of the previous series.

-- 
Andreas Henriksson
From a676f401ee17ae277fa1c1d6c6f20c981f2cc4cb Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <[email protected]>
Date: Thu, 14 Jun 2012 08:41:38 +0200
Subject: [PATCH 1/4] Add patch to fix when os-release is missing

This patch is from upstream and should be dropped in future updates.

See:
http://cgit.freedesktop.org/plymouth/commit/?id=57fab85b2642f6171dcdef5e7066c2c29b0a39bd
---
 .../08-backport-missing-osrelease-fix.patch        |   49 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 2 files changed, 50 insertions(+)
 create mode 100644 debian/patches/08-backport-missing-osrelease-fix.patch

diff --git a/debian/patches/08-backport-missing-osrelease-fix.patch b/debian/patches/08-backport-missing-osrelease-fix.patch
new file mode 100644
index 0000000..321f453
--- /dev/null
+++ b/debian/patches/08-backport-missing-osrelease-fix.patch
@@ -0,0 +1,49 @@
+From 57fab85b2642f6171dcdef5e7066c2c29b0a39bd Mon Sep 17 00:00:00 2001
+From: Ray Strode <[email protected]>
+Date: Wed, 13 Jun 2012 10:56:56 +0000
+Subject: text-progress-bar: Initial os-string to "" when can't be read
+
+get_os_string either returns a string describing the distribution,
+or NULL on error.
+
+This NULL later causes problems since we run strlen on it.
+
+This commit makes get_os_string return "" instead of NULL for error
+cases.
+
+Spotted by Andreas Henriksson.
+---
+diff --git a/src/libply-splash-core/ply-text-progress-bar.c b/src/libply-splash-core/ply-text-progress-bar.c
+index faf84a4..7c9d688 100644
+--- a/src/libply-splash-core/ply-text-progress-bar.c
++++ b/src/libply-splash-core/ply-text-progress-bar.c
+@@ -102,13 +102,15 @@ get_os_string (void)
+   char *buf, *pos, *pos2;
+   struct stat sbuf;
+ 
++  buf = NULL;
++
+   fd = open (RELEASE_FILE, O_RDONLY);
+   if (fd == -1)
+-    return;
++    goto out;
+ 
+   if (fstat (fd, &sbuf) == -1) {
+     close (fd);
+-    return;
++    goto out;
+   }
+ 
+   buf = calloc (sbuf.st_size + 1, sizeof(char));
+@@ -158,6 +160,9 @@ get_os_string (void)
+ 
+ out:
+   free (buf);
++
++  if (os_string == NULL)
++    os_string = strdup ("");
+ }
+ 
+ void
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/debian/patches/series b/debian/patches/series
index d391167..5dda944 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 04-stderr.patch
 05-default-theme.patch
 07-return-code.patch
+08-backport-missing-osrelease-fix.patch
-- 
1.7.10

From 4b5062f816c525ea07c909737af48ba7b2b73f16 Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <[email protected]>
Date: Thu, 14 Jun 2012 08:43:46 +0200
Subject: [PATCH 2/4] Gracefully handle case of missing /etc/os-release

Can't really expect it to always exist, since it's a conffile.
If the user wants it gone (which would make no sense, but still),
then it should be respected.

This also avoids having to add a versioned dependency on an essential
package (base-files (>= 6.8)) to be able to gracefully handle upgrades
from squeeze -> wheezy.

Thanks: Julien Cristau
---
 debian/local/plymouth.hook |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/local/plymouth.hook b/debian/local/plymouth.hook
index ffe858a..6752536 100644
--- a/debian/local/plymouth.hook
+++ b/debian/local/plymouth.hook
@@ -64,7 +64,10 @@ done
 # copy base themes and logo
 cp -a "${THEMES}/details" "${DESTDIR}/${THEMES}"
 cp -a "${THEMES}/text" "${DESTDIR}/${THEMES}"
-cp /etc/os-release "${DESTDIR}/etc"
+
+if [ -f /etc/os-release ]; then
+	cp /etc/os-release "${DESTDIR}/etc"
+fi
 
 case "$(basename ${THEME} .plymouth)" in
 	text)
-- 
1.7.10

From 250ff1fa64a36ae1e7823e0c38952a6970ff6b44 Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <[email protected]>
Date: Thu, 14 Jun 2012 16:06:08 +0200
Subject: [PATCH 3/4] Bail out of initramfs generation if missing plymouth
 module

From a user perspective, this change does not really solve
bug #629416. It mainly tries to make the hook more robust
and prevent the catastrophic failure of not being able to
generate the initramfs and breaking it, making the system
unbootable.

Better not have plymouth in the initramfs then breaking it.
---
 debian/local/plymouth.hook |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/debian/local/plymouth.hook b/debian/local/plymouth.hook
index 6752536..b7546f5 100644
--- a/debian/local/plymouth.hook
+++ b/debian/local/plymouth.hook
@@ -42,6 +42,11 @@ esac
 
 MODULE="${PLUGIN_PATH}/$(sed -n 's/^ModuleName=\(.*\)/\1/p' ${THEME}).so"
 
+if [ ! -e "$MODULE" ]; then
+	echo "Warning: plymouth module ($MODULE) missing, skipping plymouth."
+	exit 0
+fi
+
 # copy plugin and images for current theme
 copy_exec "${MODULE}"
 mkdir -p "${DESTDIR}/${THEMES}"
-- 
1.7.10

From c00dcc28dbb33fb84b760352da77aff6ff1199a6 Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <[email protected]>
Date: Thu, 14 Jun 2012 17:02:00 +0200
Subject: [PATCH 4/4] Update debian/changelog

---
 debian/changelog |   22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 26e316c..18d47d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-plymouth (0.8.5.1-0.1) UNRELEASED; urgency=low
+plymouth (0.8.5.1-0.1) unstable; urgency=low
 
   [ Andreas Henriksson ]
   * New upstream release(s) (Closes: #670197), relevant fixes included:
@@ -22,8 +22,24 @@ plymouth (0.8.5.1-0.1) UNRELEASED; urgency=low
     Thanks to Julien Cristau for suggesting the solution
   * Add --enable-log-viewer configure flag to continue building it
   * Add new plymouth-themes-spinner package
-
- -- Andreas Henriksson <[email protected]>  Mon, 11 Jun 2012 17:35:28 +0200
+  * Add patch to fix when os-release is missing
+    - this patch fixes the upstream error handling code.
+  * Gracefully handle case of missing /etc/os-release.
+    Thanks to Julien Cristau
+  * Bail out of initramfs generation if missing plymouth module
+    - Maintainer hinted that he had a solution in mind for the problem
+      of breaking initramfs generation created by the package split.
+      Unfortunately there is no additional information, but it seems
+      just merging the packages back together is not what he intended.
+      This change just adds a simple check to the initramfs hook
+      to bail out (and not include plymouth) of the generation
+      instead of breaking it. While not being a perfect solution,
+      it should mitigate the worst problem while still not be too
+      annoying and creating to much work for the maintainer to
+      implement his intended solution later.
+      So for now this closes: #629416 but more work would be beneficial.
+
+ -- Andreas Henriksson <[email protected]>  Thu, 21 Jun 2012 10:24:52 +0200
 
 plymouth (0.8.3-20) unstable; urgency=low
 
-- 
1.7.10

Attachment: signature.asc
Description: Digital signature

Reply via email to