HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3.9/site-packages/tuned/plugins/__pycache__/plugin_bootloader.cpython-39.pyc
a

Y��d�d�@s�ddlmZddlTddlZddlmZddlmZddlm	Z	ddl
Z
ddlZddlZddl
mZej��ZGdd	�d	ej�ZdS)
�)�base)�*�N)�
exceptions)�commands)�sleepcs�eZdZdZ�fdd�Zdd�Zdd�Zedd	��Ze	d[dd��Z
e	d
d��Zdd�Zdd�Z
iifdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zejfd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Z d5d6�Z!d7d8�Z"d9d:�Z#d;d<�Z$d=d>�Z%d?d@�Z&e'dA�dBdC��Z(e'dD�dEdF��Z)e'dG�dHdI��Z*e'dJdKdLdM�dNdO��Z+e'dPdKdLdM�dQdR��Z,e'dSdKdLdM�dTdU��Z-e'dVdKdLdM�dWdX��Z.dYdZ�Z/�Z0S)\�BootloaderPlugina�
	`bootloader`::
	
	Adds options to the kernel command line. This plug-in supports the
	GRUB 2 boot loader and the Boot Loader Specification (BLS).
	+
	NOTE: *TuneD* will not remove or replace kernel command line
	parameters added via other methods like *grubby*. *TuneD* will manage
	the kernel command line parameters added via *TuneD*. Please refer
	to your platform bootloader documentation about how to identify and
	manage kernel command line parameters set outside of *TuneD*.
	+
	Customized non-standard location of the GRUB 2 configuration file
	can be specified by the [option]`grub2_cfg_file` option.
	+
	The kernel options are added to the current GRUB configuration and
	its templates. Reboot the system for the kernel option to take effect.
	+
	Switching to another profile or manually stopping the `tuned`
	service removes the additional options. If you shut down or reboot
	the system, the kernel options persist in the [filename]`grub.cfg`
	file and grub environment files.
	+
	The kernel options can be specified by the following syntax:
	+
	[subs="+quotes,+macros"]
	----
	cmdline__suffix__=__arg1__ __arg2__ ... __argN__
	----
	+
	Or with an alternative, but equivalent syntax:
	+
	[subs="+quotes,+macros"]
	----
	cmdline__suffix__=+__arg1__ __arg2__ ... __argN__
	----
	+
	Where __suffix__ can be arbitrary (even empty) alphanumeric
	string which should be unique across all loaded profiles. It is
	recommended to use the profile name as the __suffix__
	(for example, [option]`cmdline_my_profile`). If there are multiple
	[option]`cmdline` options with the same suffix, during the profile
	load/merge the value which was assigned previously will be used. This
	is the same behavior as any other plug-in options. The final kernel
	command line is constructed by concatenating all the resulting
	[option]`cmdline` options.
	+
	It is also possible to remove kernel options by the following syntax:
	+
	[subs="+quotes,+macros"]
	----
	cmdline__suffix__=-__arg1__ __arg2__ ... __argN__
	----
	+
	Such kernel options will not be concatenated and thus removed during
	the final kernel command line construction.
	+
	.Modifying the kernel command line
	====
	For example, to add the [option]`quiet` kernel option to a *TuneD*
	profile, include the following lines in the [filename]`tuned.conf`
	file:
	
	----
	[bootloader]
	cmdline_my_profile=+quiet
	----
	
	An example of a custom profile `my_profile` that adds the
	[option]`isolcpus=2` option to the kernel command line:
	
	----
	[bootloader]
	cmdline_my_profile=isolcpus=2
	----
	
	An example of a custom profile `my_profile` that removes the
	[option]`rhgb quiet` options from the kernel command line (if
	previously added by *TuneD*):
	
	----
	[bootloader]
	cmdline_my_profile=-rhgb quiet
	----
	====
	+
	.Modifying the kernel command line, example with inheritance
	====
	For example, to add the [option]`rhgb quiet` kernel options to a
	*TuneD* profile `profile_1`:
	
	----
	[bootloader]
	cmdline_profile_1=+rhgb quiet
	----
	
	In the child profile `profile_2` drop the [option]`quiet` option
	from the kernel command line:
	
	----
	[main]
	include=profile_1
	
	[bootloader]
	cmdline_profile_2=-quiet
	----
	
	The final kernel command line will be [option]`rhgb`. In case the same
	[option]`cmdline` suffix as in the `profile_1` is used:
	
	----
	[main]
	include=profile_1
	
	[bootloader]
	cmdline_profile_1=-quiet
	----
	
	It will result in the empty kernel command line because the merge
	executes and the [option]`cmdline_profile_1` gets redefined to just
	[option]`-quiet`. Thus there is nothing to remove in the final kernel
	command line processing.
	====
	+
	The [option]`initrd_add_img=IMAGE` adds an initrd overlay file
	`IMAGE`. If the `IMAGE` file name begins with '/', the absolute path is
	used. Otherwise, the current profile directory is used as the base
	directory for the `IMAGE`.
	+
	The [option]`initrd_add_dir=DIR` creates an initrd image from the
	directory `DIR` and adds the resulting image as an overlay.
	If the `DIR` directory name begins with '/', the absolute path
	is used. Otherwise, the current profile directory is used as the
	base directory for the `DIR`.
	+
	The [option]`initrd_dst_img=PATHNAME` sets the name and location of
	the resulting initrd image. Typically, it is not necessary to use this
	option. By default, the location of initrd images is `/boot` and the
	name of the image is taken as the basename of `IMAGE` or `DIR`. This can
	be overridden by setting [option]`initrd_dst_img`.
	+
	The [option]`initrd_remove_dir=VALUE` removes the source directory
	from which the initrd image was built if `VALUE` is true. Only 'y',
	'yes', 't', 'true' and '1' (case insensitive) are accepted as true
	values for this option. Other values are interpreted as false.
	+
	.Adding an overlay initrd image
	====
	----
	[bootloader]
	initrd_remove_dir=True
	initrd_add_dir=/tmp/tuned-initrd.img
	----
	
	This creates an initrd image from the `/tmp/tuned-initrd.img` directory
	and and then removes the `tuned-initrd.img` directory from `/tmp`.
	====
	+
	The [option]`skip_grub_config=VALUE` does not change grub
	configuration if `VALUE` is true. However, [option]`cmdline`
	options are still processed, and the result is used to verify the current
	cmdline. Only 'y', 'yes', 't', 'true' and '1' (case insensitive) are accepted
	as true values for this option. Other values are interpreted as false.
	+
	.Do not change grub configuration
	====
	----
	[bootloader]
	skip_grub_config=True
	cmdline=+systemd.cpu_affinity=1
	----
	====
	cs:tj�tj�st�d��tt|�j	|i|��t
�|_dS)Nz4Required GRUB2 template not found, disabling plugin.)�os�path�isfile�constsZGRUB2_TUNED_TEMPLATE_PATHrZNotSupportedPluginException�superr�__init__r�_cmd)�self�args�kwargs��	__class__��C/usr/lib/python3.9/site-packages/tuned/plugins/plugin_bootloader.pyr�s
zBootloaderPlugin.__init__cCsVd|_d|_d|_d|_d|_d|_d|_d|_|��|_	|�
�|_|��du|_
dS)NFT�)Z_has_dynamic_tuningZ_has_static_tuning�update_grub2_cfg�_skip_grub_config_val�_initrd_remove_dir�_initrd_dst_img_val�_cmdline_val�_initrd_val�_get_grub2_cfg_files�_grub2_cfg_file_names�_bls_enabled�_bls�_rpm_ostree_status�_rpm_ostree�r�instancerrr�_instance_init�s

