#!/usr/bin/env bash
# Say Hello to Vasile, a modular script to build Redcore Linux packages && ISO images using a clean squashfs + overlayfs chroot
# Main author : Ghiunhan Mamut (aka V3n3RiX)
# LICENSE: GPL v2 Ghiunhan Mamut & Rogentos Team ( original license authors )
# Dependencies : kernel built with squashfs + overlayfs + loopback support && sys-fs/grub:2 && sys-fs/squashfs-tools && dev-libs/libisoburn && sys-fs/mtools
#

# Import our variables and functions

source /lib64/avasile/libavasile

# Vasile need root privileges and a proper kernel to run
# Also, running it in live mode is a really bad idea

checkiflive


case $1 in
	--status)
		checkmode
		;;
	--makepkg)
		kernelconfig
		makepkg
		;;
	--makeiso)
		kernelconfig
		makeiso "$@"
		;;
	--resetmode)
		resetmode
		;;
	--usermode)
		binmode
		;;
	--devmode)
		mixedmode
		;;
	--srcmode)
		srcmode
		;;
	--custom)
		srccustom
		;;
	--decentralize-user)
		decentralized_user
		;;
	--decentralize-dev)
		decentralized_devel
		;;
	--decentralize-source)
		decentralized_source
		;;
	--decentralize-custom)
		decentralized_custom
		;;
	--decentralize-gentoo)
		decentralized_gentoo
		;;
	--help)
		showhelp
		;;
	*)
		eerror "error: no operation specified, use --help for help"
		;;
esac

exit 0
