Example #1
0
    def setup_boot(self, devices, path):
        first_device, partitions = find_first_device(devices)

        tmp_devicemap = generate_devicemap(devices)
        log.info("Writing temporary device.map")
        write_mounted(self.mountpoint, "boot/grub/device.map", tmp_devicemap)

        log.info("Installing grub on first device")
        self.chroot(path, "grub-install", "--no-floppy", first_device)
    def setup_boot(self, devices, path):
        first_device, partitions = find_first_device(devices)

        tmp_devicemap = generate_devicemap(devices)
        log.info("Writing temporary device.map")
        write_mounted(self.mountpoint, "boot/grub/device.map", tmp_devicemap)

        log.info("Installing grub on first device")
        self.chroot(path, "grub-install", "--no-floppy", first_device)
Example #3
0
def action(ns):
    if not os.path.isfile(ns.path):
        raise Exception("Missing image file: {0}".format(ns.path))

    if ns.selections is None:
        ns.selections = os.path.join(ns.root, "selections", "default")

    if not os.path.isfile(ns.selections):
        raise Exception("Missing selections file: {0}".format(ns.selections))

    with entered_system(ns.path, ns.volume_group, ns.mountpoint) as d:
        devices, logical_volumes, path = d

        # find first device as soon as possible
        first_device = find_first_device(devices)
        apt_env = dict(APTITUDE_ENV)

        log.info("Configuring apt")
        configure_base_system(ns, apt_env, path)

        log.info("Install selected packages")
        if ns.download:
            download_selections(ns, apt_env, path)
        else:
            install_selections(ns, apt_env, path)

        tmp_devicemap = generate_temporary_devicemap(devices)
        log.info("Writing temporary device.map")
        write_mounted(ns.mountpoint, "boot/grub/device.map", tmp_devicemap)

        log.info("Installing grub on first device")
        chroot(path, "grub-install", "--no-floppy", first_device)

        log.info("Writing fstab")
        fstab = generate_fstab(ns)
        write_mounted(ns.mountpoint, "etc/fstab", fstab)

        log.info("Writing real device.map")
        new_devicemap = generate_devicemap(ns, logical_volumes)
        write_mounted(ns.mountpoint, "boot/grub/device.map", new_devicemap)

        manifest = ns.config.get("manifest")
        postinst = ns.config.get("postinst")

        if manifest:
            install_manifest(ns, manifest)

        if postinst:
            execute_postinst(ns, postinst)

    return 0
Example #4
0
def action(ns):
    if not os.path.isfile(ns.path):
        raise Exception("Missing image file: {0}".format(ns.path))

    if ns.selections is None:
        ns.selections = os.path.join(ns.root, "selections", "default")

    if not os.path.isfile(ns.selections):
        raise Exception("Missing selections file: {0}".format(ns.selections))

    with entered_system(ns.path, ns.volume_group, ns.mountpoint) as d:
        devices, logical_volumes, path = d

        # find first device as soon as possible
        first_device = find_first_device(devices)
        apt_env = dict(APTITUDE_ENV)

        log.info("Configuring apt")
        configure_base_system(ns, apt_env, path)

        log.info("Download selected packages (do not unpack or configure)")
        download_selections(ns, apt_env, path)

        tmp_devicemap = generate_temporary_devicemap(devices)
        log.info("Writing temporary device.map")
        write_mounted(ns.mountpoint, "boot/grub/device.map", tmp_devicemap)

        log.info("Installing grub on first device")
        chroot(path, "grub-install", "--no-floppy", first_device)

        log.info("Writing fstab")
        fstab = generate_fstab(ns)
        write_mounted(ns.mountpoint, "etc/fstab", fstab)

        log.info("Writing real device.map")
        new_devicemap = generate_devicemap(ns, logical_volumes)
        write_mounted(ns.mountpoint, "boot/grub/device.map", new_devicemap)

        manifest = ns.config.get("manifest")
        postinst = ns.config.get("postinst")

        if manifest:
            install_manifest(ns, manifest)

        if postinst:
            execute_postinst(ns, postinst)

    return 0
Example #5
0
        def __ec2_extra_mounts(devices, logical_volumes):
            first_device, partitions = find_first_device(devices)

            return mounted_device(partitions[0],
                                  "{0}/boot".format(self.mountpoint))
Example #6
0
        def __ec2_extra_mounts(devices, logical_volumes):
            first_device, partitions = find_first_device(devices)

            return mounted_device(
                partitions[0], "{0}/boot".format(self.mountpoint))