zBootloaderPlugin._instance_initcCsdS�Nrr$rrr�_instance_cleanup�sz"BootloaderPlugin._instance_cleanupcCsdddddddd�S)N)�grub2_cfg_file�initrd_dst_img�initrd_add_img�initrd_add_dir�initrd_remove_dir�cmdline�skip_grub_configr)�clsrrr�_get_config_options�s�z$BootloaderPlugin._get_config_optionsrcCs\i}|��}|��D]B}||vr|�dd�}|�|dg��t|�dkrP|dnd�q|S)z�
		Returns dict created from options
		e.g.: _options_to_dict("A=A A=B A B=A C=A", "A=B B=A B=B") returns {'A': ['A', None], 'C': ['A']}
		�=rrN)�split�
setdefault�append�len)�optionsZomit�d�oZarrrrr�_options_to_dict�s,z!BootloaderPlugin._options_to_dictcCsd�dd�|��D��S)N� cSs2g|]*\}}|D]}|dur(|d|n|�qqS�Nr2r)�.0�k�vZv1rrr�
<listcomp>��z5BootloaderPlugin._dict_to_options.<locals>.<listcomp>)�join�items)r8rrr�_dict_to_options�sz!BootloaderPlugin._dict_to_optionscCsr|jjddgdd�\}}}t�d||f�|dkr8dS|��}t|�dksX|dd	krjt�d
|�dS|dS)zW
		Returns status of rpm-ostree transactions or None if not run on rpm-ostree system
		�
