Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1454340 - Invalid value of tuned_initrd in grub.cfg when wrong image path is used in bootloader parameter initrd_add_img
Invalid value of tuned_initrd in grub.cfg when wrong image path is used in bo...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned (Show other bugs)
7.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Ondřej Lysoněk
Tereza Cerna
: Patch, Upstream
Depends On:
Blocks: 1451764 TUNED-7.5-REBASE 1485946
  Show dependency treegraph
 
Reported: 2017-05-22 09:50 EDT by Tereza Cerna
Modified: 2018-04-10 12:01 EDT (History)
4 users (show)

See Also:
Fixed In Version: tuned-2.9.0-0.1.rc1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 12:01:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0879 normal SHIPPED_LIVE tuned bug fix and enhancement update 2018-04-10 09:39:08 EDT

  None (edit)
Description Tereza Cerna 2017-05-22 09:50:01 EDT
Description of problem:
=======================
If user uses bootloader parameter initrd_add_img with path from profile directory (only tuned-overlay.img instead of /usr/lib/tuned/test-profile/tuned-overlay.img), it prints ERROR message in log file (correct) and it changes also parameter tuned_initrd in grub.cfg to invalid path (incorrect). This should stay empty. 

This is solved for bootloader parameter initrd_add_dir. If it contains wrong value, parameter tuned_initrd in grub.cfg is not set too. 

Example is written below.


Version-Release number of selected component (if applicable):
=============================================================
tuned-2.8.0-2.el7


How reproducible:
=================
always


Steps to Reproduce:
===================

Wrong behavior in parameter initrd_add_img:
-------------------------------------------

# cat /usr/lib/tuned/add-img-profile/tuned.conf
[bootloader]
initrd_add_img=tuned-overlay.img
 
# tuned-adm profile add-img-profile
 
# cat /var/log/tuned/tuned.log
2017-05-22 04:16:25,067 INFO     tuned.daemon.daemon: stopping tunning
2017-05-22 04:16:25,202 INFO     tuned.profiles.loader: loading profile: add-img-profile
2017-05-22 04:16:25,202 INFO     tuned.daemon.daemon: starting tuning
2017-05-22 04:16:25,204 INFO     tuned.plugins.plugin_bootloader: installing initrd image as '/boot/tuned-overlay.img'
2017-05-22 04:16:25,204 ERROR    tuned.utils.commands: cannot copy file 'tuned-overlay.img' to '/boot/tuned-overlay.img': [Errno 2] No such file or directory: 'tuned-overlay.img'
2017-05-22 04:16:25,205 INFO     tuned.daemon.daemon: static tuning from profile 'add-img-profile' applied
 
# cat /boot/grub2/grub.cfg | grep tuned_initrd=
set tuned_initrd="/tuned-overlay.img"

>> There is error in log file which tells 'No such file or directory: tuned-overlay.img', but path to this file is filled into grub.cfg file: "set tuned_initrd="/tuned-overlay.img". There should not be invalid path in grub configuration file. This parameter tuned_initrd should be empty. If somebody tries it in this way, it will not work.

>> Please, fix this unspecified option.

Right behavior in parameter initrd_add_dir:
-------------------------------------------

# cat /usr/lib/tuned/add-dir-profile/tuned.conf
[bootloader]
initrd_add_dir=tuned-overlay.img

# cat /var/log/tuned/tuned.log
2017-05-22 09:13:03,578 INFO     tuned.daemon.daemon: stopping tunning
2017-05-22 09:13:04,314 INFO     tuned.profiles.loader: loading profile: add-dir-profile
2017-05-22 09:13:04,315 INFO     tuned.daemon.daemon: starting tuning
2017-05-22 09:13:04,318 ERROR    tuned.plugins.plugin_bootloader: error: cannot create initrd image, source directory 'tuned-overlay.img' doesn't exist
2017-05-22 09:13:04,318 INFO     tuned.daemon.daemon: static tuning from profile 'add-dir-profile' applied

