/* fedora-installer.c generated by valac 0.15.0.38-5123-dirty, the Vala compiler
 * generated from fedora-installer.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <osinfo/osinfo.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <libvirt-gconfig/libvirt-gconfig.h>
#include <gio/gio.h>


#define BOXES_TYPE_INSTALLER_MEDIA (boxes_installer_media_get_type ())
#define BOXES_INSTALLER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMedia))
#define BOXES_INSTALLER_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMediaClass))
#define BOXES_IS_INSTALLER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_INSTALLER_MEDIA))
#define BOXES_IS_INSTALLER_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_INSTALLER_MEDIA))
#define BOXES_INSTALLER_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMediaClass))

typedef struct _BoxesInstallerMedia BoxesInstallerMedia;
typedef struct _BoxesInstallerMediaClass BoxesInstallerMediaClass;
typedef struct _BoxesInstallerMediaPrivate BoxesInstallerMediaPrivate;

#define BOXES_TYPE_UNATTENDED_INSTALLER (boxes_unattended_installer_get_type ())
#define BOXES_UNATTENDED_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UNATTENDED_INSTALLER, BoxesUnattendedInstaller))
#define BOXES_UNATTENDED_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_UNATTENDED_INSTALLER, BoxesUnattendedInstallerClass))
#define BOXES_IS_UNATTENDED_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UNATTENDED_INSTALLER))
#define BOXES_IS_UNATTENDED_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_UNATTENDED_INSTALLER))
#define BOXES_UNATTENDED_INSTALLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_UNATTENDED_INSTALLER, BoxesUnattendedInstallerClass))

typedef struct _BoxesUnattendedInstaller BoxesUnattendedInstaller;
typedef struct _BoxesUnattendedInstallerClass BoxesUnattendedInstallerClass;
typedef struct _BoxesUnattendedInstallerPrivate BoxesUnattendedInstallerPrivate;

#define BOXES_TYPE_FEDORA_INSTALLER (boxes_fedora_installer_get_type ())
#define BOXES_FEDORA_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_FEDORA_INSTALLER, BoxesFedoraInstaller))
#define BOXES_FEDORA_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_FEDORA_INSTALLER, BoxesFedoraInstallerClass))
#define BOXES_IS_FEDORA_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_FEDORA_INSTALLER))
#define BOXES_IS_FEDORA_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_FEDORA_INSTALLER))
#define BOXES_FEDORA_INSTALLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_FEDORA_INSTALLER, BoxesFedoraInstallerClass))

typedef struct _BoxesFedoraInstaller BoxesFedoraInstaller;
typedef struct _BoxesFedoraInstallerClass BoxesFedoraInstallerClass;
typedef struct _BoxesFedoraInstallerPrivate BoxesFedoraInstallerPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _BoxesFedoraInstallerPrepareDirectBootData BoxesFedoraInstallerPrepareDirectBootData;
typedef struct _BoxesFedoraInstallerNormalCleanUpData BoxesFedoraInstallerNormalCleanUpData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _BoxesFedoraInstallerMountMediaData BoxesFedoraInstallerMountMediaData;
typedef struct _BoxesFedoraInstallerExtractBootFilesData BoxesFedoraInstallerExtractBootFilesData;
typedef struct _BoxesFedoraInstallerCopyFileData BoxesFedoraInstallerCopyFileData;

struct _BoxesInstallerMedia {
	GObject parent_instance;
	BoxesInstallerMediaPrivate * priv;
	OsinfoOs* os;
	OsinfoMedia* os_media;
	gchar* label;
	gchar* device_file;
	gchar* mount_point;
	gboolean from_image;
};

struct _BoxesInstallerMediaClass {
	GObjectClass parent_class;
};

struct _BoxesUnattendedInstaller {
	BoxesInstallerMedia parent_instance;
	BoxesUnattendedInstallerPrivate * priv;
	gchar* unattended_src_path;
	gchar* unattended_dest_name;
	GDataStreamNewlineType newline_type;
	gchar* disk_path;
	GtkTable* setup_table;
	GtkLabel* setup_label;
	GtkHBox* setup_hbox;
	GtkSwitch* express_toggle;
	GtkEntry* username_entry;
	GtkEntry* password_entry;
	gchar* timezone;
	gchar* kbd;
	gchar* lang;
};

struct _BoxesUnattendedInstallerClass {
	BoxesInstallerMediaClass parent_class;
	void (*populate_setup_vbox) (BoxesUnattendedInstaller* self, GtkVBox* setup_vbox);
	void (*set_direct_boot_params) (BoxesUnattendedInstaller* self, GVirConfigDomainOs* os);
	GVirConfigDomainDisk* (*get_unattended_disk_config) (BoxesUnattendedInstaller* self);
	void (*setup_ui) (BoxesUnattendedInstaller* self);
	void (*clean_up) (BoxesUnattendedInstaller* self, GError** error);
	gchar* (*fill_unattended_data) (BoxesUnattendedInstaller* self, const gchar* data, GError** error);
	void (*prepare_direct_boot) (BoxesUnattendedInstaller* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*prepare_direct_boot_finish) (BoxesUnattendedInstaller* self, GAsyncResult* _res_, GError** error);
};

struct _BoxesFedoraInstaller {
	BoxesUnattendedInstaller parent_instance;
	BoxesFedoraInstallerPrivate * priv;
};

struct _BoxesFedoraInstallerClass {
	BoxesUnattendedInstallerClass parent_class;
};

struct _BoxesFedoraInstallerPrivate {
	gboolean mounted;
	GFile* source_dir;
	GFile* kernel_file;
	GFile* initrd_file;
	gchar* kernel_path;
	gchar* initrd_path;
};

struct _BoxesFedoraInstallerPrepareDirectBootData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesFedoraInstaller* self;
	GCancellable* cancellable;
	GtkSwitch* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	OsinfoMedia* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean _tmp8_;
	OsinfoMedia* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gboolean _tmp13_;
	GCancellable* _tmp14_;
	GCancellable* _tmp15_;
	GCancellable* _tmp16_;
	GError * _inner_error_;
};

struct _BoxesFedoraInstallerNormalCleanUpData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesFedoraInstaller* self;
	GCancellable* cancellable;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar** _tmp6_;
	gchar** argv;
	gint argv_length1;
	gint _argv_size_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	GCancellable* _tmp8_;
	const gchar* _tmp9_;
	GFile* _tmp10_;
	const gchar* _tmp11_;
	GError * _inner_error_;
};

struct _BoxesFedoraInstallerMountMediaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesFedoraInstaller* self;
	GCancellable* cancellable;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	OsinfoOs* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	GFile* _tmp8_;
	GFile* dir;
	GFile* _tmp9_;
	GError* _error_;
	GFile* _tmp10_;
	GFile* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gchar** argv;
	gint argv_length1;
	gint _argv_size_;
	gchar** _tmp20_;
	gint _tmp20__length1;
	GCancellable* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	GError * _inner_error_;
};

struct _BoxesFedoraInstallerExtractBootFilesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesFedoraInstaller* self;
	GCancellable* cancellable;
	const gchar* _tmp0_;
	OsinfoMedia* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	GFile* _tmp7_;
	const gchar* _tmp8_;
	OsinfoMedia* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	GFile* _tmp15_;
	gboolean _tmp16_;
	OsinfoOs* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	GFile* _tmp23_;
	const gchar* _tmp24_;
	GCancellable* _tmp25_;
	GFile* _tmp26_;
	GFile* _tmp27_;
	OsinfoOs* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	GFile* _tmp34_;
	const gchar* _tmp35_;
	GCancellable* _tmp36_;
	GFile* _tmp37_;
	GFile* _tmp38_;
	GError * _inner_error_;
};

struct _BoxesFedoraInstallerCopyFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesFedoraInstaller* self;
	GFile* file;
	gchar* dest_path;
	GCancellable* cancellable;
	GFile* result;
	const gchar* _tmp0_;
	GFile* _tmp1_;
	GFile* dest_file;
	GFile* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	GFile* _tmp6_;
	GCancellable* _tmp7_;
	GFile* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	GError* _error_;
	GError * _inner_error_;
};


static gpointer boxes_fedora_installer_parent_class = NULL;

GType boxes_installer_media_get_type (void) G_GNUC_CONST;
GType boxes_unattended_installer_get_type (void) G_GNUC_CONST;
GType boxes_fedora_installer_get_type (void) G_GNUC_CONST;
#define BOXES_FEDORA_INSTALLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_FEDORA_INSTALLER, BoxesFedoraInstallerPrivate))
enum  {
	BOXES_FEDORA_INSTALLER_DUMMY_PROPERTY
};
BoxesFedoraInstaller* boxes_fedora_installer_new_copy (BoxesInstallerMedia* media, GError** error);
BoxesFedoraInstaller* boxes_fedora_installer_construct_copy (GType object_type, BoxesInstallerMedia* media, GError** error);
gchar* boxes_get_unattended_dir (const gchar* file_name);
BoxesUnattendedInstaller* boxes_unattended_installer_construct_copy (GType object_type, BoxesInstallerMedia* media, const gchar* unattended_src_path, const gchar* unattended_dest_name, GError** error);
static void boxes_fedora_installer_real_set_direct_boot_params (BoxesUnattendedInstaller* base, GVirConfigDomainOs* os);
static void boxes_fedora_installer_real_prepare_direct_boot_data_free (gpointer _data);
static void boxes_fedora_installer_real_prepare_direct_boot (BoxesUnattendedInstaller* base, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean boxes_fedora_installer_real_prepare_direct_boot_co (BoxesFedoraInstallerPrepareDirectBootData* _data_);
static void boxes_fedora_installer_mount_media (BoxesFedoraInstaller* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_fedora_installer_mount_media_finish (BoxesFedoraInstaller* self, GAsyncResult* _res_, GError** error);
static void boxes_fedora_installer_prepare_direct_boot_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_fedora_installer_extract_boot_files (BoxesFedoraInstaller* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_fedora_installer_extract_boot_files_finish (BoxesFedoraInstaller* self, GAsyncResult* _res_, GError** error);
static void boxes_fedora_installer_normal_clean_up (BoxesFedoraInstaller* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_fedora_installer_normal_clean_up_finish (BoxesFedoraInstaller* self, GAsyncResult* _res_, GError** error);
static void boxes_fedora_installer_real_clean_up (BoxesUnattendedInstaller* base, GError** error);
void boxes_unattended_installer_clean_up (BoxesUnattendedInstaller* self, GError** error);
static void boxes_fedora_installer_normal_clean_up_data_free (gpointer _data);
static gboolean boxes_fedora_installer_normal_clean_up_co (BoxesFedoraInstallerNormalCleanUpData* _data_);
void boxes_unattended_installer_exec (BoxesUnattendedInstaller* self, gchar** argv, int argv_length1, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_unattended_installer_exec_finish (BoxesUnattendedInstaller* self, GAsyncResult* _res_, GError** error);
static void boxes_fedora_installer_normal_clean_up_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_fedora_installer_mount_media_data_free (gpointer _data);
static gboolean boxes_fedora_installer_mount_media_co (BoxesFedoraInstallerMountMediaData* _data_);
gchar* boxes_get_user_unattended_dir (const gchar* file_name);
static void boxes_fedora_installer_mount_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_fedora_installer_extract_boot_files_data_free (gpointer _data);
static gboolean boxes_fedora_installer_extract_boot_files_co (BoxesFedoraInstallerExtractBootFilesData* _data_);
static void boxes_fedora_installer_copy_file (BoxesFedoraInstaller* self, GFile* file, const gchar* dest_path, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GFile* boxes_fedora_installer_copy_file_finish (BoxesFedoraInstaller* self, GAsyncResult* _res_, GError** error);
static void boxes_fedora_installer_extract_boot_files_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_fedora_installer_copy_file_data_free (gpointer _data);
static gboolean boxes_fedora_installer_copy_file_co (BoxesFedoraInstallerCopyFileData* _data_);
static void boxes_fedora_installer_copy_file_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
BoxesFedoraInstaller* boxes_fedora_installer_new (void);
BoxesFedoraInstaller* boxes_fedora_installer_construct (GType object_type);
BoxesUnattendedInstaller* boxes_unattended_installer_construct (GType object_type);
static void boxes_fedora_installer_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


BoxesFedoraInstaller* boxes_fedora_installer_construct_copy (GType object_type, BoxesInstallerMedia* media, GError** error) {
	BoxesFedoraInstaller * self = NULL;
	gchar* _tmp0_ = NULL;
	gchar* source_path;
	BoxesInstallerMedia* _tmp1_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (media != NULL, NULL);
	_tmp0_ = boxes_get_unattended_dir ("fedora.ks");
	source_path = _tmp0_;
	_tmp1_ = media;
	self = (BoxesFedoraInstaller*) boxes_unattended_installer_construct_copy (object_type, _tmp1_, source_path, "ks.cfg", &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_free0 (source_path);
		_g_object_unref0 (self);
		return NULL;
	}
	_g_free0 (source_path);
	return self;
}


BoxesFedoraInstaller* boxes_fedora_installer_new_copy (BoxesInstallerMedia* media, GError** error) {
	return boxes_fedora_installer_construct_copy (BOXES_TYPE_FEDORA_INSTALLER, media, error);
}


static void boxes_fedora_installer_real_set_direct_boot_params (BoxesUnattendedInstaller* base, GVirConfigDomainOs* os) {
	BoxesFedoraInstaller * self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	gboolean _tmp3_;
	GVirConfigDomainOs* _tmp4_;
	const gchar* _tmp5_;
	GVirConfigDomainOs* _tmp6_;
	const gchar* _tmp7_;
	GVirConfigDomainOs* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	self = (BoxesFedoraInstaller*) base;
	g_return_if_fail (os != NULL);
	_tmp1_ = self->priv->kernel_path;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->initrd_path;
		_tmp0_ = _tmp2_ == NULL;
	}
	_tmp3_ = _tmp0_;
	if (_tmp3_) {
		return;
	}
	_tmp4_ = os;
	_tmp5_ = self->priv->kernel_path;
	gvir_config_domain_os_set_kernel (_tmp4_, _tmp5_);
	_tmp6_ = os;
	_tmp7_ = self->priv->initrd_path;
	gvir_config_domain_os_set_ramdisk (_tmp6_, _tmp7_);
	_tmp8_ = os;
	_tmp9_ = ((BoxesUnattendedInstaller*) self)->unattended_dest_name;
	_tmp10_ = g_strconcat ("ks=hd:sdb:", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	gvir_config_domain_os_set_cmdline (_tmp8_, _tmp11_);
	_g_free0 (_tmp11_);
}


static void boxes_fedora_installer_real_prepare_direct_boot_data_free (gpointer _data) {
	BoxesFedoraInstallerPrepareDirectBootData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesFedoraInstallerPrepareDirectBootData, _data_);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void boxes_fedora_installer_real_prepare_direct_boot (BoxesUnattendedInstaller* base, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesFedoraInstaller * self;
	BoxesFedoraInstallerPrepareDirectBootData* _data_;
	BoxesFedoraInstaller* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	self = (BoxesFedoraInstaller*) base;
	_data_ = g_slice_new0 (BoxesFedoraInstallerPrepareDirectBootData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_fedora_installer_real_prepare_direct_boot);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_fedora_installer_real_prepare_direct_boot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = cancellable;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->cancellable = _tmp2_;
	boxes_fedora_installer_real_prepare_direct_boot_co (_data_);
}


static void boxes_fedora_installer_real_prepare_direct_boot_finish (BoxesUnattendedInstaller* base, GAsyncResult* _res_, GError** error) {
	BoxesFedoraInstallerPrepareDirectBootData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void boxes_fedora_installer_prepare_direct_boot_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesFedoraInstallerPrepareDirectBootData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_fedora_installer_real_prepare_direct_boot_co (_data_);
}


static gboolean boxes_fedora_installer_real_prepare_direct_boot_co (BoxesFedoraInstallerPrepareDirectBootData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = ((BoxesUnattendedInstaller*) _data_->self)->express_toggle;
	_data_->_tmp1_ = gtk_switch_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (!_data_->_tmp2_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = ((BoxesInstallerMedia*) _data_->self)->os_media;
	_data_->_tmp5_ = NULL;
	g_object_get (_data_->_tmp4_, "kernel-path", &_data_->_tmp5_, NULL);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_ == NULL;
	_g_free0 (_data_->_tmp7_);
	if (_data_->_tmp8_) {
		_data_->_tmp3_ = TRUE;
	} else {
		_data_->_tmp9_ = ((BoxesInstallerMedia*) _data_->self)->os_media;
		_data_->_tmp10_ = NULL;
		g_object_get (_data_->_tmp9_, "initrd-path", &_data_->_tmp10_, NULL);
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp3_ = _data_->_tmp12_ == NULL;
		_g_free0 (_data_->_tmp12_);
	}
	_data_->_tmp13_ = _data_->_tmp3_;
	if (_data_->_tmp13_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp14_ = _data_->cancellable;
	_data_->_state_ = 1;
	boxes_fedora_installer_mount_media (_data_->self, _data_->_tmp14_, boxes_fedora_installer_prepare_direct_boot_ready, _data_);
	return FALSE;
	_state_1:
	boxes_fedora_installer_mount_media_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = _data_->cancellable;
	_data_->_state_ = 2;
	boxes_fedora_installer_extract_boot_files (_data_->self, _data_->_tmp15_, boxes_fedora_installer_prepare_direct_boot_ready, _data_);
	return FALSE;
	_state_2:
	boxes_fedora_installer_extract_boot_files_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp16_ = _data_->cancellable;
	_data_->_state_ = 3;
	boxes_fedora_installer_normal_clean_up (_data_->self, _data_->_tmp16_, boxes_fedora_installer_prepare_direct_boot_ready, _data_);
	return FALSE;
	_state_3:
	boxes_fedora_installer_normal_clean_up_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void boxes_fedora_installer_real_clean_up (BoxesUnattendedInstaller* base, GError** error) {
	BoxesFedoraInstaller * self;
	GFile* _tmp0_;
	GFile* _tmp4_;
	GError * _inner_error_ = NULL;
	self = (BoxesFedoraInstaller*) base;
	BOXES_UNATTENDED_INSTALLER_CLASS (boxes_fedora_installer_parent_class)->clean_up (BOXES_UNATTENDED_INSTALLER (self), &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	_tmp0_ = self->priv->kernel_file;
	if (_tmp0_ != NULL) {
		const gchar* _tmp1_;
		GFile* _tmp2_;
		const gchar* _tmp3_;
		_tmp1_ = self->priv->kernel_path;
		g_debug ("fedora-installer.vala:46: Removing '%s'..", _tmp1_);
		_tmp2_ = self->priv->kernel_file;
		g_file_delete (_tmp2_, NULL, &_inner_error_);
		if (_inner_error_ != NULL) {
			g_propagate_error (error, _inner_error_);
			return;
		}
		_tmp3_ = self->priv->kernel_path;
		g_debug ("fedora-installer.vala:48: Removed '%s'.", _tmp3_);
	}
	_tmp4_ = self->priv->initrd_file;
	if (_tmp4_ != NULL) {
		const gchar* _tmp5_;
		GFile* _tmp6_;
		const gchar* _tmp7_;
		_tmp5_ = self->priv->initrd_path;
		g_debug ("fedora-installer.vala:52: Removing '%s'..", _tmp5_);
		_tmp6_ = self->priv->initrd_file;
		g_file_delete (_tmp6_, NULL, &_inner_error_);
		if (_inner_error_ != NULL) {
			g_propagate_error (error, _inner_error_);
			return;
		}
		_tmp7_ = self->priv->initrd_path;
		g_debug ("fedora-installer.vala:54: Removed '%s'.", _tmp7_);
	}
}


static void boxes_fedora_installer_normal_clean_up_data_free (gpointer _data) {
	BoxesFedoraInstallerNormalCleanUpData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesFedoraInstallerNormalCleanUpData, _data_);
}


static void boxes_fedora_installer_normal_clean_up (BoxesFedoraInstaller* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesFedoraInstallerNormalCleanUpData* _data_;
	BoxesFedoraInstaller* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	_data_ = g_slice_new0 (BoxesFedoraInstallerNormalCleanUpData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_fedora_installer_normal_clean_up);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_fedora_installer_normal_clean_up_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = cancellable;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->cancellable = _tmp2_;
	boxes_fedora_installer_normal_clean_up_co (_data_);
}


static void boxes_fedora_installer_normal_clean_up_finish (BoxesFedoraInstaller* self, GAsyncResult* _res_, GError** error) {
	BoxesFedoraInstallerNormalCleanUpData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void boxes_fedora_installer_normal_clean_up_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesFedoraInstallerNormalCleanUpData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_fedora_installer_normal_clean_up_co (_data_);
}


static gboolean boxes_fedora_installer_normal_clean_up_co (BoxesFedoraInstallerNormalCleanUpData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->mounted;
	if (!_data_->_tmp0_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	g_debug ("fedora-installer.vala:62: Unmounting '%s'..", _data_->_tmp1_);
	_data_->_tmp2_ = g_strdup ("fusermount");
	_data_->_tmp3_ = g_strdup ("-u");
	_data_->_tmp4_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	_data_->_tmp5_ = g_strdup (_data_->_tmp4_);
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = g_new0 (gchar*, 3 + 1);
	_data_->_tmp6_[0] = _data_->_tmp2_;
	_data_->_tmp6_[1] = _data_->_tmp3_;
	_data_->_tmp6_[2] = _data_->_tmp5_;
	_data_->argv = _data_->_tmp6_;
	_data_->argv_length1 = 3;
	_data_->_argv_size_ = _data_->argv_length1;
	_data_->_tmp7_ = _data_->argv;
	_data_->_tmp7__length1 = _data_->argv_length1;
	_data_->_tmp8_ = _data_->cancellable;
	_data_->_state_ = 1;
	boxes_unattended_installer_exec ((BoxesUnattendedInstaller*) _data_->self, _data_->_tmp7_, _data_->_tmp7__length1, _data_->_tmp8_, boxes_fedora_installer_normal_clean_up_ready, _data_);
	return FALSE;
	_state_1:
	boxes_unattended_installer_exec_finish ((BoxesUnattendedInstaller*) _data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	g_debug ("fedora-installer.vala:65: Unmounted '%s'.", _data_->_tmp9_);
	_data_->_tmp10_ = _data_->self->priv->source_dir;
	g_file_delete (_data_->_tmp10_, NULL, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	g_debug ("fedora-installer.vala:68: Removed '%s'.", _data_->_tmp11_);
	_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void boxes_fedora_installer_mount_media_data_free (gpointer _data) {
	BoxesFedoraInstallerMountMediaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesFedoraInstallerMountMediaData, _data_);
}


static void boxes_fedora_installer_mount_media (BoxesFedoraInstaller* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesFedoraInstallerMountMediaData* _data_;
	BoxesFedoraInstaller* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	_data_ = g_slice_new0 (BoxesFedoraInstallerMountMediaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_fedora_installer_mount_media);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_fedora_installer_mount_media_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = cancellable;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->cancellable = _tmp2_;
	boxes_fedora_installer_mount_media_co (_data_);
}


static void boxes_fedora_installer_mount_media_finish (BoxesFedoraInstaller* self, GAsyncResult* _res_, GError** error) {
	BoxesFedoraInstallerMountMediaData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void boxes_fedora_installer_mount_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesFedoraInstallerMountMediaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_fedora_installer_mount_media_co (_data_);
}


static gboolean boxes_fedora_installer_mount_media_co (BoxesFedoraInstallerMountMediaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = g_file_new_for_path (_data_->_tmp1_);
		_g_object_unref0 (_data_->self->priv->source_dir);
		_data_->self->priv->source_dir = _data_->_tmp2_;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = ((BoxesInstallerMedia*) _data_->self)->os;
	_data_->_tmp4_ = osinfo_product_get_short_id ((OsinfoProduct*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = boxes_get_user_unattended_dir (_data_->_tmp5_);
	_g_free0 (((BoxesInstallerMedia*) _data_->self)->mount_point);
	((BoxesInstallerMedia*) _data_->self)->mount_point = _data_->_tmp6_;
	_data_->_tmp7_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = g_file_new_for_path (_data_->_tmp7_);
	_data_->dir = _data_->_tmp8_;
	{
		_data_->_tmp9_ = _data_->dir;
		g_file_make_directory (_data_->_tmp9_, NULL, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			if (g_error_matches (_data_->_inner_error_, G_IO_ERROR, G_IO_ERROR_EXISTS)) {
				goto __catch9_g_io_error_exists;
			}
			goto __finally9;
		}
	}
	goto __finally9;
	__catch9_g_io_error_exists:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_g_error_free0 (_data_->_error_);
	}
	__finally9:
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_object_unref0 (_data_->dir);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp10_ = _data_->dir;
	_data_->_tmp11_ = _g_object_ref0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->self->priv->source_dir);
	_data_->self->priv->source_dir = _data_->_tmp11_;
	_data_->_tmp12_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
	_data_->_tmp13_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	g_debug ("fedora-installer.vala:85: Mounting '%s' on '%s'..", _data_->_tmp12_, _data_->_tmp13_);
	_data_->_tmp14_ = g_strdup ("fuseiso");
	_data_->_tmp15_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
	_data_->_tmp16_ = g_strdup (_data_->_tmp15_);
	_data_->_tmp17_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
	_data_->_tmp19_ = NULL;
	_data_->_tmp19_ = g_new0 (gchar*, 3 + 1);
	_data_->_tmp19_[0] = _data_->_tmp14_;
	_data_->_tmp19_[1] = _data_->_tmp16_;
	_data_->_tmp19_[2] = _data_->_tmp18_;
	_data_->argv = _data_->_tmp19_;
	_data_->argv_length1 = 3;
	_data_->_argv_size_ = _data_->argv_length1;
	_data_->_tmp20_ = _data_->argv;
	_data_->_tmp20__length1 = _data_->argv_length1;
	_data_->_tmp21_ = _data_->cancellable;
	_data_->_state_ = 1;
	boxes_unattended_installer_exec ((BoxesUnattendedInstaller*) _data_->self, _data_->_tmp20_, _data_->_tmp20__length1, _data_->_tmp21_, boxes_fedora_installer_mount_media_ready, _data_);
	return FALSE;
	_state_1:
	boxes_unattended_installer_exec_finish ((BoxesUnattendedInstaller*) _data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (_data_->dir);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp22_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
	_data_->_tmp23_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	g_debug ("fedora-installer.vala:88: '%s' now mounted on '%s'.", _data_->_tmp22_, _data_->_tmp23_);
	_data_->self->priv->mounted = TRUE;
	_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (_data_->dir);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void boxes_fedora_installer_extract_boot_files_data_free (gpointer _data) {
	BoxesFedoraInstallerExtractBootFilesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesFedoraInstallerExtractBootFilesData, _data_);
}


static void boxes_fedora_installer_extract_boot_files (BoxesFedoraInstaller* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesFedoraInstallerExtractBootFilesData* _data_;
	BoxesFedoraInstaller* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	_data_ = g_slice_new0 (BoxesFedoraInstallerExtractBootFilesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_fedora_installer_extract_boot_files);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_fedora_installer_extract_boot_files_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = cancellable;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->cancellable = _tmp2_;
	boxes_fedora_installer_extract_boot_files_co (_data_);
}


static void boxes_fedora_installer_extract_boot_files_finish (BoxesFedoraInstaller* self, GAsyncResult* _res_, GError** error) {
	BoxesFedoraInstallerExtractBootFilesData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void boxes_fedora_installer_extract_boot_files_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesFedoraInstallerExtractBootFilesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_fedora_installer_extract_boot_files_co (_data_);
}


static gboolean boxes_fedora_installer_extract_boot_files_co (BoxesFedoraInstallerExtractBootFilesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	_data_->_tmp1_ = ((BoxesInstallerMedia*) _data_->self)->os_media;
	_data_->_tmp2_ = NULL;
	g_object_get (_data_->_tmp1_, "kernel-path", &_data_->_tmp2_, NULL);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = g_build_filename (_data_->_tmp0_, _data_->_tmp4_, NULL);
	_g_free0 (_data_->self->priv->kernel_path);
	_data_->self->priv->kernel_path = _data_->_tmp5_;
	_g_free0 (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->self->priv->kernel_path;
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = g_file_new_for_path (_data_->_tmp6_);
	_g_object_unref0 (_data_->self->priv->kernel_file);
	_data_->self->priv->kernel_file = _data_->_tmp7_;
	_data_->_tmp8_ = ((BoxesInstallerMedia*) _data_->self)->mount_point;
	_data_->_tmp9_ = ((BoxesInstallerMedia*) _data_->self)->os_media;
	_data_->_tmp10_ = NULL;
	g_object_get (_data_->_tmp9_, "initrd-path", &_data_->_tmp10_, NULL);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = NULL;
	_data_->_tmp13_ = g_build_filename (_data_->_tmp8_, _data_->_tmp12_, NULL);
	_g_free0 (_data_->self->priv->initrd_path);
	_data_->self->priv->initrd_path = _data_->_tmp13_;
	_g_free0 (_data_->_tmp12_);
	_data_->_tmp14_ = _data_->self->priv->initrd_path;
	_data_->_tmp15_ = NULL;
	_data_->_tmp15_ = g_file_new_for_path (_data_->_tmp14_);
	_g_object_unref0 (_data_->self->priv->initrd_file);
	_data_->self->priv->initrd_file = _data_->_tmp15_;
	_data_->_tmp16_ = _data_->self->priv->mounted;
	if (!_data_->_tmp16_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp17_ = ((BoxesInstallerMedia*) _data_->self)->os;
	_data_->_tmp18_ = osinfo_product_get_short_id ((OsinfoProduct*) _data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = g_strconcat (_data_->_tmp19_, "-kernel", NULL);
	_data_->_tmp21_ = _data_->_tmp20_;
	_data_->_tmp22_ = NULL;
	_data_->_tmp22_ = boxes_get_user_unattended_dir (_data_->_tmp21_);
	_g_free0 (_data_->self->priv->kernel_path);
	_data_->self->priv->kernel_path = _data_->_tmp22_;
	_g_free0 (_data_->_tmp21_);
	_data_->_tmp23_ = _data_->self->priv->kernel_file;
	_data_->_tmp24_ = _data_->self->priv->kernel_path;
	_data_->_tmp25_ = _data_->cancellable;
	_data_->_state_ = 1;
	boxes_fedora_installer_copy_file (_data_->self, _data_->_tmp23_, _data_->_tmp24_, _data_->_tmp25_, boxes_fedora_installer_extract_boot_files_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp26_ = NULL;
	_data_->_tmp26_ = boxes_fedora_installer_copy_file_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	_data_->_tmp27_ = _data_->_tmp26_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->self->priv->kernel_file);
	_data_->self->priv->kernel_file = _data_->_tmp27_;
	_data_->_tmp28_ = ((BoxesInstallerMedia*) _data_->self)->os;
	_data_->_tmp29_ = osinfo_product_get_short_id ((OsinfoProduct*) _data_->_tmp28_);
	_data_->_tmp30_ = _data_->_tmp29_;
	_data_->_tmp31_ = g_strconcat (_data_->_tmp30_, "-initrd", NULL);
	_data_->_tmp32_ = _data_->_tmp31_;
	_data_->_tmp33_ = NULL;
	_data_->_tmp33_ = boxes_get_user_unattended_dir (_data_->_tmp32_);
	_g_free0 (_data_->self->priv->initrd_path);
	_data_->self->priv->initrd_path = _data_->_tmp33_;
	_g_free0 (_data_->_tmp32_);
	_data_->_tmp34_ = _data_->self->priv->initrd_file;
	_data_->_tmp35_ = _data_->self->priv->initrd_path;
	_data_->_tmp36_ = _data_->cancellable;
	_data_->_state_ = 2;
	boxes_fedora_installer_copy_file (_data_->self, _data_->_tmp34_, _data_->_tmp35_, _data_->_tmp36_, boxes_fedora_installer_extract_boot_files_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp37_ = NULL;
	_data_->_tmp37_ = boxes_fedora_installer_copy_file_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	_data_->_tmp38_ = _data_->_tmp37_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->self->priv->initrd_file);
	_data_->self->priv->initrd_file = _data_->_tmp38_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void boxes_fedora_installer_copy_file_data_free (gpointer _data) {
	BoxesFedoraInstallerCopyFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file);
	_g_free0 (_data_->dest_path);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesFedoraInstallerCopyFileData, _data_);
}


static void boxes_fedora_installer_copy_file (BoxesFedoraInstaller* self, GFile* file, const gchar* dest_path, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesFedoraInstallerCopyFileData* _data_;
	BoxesFedoraInstaller* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GCancellable* _tmp5_;
	GCancellable* _tmp6_;
	_data_ = g_slice_new0 (BoxesFedoraInstallerCopyFileData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_fedora_installer_copy_file);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_fedora_installer_copy_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = file;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->file = _tmp2_;
	_tmp3_ = dest_path;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->dest_path = _tmp4_;
	_tmp5_ = cancellable;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	_data_->cancellable = _tmp6_;
	boxes_fedora_installer_copy_file_co (_data_);
}


static GFile* boxes_fedora_installer_copy_file_finish (BoxesFedoraInstaller* self, GAsyncResult* _res_, GError** error) {
	GFile* result;
	BoxesFedoraInstallerCopyFileData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void boxes_fedora_installer_copy_file_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesFedoraInstallerCopyFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_fedora_installer_copy_file_co (_data_);
}


static gboolean boxes_fedora_installer_copy_file_co (BoxesFedoraInstallerCopyFileData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->dest_path;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = g_file_new_for_path (_data_->_tmp0_);
	_data_->dest_file = _data_->_tmp1_;
	{
		_data_->_tmp2_ = _data_->file;
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = g_file_get_path (_data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = _data_->dest_path;
		g_debug ("fedora-installer.vala:112: Copying '%s' to '%s'..", _data_->_tmp4_, _data_->_tmp5_);
		_g_free0 (_data_->_tmp4_);
		_data_->_tmp6_ = _data_->file;
		_data_->_tmp7_ = _data_->cancellable;
		_data_->_state_ = 1;
		g_file_copy_async (_data_->_tmp6_, _data_->dest_file, 0, G_PRIORITY_DEFAULT, _data_->_tmp7_, NULL, NULL, boxes_fedora_installer_copy_file_ready, _data_);
		return FALSE;
		_state_1:
		g_file_copy_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			if (g_error_matches (_data_->_inner_error_, G_IO_ERROR, G_IO_ERROR_EXISTS)) {
				goto __catch10_g_io_error_exists;
			}
			goto __finally10;
		}
		_data_->_tmp8_ = _data_->file;
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = g_file_get_path (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->dest_path;
		g_debug ("fedora-installer.vala:114: Copied '%s' to '%s'.", _data_->_tmp10_, _data_->_tmp11_);
		_g_free0 (_data_->_tmp10_);
	}
	goto __finally10;
	__catch10_g_io_error_exists:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_g_error_free0 (_data_->_error_);
	}
	__finally10:
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_object_unref0 (_data_->dest_file);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->dest_file;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->dest_file);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


BoxesFedoraInstaller* boxes_fedora_installer_construct (GType object_type) {
	BoxesFedoraInstaller * self = NULL;
	self = (BoxesFedoraInstaller*) boxes_unattended_installer_construct (object_type);
	return self;
}


BoxesFedoraInstaller* boxes_fedora_installer_new (void) {
	return boxes_fedora_installer_construct (BOXES_TYPE_FEDORA_INSTALLER);
}


static void boxes_fedora_installer_class_init (BoxesFedoraInstallerClass * klass) {
	boxes_fedora_installer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesFedoraInstallerPrivate));
	BOXES_UNATTENDED_INSTALLER_CLASS (klass)->set_direct_boot_params = boxes_fedora_installer_real_set_direct_boot_params;
	BOXES_UNATTENDED_INSTALLER_CLASS (klass)->prepare_direct_boot = boxes_fedora_installer_real_prepare_direct_boot;
	BOXES_UNATTENDED_INSTALLER_CLASS (klass)->prepare_direct_boot_finish = boxes_fedora_installer_real_prepare_direct_boot_finish;
	BOXES_UNATTENDED_INSTALLER_CLASS (klass)->clean_up = boxes_fedora_installer_real_clean_up;
	G_OBJECT_CLASS (klass)->finalize = boxes_fedora_installer_finalize;
}


static void boxes_fedora_installer_instance_init (BoxesFedoraInstaller * self) {
	self->priv = BOXES_FEDORA_INSTALLER_GET_PRIVATE (self);
}


static void boxes_fedora_installer_finalize (GObject* obj) {
	BoxesFedoraInstaller * self;
	self = BOXES_FEDORA_INSTALLER (obj);
	_g_object_unref0 (self->priv->source_dir);
	_g_object_unref0 (self->priv->kernel_file);
	_g_object_unref0 (self->priv->initrd_file);
	_g_free0 (self->priv->kernel_path);
	_g_free0 (self->priv->initrd_path);
	G_OBJECT_CLASS (boxes_fedora_installer_parent_class)->finalize (obj);
}


GType boxes_fedora_installer_get_type (void) {
	static volatile gsize boxes_fedora_installer_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_fedora_installer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesFedoraInstallerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_fedora_installer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesFedoraInstaller), 0, (GInstanceInitFunc) boxes_fedora_installer_instance_init, NULL };
		GType boxes_fedora_installer_type_id;
		boxes_fedora_installer_type_id = g_type_register_static (BOXES_TYPE_UNATTENDED_INSTALLER, "BoxesFedoraInstaller", &g_define_type_info, 0);
		g_once_init_leave (&boxes_fedora_installer_type_id__volatile, boxes_fedora_installer_type_id);
	}
	return boxes_fedora_installer_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