rpm-ostree�statusT�Z
return_errz.rpm-ostree status output stdout:
%s
stderr:
%srN�zState:z2Exceptional format of rpm-ostree status result:
%sr)r�execute�log�debugr3r6�warn)r�rc�out�errZsplitedrrrr"�sz#BootloaderPlugin._rpm_ostree_statuscCsDd}d}t|�D]}|��dkr&dSt|�q|��dkr@dSdS)N�
g�?ZidleTF)�ranger"r)rZsleep_cyclesZ
sleep_secs�irrr�_wait_till_idles
z BootloaderPlugin._wait_till_idlecs�|jjddgdd�\}}}t�d||f�|dkr8dS|�|�}|��sXt�d�dSi}|�|���}|�	�D](\�}	|	D]}
|��
|
�q~|	|�<qri}|�|���}|�	�D]~\�}	|����rt�d	�|�f�|��g��
|��|�
�fd
d�|�D��g|�<|��g��
|	�|	|�<q�t�d||f�|jjddgd
d�|D�dd�|D�dd�\}}
}|dk�r�t�d|�|�|�ddfS|||fSdS)z�
		Method for appending or deleting rpm-ostree karg
		returns None if rpm-ostree not present or is run on not ostree system
		or tuple with new kargs, appended kargs and deleted kargs
		rE�kargsTrGz'rpm-ostree output stdout:
%s
stderr:
%sr)NNNzCannot wait for transaction endz)adding rpm-ostree kargs %s: %s for deletecs$g|]}|dur�d|n��qSr<r�r=r?�r>rrr@.rAz6BootloaderPlugin._rpm_ostree_kargs.<locals>.<listcomp>z2rpm-ostree kargs - appending: '%s'; deleting: '%s'cSsg|]}d|�qS)z--append=%srrUrrrr@5rAcSsg|]}d|�qS)z--delete=%srrUrrrr@6rAz-Something went wrong with rpm-ostree kargs
%sN)rrIrJrKr:rS�errorrDr3rC�remove�getr4�extend�info)rr5�deleterMrNrOrT�deletedZ
delete_params�valr?�appendedZ
append_params�_rrVr�_rpm_ostree_kargs
sH



���
z"BootloaderPlugin._rpm_ostree_kargscCsH|����}g}|D]J}t|��d�r2|�|�q||vrH||||<qt�d||jjf�qd}|D]�}||}|dush|dkr�qh|d}|dd�}|dd��	�}	|dks�|d	kr�|d
vr�|	dkr�|d|	7}qh|dk�r|	dk�r(|	�
�D]$}
t�|
�}t�
d
|dd|�}q�qh|d|7}qh|�	�}|dk�rD||d<|S)zSMerge provided options with plugin default options and merge all cmdline.* options.r.z$Unknown option '%s' for plugin '%s'.rNrrrH�+�\)rcrb�-r;rdz(\A|\s)z	(?=\Z|\s))r1�copy�str�
startswithr5rJrLr�__name__�stripr3�re�escape�sub)rr7Z	effectiveZcmdline_keys�keyr.r^�opZop1Zvals�pZregexrrr�_get_effective_options=s:



z'BootloaderPlugin._get_effective_optionscCs*g}tjD]}tj�|�r
|�|�q
|Sr')rZGRUB2_CFG_FILESr	r
�existsr5)rZ	cfg_files�frrrr_s

z%BootloaderPlugin._get_grub2_cfg_filescCsH|jjtjdd�}t|�dkr2t�dtj�dStjd|tj	d�duS)NT�Zno_errorr�cannot read '%s'Fz=^\s*GRUB_ENABLE_BLSCFG\s*=\s*\"?\s*[tT][rR][uU][eE]\s*\"?\s*$��flags)
r�	read_filer�GRUB2_DEFAULT_ENV_FILEr6rJr[rj�search�	MULTILINE)r�grub2_default_envrrrr fs��zBootloaderPlugin._bls_enabledcCs|j�tj|�Sr')r�add_modify_option_in_filer�BOOT_CMDLINE_FILE)rr8rrr�_patch_bootcmdlineosz#BootloaderPlugin._patch_bootcmdlinecCs�|�tjdtjdi�|js*t�d�dS|jD]*}|jj|dtj	ddtj
didd�q0|jdur�t�d|j�|j�|j�dS)Nr�cannot find grub.cfg to patchzset\s+F)�addzremoving initrd image '%s')
r~r�BOOT_CMDLINE_TUNED_VAR�BOOT_CMDLINE_INITRD_ADD_VARrrJr[rr|�GRUB2_TUNED_VAR�GRUB2_TUNED_INITRD_VARr�unlink)rrrrrr�_remove_grub2_tuningrs

