/usr/lib/python2.7/dist-packages/provisioningserver/boot/install_grub.py is in python-maas-provisioningserver 1.5.4+bzr2294-0ubuntu1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | # Copyright 2014 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Install a GRUB2 pre-boot loader config for TFTP download."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = type
__all__ = [
"add_arguments",
"run",
]
import os.path
from provisioningserver.boot.install_bootloader import make_destination
from provisioningserver.config import Config
from provisioningserver.utils import write_text_file
CONFIG_FILE = """
# MAAS GRUB2 pre-loader configuration file
# Load based on MAC address first.
configfile (pxe)/grub/grub.cfg-${net_default_mac}
# Failed to load based on MAC address.
# Load amd64 by default, UEFI only supported by 64-bit
configfile (pxe)/grub/grub.cfg-default-amd64
"""
def add_arguments(parser):
pass
def run(args):
"""Install a GRUB2 pre-boot loader config into the TFTP
directory structure.
"""
config = Config.load(args.config_file)
grubroot = os.path.join(config["tftp"]["resource_root"], 'grub')
destination_path = make_destination(grubroot)
write_text_file(os.path.join(destination_path, 'grub.cfg'), CONFIG_FILE)
|