summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2015-08-30 20:08:41 +0100
committerV3n3RiX <venerix@rogentos.ro>2015-08-30 20:08:41 +0100
commit96716471ccdd0b0a779ba7ea2fb3858eac68ccda (patch)
tree1505faf7ee840bd7940068d64334a6cc79e2393c
parent3f17e27be05f9a41fe044fbf5ef3c16e6d625be8 (diff)
parent097ad73f4e3cf05ab290f067f484e482d6a4e421 (diff)
merge experimental into master
-rwxr-xr-xbuild3237
-rwxr-xr-xbuild6437
-rwxr-xr-xlibvasile239
-rwxr-xr-xvasile278
4 files changed, 339 insertions, 252 deletions
diff --git a/build32 b/build32
new file mode 100755
index 0000000..161f300
--- /dev/null
+++ b/build32
@@ -0,0 +1,37 @@
+#!/bin/bash -x
+
+chrootpreparex86 () {
+ # check our environment for sanity
+ # if safe, trigger start && break the loop to build packages
+ # else trigger stop && cleanup && check again
+ while : true ; do
+ if [[ ! -d "$rodir" && ! -d "$rwdir" && ! -d "$overlaydir" ]] ; then
+ for i in "$rodir" "$rwdir" "$overlaydir" ; do
+ mkdir "$i"
+ done
+ chrootstartx86
+ break
+ elif [[ -d "$rodir" && -d "$rwdir" && -d "$overlaydir" ]] ; then
+ chrootstop
+ for i in "$rodir" "$rwdir" "$overlaydir" ; do
+ rm -rf "$i"
+ done
+ continue
+ fi
+ done
+}
+
+main () {
+ if checkroot ; then
+ chrootchecksumx86
+ chrootpreparex86
+ chrootoverlaysx86
+ chrootbuildsystemx86
+ chrootbuildx86
+ chrootx86
+ chrootstop
+ fi
+}
+
+main
+exit 0
diff --git a/build64 b/build64
new file mode 100755
index 0000000..6628014
--- /dev/null
+++ b/build64
@@ -0,0 +1,37 @@
+#!/bin/bash -x
+
+chrootpreparex64 () {
+ # check our environment for sanity
+ # if safe, trigger start && break the loop to build packages
+ # else trigger stop && cleanup && check again
+ while : true ; do
+ if [[ ! -d "$rodir" && ! -d "$rwdir" && ! -d "$overlaydir" ]] ; then
+ for i in "$rodir" "$rwdir" "$overlaydir" ; do
+ mkdir "$i"
+ done
+ chrootstartx64
+ break
+ elif [[ -d "$rodir" && -d "$rwdir" && -d "$overlaydir" ]] ; then
+ chrootstop
+ for i in "$rodir" "$rwdir" "$overlaydir" ; do
+ rm -rf "$i"
+ done
+ continue
+ fi
+ done
+}
+
+main () {
+ if checkroot ; then
+ chrootchecksumx64
+ chrootpreparex64
+ chrootoverlaysx64
+ chrootbuildsystemx64
+ chrootbuildx64
+ chrootx64
+ chrootstop
+ fi
+}
+
+main
+exit 0
diff --git a/libvasile b/libvasile
new file mode 100755
index 0000000..4e7f03f
--- /dev/null
+++ b/libvasile
@@ -0,0 +1,239 @@
+# arch agnostic code
+export local rodir="rodir"
+export local rwdir="rwdir"
+export local overlaydir="overlaydir"
+export local chrootuser="root"
+export local chroottarget="${@:2}"
+export local chrootbuildtarget="emerge -kav "$chroottarget""
+export local chrootoverlay="layman -f -a kogaion -o https://raw.github.com/Rogentos/kogaion/master/overlay.xml"
+export local chrootdesktopoverlay="layman -f -a kogaion-desktop -o https://raw.github.com/Rogentos/kogaion-desktop/master/overlay.xml"
+export local chrootbuildgit="cd /opt && git clone https://github.com/Rogentos/build.git"
+export local chrootportageconfig="ln -sf /opt/build/conf/intel/portage /etc/portage"
+export local chrootenvupdate="/usr/sbin/env-update && . /etc/profile"
+export local chrootprofile="eselect profile set 1"
+
+checkroot () {
+ if [[ "$(whoami)" != root ]] ; then
+ echo ""
+ echo "You're not root?...No cookies for you, go away !!!"
+ echo ""
+ exit 1
+ fi
+}
+
+chrootstop () {
+ 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
+}
+
+# x64 specific code
+export local chrootx64="kogaiondevelx64.squashfs"
+export local chrootx64md5=""$chrootx64".md5"
+export local chrootmakeconfx64="ln -sf /opt/build/conf/intel/portage/make.conf.amd64 /etc/portage/make.conf"
+
+chrootchecksumx64 () {
+ while : true ; do
+ if [[ -f "$chrootx64" && -f "$chrootx64md5" ]] ; then
+ echo "Good, x64 squashed chroot && checksum file FOUND ... verifying integrity"
+ echo ""
+ if [[ "$(md5sum -c "$chrootx64md5")" ]] ; then
+ echo "Good, x64 squashed chroot checksum PASSED ... starting environment"
+ echo ""
+ sleep 1
+ break
+ else
+ echo "Ooops, x64 squashed chroot checksum FAILED ... aborting"
+ exit 1
+ fi
+ else
+ echo "Ooops, x64 squashed chroot or checksum file NOT FOUND ... aborting"
+ exit 1
+ fi
+ done
+}
+
+chrootstartx64 () {
+ mount -t squashfs "$chrootx64" "$rodir"
+ mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir"
+ while : true ; do
+ if [[ ! -d packages ]] ; then
+ mkdir packages
+ mount -o bind packages "$overlaydir"/usr/portage/packages
+ break
+ elif [[ -d packages ]] ; then
+ mount -o bind packages "$overlaydir"/usr/portage/packages
+ break
+ fi
+ done
+ while : true ; do
+ if [[ ! -d distfiles ]] ; then
+ mkdir distfiles
+ mount -o bind distfiles "$overlaydir"/usr/portage/distfiles
+ break
+ elif [[ -d distfiles ]] ; then
+ mount -o bind distfiles "$overlaydir"/usr/portage/distfiles
+ break
+ fi
+ done
+ mount -o bind targets "$overlaydir"/mnt
+ mount -t proc proc "$overlaydir"/proc
+ mount -t sysfs sysfs "$overlaydir"/sys
+ mount -t devtmpfs -o relatime,size=3055348k,nr_inodes=763837,mode=755 none "$overlaydir"/dev
+ mount -t devpts -o nosuid,noexec,relatime,gid=5,mode=620 none "$overlaydir"/dev/pts
+ mount -t tmpfs -o nosuid,nodev none "$overlaydir"/dev/shm
+ mount -t tmpfs -o nosuid,nodev,noexec none "$overlaydir"/tmp
+}
+
+chrootoverlaysx64() {
+ echo "Injecting Kogaion Linux Main Overlay into x64 environment"
+ sleep 1
+ chroot "$overlaydir" su - "$chrootuser" -c "$chrootoverlay"
+ echo "Injecting Kogaion Linux Desktop Overlay into x64 environment"
+ sleep 1
+ chroot "$overlaydir" su - "$chrootuser" -c "$chrootdesktopoverlay"
+}
+
+chrootbuildsystemx64() {
+ echo "Injecting Kogaion Linux x64 Buildsystem && Setting up Portage && Setting up make.conf"
+ echo ""
+ sleep 1
+ for cmd in "$chrootbuildgit" "$chrootportageconfig" "$chrootmakeconfx64" "$chrootprofile" "$chrootenvupdate" ; do
+ chroot "$overlaydir" su - "$chrootuser" -c "$cmd"
+ done
+}
+
+chrootbuildx64 () {
+ echo ""
+ echo "x64 Environment is UP && RUNNING ... building targets"
+ sleep 1
+ chroot "$overlaydir" su - "$chrootuser" -c "$chrootbuildtarget"
+}
+
+chrootx64() {
+ echo -e ""
+ echo -e "#################################################################"
+ echo -e "# ENTERING CHROOT ENV FOR YOU TO PUSH BUILT PACKAGES #"
+ echo -e "# OR TO FIX EVENTUAL BUILD ERRORS #"
+ echo -e "#################################################################"
+ echo -e "# !!! WARNING !!! WARNING !!! WARNING !!! #"
+ echo -e "#################################################################"
+ echo -e "# NEXT RUN OF THIS SCRIPT WILL DESTROY ALL YOUR WORK #"
+ echo -e "# DO NOT EXIT CHROOT UNTIL ALL PACKAGES ARE PUSHED TO REPOS #"
+ echo -e "# OR, IN CASE OF BUILD FAILURES, UNTIL ALL FIXES ARE COMMITED #"
+ echo -e "#################################################################"
+ echo -e "# !!! WARNING !!! WARNING !!! WARNING !!! #"
+ echo -e "#################################################################"
+ echo -e ""
+ echo -e ""
+ chroot "$overlaydir" su - "$chrootuser"
+}
+
+# x86 specific code
+export local chrootx86="kogaiondevelx86.squashfs"
+export local chrootx86md5=""$chrootx86".md5"
+export local chrootmakeconfx86="ln -sf /opt/build/conf/intel/portage/make.conf.x86 /etc/portage/make.conf"
+
+chrootchecksumx86 () {
+ while : true ; do
+ if [[ -f "$chrootx86" && -f "$chrootx86md5" ]] ; then
+ echo "Good, x86 squashed chroot && checksum file FOUND ... verifying integrity"
+ echo ""
+ if [[ "$(md5sum -c "$chrootx86md5")" ]] ; then
+ echo "Good, x86 squashed chroot checksum PASSED ... starting environment"
+ echo ""
+ sleep 1
+ break
+ else
+ echo "Ooops, x86 squashed chroot checksum FAILED ... aborting"
+ exit 1
+ fi
+ else
+ echo "Ooops, x86 squashed chroot or checksum file NOT FOUND ... aborting"
+ exit 1
+ fi
+ done
+}
+
+chrootstartx86 () {
+ mount -t squashfs "$chrootx86" "$rodir"
+ mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir"
+ while : true ; do
+ if [[ ! -d packages ]] ; then
+ mkdir packages
+ mount -o bind packages "$overlaydir"/usr/portage/packages
+ break
+ elif [[ -d packages ]] ; then
+ mount -o bind packages "$overlaydir"/usr/portage/packages
+ break
+ fi
+ done
+ while : true ; do
+ if [[ ! -d distfiles ]] ; then
+ mkdir distfiles
+ mount -o bind distfiles "$overlaydir"/usr/portage/distfiles
+ break
+ elif [[ -d distfiles ]] ; then
+ mount -o bind distfiles "$overlaydir"/usr/portage/distfiles
+ break
+ fi
+ done
+ mount -o bind targets "$overlaydir"/mnt
+ mount -t proc proc "$overlaydir"/proc
+ mount -t sysfs sysfs "$overlaydir"/sys
+ mount -t devtmpfs -o relatime,size=3055348k,nr_inodes=763837,mode=755 none "$overlaydir"/dev
+ mount -t devpts -o nosuid,noexec,relatime,gid=5,mode=620 none "$overlaydir"/dev/pts
+ mount -t tmpfs -o nosuid,nodev none "$overlaydir"/dev/shm
+ mount -t tmpfs -o nosuid,nodev,noexec none "$overlaydir"/tmp
+}
+
+chrootoverlaysx86() {
+ echo "Injecting Kogaion Linux Main Overlay into x86 environment"
+ sleep 1
+ linux32 chroot "$overlaydir" su - "$chrootuser" -c "$chrootoverlay"
+ echo "Injecting Kogaion Linux Desktop Overlay into x86 environment"
+ sleep 1
+ linux32 chroot "$overlaydir" su - "$chrootuser" -c "$chrootdesktopoverlay"
+}
+
+chrootbuildsystemx86() {
+ echo "Injecting Kogaion Linux x86 Buildsystem && Setting up Portage && Setting up make.conf"
+ echo ""
+ sleep 1
+ for cmd in "$chrootbuildgit" "$chrootportageconfig" "$chrootmakeconfx86" "$chrootprofile" "$chrootenvupdate" ; do
+ linux32 chroot "$overlaydir" su - "$chrootuser" -c "$cmd"
+ done
+}
+
+chrootbuildx86 () {
+ echo ""
+ echo "x86 Environment is UP && RUNNING ... building targets"
+ sleep 1
+ chroot "$overlaydir" su - "$chrootuser" -c "$chrootbuildtarget"
+}
+
+chrootx86() {
+ echo -e ""
+ echo -e "#################################################################"
+ echo -e "# ENTERING CHROOT ENV FOR YOU TO PUSH BUILT PACKAGES #"
+ echo -e "# OR TO FIX EVENTUAL BUILD ERRORS #"
+ echo -e "#################################################################"
+ echo -e "# !!! WARNING !!! WARNING !!! WARNING !!! #"
+ echo -e "#################################################################"
+ echo -e "# NEXT RUN OF THIS SCRIPT WILL DESTROY ALL YOUR WORK #"
+ echo -e "# DO NOT EXIT CHROOT UNTIL ALL PACKAGES ARE PUSHED TO REPOS #"
+ echo -e "# OR, IN CASE OF BUILD FAILURES, UNTIL ALL FIXES ARE COMMITED #"
+ echo -e "#################################################################"
+ echo -e "# !!! WARNING !!! WARNING !!! WARNING !!! #"
+ echo -e "#################################################################"
+ echo -e ""
+ echo -e ""
+ linux32 chroot "$overlaydir" su - "$chrootuser"
+}
diff --git a/vasile b/vasile
index ef45594..6218135 100755
--- a/vasile
+++ b/vasile
@@ -1,254 +1,28 @@
-#!/usr/bin/env bash
-#
-# Say Hello to Vasile , a script to build Kogaion Linux packages in a clean squashfs + overlayfs chroot
-# using predefined targets : kernel.target, libs.target, x11.target, sound.target, artwork.target etc
-# Targets are passed as arguments, and will remain private...for now (not all of them are stable yet)
-# Author : Ghiunhan Mamut (aka V3n3RiX) @ RogentOS Linux Group
-# Dependencies : squashfs + overlayfs kernel support
+#!/bin/bash -x
+# Say Hello to Vasile, a script to build Kogaion Linux packages in a clean squashfs + overlayfs chroot
+# Using predefined targets : kernel.target , xlibs.target , x11.target , sound.target , artwork.target
+# Main author : Ghiunhan Mamut (aka V3n3RiX) @ RogentOS Development Group
+# Dependencies : kernel built with squashfs + overlayfs, app-arch/dpkg (optional for building deb packages in portage)
+#
+
+source libvasile
+
+case $1 in
+ --build64) source build64
+ ;;
+ --build32) source build32
+ ;;
+ --help) echo -e ""
+ echo -e "Usage: vasile [options]"
+ echo -e ""
+ echo -e "Options:"
+ echo -e "--build64 : build package in a clean x64 environment"
+ echo -e "--build32 : build package in a clean x86 environment"
+ echo -e "--help : display this help and exit"
+ echo -e ""
+ ;;
+ *) echo -e "error: no operation specified, use --help for help"
+ ;;
+esac
-
-# 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="$@"
-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"
-
-envkogaionstart () {
- # mount ro squashfs chroot + add rw overlayfs layer to enable clean package building
- mount -t squashfs "$sqfsroot" "$rodir"
- mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir"
- # portage buildpkg feature is now enabled by default, so all built packages or targets will also have binary packages created
- # each target depends on previous one, building a target will most likely pull packages from previous one
- # to avoid useless rebuilds, bind mount portage binary packages folder, and use binaries if needed
- # every binary was built in same clean build environment managed by vasile, so they are safe to reuse
- # vasile will still clean the build environment, but will leave binaries in place
- while : true ; do
- if [[ ! -d packages ]] ; then
- mkdir packages
- mount -o bind packages "$overlaydir"/usr/portage/packages
- break
- elif [[ -d packages ]] ; then
- mount -o bind packages "$overlaydir"/usr/portage/packages
- break
- fi
- done
- # keep distfiles around
- while : true ; do
- if [[ ! -d distfiles ]] ; then
- mkdir distfiles
- mount -o bind distfiles "$overlaydir"/usr/portage/distfiles
- break
- elif [[ -d distfiles ]] ; then
- mount -o bind distfiles "$overlaydir"/usr/portage/distfiles
- break
- fi
- done
- # bind mount targets inside clean build environment managed by vasile, we really need them to be in there
- mount -o bind targets "$overlaydir"/mnt
- mount -t proc proc "$overlaydir"/proc
- mount -t sysfs sysfs "$overlaydir"/sys
- mount -t devtmpfs -o relatime,size=3055348k,nr_inodes=763837,mode=755 none "$overlaydir"/dev
- mount -t devpts -o nosuid,noexec,relatime,gid=5,mode=620 none "$overlaydir"/dev/pts
- mount -t tmpfs -o nosuid,nodev none "$overlaydir"/dev/shm
- mount -t tmpfs -o nosuid,nodev,noexec none "$overlaydir"/tmp
-}
-
-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
-}
-
-envcheckroot () {
- if [[ "$(whoami)" != root ]] ; then
- echo ""
- echo "You're not root?...No cookies for you, go away !!!"
- echo ""
- exit 1
- fi
-}
-
-envkogaionsquashfsintegrity () {
- # our bare metal buildserver is x86_64 but we want to build 32bit packages as well
- # run this script with linux32 to fool it we run i686 and to build 32bit packages
- while : true ; do
- if [[ "$(uname -m)" = "x86_64" ]] ; then
- export local sqfsroot="kogaiondevelx64.squashfs"
- export local sqfsrootmd5file=""$sqfsroot".md5"
- export local sqfsrootmd5="$(cat "$sqfsrootmd5file" | awk {'print $1'})"
- if [[ -f "$sqfsroot" && -f "$sqfsrootmd5file" ]] ; then
- echo "Good, x86_64 squashed chroot && checksum file FOUND ... verifying integrity"
- echo ""
- if [[ "$(md5sum "$sqfsroot" | awk {'print $1'})" = "$sqfsrootmd5" ]] ; then
- echo "Good, x86_64 squashed chroot checksum PASSED ... starting environment"
- echo ""
- sleep 1
- break
- else
- echo "Ooops, x86_64 squashed chroot checksum FAILED ... aborting"
- exit 1
- fi
- else
- echo "Ooops, x86_64 squashed chroot or checksum file NOT FOUND ... aborting"
- exit 1
- fi
- elif [[ "$(uname -m)" = "i686" ]] ; then
- export local sqfsroot="kogaiondevelx86.squashfs"
- export local sqfsrootmd5file=""$sqfsroot".md5"
- export local sqfsrootmd5="$(cat "$sqfsrootmd5file" | awk {'print $1'})"
- if [[ -f "$sqfsroot" && -f "$sqfsrootmd5file" ]] ; then
- echo "Good, i686 squashed chroot && checksum file FOUND ... verifying integrity"
- echo ""
- if [[ "$(md5sum "$sqfsroot" | awk {'print $1'})" = "$sqfsrootmd5" ]] ; then
- echo "Good, i686 squashed chroot checksum PASSED ... starting environment"
- echo ""
- sleep 1
- break
- else
- echo "Ooops, i686 squashed chroot checksum FAILED ... aborting"
- fi
- else
- echo "Ooops, i686 squashed chroot of checksum file NOT FOUND ... aborting"
- exit 1
- fi
- fi
- done
-}
-
-envkogaionprepare () {
- # check our environment for sanity
- # if safe, trigger start && break the loop to build packages
- # else trigger stop && cleanup && check again
- while : true ; do
- if [[ ! -d "$rodir" && ! -d "$rwdir" && ! -d "$overlaydir" ]] ; then
- for i in "$rodir" "$rwdir" "$overlaydir" ; do
- mkdir "$i"
- done
- envkogaionstart
- break
- elif [[ -d "$rodir" && -d "$rwdir" && -d "$overlaydir" ]] ; then
- envkogaionstop
- for i in "$rodir" "$rwdir" "$overlaydir" ; do
- rm -rf "$i"
- done
- continue
- fi
- done
-}
-
-envkogaionoverlays() {
- # inject our overlays into squashfs + overlayfs chroot
- if [[ "$(uname -m)" = "x86_64" ]] ; then
- echo "Injecting Kogaion Linux Main Overlay into x86_64 environment"
- sleep 1
- chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionoverlay"
- echo "Injecting Kogaion Linux Desktop Overlay into x86_64 environment"
- sleep 1
- chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaiondesktopoverlay"
- elif [[ "$(uname -m)" = "i686" ]] ; then
- echo "Injecting Kogaion Linux Main Overlay into i686 environment"
- sleep 1
- linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionoverlay"
- echo "Injecting Kogaion Linux Desktop Overlay into i686 environment"
- linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaiondesktopoverlay"
- fi
-}
-
-envkogaionbuildsystem() {
- # inject our buildsystem into squashfs + overlayfs chroot
- if [[ "$(uname -m)" = "x86_64" ]] ; then
- export local envkogaionmakeconf="ln -sf /opt/build/conf/intel/portage/make.conf.amd64 /etc/portage/make.conf"
- export local envkogaionprofile="eselect profile set 1"
- echo "Injecting Kogaion Linux X86_64 Buildsystem && Setting up Portage && Setting up make.conf"
- echo ""
- sleep 1
- for cmd in "$envkogaionbuildgit" "$envkogaionportageconfig" "$envkogaionmakeconf" "$envkogaionprofile" "$envkogaionenvupdate" ; do
- chroot "$overlaydir" su - "$envkogaionuser" -c "$cmd"
- done
- elif [[ "$(uname -m)" = "i686" ]] ; then
- export local envkogaionmakeconf="ln -sf /opt/build/conf/intel/portage/make.conf.x86 /etc/portage/make.conf"
- export local envkogaionprofile="eselect profile set 1"
- echo "Injecting Kogaion Linux i686 Buildsystem && Setting up Portage && Setting up make.conf"
- echo ""
- sleep 1
- for cmd in "$envkogaionbuildgit" "$envkogaionportageconfig" "$envkogaionmakeconf" "$envkogaionprofile" "$envkogaionenvupdate" ; do
- linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$cmd"
- done
- fi
-
-}
-
-envkogaionbuild () {
- # build packages in squashfs + overlayfs chroot
- if [[ "$(uname -m)" = "x86_64" ]] ; then
- echo ""
- echo "x86_46 Environment is UP && RUNNING ... building targets"
- sleep 1
- chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionbuildtarget"
- elif [[ "$(uname -m)" = "i686" ]] ; then
- echo ""
- echo "i686 Environment is UP && RUNNING ... building targets"
- sleep 1
- linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionbuildtarget"
- fi
-}
-
-envkogaionchroot() {
- # enter squashfs + overlayfs chroot to push packages, or debug build errors
- echo -e ""
- echo -e "#################################################################"
- echo -e "# ENTERING CHROOT ENV FOR YOU TO PUSH BUILT PACKAGES #"
- echo -e "# OR TO FIX EVENTUAL BUILD ERRORS #"
- echo -e "#################################################################"
- echo -e "# !!! WARNING !!! WARNING !!! WARNING !!! #"
- echo -e "#################################################################"
- echo -e "# NEXT RUN OF THIS SCRIPT WILL DESTROY ALL YOUR WORK #"
- echo -e "# DO NOT EXIT CHROOT UNTIL ALL PACKAGES ARE PUSHED TO REPOS #"
- echo -e "# OR, IN CASE OF BUILD FAILURES, UNTIL ALL FIXES ARE COMMITED #"
- echo -e "#################################################################"
- echo -e "# !!! WARNING !!! WARNING !!! WARNING !!! #"
- echo -e "#################################################################"
- echo -e ""
- echo -e ""
- if [[ "$(uname -m)" = "x86_64" ]] ; then
- chroot "$overlaydir" su - "$envkogaionuser"
- elif [[ "$(uname -m)" = "i686" ]] ; then
- linux32 chroot "$overlaydir" su - "$envkogaionuser"
- fi
-}
-
-main () {
- if envcheckroot ; then
- envkogaionsquashfsintegrity
- envkogaionprepare
- envkogaionoverlays
- envkogaionbuildsystem
- envkogaionbuild
- envkogaionchroot
- envkogaionstop
- fi
-}
-
-main
exit 0