(
z%BootloaderPlugin._remove_grub2_tuningcCsf|j�tj�}tjtjd|tjd�}|r2|dnd}tjtjd|tjd�}|rZ|dnd}||fS)Nz	=\"(.*)\"rurr)	rrwrr}rjryr�rz�BOOT_CMDLINE_KARGS_DELETED_VAR)rrrr_r]rrr�_get_rpm_ostree_changes}sz(BootloaderPlugin._get_rpm_ostree_changescCs@|��\}}|j|�|�|�|�d�|�tjdtjdi�dS)N)r5r\r)r�rar:r~rr�r�)rr_r]rrr�_remove_rpm_ostree_tuning�sz*BootloaderPlugin._remove_rpm_ostree_tuningcCsP|tjkrL|jsL|jr*t�d�|��n"t�d�|��|�ddd��dS)Nz4removing rpm-ostree tuning previously added by Tunedz/removing grub2 tuning previously added by Tunedr�Ztuned_paramsZtuned_initrd)	rZ
ROLLBACK_FULLrr#rJr[r�r��_update_grubenv)rr%Zrollbackrrr�_instance_unapply_static�s


z)BootloaderPlugin._instance_unapply_staticcCs�t�d�tjdtjdd|tjd�}tjdtjd|tjd�}tjdtjdd|tjd�}tjdtjd|tjd�}tjtjdd|tjd�}tjtj	dd|tjd�S)	Nzunpatching grub.cfgz
^\s*set\s+z\s*=.*
rruz *\$�\nz\n+)
rJrKrjrlrr�rzr��GRUB2_TEMPLATE_HEADER_BEGIN�GRUB2_TEMPLATE_HEADER_END)r�	grub2_cfg�cfgrrr�_grub2_cfg_unpatch�s
z#BootloaderPlugin._grub2_cfg_unpatchcCs�t�d�dtjd}|D]0}|d|j�|�d|j�||�d7}q|tjd7}tjd||tj	d	�}tj
tjd
�}|D]l}tjd|dd
|||tj	d	�}tjd|d||dd|tj	d	�}tjd|dd|tj	d	�}q�|S)Nzinitial patching of grub.cfgz\1\n\n�
zset z="�"
r�z+^(\s*###\s+END\s+[^#]+/00_header\s+### *)\nru)ZlinuxZinitrdz^(\s*z(16|efi)?\s+.*)$z\1 $z(?:16|efi)?\s+\S+rescue.*)\$z *(.*)$z\1\2z(?:16|efi)?\s+\S+rescue.*) +$�\1)rJrKrr�rrkr�rjrlrzr�r�)rr�r8�s�optZd2rRrrr�_grub2_cfg_patch_initial�s
.$(z)BootloaderPlugin._grub2_cfg_patch_initialcCs�|j�tj�}t|�dkr.t�dtj�dStjtjd�}d}|D]n}t	j
d|d||d|t	jd�durDd	}|d
dkr�|d7}||d|d
|d||d7}qD|r�t�dtj�|j�
tj|�d	S)NrrtF)ZGRUB_CMDLINE_LINUX_DEFAULTZGRUB_INITRD_OVERLAYz^[^#]*\bz
\s*=.*\\\$z\b.*$ruT���r�z="${z:+$z }\$r�z
patching '%s')rrwrrxr6rJr[r�r�rjryrzrK�
write_to_file)rr{r8�writerRrrr�_grub2_default_env_patch�s **z)BootloaderPlugin._grub2_default_env_patchcCs�|j�tj�}t|�dkr.t�dtj�dSd}tjdtj	d|tj
d�r�d}tjdtj	dd	|tj
d�}|d
dkr�|d7}|r�t�dtj�|j�
tj|�dS)
NrrtFzb^GRUB_CMDLINE_LINUX_DEFAULT=\"\$\{GRUB_CMDLINE_LINUX_DEFAULT:\+\$GRUB_CMDLINE_LINUX_DEFAULT \}\\\$z"$ruTz"$
rr�r�zunpatching '%s')rrwrrxr6rJr[rjryr�rzrlrKr�)rr{r�r�rrr�_grub2_default_env_unpatch�s4������z+BootloaderPlugin._grub2_default_env_unpatchc	CsPt�d�|jst�d�dS|jD�]
}|j�|�}t|�dkrRt�d|�q$t�d|�|}d}|D]^}tjd|dd	|j�	||�d
|tj
d�\}}|dks�tjd
||tj
d�durld}qlttjd
t
j|tj
d��ttjd
t
j|tj
d��k�r
d}|�r"|�|�|�|�}|j�||�q$|j�rD|��n|��dS)Nzpatching grub.cfgrFrzcannot patch %sz+adding boot command line parameters to '%s'z	\b(set\s+z\s*=).*$z\1"�"rurz\$T)rJrKrr[rrwr6rj�subnrkrzry�findallrr�r�r�r�r�r!r�r�)rr8rrr�Z
grub2_cfg_newZ
patch_initialr�Znsubsrrr�_grub2_cfg_patch�s6

