#!/usr/bin/env python
#
# FreeBSD VM image
#
# Copyright 2017 Red Hat Inc.
#
# Authors:
#  Fam Zheng <famz@redhat.com>
#
# This code is licensed under the GPL version 2 or later.  See
# the COPYING file in the top-level directory.
#

import os
import sys
import subprocess
import basevm

class FreeBSDVM(basevm.BaseVM):
    name = "freebsd"
    arch = "x86_64"
    BUILD_SCRIPT = """
        set -e;
        rm -rf /var/tmp/qemu-test.*
        cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
        tar -xf /dev/vtbd1;
        ./configure {configure_opts};
        gmake --output-sync -j{jobs} {target} {verbose};
    """

    def build_image(self, img):
        cimg = self._download_with_cache("http://download.patchew.org/freebsd-11.1-amd64.img.xz",
                sha256sum='adcb771549b37bc63826c501f05121a206ed3d9f55f49145908f7e1432d65891')
        img_tmp_xz = img + ".tmp.xz"
        img_tmp = img + ".tmp"
        sys.stderr.write("Extracting the image...\n")
        subprocess.check_call(["cp", "-f", cimg, img_tmp_xz])
        subprocess.check_call(["xz", "-dvf", img_tmp_xz])
        if os.path.exists(img):
            os.remove(img)
        os.rename(img_tmp, img)

if __name__ == "__main__":
    sys.exit(basevm.main(FreeBSDVM))
