From 7ee6d9c3c4bbe8ff72a45b6bd6165b3478f95c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Wed, 3 Oct 2018 12:47:21 +0200 Subject: [PATCH] card-helpers.inc: Add filename which is going to be written in final message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Müller --- scripts/include/card-helpers.inc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/include/card-helpers.inc b/scripts/include/card-helpers.inc index ddec712..4101c49 100644 --- a/scripts/include/card-helpers.inc +++ b/scripts/include/card-helpers.inc @@ -199,10 +199,12 @@ PrepareWrite() { EnsureUnmount $DevicePath } -# RunUserStartRoot() tests if we are running as root. If not, it calls SelectInOut. It expects -# SelectInOut to leave the required parameters for root call in variable RootParams. -# After this it asks user how to log on as root. Then the main script is started -# as root. +# RunUserStartRoot() tests if we are running as root. If not, it calls +# SelectInOut and SelectSuSudo and starts the main script as root. +# One parameter can be set optionally containing the last-exit message. +# If not set the standard full-card message is displayed. If set the +# placeholders %DeployedFile% and %DeployedFile% are replaces by actual +# contents of the variables. RunUserStartRoot() { # we are not already root? if [ ! $( id -u ) -eq 0 ]; then @@ -220,10 +222,10 @@ RunUserStartRoot() { echo if [ "x$1" = "x" ] ; then # No message text passed: use standard - echo "${style_bold}All data currenly stored on $DevicePath will be overwritten!${style_normal}" + echo "${style_bold}All data currenly stored on $DevicePath will be overwritten by $DeployedFile!${style_normal}" else # Use message text passed - echo $1 | sed "s|\%DevicePath\%|$DevicePath|" + echo $1 | sed "s|\%DevicePath\%|$DevicePath|" | sed "s|\%DeployedFile\%|$DeployedFile|" fi if [ $SuSudoSelection -eq 1 ]; then @@ -268,7 +270,7 @@ StartCardKernelWrite() { KernelImageType="$DEFAULT_KERNEL_IMAGE_TYPE" fi - RunUserStartRoot "${style_bold}The kernel images on %DevicePath% will be overwritten!${style_normal}" + RunUserStartRoot "${style_bold}The kernel images on %DevicePath% will be overwritten by %DeployedFile%!${style_normal}" PrepareWrite RootCardKernelWriteCallback }