4"�
z!BootloaderPlugin._grub2_cfg_patchcCsb|��\}}|�|j|�}|s"dS|j|d�\}}}|dur@dS|�tj|jtj|�|�i�dS)N)r5)	r�r:rrar~rr�r�rD)rr_r`Z
_cmdline_dictr8rrr�_rpm_ostree_update�sz#BootloaderPlugin._rpm_ostree_updatecCs8|�tj|jtj|ji�|�tj|jtj|ji�dSr')	r�rr�rr�rr~r�r��rrrr�
_grub2_update�szBootloaderPlugin._grub2_updatecCstj�tj�Sr')r	r
rqrZBLS_ENTRIES_PATHr�rrr�_has_blsszBootloaderPlugin._has_blscCsZt�dt|��dd�|��D�}|j�gd�|�\}}|dkrVt�d|�dSdS)	Nzupdating grubenv, setting %scSs$g|]\}}dt|�t|�f�qS)z%s=%s)rf)r=�option�valuerrrr@rAz4BootloaderPlugin._update_grubenv.<locals>.<listcomp>)z
grub2-editenvrd�setrzcannot update grubenv: '%s'FT)rJrKrfrCrrIrL)rr8�lrMrNrrrr�sz BootloaderPlugin._update_grubenvcCsb|j��}|dkrdSt�dtj�|jjtjdgd|id�\}}|dkr^t�d|�dSd	S)
NrFz4running kernel update hook '%s' to patch BLS entriesr�ZKERNEL_INSTALL_MACHINE_ID)�envrzcannot patch BLS entries: '%s'T)rZget_machine_idrJrKrZKERNEL_UPDATE_HOOK_FILErIrL)rZ
machine_idrMrNrrr�_bls_entries_patch_initials
z+BootloaderPlugin._bls_entries_patch_initialcCs6t�d�|��r2|�|j|jd��r2|��r2dSdS)Nzupdating BLSr�TF)rJrKr�r�rrr�r�rrr�_bls_updates
��zBootloaderPlugin._bls_updatecCs(|jdur$tj�tjtj�|��|_dSr')rr	r
rBr�BOOT_DIR�basename)r�namerrr�_init_initrd_dst_img"s
z%BootloaderPlugin._init_initrd_dst_imgcCstj�tj�Sr')r	r
�isdirrZPETITBOOT_DETECT_DIRr�rrr�_check_petitboot&sz!BootloaderPlugin._check_petitbootcCs�|jrt�d�dS|��r&t�d�t�d|j�tj�|j�}|j	�
||j�sXdSd|_|j	�d��
�}d}t|�}|r�t�dd	|�}t|�|kr�|}tj�||�|_dS)
Nz:Detected rpm-ostree which doesn't support initrd overlays.FzkDetected Petitboot which doesn't support initrd overlays. The initrd overlay will be ignored by bootloader.zinstalling initrd image as '%s'T�
/proc/cmdline�/z)^\s*BOOT_IMAGE=\s*(?:\([^)]*\))?(\S*/).*$r�)r#rJrLr�r[rr	r
r�rrerrw�rstripr6rjrlrBr)rZimgZimg_nameZcurr_cmdlineZinitrd_grubpathZlcr
rrr�_install_initrd)s&

