Mini Shell

Direktori : /usr/lib64/python3.6/site-packages/pyanaconda/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/site-packages/pyanaconda/__pycache__/kexec.cpython-36.opt-1.pyc

3

C��e�@svddlZddlmZddlmZddlmZmZddlm	Z	ddl
mZee�Z
Gdd�de�Zd
d	d
�Zdd�ZdS)�N)�
namedtuple)�conf)�
execReadlines�execWithRedirect)�unquote)�get_module_loggerc@seZdZdS)�GrubbyInfoErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.6/kexec.pyr src
Csddddg}td|�}i}|s&ddg}yXxRtd|tjjd	�D]<}|jd
�\}}}t|�}||krr|||<|j|�|s<Pq<WWn6tk
r�}zt	j
d|�t|��WYdd}~XnX|r�td
dj|���d|kr�|dj
d�d|d<|f|�}	t	jd||	�|	S)av Run grubby and retrieve the kernel, initrd and boot arguments

        :param list args: Arguments to pass to grubby.
        :returns: kernel path, initrd path, root device, kernel cmdline args.
        :rtype: namedtuple
        :raises: some error on failure

        The returned namedtuple contains the following attributes:
            kernel, initrd, root, args
    �kernel�initrd�root�argsZBootInfoz--infoZDEFAULTZgrubby)r�=zrun_grubby failed: %sNzMissing values: %sz, � rzgrubby boot info for (%s): %s)rrr�target�system_root�	partitionr�remove�OSError�log�errorr�join�split�info)
rZboot_info_fieldsZboot_info_classZboot_info_args�line�keyZ_sep�value�e�	boot_inforrr
�
run_grubby$s0



r#cCs�y
t�}WnDtk
rNytddg�}Wntk
rHtjd�dSXYnXtjtjj|j	d�tjtjj|j
d�d|j|jf}ddd	|d
dg}yt
d|�}Wn.tk
r�}ztjd|�WYdd}~XnX|d
kr�tjd|�dS)a� Setup kexec to use the new kernel and default bootloader entry

        This uses grubby to determine the bootloader arguments from the default entry,
        and then sets up kexec so that reboot will use the new kernel and initrd instead
        of doing a full reboot.

        .. note::
            Once kexec is called there is nothing else to do, the reboot code already handles
            having kexec setup.
    z--infoZALLz@kexec reboot setup failed, grubby could not get bootloader info.Nz/tmp/vmlinuz-kexec-rebootz/tmp/initrd-kexec-rebootz
root=%s %sz--initrdz--appendz-lZkexeczsetup_kexec failed: %srz9setup_kexec failed with rc=%d: See program.log for output)r#rrr�shutilZcopy2rrrrrrrrr)r"�appendrZrcr!rrr
�setup_kexecUs$

r&)N)r$�collectionsrZ&pyanaconda.core.configuration.anacondarZpyanaconda.core.utilrrZpyanaconda.simpleconfigrZpyanaconda.anaconda_loggersrr	r�	Exceptionrr#r&rrrr
�<module>s
1