Package pyanaconda :: Module bootloader :: Class GRUB2
[hide private]
[frames] | no frames]

Class GRUB2

source code

object --+        
         |        
BootLoader --+    
             |    
          GRUB --+
                 |
                GRUB2

GRUBv2

- configuration
    - password (insecure), password_pbkdf2
        - http://www.gnu.org/software/grub/manual/grub.html#Invoking-grub_002dmkpasswd_002dpbkdf2
    - --users per-entry specifies which users can access, otherwise
      entry is unrestricted
    - /etc/grub/custom.cfg

- how does grub resolve names of md arrays?

- disable automatic use of grub-mkconfig?
    - on upgrades?

- BIOS boot partition (GPT)
    - parted /dev/sda set <partition_number> bios_grub on
    - can't contain a filesystem
    - 31KiB min, 1MiB recommended

Instance Methods [hide private]
 
_gpt_disk_has_bios_boot(self, device)
Return False if device is gpt-labeled disk w/o bios boot part.
source code
 
is_valid_stage1_device(self, device)
Return True if the device is a valid stage1 target device.
source code
 
grub_device_name(self, device)
Return a grub-friendly representation of device.
source code
 
write_config_console(self, config)
Write console-related configuration.
source code
 
write_device_map(self)
Write out a device map containing all supported devices.
source code
 
write_defaults(self) source code
 
_encrypt_password(self)
Make sure self.encrypted_password is set up properly.
source code
 
write_password_config(self) source code
 
write_config(self)
Write bootloader configuration to disk.
source code
 
install(self) source code

Inherited from GRUB: __init__, config_dir, config_file, device_map_file, grub_conf_device_line, grub_config_dir, has_windows, install_targets, serial_command, update, write_config_header, write_config_images, write_config_password, write_config_post

Inherited from BootLoader: add_image, boot_prefix, bootable_chain_devices, bootable_devices, clear_drive_list, clear_images, default, device_description, device_descriptions, disklabel_types, drive_order, drives, image_label, images, is_valid_stage2_device, platform, read, set_boot_args, set_preferred_stage1_type, stage1_device, stage1_devices, stage2_device, timeout, trusted_boot, update_only, write, writeKS

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  name = "GRUB2"
  packages = ["grub2"]
  obsoletes = ["grub"]
  _config_file = "grub.cfg"
  _config_dir = "grub2"
  config_file_mode = 0600
  defaults_file = "/etc/default/grub"
  can_dual_boot = True
  can_update = True
  stage2_format_types = ["ext4", "ext3", "ext2", "btrfs"]
  stage2_device_types = ["partition", "mdarray", "lvmlv", "btrfs...
  stage2_raid_levels = [mdraid.RAID0, mdraid.RAID1, mdraid.RAID4...

Inherited from GRUB: stage2_bootable, stage2_is_valid_stage1, stage2_must_be_primary, stage2_raid_member_types, stage2_raid_metadata

Inherited from GRUB (private): _device_map_file

Inherited from BootLoader: encryption_support, global_preserve_args, image_label_attr, preserve_args, stage2_description, stage2_max_end_mb, stage2_mountpoints

Inherited from BootLoader (private): _trusted_boot

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

is_valid_stage1_device(self, device)

source code 

Return True if the device is a valid stage1 target device.

Also collect lists of errors and warnings.

The criteria for being a valid stage1 target device vary from platform to platform. On some platforms a disk with an msdos disklabel is a valid stage1 target, while some platforms require a special device. Some examples of these special devices are EFI system partitions on EFI machines, PReP boot partitions on iSeries, and Apple bootstrap partitions on Mac.

Overrides: BootLoader.is_valid_stage1_device
(inherited documentation)

grub_device_name(self, device)

source code 

Return a grub-friendly representation of device.

Disks and partitions use the (hdX,Y) notation, while lvm and md devices just use their names.

Overrides: GRUB.grub_device_name

write_config_console(self, config)

source code 

Write console-related configuration.

Overrides: BootLoader.write_config_console
(inherited documentation)

write_device_map(self)

source code 

Write out a device map containing all supported devices.

Overrides: GRUB.write_device_map

_encrypt_password(self)

source code 

Make sure self.encrypted_password is set up properly.

Overrides: GRUB._encrypt_password

write_config(self)

source code 

Write bootloader configuration to disk.

Overrides: BootLoader.write_config
(inherited documentation)

install(self)

source code 
Overrides: BootLoader.install

Class Variable Details [hide private]

stage2_device_types

Value:
["partition", "mdarray", "lvmlv", "btrfs volume"]

stage2_raid_levels

Value:
[mdraid.RAID0, mdraid.RAID1, mdraid.RAID4, mdraid.RAID5, mdraid.RAID6,\
 mdraid.RAID10]