z BootloaderPlugin._install_initrdr)cCs$|rdS|r |dur t|�g|_dSr')rfr�r�enablingr��verify�ignore_missingrrr�_grub2_cfg_file>sz BootloaderPlugin._grub2_cfg_filer*cCsR|rdS|rN|durNt|�|_|jdkr,dS|jddkrNtj�tj|j�|_dS)NrFrr�)rfrr	r
rBrr�r�rrr�_initrd_dst_imgFs

z BootloaderPlugin._initrd_dst_imgr-cCs*|rdS|r&|dur&|j�|�dk|_dS)N�1)r�get_boolrr�rrrrRsz#BootloaderPlugin._initrd_remove_dirr+FrP)Z
per_device�prioritycCsD|rdS|r@|dur@t|�}|�|�|dkr2dS|�|�s@dSdS)NrF)rfr�r�)rr�r�r�r�Zsrc_imgrrr�_initrd_add_imgZs

z BootloaderPlugin._initrd_add_imgr,c
Cs|rdS|�r|du�rt|�}|�|�|dkr6dStj�|�sTt�d|�dSt�d|�tj	ddd�\}}t�
d|�t�|�|jj
d	||d
d�\}}	t�
d|	�|d
kr�t�d�|jj|d
d�dS|�|�|j�|�|j�rt�d|�|j�|�dS)NrFzFerror: cannot create initrd image, source directory '%s' doesn't existz+generating initrd image from directory '%s'ztuned-bootloader-z.tmp)�prefix�suffixz+writing initrd image to temporary file '%s'zfind . | cpio -co > %sT)�cwd�shellzcpio log: %srzerror generating initrd imagerszremoving directory '%s')rfr�r	r
r�rJrWr[�tempfileZmkstemprK�closerrIr�r�r�rmtree)
rr�r�r�r�Zsrc_dir�fdZtmpfilerMrNrrr�_initrd_add_dirgs2



z BootloaderPlugin._initrd_add_dirr.cCsF|j�|j�|��}|�r|jr8|��d}|�|�}n|j�d�}t|�dkrTdSt	|�
��}t	|�
��}	|	|}
t|
�dkr�t�t
jdt|	�f�dSdd�|D�}|
D]J}|�
dd�d}
|
|vr�t�t
j|
|f�q�t�t
j||
|f�q�|	|@}t�d	d
�|�f�dS|�rB|du�rBt�d�d|_||_dS)
Nrr�r.TcSsi|]}|�dd�d|�qS)r2rr)r3rUrrr�
<dictcomp>�rAz-BootloaderPlugin._cmdline.<locals>.<dictcomp>r2rz2expected arguments that are present in cmdline: %sr;Fz;installing additional boot command line parameters to grub2)Z
_variables�expandr�unquoter#rarDrwr6r�r3rJr[rZSTR_VERIFY_PROFILE_VALUE_OKrfrWZ'STR_VERIFY_PROFILE_CMDLINE_FAIL_MISSINGZSTR_VERIFY_PROFILE_CMDLINE_FAILrBrr)rr�r�r�r�r?Zrpm_ostree_kargsr.Zcmdline_setZ	value_setZmissing_setZcmdline_dict�m�argZpresent_setrrr�_cmdline�s6
zBootloaderPlugin._cmdliner/cCs8|rdS|r4|dur4|j�|�dkr4t�d�d|_dS)Nr�z(skipping any modification of grub configT)rr�rJr[rr�rrr�_skip_grub_config�s
z"BootloaderPlugin._skip_grub_configcCs�|rV|jrVt|j�dkr"t�d�t|j�dkr:t�d�|�tj|jtj	|ji�n0|r�|j
r�|jrp|��n|�
�|��d|_
dS)Nrz0requested changes to initrd will not be applied!z1requested changes to cmdline will not be applied!F)rr6rrJrLrr~rr�r�rr#r�r�r�)rr%r�rrr�_instance_post_static�s




z&BootloaderPlugin._instance_post_static)r)1rh�
__module__�__qualname__�__doc__rr&r(�classmethodr1�staticmethodr:rDr"rSrarprr r~r�r�r�rZ
ROLLBACK_SOFTr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zcommand_customr�r�rr�r�r�r�r��
__classcell__rrrrrsf/


0"	
	 
	





 
r)rrZ
decoratorsZ
tuned.logsZtunedrZtuned.utils.commandsrZtuned.constsrr	rjr��timerZlogsrYrJZPluginrrrrr�<module>s