From b5c5317fd09fe52896a5b0935e6677c034b45b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20COUDERC?= Date: Mon, 9 Jan 2017 14:55:02 +0000 Subject: [PATCH] Plymouth/{softWaves,Lines,Joy}: provide fsckd progress support. (Closes: #850181) --- debian/changelog | 2 ++ joy-theme/plymouth/joy.script | 23 +++++++++++++++++++++++ lines-theme/plymouth/lines.script | 23 +++++++++++++++++++++++ softwaves-theme/plymouth/softwaves.script | 23 +++++++++++++++++++++++ 4 files changed, 71 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9b9dac1..74f1e9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ desktop-base (9.0.1) UNRELEASED; urgency=medium [ Aurélien COUDERC ] + * Plymouth/{softWaves,Lines,Joy}: provide fsckd progress support. + (Closes: #850181) * Plymouth/softWaves: raise messages and password field a little. * Plymouth/Lines: ensure password field doesn’t bump into the Debian image even for smaller height screens. (Closes: #774226) diff --git a/joy-theme/plymouth/joy.script b/joy-theme/plymouth/joy.script index f346d09..07664ea 100644 --- a/joy-theme/plymouth/joy.script +++ b/joy-theme/plymouth/joy.script @@ -511,6 +511,12 @@ fun message_callback (message) if (keys != NULL) message = StringCopy (message, keys + StringLength(local.substring), NULL); + # Get the message without the "fsckd-cancel-msg" prefix as we don't support i18n + substring = "fsckd-cancel-msg:"; + keys = StringString(message, substring); + if (keys != NULL) + message = StringCopy(message, keys + StringLength(substring), NULL); + local.label.is_fake = is_fake; label = get_message_label(message, is_fake, is_action_line); label.z = 10000; @@ -1021,6 +1027,23 @@ fun update_status_callback (status) { } + # systemd-fsckd pass fsckd::: + if (update_strings[0] == "fsckd") { + number_devices = StringToInteger(update_strings[1]); + + if (number_devices > 0) { + label = update_strings[3]; + + progress_label = get_fsck_label (label, 0); + progress_label.sprite = Sprite (progress_label.image); + progress_label.sprite.SetPosition(progress_label.x, progress_label.y, 1); + progress_label.sprite.SetOpacity (1); + } else { + if (progress_label.sprite) + progress_label.sprite.SetOpacity (0); + } + } + } Plymouth.SetUpdateStatusFunction (update_status_callback); diff --git a/lines-theme/plymouth/lines.script b/lines-theme/plymouth/lines.script index e666480..ee0a110 100644 --- a/lines-theme/plymouth/lines.script +++ b/lines-theme/plymouth/lines.script @@ -473,6 +473,12 @@ fun message_callback (message) local.label.is_fake = is_fake; label = get_message_label(message, is_fake, is_action_line); label.z = 10000; + + # Get the message without the "fsckd-cancel-msg" prefix as we don't support i18n + substring = "fsckd-cancel-msg:"; + keys = StringString(message, substring); + if (keys != NULL) + message = StringCopy(message, keys + StringLength(substring), NULL); setup_message (message, label.x, label.y, label.z, is_action_line); if (prompt_active && local.is_action_line) @@ -980,6 +986,23 @@ fun update_status_callback (status) { } + # systemd-fsckd pass fsckd::: + if (update_strings[0] == "fsckd") { + number_devices = StringToInteger(update_strings[1]); + + if (number_devices > 0) { + label = update_strings[3]; + + progress_label = get_fsck_label (label, 0); + progress_label.sprite = Sprite (progress_label.image); + progress_label.sprite.SetPosition(progress_label.x, progress_label.y, 1); + progress_label.sprite.SetOpacity (1); + } else { + if (progress_label.sprite) + progress_label.sprite.SetOpacity (0); + } + } + } Plymouth.SetUpdateStatusFunction (update_status_callback); diff --git a/softwaves-theme/plymouth/softwaves.script b/softwaves-theme/plymouth/softwaves.script index fbdc80b..134782e 100644 --- a/softwaves-theme/plymouth/softwaves.script +++ b/softwaves-theme/plymouth/softwaves.script @@ -430,6 +430,12 @@ fun message_callback (message) if (keys != NULL) message = StringCopy (message, keys + StringLength(local.substring), NULL); + # Get the message without the "fsckd-cancel-msg" prefix as we don't support i18n + substring = "fsckd-cancel-msg:"; + keys = StringString(message, substring); + if (keys != NULL) + message = StringCopy(message, keys + StringLength(substring), NULL); + local.label.is_fake = is_fake; label = get_message_label(message, is_fake, is_action_line); label.z = 10000; @@ -941,6 +947,23 @@ fun update_status_callback (status) { } + # systemd-fsckd pass fsckd::: + if (update_strings[0] == "fsckd") { + number_devices = StringToInteger(update_strings[1]); + + if (number_devices > 0) { + label = update_strings[3]; + + progress_label = get_fsck_label (label, 0); + progress_label.sprite = Sprite (progress_label.image); + progress_label.sprite.SetPosition(progress_label.x, progress_label.y, 1); + progress_label.sprite.SetOpacity (1); + } else { + if (progress_label.sprite) + progress_label.sprite.SetOpacity (0); + } + } + } Plymouth.SetUpdateStatusFunction (update_status_callback);