Bug 28055 - dracut: warning about missing surrounding white spaces in /etc/dracut.conf.d/51-mageia-resume.conf while updating mga7 to upcoming mga8
Summary: dracut: warning about missing surrounding white spaces in /etc/dracut.conf.d/...
Status: REOPENED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-10 09:08 CET by Jani Välimaa
Modified: 2023-04-28 21:04 CEST (History)
7 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description Jani Välimaa 2021-01-10 09:08:33 CET
I'm not sure which tool creates and/or updates /etc/dracut.conf.d/51-mageia-resume.conf, but I got the following warning msg while updating.

/etc/dracut.conf.d/51-mageia-resume.conf:add_device+="UUID=00000000-0000-0000-0000-000000000000"

dracut: WARNING: <key>+=" <values> ": <values> should have surrounding white spaces!
dracut: WARNING: This will lead to unwanted side effects! Please fix the configuration file.
Comment 1 Lewis Smith 2021-01-10 10:41:38 CET
Thanks for the notification.

Same question as before: did it stop the upgrade, or did that continue anyway?

Assigning to the Mageiatools group.

Assignee: bugsquad => mageiatools

Comment 2 Jani Välimaa 2021-01-10 10:57:40 CET
This was only a warning and installation continued.
Comment 3 Nicolas Lécureuil 2021-01-10 11:33:31 CET
Martin, 

According to dracut WARNING, can i commit this ?
It added white spaces before and after $biggest_swap_dev


diff --git a/perl-install/any.pm b/perl-install/any.pm
index 24c3575ad..2fdf15902 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -174,7 +174,7 @@ sub setupBootloaderBefore {
            my $biggest_swap_dev = fs::wild_device::from_part('', $biggest_swap);
            bootloader::set_append_with_key($bootloader, resume => $biggest_swap_dev);
            mkdir_p("$::prefix/etc/dracut.conf.d");
-           output("$::prefix/etc/dracut.conf.d/51-mageia-resume.conf", qq(add_device+="$biggest_swap_dev"\n));
+           output("$::prefix/etc/dracut.conf.d/51-mageia-resume.conf", qq(add_device+=" $biggest_swap_dev "\n));
        }
     }

CC: (none) => mageia, mageia

Comment 4 Martin Whitaker 2021-01-10 13:00:19 CET
That looks OK to me.
Comment 5 Nicolas Lécureuil 2021-01-10 15:35:46 CET
thank you for the review.
I commited it commit: b2d062329f10000e007b80cc72f10c3c649341eb

Resolution: (none) => FIXED
Status: NEW => RESOLVED

Comment 6 Jani Välimaa 2021-01-10 16:28:32 CET
I think the bug shouldn't be closed before the fix is pushed to BS and the fix is confirmed.

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 7 Nicolas Lécureuil 2021-01-10 19:56:02 CET
you are right :-)
Comment 8 Jani Välimaa 2021-02-25 10:09:56 CET
What's the status of this? Was the fix included in mga8?
Comment 9 Florian Hubold 2021-03-17 18:08:47 CET
For a fresh installation /etc/dracut.conf.d/51-mageia-resume.conf looks fine here with surrounding spaces, although for upgrades this might still be an issue.

CC: (none) => doktor5000

Comment 10 Aurelien Oudelet 2021-04-03 21:55:07 CEST
(In reply to Florian Hubold from comment #9)
> For a fresh installation /etc/dracut.conf.d/51-mageia-resume.conf looks fine
> here with surrounding spaces, although for upgrades this might still be an
> issue.

Agreed!

CC: (none) => ouaurelien

Comment 11 Marc Krämer 2023-04-27 13:38:31 CEST
fix is not included in mga9. or not executed - got the same error.

CC: (none) => mageia

Comment 12 Martin Whitaker 2023-04-27 20:15:02 CEST
In a fresh install of mga9

[root@localhost ~]# cat /etc/dracut.conf.d/51-mageia-resume.conf 
add_device+=" UUID=fa0e642f-8238-4290-b47b-fcf820e94d66 "

so the fix is included. But as mentioned in comment 9 and in my recent reply on the dev ML, it only applies to fresh installs, not upgrades.
Comment 13 Marc Krämer 2023-04-28 01:28:13 CEST
shouldn't we add an upgrade-script that corrects (generated) files in this dir?
Comment 14 Dave Hodgins 2023-04-28 03:33:02 CEST
The following works as a script. Would it work as a post-install scriptlet
for dracut?

ConfFile="/etc/dracut.conf.d/51-mageia-resume.conf"
if  [[ -e "$ConfFile" ]] ; then
    . "$ConfFile"
    ResumeConf=$(cat "$ConfFile")
    read  -rd device <<< "$add_device" # Remove leading/trailing spaces
    FixedResumeConf='add_device+=" '"$device"' "'
    if  [ "$ResumeConf" != "$FixedResumeConf" ] ; then
        echo "$FixedResumeConf" > "$ConfFile"
    fi
fi

CC: (none) => davidwhodgins
Version: 8 => Cauldron

Comment 15 sturmvogel 2023-04-28 21:04:23 CEST
*** Bug 31849 has been marked as a duplicate of this bug. ***

CC: (none) => estellnb


Note You need to log in before you can comment on or make changes to this bug.