summaryrefslogtreecommitdiff
path: root/libvasile
blob: aa08f91e7b7d3b09c3dcead7fc7170dc8a4a6fde (plain)
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
51
52
# env mount variables
export local rodir="rodir"
export local rwdir="rwdir"
export local overlaydir="overlaydir"

# env user variable
export local envkogaionuser="root"

# env target variable (can be a single package, multiple packages, or a target file passed as parameter)
export local envkogaiontarget="${@:2}"
export local envkogaionbuildtarget="emerge -kav "$envkogaiontarget""

# env buildsystem variables
export local envkogaionoverlay="layman -f -a kogaion -o https://raw.github.com/Rogentos/kogaion/master/overlay.xml"
export local envkogaiondesktopoverlay="layman -f -a kogaion-desktop -o https://raw.github.com/Rogentos/kogaion-desktop/master/overlay.xml"
export local envkogaionbuildgit="cd /opt && git clone https://github.com/Rogentos/build.git"
export local envkogaionportageconfig="ln -sf /opt/build/conf/intel/portage /etc/portage"
export local envkogaionenvupdate="/usr/sbin/env-update && . /etc/profile"
export local envkogaionprofile="eselect profile set 1"

# env squashfs chroot variables
export local sqfsrootx86="kogaiondevelx86.squashfs"
export local sqfsrootx86md5=""$sqfsrootx86".md5"
export local sqfsrootx64="kogaiondevelx64.squashfs"
export local sqfsrootx64md5=""$sqfsrootx64".md5"

# env make.conf variables
export local envkogaionmakeconfx86="ln -sf /opt/build/conf/intel/portage/make.conf.x86 /etc/portage/make.conf"
export local envkogaionmakeconfx64="ln -sf /opt/build/conf/intel/portage/make.conf.amd64 /etc/portage/make.conf"

envcheckroot () {
	if [[ "$(whoami)" != root ]] ; then
		echo ""
		echo "You're not root?...No cookies for you, go away !!!"
		echo ""
		exit 1
	fi
}

envkogaionstop () {
	# umount squashfs + overlayfs chroot
	umount -l "$overlaydir"/proc > /dev/null 2>&1
	umount -l "$overlaydir"/sys > /dev/null 2>&1
	umount -l "$overlaydir"/dev/pts > /dev/null 2>&1
	umount -l "$overlaydir"/dev/shm > /dev/null 2>&1
	umount -l "$overlaydir"/dev > /dev/null 2>&1
	umount -l "$overlaydir"/tmp > /dev/null 2>&1
	umount -l "$overlaydir"/usr/portage/packages > /dev/null 2>&1
	umount -l "$overlaydir"/mnt > /dev/null 2>&1
	umount -l "$overlaydir" > /dev/null 2>&1
	umount -l "$rodir" > /dev/null 2>&1
}