# cat /boot/grub2/grub.cfg | grep tuned_initrd=
set tuned_initrd=""

>> You can see error in log file that source directory doesn't exist and parameter tuned_initrd in /boot/grub2/grub.cfg stays empty. So this doesn't cause problem.


Actual results:
===============
# cat /boot/grub2/grub.cfg | grep tuned_initrd=
set tuned_initrd="/tuned-overlay.img"


Expected results:
=================
# cat /boot/grub2/grub.cfg | grep tuned_initrd=
set tuned_initrd=""
Comment 4 Fedora Update System 2017-10-13 10:20:57 EDT
tuned-2.9.0-0.1.rc1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d9c6b990df
Comment 6 Fedora Update System 2017-10-13 18:25:19 EDT
tuned-2.9.0-0.1.rc1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-d9c6b990df
Comment 7 Fedora Update System 2017-10-13 19:25:08 EDT
tuned-2.9.0-0.1.rc1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-5f0849d207
Comment 8 Fedora Update System 2017-10-29 17:07:10 EDT
tuned-2.9.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0e45ce4685
Comment 9 Fedora Update System 2017-10-29 17:13:16 EDT
tuned-2.9.0-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c30e9bd1ea
Comment 10 Tereza Cerna 2018-01-25 03:49:08 EST
============================
Verified in:
    tuned-2.9.0-1.el7.noarch
PASS
============================

:: [   LOG    ] :: ==== Invalid config: [bootloader] initrd_add_img=tuned-overlay.img ==== [BZ#1454340]
:: [   LOG    ] :: See content of profile add-img-profile
:: [   PASS   ] :: Command 'tuned-adm profile add-img-profile' (Expected 0, got 0)
:: [   PASS   ] :: Command 'tuned-adm active | grep add-img-profile' (Expected 0, got 0)
:: [   LOG    ] :: Check log file
:: [   PASS   ] :: Command 'grep "INFO     tuned.plugins.plugin_bootloader: installing initrd image as '/boot/tuned-overlay.img'" /var/log/tuned/tuned.log' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "ERROR    tuned.utils.commands: cannot copy file 'tuned-overlay.img' to '/boot/tuned-overlay.img': \[Errno 2\] No such file or directory: 'tuned-overlay.img'" /var/log/tuned/tuned.log' (Expected 0, got 0)
:: [   LOG    ] :: Check grub.cfg
:: [   PASS   ] :: Command 'grep 'set tuned_initrd=""' /boot/grub2/grub.cfg' (Expected 0, got 0)

============================
Reproduced in:
    tuned-2.8.0-5.el7.noarch
FAIL
============================

:: [   LOG    ] :: ==== Invalid config: [bootloader] initrd_add_img=tuned-overlay.img ==== [BZ#1454340]
:: [   LOG    ] :: See content of profile add-img-profile
:: [   PASS   ] :: Command 'tuned-adm profile add-img-profile' (Expected 0, got 0)
:: [   PASS   ] :: Command 'tuned-adm active | grep add-img-profile' (Expected 0, got 0)
:: [   LOG    ] :: Check log file
:: [   PASS   ] :: Command 'grep "INFO     tuned.plugins.plugin_bootloader: installing initrd image as '/boot/tuned-overlay.img'" /var/log/tuned/tuned.log' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "ERROR    tuned.utils.commands: cannot copy file 'tuned-overlay.img' to '/boot/tuned-overlay.img': \[Errno 2\] No such file or directory: 'tuned-overlay.img'" /var/log/tuned/tuned.log' (Expected 0, got 0)
:: [   LOG    ] :: Check grub.cfg
:: [   FAIL   ] :: Command 'grep 'set tuned_initrd=""' /boot/grub2/grub.cfg' (Expected 0, got 1)
Comment 13 errata-xmlrpc 2018-04-10 12:01:26 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0879

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