summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild328
-rwxr-xr-xbuild6410
-rwxr-xr-xlibvasile19
3 files changed, 23 insertions, 14 deletions
diff --git a/build32 b/build32
index 7c84de6..01729b9 100755
--- a/build32
+++ b/build32
@@ -5,15 +5,15 @@ chrootpreparex86 () {
# 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
+ if [[ ! -d "$rodir" && ! -d "$rwdir" && ! -d "$workdir" && ! -d "$overlaydir" ]] ; then
+ for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do
mkdir "$i"
done
chrootstartx86
break
- elif [[ -d "$rodir" && -d "$rwdir" && -d "$overlaydir" ]] ; then
+ elif [[ -d "$rodir" && -d "$rwdir" && -d "$workdir" && -d "$overlaydir" ]] ; then
chrootstop
- for i in "$rodir" "$rwdir" "$overlaydir" ; do
+ for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do
rm -rf "$i"
done
continue
diff --git a/build64 b/build64
index 41bea4a..f41ab06 100755
--- a/build64
+++ b/build64
@@ -5,15 +5,15 @@ chrootpreparex64 () {
# 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
+ if [[ ! -d "$rodir" && ! -d "$rwdir" && ! -d "$workdir" && ! -d "$overlaydir" ]] ; then
+ for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do
mkdir "$i"
done
chrootstartx64
break
- elif [[ -d "$rodir" && -d "$rwdir" && -d "$overlaydir" ]] ; then
+ elif [[ -d "$rodir" && -d "$rwdir" && -d "$workdir" && -d "$overlaydir" ]] ; then
chrootstop
- for i in "$rodir" "$rwdir" "$overlaydir" ; do
+ for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do
rm -rf "$i"
done
continue
@@ -33,5 +33,5 @@ main () {
fi
}
-main
+main
exit 0
diff --git a/libvasile b/libvasile
index 1b261f5..dee2937 100755
--- a/libvasile
+++ b/libvasile
@@ -1,6 +1,7 @@
# arch agnostic code
export local rodir="rodir"
export local rwdir="rwdir"
+export local workdir="workdir" # only needed for overlayfs on kernel greather than 3.18
export local overlaydir="overlaydir"
export local chrootuser="root"
export local chroottarget="${@:2}"
@@ -8,7 +9,7 @@ export local chrootbuildtarget="emerge -kav "$chroottarget""
export local chrootoverlay="layman -f -a kogaion -o https://gitlab.com/kogaion/kogaion-main/raw/master/overlay.xml"
export local chrootdesktopoverlay="layman -f -a kogaion-desktop -o https://gitlab.com/kogaion/kogaion-desktop/raw/master/overlay.xml"
export local chrootbuildgit="cd /opt && git clone https://gitlab.com/kogaion/kogaion-build.git"
-export local chrootportageconfig="ln -sf /opt/build/conf/intel/portage /etc/portage"
+export local chrootportageconfig="ln -sf /opt/kogaion-build/conf/intel/portage /etc/portage"
export local chrootenvupdate="/usr/sbin/env-update && . /etc/profile"
export local chrootprofile="eselect profile set 1"
@@ -37,7 +38,7 @@ chrootstop () {
# 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"
+export local chrootmakeconfx64="ln -sf /opt/kogaion-build/conf/intel/portage/make.conf.amd64 /etc/portage/make.conf"
chrootchecksumx64 () {
while : true ; do
@@ -62,7 +63,11 @@ chrootchecksumx64 () {
chrootstartx64 () {
mount -t squashfs "$chrootx64" "$rodir"
- mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir"
+ if [[ "$(uname -r | cut -d - -f1)" = "3.14.0" ]] ; then
+ mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir"
+ elif [[ "(uname -r | cut -d - -f1)" = "4.1.0" ]] ; then
+ mount -t overlay -o lowerdir="$rodir",upperdir="$rwdir",workdir="$workdir" overlay "$overlaydir"
+ fi
while : true ; do
if [[ ! -d packages ]] ; then
mkdir packages
@@ -139,7 +144,7 @@ chrootx64() {
# 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"
+export local chrootmakeconfx86="ln -sf /opt/kogaion-build/conf/intel/portage/make.conf.x86 /etc/portage/make.conf"
chrootchecksumx86 () {
while : true ; do
@@ -164,7 +169,11 @@ chrootchecksumx86 () {
chrootstartx86 () {
mount -t squashfs "$chrootx86" "$rodir"
- mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir"
+ if [[ "$(uname -r | cut -d - -f1)" = "3.14.0" ]] ; then
+ mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir"
+ elif [[ "(uname -r | cut -d - -f1)" = "4.1.0" ]] ; then
+ mount -t overlay -o lowerdir="$rodir",upperdir="$rwdir",workdir="$workdir" overlay "$overlaydir"
+ fi
while : true ; do
if [[ ! -d packages ]] ; then
mkdir packages